Custom menu

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!)
Post Reply
User avatar
Iniquitatis
Posts: 49
Joined: Sat Oct 24, 2009 1:23 am
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Custom menu

Post by Iniquitatis »

Let's assume I have a TC, and I want to reinvent the wheel by writing custom menu code from scratch* without using MENUDEF**.
At first everything is going fine, because GZDoom gives you an access to the 2D drawing routines, mouse/keyboard/joystick input, etc.
But then I need a "Quit" option in the main menu, for example. First thing that comes to mind is to call some native function, which will terminate the engine. ZScript doesn't have this function, so I can still use CCMDs. And only ZScript class in the entire engine that has access to CCMDs is an OptionMenuItemCommand with its private DoCommand function.
The only thing left is to call a Menu.SetMenu("QuitMenu"), but this menu*** can't even be redesigned properly.

So, which options do I have, besides modifying the engine source code or any of the native actors?

* — It just doesn't share many similarities to the original Doom menu.
** — Actually, with MENUDEF, but just for reassigning class of the "MainMenu".
*** — Same goes for any of the generated menus.
Post Reply

Return to “Scripting”