How to use generic menus

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!)
Ershantik
Posts: 9
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

How to use generic menus

Post by Ershantik »

I've been trying to figure out how to make custom menus for my project, and while I think I'm getting the hang of it, I can't figure out how to make generic menus accessible in-game.

I know that custom list and option menus need to be backed by a MENUDEF entry, but as far as I know, that's not the case with generic menus. But if they're not defined in MENUDEF, how do you link them to other menus that are?

I've been trying to pick apart Doom Delta's code to figure out how their menus work, but I can't seem to find anything about how the generic menus are actually called onscreen.
yum13241
Posts: 781
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support

Re: How to use generic menus

Post by yum13241 »

The ZDoom Wiki wrote: Submenu "<label>", "<menu block reference>" [, <param>] [, <centered>]
Opens the listed submenu.

Code: Select all

OptionMenu "TestMenu"
{
Control "Example Label", "whereisini" // this is an example
Submenu "Mouse Options (Submenu method)",  "MouseOptions" // go to the "Mouse Options" menu.
ConsoleCommand "Mouse Options (dedicated command method), "menu_mouse" // Uses the "menu_mouse" command to open the Mouse Options menu.
ConsoleCommand "Mouse Options (openmenu method), "openmenu mouseoptions" // Uses the "openmenu mouseoptions" command to open the Mouse Options menu.

}
I just realized you are talking about the GenericMenu class. You'll need to have a good understanding of ZScript to understand them, and write your own. I can vouch for this guide to learn ZScript, and it's how I* started. Prior programming knowledge is helpful, but not required.

*Not that I'm a ZScript god anyway.
Ershantik
Posts: 9
Joined: Sat Dec 23, 2023 4:04 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 7

Re: How to use generic menus

Post by Ershantik »

Well I'll be damned, it works. Thanks. That's really the one thing I was hung up on. No matter where I looked, I couldn't find any documentation that explained this about generic menus.

The weird thing is, Doom Delta doesn't seem to use any of the methods you showed me. Their MENUDEF doesn't list any submenus or commands, so I still have no idea how their menus work.
yum13241
Posts: 781
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support

Re: How to use generic menus

Post by yum13241 »

Like I said, it's in the ZScript. Maybe ask the author?

Those methods I showed you are MENUDEF exclusive, so obviously Doom Delta is not using them.

See https://zdoom.org/wiki/Classes:Menu/.

Good luck, and have fun!

Return to “Scripting”