Page 1 of 1

Best Method To Add CVARs To Player Setup Menu

PostPosted: Thu Sep 09, 2021 8:51 am
by 22alpha22
Been awhile since I've been on the ZDoom forums, I didn't want to make a new topic for this question but the How Do I thread seems to be locked.

Anyway I was wondering what the best way would be to add some custom CVARs to the player setup menu. I don't want to add any new menus or customize any of the existing ones except to add user configurable CVARs to the player setup menu. Some of the CVARs will be simple booleans while others will be a switchable string argument for example: ("Off", "Minimal", "Normal", or "Full"). I know I can do this through MENUDEF but correct me if I'm wrong, MENUDEF would require me to define all the menus if I remember correctly. Plus I'm pretty sure it is deprecated. ZScript would be the other option and while I have learned to use ZScript somewhat, I have not at all tried any menu stuff with it.

Re: Best Method To Add CVARs To Player Setup Menu

PostPosted: Thu Sep 09, 2021 10:51 am
by Jarewill
MENUDEF deprecated? Not at all.
You don't even need to redefine the menus just to add a single option:
Code: Select allExpand view
AddOptionMenu "NewPlayerMenu"
{
    
StaticText ""
    
Option "Bool Option""option_cvar1""OnOff"
    
Option "Custom Option""option_cvar2""NewValue1"
}

OptionValue "NewValue1"
{
    
0"Off"
    
1"Minimal"
    
2"Normal"
    
3"Full"

Re: Best Method To Add CVARs To Player Setup Menu

PostPosted: Fri Sep 10, 2021 4:28 am
by 22alpha22
Thanks for the info, guess my memory isn't what it used to be because I could have swore I once read that MENUDEF required defining all menus. Anyway thanks.