DEATH TO ALL HARDCODE MENUS
except master server and discord :^)
This commit is contained in:
parent
65a86671fe
commit
d0bb9a33ce
3 changed files with 24 additions and 1465 deletions
|
|
@ -2145,6 +2145,15 @@ void readtextprompt(MYFILE *f, INT32 num)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
static menu_t *allocmenu(INT32 num)
|
||||
{
|
||||
if (num < 0 || num >= NUMMENUTYPES)
|
||||
I_Error("Tried to allocate out-of-range menu number");
|
||||
if (menunum2menudef[num] == NULL)
|
||||
menunum2menudef[num] = Z_Malloc(sizeof(menu_t), PU_STATIC, NULL);
|
||||
return menunum2menudef[num];
|
||||
}
|
||||
|
||||
// super secret menu cvars... :shushing_face:
|
||||
static struct { const char *name; consvar_t *var; } HIDDENVARS[] = {
|
||||
{ "CHOOSESKIN", &cv_chooseskin },
|
||||
|
|
@ -2294,7 +2303,7 @@ static void readmenuitem(MYFILE *f, menu_t *menudef, char *itemname)
|
|||
}
|
||||
actionset = true;
|
||||
menuitem->status |= IT_SUBMENU;
|
||||
menuitem->itemaction.submenu = menunum2menudef[mn];
|
||||
menuitem->itemaction.submenu = allocmenu(mn);
|
||||
}
|
||||
else if (fastncmp(word, "CALL", 4) || fastcmp(word, "KEYHANDLER") || fastcmp(word, "ARROWS"))
|
||||
{
|
||||
|
|
@ -2359,12 +2368,7 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
INT32 value;
|
||||
boolean space = false;
|
||||
|
||||
menu_t *menudef = menunum2menudef[num];
|
||||
if (menudef == NULL)
|
||||
{
|
||||
deh_warning("No def for menu %d, that is certainly strange...", num);
|
||||
return;
|
||||
}
|
||||
menu_t *menudef = allocmenu(num);
|
||||
|
||||
//menuactive = false;
|
||||
|
||||
|
|
@ -2579,7 +2583,7 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
deh_warning("Menu %d: unknown previous menu '%s'", num, word2);
|
||||
continue;
|
||||
}
|
||||
menudef->prevMenu = menunum2menudef[value];
|
||||
menudef->prevMenu = allocmenu(value);
|
||||
}
|
||||
else if (fastcmp(word, "DRAWROUTINE"))
|
||||
{
|
||||
|
|
|
|||
1403
src/m_menu.c
1403
src/m_menu.c
File diff suppressed because it is too large
Load diff
66
src/m_menu.h
66
src/m_menu.h
|
|
@ -505,7 +505,6 @@ extern I_mutex m_menu_mutex;
|
|||
extern menu_t *currentMenu;
|
||||
|
||||
extern menu_t MainDef;
|
||||
extern menu_t SP_LoadDef;
|
||||
|
||||
// Call upon joystick hotplug
|
||||
void M_SetupJoystickMenu(INT32 choice);
|
||||
|
|
@ -658,71 +657,6 @@ void M_FreePlayerSetupColors(void);
|
|||
NULL\
|
||||
}
|
||||
|
||||
#define DEFAULTSCROLLMENUSTYLE(id, header, source, prev, x, y)\
|
||||
{\
|
||||
id,\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawGenericScrollMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define PAUSEMENUSTYLE(source, x, y)\
|
||||
{\
|
||||
MN_SPECIAL,\
|
||||
NULL,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
NULL,\
|
||||
source,\
|
||||
M_DrawPauseMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define CENTERMENUSTYLE(id, header, source, prev, y)\
|
||||
{\
|
||||
id,\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawCenteredMenu,\
|
||||
BASEVIDWIDTH/2, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define MAPICONMENUSTYLE(header, source, prev)\
|
||||
{\
|
||||
MN_NONE,\
|
||||
header,\
|
||||
sizeof (source)/sizeof (menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawServerMenu,\
|
||||
24,40,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define IMAGEDEF(source)\
|
||||
{\
|
||||
MN_SPECIAL,\
|
||||
NULL,\
|
||||
sizeof (source)/sizeof (menuitem_t),\
|
||||
NULL,\
|
||||
source,\
|
||||
M_DrawImageDef,\
|
||||
0, 0,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue