From 8093b16f28eb7d4cf6ae76c86b98d243f0ba7973 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 4 Mar 2024 16:57:00 +0100 Subject: [PATCH 1/8] Options Menu for custom console variables https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2380#9cc73f4b99ff925448389969b0ade6ba3947fc31 --- src/lua_consolelib.c | 61 +++++++++++++++++++++++++++++----- src/m_menu.c | 79 +++++++++++++++++++++++++++++++++++++++++++- src/m_menu.h | 7 +++- 3 files changed, 136 insertions(+), 11 deletions(-) diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index b6ad0e17e..6c9252ff9 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -17,6 +17,11 @@ #include "byteptr.h" #include "z_zone.h" +#include "d_netfil.h" + +#include "m_menu.h" +#include "w_wad.h" + #include "lua_script.h" #include "lua_libs.h" #include "lua_hud.h" // hud_running errors @@ -186,8 +191,8 @@ static int lib_comAddCommand(lua_State *L) const char *luaname = luaL_checkstring(L, 1); // must store in all lowercase - char *name = Z_StrDup(luaname); - strlwr(name); + char *comname = Z_StrDup(luaname); + strlwr(comname); luaL_checktype(L, 2, LUA_TFUNCTION); NOHUD @@ -220,25 +225,26 @@ static int lib_comAddCommand(lua_State *L) lua_pushvalue(L, 3); lua_rawseti(L, -2, 2); - lua_setfield(L, -2, name); + lua_setfield(L, -2, comname); // Try to add the Lua command - com_return = COM_AddLuaCommand(name); + com_return = COM_AddLuaCommand(comname); if (com_return < 0) { // failed to add -- free the lowercased name and return error - Z_Free(name); + Z_Free(comname); return luaL_error(L, "Couldn't add a new console command \"%s\"", luaname); } else if (com_return == 1) { // command existed already -- free our name as the old string will continue to be used - CONS_Printf("Replaced command \"%s\"\n", name); - Z_Free(name); + CONS_Printf("Replaced command \"%s\"\n", comname); + Z_Free(comname); } else { // new command was added -- do NOT free the string as it will forever be used by the console - CONS_Printf("Added command \"%s\"\n", name); + CONS_Printf("Added command \"%s\"\n", comname); } + return 0; } @@ -314,12 +320,17 @@ static int lib_cvRegisterVar(lua_State *L) const char *k; lua_Integer i; consvar_t *cvar; + + const char* category = NULL; + const char* menu_name = NULL; + luaL_checktype(L, 1, LUA_TTABLE); lua_settop(L, 1); // Clear out all other possible arguments, leaving only the first one. NOHUD cvar = lua_newuserdata(L, sizeof(consvar_t)); luaL_getmetatable(L, META_CVAR); lua_setmetatable(L, -2); + boolean hasminmax = false; #define FIELDERROR(f, e) luaL_error(L, "bad value for " LUA_QL(f) " in table passed to " LUA_QL("CV_RegisterVar") " (%s)", e); #define TYPEERROR(f, t) FIELDERROR(f, va("%s expected, got %s", lua_typename(L, t), luaL_typename(L, -1))) @@ -385,13 +396,17 @@ static int lib_cvRegisterVar(lua_State *L) if (lua_type(L, 5) != LUA_TSTRING || lua_type(L, 6) != LUA_TNUMBER) FIELDERROR("PossibleValue", "custom PossibleValue table requires a format of string=integer, i.e. {MIN=0, MAX=9999}"); - cvpv[i].strvalue = Z_StrDup(lua_tostring(L, 5)); + char *strvalue = Z_StrDup(lua_tostring(L, 5)); + if (fasticmp(strvalue, "MIN")) + hasminmax = true; + cvpv[i].strvalue = strvalue; cvpv[i].value = (INT32)lua_tonumber(L, 6); i++; lua_pop(L, 1); } cvpv[i].value = 0; cvpv[i].strvalue = NULL; + hasminmax = false; cvar->PossibleValue = cvpv; } else FIELDERROR("PossibleValue", va("%s or CV_PossibleValue_t expected, got %s", lua_typename(L, LUA_TTABLE), luaL_typename(L, -1))) @@ -405,6 +420,18 @@ static int lib_cvRegisterVar(lua_State *L) lua_pop(L, 1); cvar->func = Lua_OnChange; } + else if (((i == 5 && !(cvar->flags & CV_CALL)) + || (cvar->flags & CV_CALL && i == 7)) + || (k && fasticmp(k, "category"))) + { + category = lua_isnoneornil(L, 4) ? NULL : lua_tostring(L, 4); + } + else if (((i == 6 && !(cvar->flags & CV_CALL)) + || (cvar->flags & CV_CALL && i == 8)) + || (k && fasticmp(k, "menuname"))) + { + menu_name = lua_isnoneornil(L, 4) ? NULL : lua_tostring(L, 4); + } lua_pop(L, 1); } #undef FIELDERROR @@ -429,6 +456,22 @@ static int lib_cvRegisterVar(lua_State *L) if (cvar->flags & CV_MODIFIED) return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)"); + if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP)) + { + if (!category) + { + char *temp = strdup(wadfiles[numwadfiles - 1]->filename); + nameonly(temp); + + category = temp; + } + + if (menu_name && menu_name[0] != '\0') + M_SlotCvarIntoModMenu(cvar, category, menu_name, hasminmax); + else + M_SlotCvarIntoModMenu(cvar, category, cvar->name, hasminmax); + } + // return cvar userdata return 1; } diff --git a/src/m_menu.c b/src/m_menu.c index 5cf720be7..345176aae 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -50,6 +50,10 @@ #include "p_setup.h" #include "f_finale.h" +#include "lua_libs.h" + +#include "fastcmp.h" + #ifdef HWRENDER #include "hardware/hw_main.h" #endif @@ -302,6 +306,7 @@ static void M_SetupMultiHandler(INT32 choice); menu_t OP_ControlsDef, OP_AllControlsDef; menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef; menu_t OP_Joystick1Def, OP_Joystick2Def, OP_Joystick3Def, OP_Joystick4Def; +menu_t OP_CustomCvarMenuDef; static void M_VideoModeMenu(INT32 choice); static void M_Setup1PControlsMenu(INT32 choice); static void M_Setup2PControlsMenu(INT32 choice); @@ -346,6 +351,8 @@ static void M_AddonsInternal(); static void M_Addons(INT32 choice); static void M_LocalSkins(INT32 choice); static void M_AddonsOptions(INT32 choice); + +static void M_CustomCvarMenu(INT32 choice); static patch_t *addonsp[NUM_EXT+5]; static void M_DeleteProtocol(void); @@ -1086,7 +1093,8 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU|IT_STRING, NULL, "Gameplay Options...", &OP_GameOptionsDef, 60}, {IT_SUBMENU|IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 70}, - {IT_SUBMENU|IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 90}, + {IT_SUBMENU|IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 90}, + {IT_CALL|IT_STRING, NULL, "Custom Options...", M_CustomCvarMenu, 100}, {IT_CALL|IT_STRING, NULL, "Tricks & Secrets (F1)", M_Manual, 110}, {IT_CALL|IT_STRING, NULL, "Play Credits", M_Credits, 120}, @@ -2273,6 +2281,8 @@ enum syncspecialonly, }; +menuitem_t OP_CustomCvarMenu[MAXMENUCCVARS]; + // ========================================================================== // ALL MENU DEFINITIONS GO HERE // ========================================================================== @@ -2768,6 +2778,23 @@ menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30); menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60); menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60); +INT16 ccvarposition = 0; + +static void M_CustomCvarMenu(INT32 choice) +{ + (void)choice; + + if (ccvarposition) + M_SetupNextMenu(&OP_CustomCvarMenuDef); + else + M_StartMessage(M_GetText("No custom options were found\n"), NULL, MM_NOTHING); +} + +/*menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLMENUSTYLE( + MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ADDONS), + "M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 30, 30);*/ +menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 30, 30); + menu_t OP_ForkedBirdDef = { NULL, sizeof(OP_ForkedBirdMenu)/sizeof(menuitem_t), @@ -7648,6 +7675,56 @@ void M_PopupMasterServerRules(void) #endif } +#define CCVHEIGHT 5 +#define CCVHEIGHTHEADER 1 +#define CCVHEIGHTHEADERAFTER 6 + +UINT16 ccvaralphakey = 4; +INT16 ccvarlaststheader = 0; + +INT32 CVARSETUP; + +void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name, boolean minmax) +{ + if (ccvarposition == INT16_MAX) + return; + + if (ccvarposition >= MAXMENUCCVARS - 2) + { + CONS_Printf("failed to register cvar into custom settings menu as menu reached limit\n"); + ccvarposition = INT16_MAX; + return; + } + + if (!CVARSETUP) + { + CONS_Printf("custom settings menu initiation\n"); + for (CVARSETUP = 0; CVARSETUP < MAXMENUCCVARS; ++CVARSETUP) + OP_CustomCvarMenu[CVARSETUP] = (menuitem_t){IT_DISABLED, NULL, "", 0, INT16_MAX}; + } + + if (category && ((ccvarposition == 0 && category[0] != '\0') || !fasticmp(category, OP_CustomCvarMenu[ccvarlaststheader].text))) + { + ccvarlaststheader = ccvarposition; + ccvaralphakey += CCVHEIGHTHEADER; + + OP_CustomCvarMenu[ccvarposition] = (menuitem_t){IT_HEADER, NULL, Z_StrDup(category), NULL, ccvaralphakey}; + ccvaralphakey += CCVHEIGHTHEADERAFTER; + + ++ccvarposition; + } + + if (minmax) + OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, Z_StrDup(name), cvar, ccvaralphakey }; + else if (cvar->flags & CV_FLOAT) + OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR , NULL, Z_StrDup(name), cvar, ccvaralphakey }; + else + OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR, NULL, Z_StrDup(name), cvar, ccvaralphakey }; + + ccvaralphakey += CCVHEIGHT; + ++ccvarposition; +} + // ====== // CHEATS // ====== diff --git a/src/m_menu.h b/src/m_menu.h index 8d1ebb723..2c378704d 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -147,6 +147,8 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt); #define MAXSTRINGLENGTH 32 +#define MAXMENUCCVARS 999 + #define MAXTOOLTIPS 255 typedef union @@ -171,7 +173,7 @@ typedef struct menuitem_s void *itemaction; // hotkey in menu or y of the item - UINT8 alphaKey; + UINT16 alphaKey; } menuitem_t; extern menuitem_t PlayerMenu[MAXSKINS]; @@ -289,6 +291,8 @@ void M_PopupMasterServerRules(void); void M_PopupMasterServerConnectError(void); #endif +void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name, boolean minmax); + // These defines make it a little easier to make menus #define DEFAULTMENUSTYLE(header, source, prev, x, y)\ {\ @@ -316,6 +320,7 @@ void M_PopupMasterServerConnectError(void); NULL\ } + #define PAUSEMENUSTYLE(source, x, y)\ {\ NULL,\ -- 2.54.0 From 2857f368365eb368f33d836dfff699df9cc2c60b Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 2 Mar 2024 01:14:36 +0100 Subject: [PATCH 2/8] we dont have IT_CV_FLOATSLIDER so dont even need to check for float --- src/m_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 345176aae..dcb94bc26 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7716,8 +7716,8 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na if (minmax) OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, Z_StrDup(name), cvar, ccvaralphakey }; - else if (cvar->flags & CV_FLOAT) - OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR , NULL, Z_StrDup(name), cvar, ccvaralphakey }; + //else if (cvar->flags & CV_FLOAT) + //OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER , NULL, Z_StrDup(name), cvar, ccvaralphakey }; else OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR, NULL, Z_StrDup(name), cvar, ccvaralphakey }; -- 2.54.0 From 94e1a357913b8a399416c8e72788b3788a98d7a1 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 2 Mar 2024 01:15:03 +0100 Subject: [PATCH 3/8] smh --- src/lua_consolelib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 6c9252ff9..8f66d8be1 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -456,7 +456,7 @@ static int lib_cvRegisterVar(lua_State *L) if (cvar->flags & CV_MODIFIED) return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)"); - if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP)) + if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP))) { if (!category) { -- 2.54.0 From d522f202a6446a0380dcab4a324917cb2e2f301e Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 2 Mar 2024 01:32:12 +0100 Subject: [PATCH 4/8] make netvars red --- src/m_menu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index dcb94bc26..1ff637c65 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7718,6 +7718,8 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, Z_StrDup(name), cvar, ccvaralphakey }; //else if (cvar->flags & CV_FLOAT) //OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER , NULL, Z_StrDup(name), cvar, ccvaralphakey }; + else if (cvar->flags & CV_NETVAR) + OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR , NULL, Z_StrDup(va("\x85 %s", name)), cvar, ccvaralphakey }; else OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR, NULL, Z_StrDup(name), cvar, ccvaralphakey }; -- 2.54.0 From df28c875298af843f9d368f69d71061cc73f4957 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 4 Mar 2024 19:45:49 +0100 Subject: [PATCH 5/8] remove minmax sliders --- src/lua_consolelib.c | 11 +++-------- src/m_menu.c | 8 ++------ src/m_menu.h | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 8f66d8be1..8217c5d03 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -330,7 +330,6 @@ static int lib_cvRegisterVar(lua_State *L) cvar = lua_newuserdata(L, sizeof(consvar_t)); luaL_getmetatable(L, META_CVAR); lua_setmetatable(L, -2); - boolean hasminmax = false; #define FIELDERROR(f, e) luaL_error(L, "bad value for " LUA_QL(f) " in table passed to " LUA_QL("CV_RegisterVar") " (%s)", e); #define TYPEERROR(f, t) FIELDERROR(f, va("%s expected, got %s", lua_typename(L, t), luaL_typename(L, -1))) @@ -396,17 +395,13 @@ static int lib_cvRegisterVar(lua_State *L) if (lua_type(L, 5) != LUA_TSTRING || lua_type(L, 6) != LUA_TNUMBER) FIELDERROR("PossibleValue", "custom PossibleValue table requires a format of string=integer, i.e. {MIN=0, MAX=9999}"); - char *strvalue = Z_StrDup(lua_tostring(L, 5)); - if (fasticmp(strvalue, "MIN")) - hasminmax = true; - cvpv[i].strvalue = strvalue; + cvpv[i].strvalue = Z_StrDup(lua_tostring(L, 5)); cvpv[i].value = (INT32)lua_tonumber(L, 6); i++; lua_pop(L, 1); } cvpv[i].value = 0; cvpv[i].strvalue = NULL; - hasminmax = false; cvar->PossibleValue = cvpv; } else FIELDERROR("PossibleValue", va("%s or CV_PossibleValue_t expected, got %s", lua_typename(L, LUA_TTABLE), luaL_typename(L, -1))) @@ -467,9 +462,9 @@ static int lib_cvRegisterVar(lua_State *L) } if (menu_name && menu_name[0] != '\0') - M_SlotCvarIntoModMenu(cvar, category, menu_name, hasminmax); + M_SlotCvarIntoModMenu(cvar, category, menu_name); else - M_SlotCvarIntoModMenu(cvar, category, cvar->name, hasminmax); + M_SlotCvarIntoModMenu(cvar, category, cvar->name); } // return cvar userdata diff --git a/src/m_menu.c b/src/m_menu.c index 1ff637c65..729067158 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7684,7 +7684,7 @@ INT16 ccvarlaststheader = 0; INT32 CVARSETUP; -void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name, boolean minmax) +void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name) { if (ccvarposition == INT16_MAX) return; @@ -7714,11 +7714,7 @@ void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* na ++ccvarposition; } - if (minmax) - OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, Z_StrDup(name), cvar, ccvaralphakey }; - //else if (cvar->flags & CV_FLOAT) - //OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR | IT_CV_FLOATSLIDER , NULL, Z_StrDup(name), cvar, ccvaralphakey }; - else if (cvar->flags & CV_NETVAR) + if (cvar->flags & CV_NETVAR) OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR , NULL, Z_StrDup(va("\x85 %s", name)), cvar, ccvaralphakey }; else OP_CustomCvarMenu[ccvarposition] = (menuitem_t){ IT_STRING | IT_CVAR, NULL, Z_StrDup(name), cvar, ccvaralphakey }; diff --git a/src/m_menu.h b/src/m_menu.h index 2c378704d..485f7f7a1 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -291,7 +291,7 @@ void M_PopupMasterServerRules(void); void M_PopupMasterServerConnectError(void); #endif -void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name, boolean minmax); +void M_SlotCvarIntoModMenu(consvar_t* cvar, const char* category, const char* name); // These defines make it a little easier to make menus #define DEFAULTMENUSTYLE(header, source, prev, x, y)\ -- 2.54.0 From 1e0a10afb601d46db744f7671ed17adab75478e6 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 4 Mar 2024 20:17:18 +0100 Subject: [PATCH 6/8] change some numbers uuuuuh --- src/lua_consolelib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 8217c5d03..e52313cea 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -415,14 +415,14 @@ static int lib_cvRegisterVar(lua_State *L) lua_pop(L, 1); cvar->func = Lua_OnChange; } - else if (((i == 5 && !(cvar->flags & CV_CALL)) - || (cvar->flags & CV_CALL && i == 7)) + else if (((i == 5 && !(cvar->flags & CV_CALL)) + || (cvar->flags & CV_CALL && i == 6)) || (k && fasticmp(k, "category"))) - { + { category = lua_isnoneornil(L, 4) ? NULL : lua_tostring(L, 4); } else if (((i == 6 && !(cvar->flags & CV_CALL)) - || (cvar->flags & CV_CALL && i == 8)) + || (cvar->flags & CV_CALL && i == 7)) || (k && fasticmp(k, "menuname"))) { menu_name = lua_isnoneornil(L, 4) ? NULL : lua_tostring(L, 4); -- 2.54.0 From bbb0c53616d789a311fcf5d4d85a2503aaf67b96 Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 4 Mar 2024 23:07:42 +0300 Subject: [PATCH 7/8] Don't add string cvars (a bit hacky solution) --- src/lua_consolelib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index e52313cea..7d9cd67ec 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -451,7 +451,7 @@ static int lib_cvRegisterVar(lua_State *L) if (cvar->flags & CV_MODIFIED) return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)"); - if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP))) + if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP)) && (cvar->PossibleValue || !(cvar->value == 0 && stricmp(cvar->string, "0")))) { if (!category) { @@ -637,4 +637,4 @@ int LUA_ConsoleLib(lua_State *L) lua_pushvalue(L, LUA_GLOBALSINDEX); luaL_register(L, NULL, lib); return 0; -} \ No newline at end of file +} -- 2.54.0 From 3f513158634cff6972598740d1fe73ba55d7f6a0 Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 4 Mar 2024 23:27:21 +0300 Subject: [PATCH 8/8] Make custom cvar menu bit wider --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 729067158..c13a3e34b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2793,7 +2793,7 @@ static void M_CustomCvarMenu(INT32 choice) /*menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLMENUSTYLE( MTREE3(MN_OP_MAIN, MN_OP_DATA, MN_OP_ADDONS), "M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 30, 30);*/ -menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 30, 30); +menu_t OP_CustomCvarMenuDef = DEFAULTSCROLLSTYLE("M_ADDONS", OP_CustomCvarMenu, &OP_MainDef, 10, 30); menu_t OP_ForkedBirdDef = { NULL, -- 2.54.0