mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Addons menu refactor part 1
- Move M_AddonsRefresh out of M_DrawAddons - death to a HORRIBLE hack - Use it as the tickroutine for the addons menu instead - Behaves as before, possibly more consistent
This commit is contained in:
parent
139def0d3d
commit
8312f12d6c
4 changed files with 12 additions and 19 deletions
|
|
@ -963,7 +963,7 @@ void M_ReplayHut(INT32 choice);
|
|||
// Misc menus:
|
||||
#define numaddonsshown 4
|
||||
void M_Addons(INT32 choice);
|
||||
boolean M_AddonsRefresh(void);
|
||||
void M_AddonsRefresh(void);
|
||||
void M_HandleAddons(INT32 choice);
|
||||
char *M_AddonsHeaderPath(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1742,7 +1742,7 @@ menu_t MISC_AddonsDef = {
|
|||
0, 0,
|
||||
0, 0,
|
||||
M_DrawAddons,
|
||||
NULL,
|
||||
M_AddonsRefresh,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
|
|
|
|||
|
|
@ -4284,13 +4284,6 @@ void M_DrawAddons(void)
|
|||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, bg, NULL);
|
||||
}
|
||||
|
||||
// hack - need to refresh at end of frame to handle addfile...
|
||||
if (refreshdirmenu & M_AddonsRefresh())
|
||||
{
|
||||
M_DrawMessageMenu();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Playing())
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems.");
|
||||
else
|
||||
|
|
|
|||
|
|
@ -6321,8 +6321,8 @@ static void M_AddonsClearName(INT32 choice)
|
|||
M_StopMessage(choice);
|
||||
}
|
||||
|
||||
// returns whether to do message draw
|
||||
boolean M_AddonsRefresh(void)
|
||||
// Handles messages for addon errors.
|
||||
void M_AddonsRefresh(void)
|
||||
{
|
||||
if ((refreshdirmenu & REFRESHDIR_NORMAL) && !preparefilemenu(true, false))
|
||||
{
|
||||
|
|
@ -6331,7 +6331,7 @@ boolean M_AddonsRefresh(void)
|
|||
{
|
||||
CLEARNAME;
|
||||
}
|
||||
return true;
|
||||
return;// true;
|
||||
}
|
||||
|
||||
#ifdef DEVELOP
|
||||
|
|
@ -6368,23 +6368,23 @@ boolean M_AddonsRefresh(void)
|
|||
if (message)
|
||||
{
|
||||
M_StartMessage(message,FUNCPTRCAST(M_AddonsClearName),MM_YESNO);
|
||||
return true;
|
||||
return;// true;
|
||||
}
|
||||
|
||||
S_StartSound(NULL, sfx_s221);
|
||||
CLEARNAME;
|
||||
}
|
||||
|
||||
return false;
|
||||
return;// false;
|
||||
}
|
||||
|
||||
static void M_AddonExec(INT32 ch)
|
||||
{
|
||||
if (ch == MA_NO)
|
||||
return;
|
||||
|
||||
if (ch == MA_YES)
|
||||
{
|
||||
S_StartSound(NULL, sfx_zoom);
|
||||
COM_BufAddText(va("exec \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
|
||||
}
|
||||
}
|
||||
|
||||
#define len menusearch[0]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue