mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-05-09 18:30:52 +00:00
save togglehud to ini so that it can be properly restored on crash/exit
This commit is contained in:
parent
56999fecd2
commit
e406770efa
2 changed files with 12 additions and 12 deletions
|
@ -310,8 +310,6 @@ CUSTOM_CVAR(Int, I_FriendlyWindowTitle, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_N
|
||||||
}
|
}
|
||||||
CVAR(Bool, cl_nointros, false, CVAR_ARCHIVE)
|
CVAR(Bool, cl_nointros, false, CVAR_ARCHIVE)
|
||||||
|
|
||||||
|
|
||||||
bool hud_toggled = false;
|
|
||||||
bool wantToRestart;
|
bool wantToRestart;
|
||||||
bool DrawFSHUD; // [RH] Draw fullscreen HUD?
|
bool DrawFSHUD; // [RH] Draw fullscreen HUD?
|
||||||
bool devparm; // started game with -devparm
|
bool devparm; // started game with -devparm
|
||||||
|
@ -356,16 +354,18 @@ static int pagetic;
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
CVAR(Int, saved_screenblocks, 10, CVAR_ARCHIVE)
|
||||||
|
CVAR(Bool, saved_drawplayersprite, true, CVAR_ARCHIVE)
|
||||||
|
CVAR(Bool, saved_showmessages, true, CVAR_ARCHIVE)
|
||||||
|
CVAR(Bool, hud_toggled, false, CVAR_ARCHIVE)
|
||||||
|
|
||||||
void D_ToggleHud()
|
void D_ToggleHud()
|
||||||
{
|
{
|
||||||
static int saved_screenblocks;
|
|
||||||
static bool saved_drawplayersprite, saved_showmessages;
|
|
||||||
|
|
||||||
if ((hud_toggled = !hud_toggled))
|
if ((hud_toggled = !hud_toggled))
|
||||||
{
|
{
|
||||||
saved_screenblocks = screenblocks;
|
saved_screenblocks = *screenblocks;
|
||||||
saved_drawplayersprite = r_drawplayersprites;
|
saved_drawplayersprite = *r_drawplayersprites;
|
||||||
saved_showmessages = show_messages;
|
saved_showmessages = *show_messages;
|
||||||
screenblocks = 12;
|
screenblocks = 12;
|
||||||
r_drawplayersprites = false;
|
r_drawplayersprites = false;
|
||||||
show_messages = false;
|
show_messages = false;
|
||||||
|
@ -374,9 +374,9 @@ void D_ToggleHud()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
screenblocks = saved_screenblocks;
|
screenblocks =*saved_screenblocks;
|
||||||
r_drawplayersprites = saved_drawplayersprite;
|
r_drawplayersprites = *saved_drawplayersprite;
|
||||||
show_messages = saved_showmessages;
|
show_messages = *saved_showmessages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CCMD(togglehud)
|
CCMD(togglehud)
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "c_cvars.h"
|
#include "c_cvars.h"
|
||||||
|
|
||||||
extern bool advancedemo;
|
extern bool advancedemo;
|
||||||
extern bool hud_toggled;
|
EXTERN_CVAR(Bool, hud_toggled);
|
||||||
void D_ToggleHud();
|
void D_ToggleHud();
|
||||||
|
|
||||||
struct event_t;
|
struct event_t;
|
||||||
|
|
Loading…
Reference in a new issue