Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Moderator:GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
QUESTION: How do I retrieve a specifically bound key? I want to make it so that if the user presses the same button that was bound to the command that opened this menu, it will just close the menu.
My code snippet above crashes the game as soon as there's some user input.
Nope, still crashes the game. It doesn't seem to like int key = mBindings.GetKeysForCommand("openmenu StatsMenu");
hence my question, how/if it's possible to even retrieve bounded keys.
Okay, here's a menu demonstrating how to make aesthetic(ally pleasing?) effects occur. Right now this only affects the main menu, but I plan on expanding it to also chain-affect every other menu if possible.
Try opening the different list items. You'll see that New/Load/Save game move the menu off to the right, Options moves it down and Quit moves it up. You can also cancel the in-transit effect with the escape key, and the menu will move right back to the starting position.
Small bonus, the list's text items (I replaced the patches with actual text, bear that in mind) now flash between two colors, set by the Font keyword in Menudef. Reminiscent of the Doomsday engine which I happened to really like.
You do not have the required permissions to view the files attached to this post.
I almost solved my previous problem... the responder is now receiving the keyboard input, but I can't seem to make the input event match the keybind...
Can't you just do "closemenu; openmenu StatsMenu", where it only has time to do one but not the other without the wait command?
Also, I wouldn't rely on input data if I were you. That whole system is being changed as we speak, and chances are will break your menu here wide open.
It doesn't mean ZZYZX won't change something about it, like the name going from InputEventData to UiEvent. Guess we'll find out when that comes around.
My previous question still stands, though.
Last edited by Major Cooke on Sun Feb 19, 2017 1:02 pm, edited 1 time in total.
The key binder uses raw key codes (what the play code needs), the GUI codes are different. The menu normally uses GUI codes in its event processing. What you are trying to do there cannot possibly work,.
How do I add a new parameter to a custom widget I inherit from? Let's say I wanted to make a custom version of OptionMenuItem that takes an extra parameter to set the "help/tooltip text" for it.