I would like to customize the button on command cards and add dynamic strings of text as overlays, in the same way as the associated Hotkeys or the number of charges appear on top of the buttons. Is such a thing even possible?
I take by your use of the word dynamic that these things could change during the course of a game. In that case the solution is to use the "Hookup Standard Dialog Item" action to get each button as a dialog item, and then modify them from there.
The path that you want to hookup would be "UIContainer/ConsoleUIContainer/CommandPanel/CommandButton00" for the top left button, as an example.
Wow, thanks a lot for the pointer! I didn't know about those. Once I hook them up, what would the next step be to edit them?
What I want to do basically is this: I have an ability which is mainly trigger-based, and I would like to change a number overlay over the ability button as some variable set in the triggers increases.
The first would be to try setting the text value of the button itself. This will result in the text you want sitting smack dab in the center of the button. I think you can probably reposition the text by changing the style value of the button as well (the font style, that is). For example, if you want the text to be in the top left, give it a font that is positioned at top left. I assume the standard font for the button is middle center.
The second way would be to hookup the CommandPanel itself as a panel type, and use "Create Dialog Item In Panel" to create a label for each button and position them over the buttons.
Thanks for the reply. This dialog editing is very much esoteric to me though. When I hookup a dialog with an action, how do I reference it? Does it get referenced by the Last created dialog? Because it seems to be outputting some errors when I use it as a parameter.
Also, I am using Create Label for Dialog, am I getting things wrong?
Lastly, wouldn't this modification to UIContainer/ConsoleUIContainer/CommandPanel/CommandButton00 be a global modification? My intent would be to modify an overlay over a very specific set of buttons.
You should be able to reference it with "Last Created Dialog Item", not "Last Created Dialog".
If you are trying the second method that I described above, you would need to hookup "UIContainer/ConsoleUIContainer/CommandPanel" as a panel, instead of the buttons. Then you would use "Create Dialog Item In Panel" to make the labels.
Regarding your last question, I'll have to know more about what you mean by "very specific set of buttons". Because you're hooking them up as dialog items, you can modify them on a per-player basis. But the modifications would certainly still be there regardless of what abilities were actually present on the buttons.
Yes, that was my original point. You know when buttons have their associated hotkey overlayed on top of them? I hoped I could do something similar. What I am trying to do really is fixing something that doesn't work by itself.
Something similar like displaying number of available charges or the like? It would be helpful to know exactly what you're trying to do.
In any case, it becomes more complicated from there. It seems like what you want depends not just on the button but also the ability on the button. That may or may not be possible depending on a number of things.
as far as i understand your post you have one (or more?) warpgate, you can spawn 2 zealots or 1 stalker. if you spawn the stalker the whole warpgate shall go on cooldown until the charges are recharged? same after spawning 2 zealots.
i would use dummy instant abilities. first of all add requirements to all abils to hide if the warpgate has a certain disable behavior.
now add a trigger that adds the disable behavior when spawning a unit and no charges are left.
then issue order the warpgate to cast the dummy ability. when the buff runs out the real abilities are shown again.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I would like to customize the button on command cards and add dynamic strings of text as overlays, in the same way as the associated Hotkeys or the number of charges appear on top of the buttons. Is such a thing even possible?
@sunyatasattva: Go
But of course.
I take by your use of the word dynamic that these things could change during the course of a game. In that case the solution is to use the "Hookup Standard Dialog Item" action to get each button as a dialog item, and then modify them from there.
The path that you want to hookup would be "UIContainer/ConsoleUIContainer/CommandPanel/CommandButton00" for the top left button, as an example.
@MasterWrath: Go
Wow, thanks a lot for the pointer! I didn't know about those. Once I hook them up, what would the next step be to edit them?
What I want to do basically is this: I have an ability which is mainly trigger-based, and I would like to change a number overlay over the ability button as some variable set in the triggers increases.
@sunyatasattva: Go
There are two ways you could do it.
The first would be to try setting the text value of the button itself. This will result in the text you want sitting smack dab in the center of the button. I think you can probably reposition the text by changing the style value of the button as well (the font style, that is). For example, if you want the text to be in the top left, give it a font that is positioned at top left. I assume the standard font for the button is middle center.
The second way would be to hookup the CommandPanel itself as a panel type, and use "Create Dialog Item In Panel" to create a label for each button and position them over the buttons.
@MasterWrath: Go
Thanks for the reply. This dialog editing is very much esoteric to me though. When I hookup a dialog with an action, how do I reference it? Does it get referenced by the
Last created dialog
? Because it seems to be outputting some errors when I use it as a parameter.Also, I am using
Create Label for Dialog
, am I getting things wrong?Lastly, wouldn't this modification to
UIContainer/ConsoleUIContainer/CommandPanel/CommandButton00
be a global modification? My intent would be to modify an overlay over a very specific set of buttons.@sunyatasattva: Go
You should be able to reference it with "Last Created Dialog Item", not "Last Created Dialog".
If you are trying the second method that I described above, you would need to hookup "UIContainer/ConsoleUIContainer/CommandPanel" as a panel, instead of the buttons. Then you would use "Create Dialog Item In Panel" to make the labels.
Regarding your last question, I'll have to know more about what you mean by "very specific set of buttons". Because you're hooking them up as dialog items, you can modify them on a per-player basis. But the modifications would certainly still be there regardless of what abilities were actually present on the buttons.
@MasterWrath: Go
Yes, that was my original point. You know when buttons have their associated hotkey overlayed on top of them? I hoped I could do something similar. What I am trying to do really is fixing something that doesn't work by itself.
@sunyatasattva: Go
Something similar like displaying number of available charges or the like? It would be helpful to know exactly what you're trying to do.
In any case, it becomes more complicated from there. It seems like what you want depends not just on the button but also the ability on the button. That may or may not be possible depending on a number of things.
@MasterWrath: Go
(Sorry for the delays in the reply, I only have enough time to work on SC2 about once a week).
Yes, exactly as the charges; and, specifically, that's the problem I am trying to fix: http://www.sc2mapster.com/forums/development/data/61783-warp-train-with-charges/ since I couldn't manage to understand what was wrong, I thought to circumvent the problem trying some alternative solution.
as far as i understand your post you have one (or more?) warpgate, you can spawn 2 zealots or 1 stalker. if you spawn the stalker the whole warpgate shall go on cooldown until the charges are recharged? same after spawning 2 zealots.
i would use dummy instant abilities. first of all add requirements to all abils to hide if the warpgate has a certain disable behavior. now add a trigger that adds the disable behavior when spawning a unit and no charges are left. then issue order the warpgate to cast the dummy ability. when the buff runs out the real abilities are shown again.