Add menu for custom console variables
CV_RegisterVar({name = , defaultvalue = , flags = , PossibleValue = , func = })
-> CV_RegisterVar({name = , defaultvalue = , flags = , PossibleValue = , func = , category = , displayname = ,})
Changed menuname
to displayname
in case of future use (like better help command for example).
Added CV_NOMENU
consvar flag. Automatically all cvars should be added otherwise.
cvar_menu_test.lua cvar_menu_stress_test.lua
Removed ghosts
Merge request reports
Activity
added 35 commits
-
a60721d1...b6544efc - 34 commits from branch
STJr:next
- a3aa15ba - Merge branch SRB2:next into menuforcustomcvars
-
a60721d1...b6544efc - 34 commits from branch
added 25 commits
-
a3aa15ba...a75fbd22 - 24 commits from branch
STJr:next
- 9e48ab88 - Merge branch SRB2:next into menuforcustomcvars
-
a3aa15ba...a75fbd22 - 24 commits from branch
added 112 commits
-
9e48ab88...b4b72730 - 111 commits from branch
STJr:next
- 9b12a46e - Merge branch SRB2:next into menuforcustomcvars
-
9e48ab88...b4b72730 - 111 commits from branch
added 145 commits
-
9b12a46e...8824ce87 - 144 commits from branch
STJr:next
- 790e2632 - Merge branch SRB2:next into menuforcustomcvars
-
9b12a46e...8824ce87 - 144 commits from branch
added 390 commits
-
790e2632...f096e569 - 389 commits from branch
STJr:next
- 94d50090 - Merge branch SRB2:next into menuforcustomcvars
-
790e2632...f096e569 - 389 commits from branch
changed milestone to %2.2.16
125 125 // used on menus 126 126 CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on. 127 127 CV_ALLOWLUA = 4096,/* Let this be called from Lua */ 128 CV_NOMENU = 8192, // Lua exclusive flag, to give choice to modders regarding custom options menu. I was discussing this with LJ (long time ago) and that's kind of the point to have them automatically inserted into the menu. Considering a lot of mods are unmaintained, mobile port users would appreciate it too and this was developed in mind to be in-case mid-major-version addition -- I believe serving the comfort of user should take priority while developer can choose to have the cvar in the menu or not later. Otherwise, I would do it in reverse even back then. Perhaps cvars with cheats should have been discarded from automatic process in the first place. In the end, it is not my decision to make what would be better anyway.
Edited by SkyduskI agreed with Eldolon, there are addons that prefer to never expose it to a menu which is intented, and if preferable to be
CV_ADDONMENU
instead of forcing all the cvars to be added to the menu which may even cause some confusion for addon developers (which is possible :p) to say why my cvars are automatically added to the menu when i didn't want to.I would agree with the stance of it being opt-out, specifically from the perspective of the playerbase. Menu options are significantly more friendly to most users compared to commands, and a lot of mods run on the assumption that the end-user knows how to use a command line. But if you lay out all of those commands in a menu, then they're easily accessible by everyone. The only reasons you would want to disable showing a cvar in the menu are if it's related to secret/debug behavior, or is already in its own custom menu, which a majority of cvars are not. Remember too that commands will not show up here period because of how they're programmed, so I think it's fair to give cvars the distinction of being placed here automatically.
558 579 return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)"); 559 580 } 560 581 582 if (!((cvar->flags & CV_NOMENU) 583 || (cvar->flags & CV_HIDEN)) 584 || (cvar->flags & CV_NOSHOWHELP)) 585 { 586 if (!category) 587 { 588 char* temp = strdup(wadfiles[numwadfiles - 1]->filename); 589 nameonly(temp); - Comment on lines +588 to +589
changed this line in version 7 of the diff
added 1 commit
- e6d51750 - Get the filename with pointer arithmetic instead.