Inconsistent color, bug or am I doing it wrong?

Post Reply
juraj
Posts: 15
Joined: Wed Jan 13, 2010 2:47 pm

Inconsistent color, bug or am I doing it wrong?

Post by juraj » Wed Feb 03, 2010 6:41 am

I have two triggers that I use to replace and colorize text for visibility that are identical except for the foreground color and a few of the replacement text characters, but one of them isn't coloring properly.

Image

for the balance one ("You have recovered balance on all limbs.", exact match):

Code: Select all

selectString( "You have recovered balance on all limbs.", 1)
replace( "<<     +++++ ON BALANCE +++++     >>")
setBgColor(0,0,200)
setFgColor(255,100,100)
resetFormat()
equilibrium one ("You have recovered equilibrium.", exact match):

Code: Select all

selectString( "You have recovered equilibrium.", 1)
replace( "<<        +++++ ON EQ +++++        >>")
setBgColor(0,0,200)
setFgColor(255,224,102)
resetFormat()
I can't see why they should act differently, is this a bug or am I doing it wrong?

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Inconsistent color, bug or am I doing it wrong?

Post by Heiko » Wed Feb 03, 2010 7:13 am

After replace() your selection is no longer defined as the text length changes. Call replace() after setting your colors.

juraj
Posts: 15
Joined: Wed Jan 13, 2010 2:47 pm

Re: Inconsistent color, bug or am I doing it wrong?

Post by juraj » Wed Feb 03, 2010 7:27 am

That did it. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests