HTML5 client magic buttons.

edited February 2016 in Client Help
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.

Comments

  • I can't remember exactly what it is, but it's either because:

    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!
    You know, that one thing at that one place, with that one person.

    Yea, that one!
  • Right, I get the qualifiers that it's using within the game mechanics to determine if the skill is usable or not, I'm more interested in how that data is handed to the UI to turn that button green. Is the client hard coded to look for a button named 'Leapstrike' out of the box and handle the highlighting, and if so are there are skills that this works for? Is there a naming convention I should be using? Why doesn't drawslash (also a default button) work?

    I'd like to make this magic happen for all of the other buttons too, I'm just not sure how.
  • The highlighting of those buttons is handled by the client itself, not your scripts. Specifically, it will highlight those default battlerage buttons, or any buttons with the same commands, so you could make your own button that does "leapstrike @tar" or whatever and it will be highlighted just like the default leapstrike button.

    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.
  • @Sena is there a list somewhere of the supported abilities that auto-highlight?
  • edited February 2016
    Was a bit short on time for my last post, so some more detail now.

    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.

  • Thanks for the info. I actually came across this last night, which mentions that all the battlerage abilities should highlight automatically, but nothing else: http://nexus.ironrealms.com/Main_Page
  • For a simple example, say you want drawslash (button 1) to be highlighted as long as you have balance. Since balance is shown in GMCP, it makes it easy, you just need to add the following to the onGMCP function:

    if (args.gmcp_method == "Char.Vitals") {<br>&nbsp;&nbsp;&nbsp; var bal = args.gmcp_args.bal<br>&nbsp;&nbsp;&nbsp; }<br>client.button_get(1).highlight=bal;<br>client.draw_bottom_buttons();
  • This is great. Does anyone know the args.gmcp_args. for vial balance?
  • There is none. Only balances on gmcp are balance, equilibrium and class balances.
  • Oh gotcha. Thanks!
Sign In or Register to comment.