How can I make a button highlighted without keeping it pressed?
My problem is, I recreated the mercenary panel (you know, where you can hire mercenaries on the hyperion) from the campaign using dialog/items.
Now in the original, the mercenaries' buttons will stay green highlighted once you press them. My buttons will return to normal as soon as I release the mouse.
I used the same images and hover images for my buttons as in the campaign and they look exactly the same except for this thing.
Example:
Original Campaign : Once the button is pressed it turns bright green even after the mouse is released. My cursor is over another button.
My recreation:
button is pressed (mouse is held down)
button released (mouse released)
This is driving me crazy! I spent so much time recreating this.
How the hell is blizz doing this!
Basically every button has a hover and non hover state. You need to have a trigger detect when you are clicking on any of the buttons, and adjust the non-hover image to become the hover image. At the same time, you will need to reset the images of all the other buttons that were not clicked, back to the not-clicked image.
I can't tell you exactly how this is done as I've forgotten the exact function for it, but there is a function somewhere that does allow you to set the hover/non-hover image for your dialog items. You'll need to do some digging around.
@deathtorn: Go
Yeah, the problem is that these panels are used in story mode, only on the hyperion between the actual missions. So if you open any campaign map that won't help.
I dont know how to access the story mode, not sure if it's even a map file (which I doubt) or something special.
There are some functions though, which give you an "not authorized error" when used on non-blizzard-maps, like "set dialog item flash". I tried that one on a campaign map and it gave me no error, but it didn't work neither....
@FuzzYD: Go
There are two sets: normal is called "normalpressed" and hover "normaloverpressedover". Each one appears in the files as single image but they are technically two images put together.(see attachments)
Unfortunately, it seems that you can't access the pressed/pressedover images directly since it shows them only during the buttons BEING pressed, so you would have to keep the mouse pressed...
You can only apply the set, but still have the same problem.
I guess the way buttons work they just have some internal functions to ensure that...
The only possibility I can think of is to edit a picture file to have only the pressed images and use that. I might give that a try.
ATTACHMENTS
normal_image.JPG
normalover_pressedover.JPG
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
How can I make a button highlighted without keeping it pressed?
My problem is, I recreated the mercenary panel (you know, where you can hire mercenaries on the hyperion) from the campaign using dialog/items. Now in the original, the mercenaries' buttons will stay green highlighted once you press them. My buttons will return to normal as soon as I release the mouse. I used the same images and hover images for my buttons as in the campaign and they look exactly the same except for this thing.
Example:
Original Campaign : Once the button is pressed it turns bright green even after the mouse is released. My cursor is over another button.
My recreation: button is pressed (mouse is held down)
button released (mouse released)
This is driving me crazy! I spent so much time recreating this. How the hell is blizz doing this!
BUMP
BUMP anybody?
@Bugfree: Go
I would also appreciate a resolution to this problem. Have you tried looking at blizzards map?
Edit: Ignore my post.. seems I misread the question, it seem's you've already tried what I'm suggesting below.I suspect blizz may be doing it with triggers that catch when the button is pressed.. and changing the hover images whenever such an event occurs.
@Bugfree: Go
Basically every button has a hover and non hover state. You need to have a trigger detect when you are clicking on any of the buttons, and adjust the non-hover image to become the hover image. At the same time, you will need to reset the images of all the other buttons that were not clicked, back to the not-clicked image.
I can't tell you exactly how this is done as I've forgotten the exact function for it, but there is a function somewhere that does allow you to set the hover/non-hover image for your dialog items.
You'll need to do some digging around.I think this should be the one:
http://wiki.sc2mapster.com/galaxy/triggers/set-dialog-item-image/
To set the hover image, use this:
http://wiki.sc2mapster.com/galaxy/triggers/set-dialog-item-hover-image/
@deathtorn: Go Yeah, the problem is that these panels are used in story mode, only on the hyperion between the actual missions. So if you open any campaign map that won't help.
I dont know how to access the story mode, not sure if it's even a map file (which I doubt) or something special. There are some functions though, which give you an "not authorized error" when used on non-blizzard-maps, like "set dialog item flash". I tried that one on a campaign map and it gave me no error, but it didn't work neither....
@FuzzYD: Go There are two sets: normal is called "normalpressed" and hover "normaloverpressedover". Each one appears in the files as single image but they are technically two images put together.(see attachments)
Unfortunately, it seems that you can't access the pressed/pressedover images directly since it shows them only during the buttons BEING pressed, so you would have to keep the mouse pressed... You can only apply the set, but still have the same problem.
I guess the way buttons work they just have some internal functions to ensure that... The only possibility I can think of is to edit a picture file to have only the pressed images and use that. I might give that a try.