So I'm coming back to mudding for the first time in a long while, and my previous favorite client (Mudlet) just isn't doing it for me anymore. Too much overhead, too many libraries I don't want to deal with, too much hassle getting it to actually compile on OSX. In the long term, I'm solving this issue by starting a new hobby project and writing my own client in Node, and in the short term I'm trying out the surprisingly awesome HTML5 client. Seriously guys, good job on that client; it's a huge improvement.
In the process I noticed something awesome: when my battlerage ability leapstrike is ready to be used the default button associated with it turns green. It is super useful and I likes it, but I can't figure out how this is happening. It doesn't work with any of the other buttons (e.g., I created one for daze, but it doesn't light up) and there doesn't seem to be any scripting happening for this that I can see.
Can anyone tell me what magic is happening to make the button light up like that? I would absolutely love to tie the rest of my skills into that system.
0
Comments
1: the client is using GMCP and so when you become able to use the ability again, it sends a gmcp message to the client which then changes the button color, something your other abilities most likely don't have because they use standard bal/eq (and the client might not change button color based off of that.
2: battlerage abilities have their own cooldowns as well as their own rage costs. The button turns green most likely when both conditions (usable and you have the rage for it) are met, something that most other abilities (some do, but I don't know if they do that in the Nexus client) don't have with it.
My guess is a mix of the two. Don't know if this helps at all, though!
Yea, that one!
I'd like to make this magic happen for all of the other buttons too, I'm just not sure how.
If you want to use that sort of highlighting for things besides battlerage (or any other alterations to the UI that aren't covered by the client options), you'll need to use jquery to make changes.
Whether or not a button should be highlighted (checking that you have enough battlerage and it's off cooldown) is determined serverside, and sent to the client through GMCP (specifically with IRE.Display.ButtonActions). As far as I know, it just applies to battlerage abilities.
And I'm not sure why I was thinking you would need jquery to highlight buttons yourself. All you need to do is "client.button_get(<button number>).highlight=1;" (highlight=0 to unhighlight a button), then "client.draw_bottom_buttons();" to apply the highlighting. It will be reset when you get a new IRE.Display.ButtonActions, so you'll want to re-highlight it (while it should be highlighted) in the onGMCP function.
if (args.gmcp_method == "Char.Vitals") {<br> var bal = args.gmcp_args.bal<br> }<br>client.button_get(1).highlight=bal;<br>client.draw_bottom_buttons();
GMCP documentation: https://github.com/keneanung/GMCPAdditions
svof github site: https://github.com/svof/svof and documentation at https://svof.github.io/svof