- handle menu customization via callbacks.
This commit is contained in:
parent
a084667bed
commit
73142ef2cf
8 changed files with 15 additions and 14 deletions
|
|
@ -24,4 +24,5 @@ FStartupInfo GameStartupInfo;
|
|||
|
||||
CVAR(Bool, queryiwad, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
CVAR(String, defaultiwad, "", CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
CVAR(Bool, vid_fps, false, 0)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "zstring.h"
|
||||
#include "intrect.h"
|
||||
#include "name.h"
|
||||
|
||||
struct event_t;
|
||||
class FRenderState;
|
||||
|
|
@ -37,6 +38,8 @@ struct SystemCallbacks
|
|||
void (*SetTransition)(int type);
|
||||
bool (*CheckCheatmode)(bool printmsg, bool sponly);
|
||||
void (*HudScaleChanged)();
|
||||
bool (*SetSpecialMenu)(FName& menu, int param);
|
||||
void (*OnMenuOpen)(bool makesound);
|
||||
};
|
||||
|
||||
extern SystemCallbacks sysCallbacks;
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@
|
|||
#include "i_time.h"
|
||||
#include "printf.h"
|
||||
|
||||
void M_StartControlPanel(bool makeSound, bool scaleoverride = false);
|
||||
|
||||
int DMenu::InMenu;
|
||||
static ScaleOverrider *CurrentScaleOverrider;
|
||||
//
|
||||
|
|
@ -434,8 +432,10 @@ bool DMenu::TranslateKeyboardEvents()
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
void M_DoStartControlPanel (bool scaleoverride)
|
||||
|
||||
void M_StartControlPanel (bool makesound, bool scaleoverride)
|
||||
{
|
||||
if (sysCallbacks.OnMenuOpen) sysCallbacks.OnMenuOpen(makesound);
|
||||
// intro might call this repeatedly
|
||||
if (CurrentMenu != nullptr)
|
||||
return;
|
||||
|
|
@ -504,11 +504,9 @@ DEFINE_ACTION_FUNCTION(DMenu, ActivateMenu)
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
bool M_SetSpecialMenu(FName& menu, int param); // game specific checks
|
||||
|
||||
void M_SetMenu(FName menu, int param)
|
||||
{
|
||||
if (!M_SetSpecialMenu(menu, param)) return;
|
||||
if (sysCallbacks.SetSpecialMenu && !sysCallbacks.SetSpecialMenu(menu, param)) return;
|
||||
|
||||
DMenuDescriptor **desc = MenuDescriptors.CheckKey(menu);
|
||||
if (desc != nullptr)
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ void M_ActivateMenu(DMenu *menu);
|
|||
void M_ClearMenus ();
|
||||
void M_PreviousMenu ();
|
||||
void M_ParseMenuDefs();
|
||||
void M_DoStartControlPanel(bool scaleoverride);
|
||||
void M_StartControlPanel(bool makeSound, bool scaleoverride = false);
|
||||
void M_SetMenu(FName menu, int param = -1);
|
||||
void M_StartMessage(const char *message, int messagemode, FName action = NAME_None);
|
||||
DMenu *StartPickerMenu(DMenu *parent, const char *name, FColorCVar *cvar);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include "vm.h"
|
||||
#include "menustate.h"
|
||||
|
||||
void M_StartControlPanel(bool makeSound, bool scaleoverride = false);
|
||||
FName MessageBoxClass = NAME_MessageBoxMenu;
|
||||
|
||||
CVAR(Bool, m_quickexit, false, CVAR_ARCHIVE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue