mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Let Lua assign "description" via CV_RegisterVar
This commit is contained in:
parent
ee72a4c7db
commit
0fa2538142
2 changed files with 13 additions and 5 deletions
|
|
@ -422,6 +422,10 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||||
lua_rawset(L, 5);
|
lua_rawset(L, 5);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
cvar->func = Lua_OnChange;
|
cvar->func = Lua_OnChange;
|
||||||
|
} else if (i == 6 || (k && fasticmp(k, "description"))) {
|
||||||
|
if (!lua_isstring(L, 4))
|
||||||
|
TYPEERROR("description", LUA_TSTRING)
|
||||||
|
cvar->description = Z_StrDup(lua_tostring(L, 4));
|
||||||
}
|
}
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,11 @@ int menu_mode()
|
||||||
return PAUSE_AddonOptionsDef.extra1;
|
return PAUSE_AddonOptionsDef.extra1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean admin_mode()
|
||||||
|
{
|
||||||
|
return menu_mode() == kAdmin;
|
||||||
|
}
|
||||||
|
|
||||||
void menu_mode(int mode)
|
void menu_mode(int mode)
|
||||||
{
|
{
|
||||||
g_menu_cursors[menu_mode()] = itemOn;
|
g_menu_cursors[menu_mode()] = itemOn;
|
||||||
|
|
@ -66,14 +71,13 @@ void list_cvars()
|
||||||
for (consvar_t* var = consvar_vars; var; var = var->next)
|
for (consvar_t* var = consvar_vars; var; var = var->next)
|
||||||
{
|
{
|
||||||
if (!(var->flags & CV_ADDEDBYLUA))
|
if (!(var->flags & CV_ADDEDBYLUA))
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (menu_mode() == kUser && var->flags & CV_NETVAR)
|
if (var->flags & CV_NOSHOWHELP)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
|
if (!admin_mode() != !(var->flags & CV_NETVAR)) // LOL.
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
UINT16 status = IT_STRING | IT_CVAR;
|
UINT16 status = IT_STRING | IT_CVAR;
|
||||||
INT32 height = 8;
|
INT32 height = 8;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue