Page 2 of 2

Re: Mudlet-1.1.0 released

Posted: Tue Mar 16, 2010 6:08 pm
by Jeremy
I am just enjoying the scrolling output window to it's fullest. Thanks for the fix on that!

Re: Mudlet-1.1.0 released

Posted: Tue Mar 16, 2010 9:53 pm
by Vadi
Source code in git has been updated.

Re: Mudlet-1.1.0 released

Posted: Fri Mar 19, 2010 5:39 am
by Rakon
Not sure where to put this post, but I believe there is a coloring bug with the current release.

Ubuntu 9.10 X64 - 2.6.31-20-generic
Mudlet 1.1.0 built: March 8, 2010 (Linux generic installer)

I have an alias that creates two temp triggers for highlighting a target:

Code: Select all

if tar_trig_u then killTrigger(tar_trig_u) end
if tar_trig_l then killTrigger(tar_trig_l) end

if target ~= 'nothing' then
 tar_trig_u = tempRegexTrigger('\\b'.. capitalize(target) .. '\\b', [[selectString("]] .. capitalize(target) .. [[", 1) fg("light_goldenrod")]])
 tar_trig_l = tempRegexTrigger('\\b'.. target .. '\\b', [[selectString("]] .. target .. [[", 1) fg("light_goldenrod")]])

end -- if
The reason for having two triggers is because I would like for the trigger to match , regardless of case.

As you can see, the color for the trigger is set to 'light_goldenrod'. However, when the trigger matches on a few lines, it actually colors the word a dark/dim gray instead.
Image

I would think that it only does so when I'm also trying to color/highlight another line, but if you look at a direct line from the mud you can see that it was also not highlighted correctly.

So, is this correctable by my actions/trigger creation, or is it an internal issue?

Re: Mudlet-1.1.0 released

Posted: Fri Mar 19, 2010 7:05 am
by Heiko
You have forgotten to call deselect() after your goldenrod color trigger. Consequently, the selection still stands and the next call to change foreground color will not only change the current foreground color, but also the last - and now invalid - former selection and change the color from goldenrod to grey.

Re: Mudlet-1.1.0 released

Posted: Fri Mar 19, 2010 7:36 am
by Rakon
Where would I put the 'deselect()' at? In the temp trigger execute?:
tar_trig_u = tempRegexTrigger('\\b'.. capitalize(target) .. '\\b', [[selectString("]] .. capitalize(target) .."\n" .. deselect() .. [[", 1) ?

Thanks

Re: Mudlet-1.1.0 released

Posted: Fri Mar 19, 2010 7:40 am
by Heiko
You need to reset the selection after every call to one of the selection functions if some other triggers do color prints on the same line. Mudlet doesn't do this automatically because it would be less efficient.

In your case, your prompt trigger seems to be the source of the color grey -> deselect() at the end of the prompt script *and* at the end of the tempTrigger will do the trick.

Your tempTrigger on "You have slain a *rat*" selects "rat" and colors it gold, then your prompt trigger does a setFgColor() to grey which will not only change the current color to grey, but also colorize your current selection ("rat" from your tempTrigger) grey.

Re: Mudlet-1.1.0 released

Posted: Fri Mar 19, 2010 7:46 am
by Rakon
Alright, thank you for this clarification.

Another, unrelated note / question:

I noticed in the API request thread you said you where working on adding in a 'windowfocus' event, to test if the mudlet window is in focus?? Has this been implemented in the current 1.1.0 version?

Re: Mudlet-1.1.0 released

Posted: Fri Mar 19, 2010 7:48 am
by Heiko
That function is in Mudlet-1.1.1 which has been released yesterday.

bool = hasFocus()

returns true if the main window has focus.