[SOLVED - ZS] Menus - Getting the Currently Selected Option

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.

[SOLVED - ZS] Menus - Getting the Currently Selected Option

Postby Nero » Sun Apr 26, 2020 3:37 pm

So I modified m8f's Tips for Menus mod to work with Option Menus. Currently it works exactly the same, it picks from a random string and prints it at the bottom right of the screen when the menu is opened.

What I'd like it to do is show a different string depending on what option in the parent menu is highlighted. Is there a way to get an index number of the currently highlighted option, or something along those lines?

Spoiler: "MENUDEF if interested"


Spoiler: "Menu ZScript"


Lastly @m8f, I will clean up the current ZScript and incorporate it back into your mod and send it to you if you want - might be able to set up some other options too - let me know what you want me to do.

Update
Very much solved. Thank you AFADoomer for the quick response, that was exactly what I needed.

Also I'd like to make the fruits of my labor available. They, yes they for they are two, come in two flavors, Tips with Options, and Tooltips. What's the difference? Tips with Options is m8f's Tips for Menus mod with the addition of a class for Option Menus. Works exactly the same as m8f's original code, for a demo just open up the Options Menu.

Tooltips is what I was trying to accomplish here. I want text to appear in the lower right hand corner of the screen with information on the current thing I have selected in a menu. Tooltips is about 95% m8f's code, 1% mine, and 4% further head trauma as I banged my head on the keyboard getting it to work. So it's my gift to m8f and the community and you can find more info about both of these mods to the mod over at the mod thread, which I will be making a post at shortly to give info and links.

Please let me know if you have any problems downloading the files from my Google Drive - I probably borked the share settings.
Last edited by Nero on Mon Apr 27, 2020 12:02 am, edited 2 times in total.
User avatar
Nero
Royal Boredom....Why can't I do this in Windows?
 
Joined: 06 Sep 2006
Location: Middle of Nowheresville Il.

Re: [ZScript] Menus - Getting the Currently Selected Option

Postby AFADoomer » Sun Apr 26, 2020 4:05 pm

OptionMenuDescriptor has a mSelectedItem variable that you should be able to use.
User avatar
AFADoomer
 
Joined: 15 Jul 2003


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests