Page 1 of 1

coloring Problem

Posted: Mon Aug 17, 2009 11:09 am
by eraldo
I color my exits..
and as soon as I color something else after that...
the last exit turns that same color (instead of staying in ExitColor)

I color all my exits like this:

Code: Select all

selectString( matches[1], 1 )
fg( ExitColor )
deselect()
I got an error in the debug buffer telling me:
ERROR:Lua error:[string "function Trigger15()..."]:4: attempt to call global 'deselect' (a nil value)
In the manual there is a note that deselect is not yet implemented...
is this why it did not work?

My workaround:
I made the following script:

Code: Select all

function deselect()
selectString("",1)
end
This overried the default deselect() function...
Works as intended now!

Hope that helps some of you.
Eraldo

Re: coloring Problem

Posted: Mon Aug 17, 2009 3:34 pm
by Heiko
If you've changed the current text color, the color will stay current until you either set a new color or call resetFormat(). I don't remember if resetFormat( windowName ) has already been implemented, but I think so.

Re: coloring Problem

Posted: Mon Aug 17, 2009 3:52 pm
by eraldo
The problem here was that there was still text selected at the time of changing color...
resulting in changing the color of the still selected text (which is not intended)