- changed the rules for dimming the menu to be more clear

It will no longer depend on the game state when the menu was opened but the current game state - only on the dedicated menu screen there's no dimming - everywhere else a dim gets applied.

Also renamed GS_DEMOSCREEN to GS_MENUSCREEN for clarity
This commit is contained in:
Christoph Oelckers 2020-08-11 00:46:27 +02:00
parent 000c00dc91
commit 6a10a7f266
10 changed files with 18 additions and 20 deletions

View file

@ -655,7 +655,7 @@ void ProcessFrame(void)
if (gGameOptions.nGameType == 0)
{
auto completion = [] (bool) {
gamestate = GS_DEMOSCREEN;
gamestate = GS_MENUSCREEN;
M_StartControlPanel(false);
M_SetMenu(NAME_CreditsMenu);
gGameOptions.uGameFlags &= ~3;
@ -948,13 +948,13 @@ int GameInterface::app_main()
if (playvideo) playlogos();
else
{
gamestate = GS_DEMOSCREEN;
gamestate = GS_MENUSCREEN;
M_StartControlPanel(false);
M_SetMenu(NAME_Mainmenu);
}
break;
case GS_DEMOSCREEN:
case GS_MENUSCREEN:
case GS_FULLCONSOLE:
drawBackground();
break;

View file

@ -91,7 +91,7 @@ void playlogos()
jobs[job++] = { Create<DImageScreen>(2518, DScreenJob::fadein) };
RunScreenJob(jobs, job, [](bool) {
gamestate = GS_DEMOSCREEN;
gamestate = GS_MENUSCREEN;
M_StartControlPanel(false);
M_SetMenu(NAME_Mainmenu);
}, true, true);

View file

@ -783,7 +783,7 @@ void FNotifyBuffer::AddString(int printlevel, FString source)
if (hud_messages == 0 ||
source.IsEmpty() ||
gamestate == GS_FULLCONSOLE ||
gamestate == GS_DEMOSCREEN ||
gamestate == GS_MENUSCREEN ||
con_notifylines == 0)
return;
@ -1074,7 +1074,7 @@ void FNotifyBuffer::Draw()
int line, lineadv, color, j;
bool canskip;
if (gamestate == GS_FULLCONSOLE || gamestate == GS_DEMOSCREEN)
if (gamestate == GS_FULLCONSOLE || gamestate == GS_MENUSCREEN)
return;
FFont* font = generic_ui ? NewSmallFont : SmallFont? SmallFont : AlternativeSmallFont;
@ -1293,7 +1293,7 @@ void C_ToggleConsole ()
{
return;
}
if (gamestate == GS_DEMOSCREEN)
if (gamestate == GS_MENUSCREEN)
{
gamestate = GS_FULLCONSOLE;
C_FullConsole();
@ -1605,7 +1605,7 @@ static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
}
else if (gamestate == GS_FULLCONSOLE)
{
gamestate = GS_DEMOSCREEN;
gamestate = GS_MENUSCREEN;
C_DoCommand ("menu_main");
}
else

View file

@ -173,7 +173,7 @@ bool System_WantGuiCapture()
bool System_WantLeftButton()
{
return false;// (gamestate == GS_DEMOSCREEN || gamestate == GS_TITLELEVEL);
return false;// (gamestate == GS_MENUSCREEN || gamestate == GS_TITLELEVEL);
}
bool System_NetGame()

View file

@ -9,11 +9,11 @@ enum gamestate_t : int
GS_INTRO,
GS_INTERMISSION,
GS_FINALE,
GS_DEMOSCREEN,
GS_MENUSCREEN,
GS_FULLCONSOLE, // [RH] Fullscreen console
GS_HIDECONSOLE, // [RH] The menu just did something that should hide fs console
GS_STARTUP, // [RH] Console is fullscreen, and game is just starting
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_DEMOSCREEN
GS_TITLELEVEL, // [RH] A combination of GS_LEVEL and GS_MENUSCREEN
GS_FORCEWIPE = -1,
GS_FORCEWIPEFADE = -2,

View file

@ -67,7 +67,6 @@ void RegisterJoystickMenus();
void UpdateJoystickMenu(IJoystickConfig* joy);
bool help_disabled, credits_disabled;
int g_currentMenu; // accessible by CON scripts - contains the current menu's script ID if defined or INT_MAX if none given.
int DrawBackground;
TArray<DMenu*> toDelete;
//
@ -432,7 +431,6 @@ bool M_SetMenu(FName menu, int param, FName caller)
NewGameStartupInfo.Episode = NewGameStartupInfo.Skill = 0;
menu = NAME_Startgame;
#endif
DrawBackground = gamestate == GS_DEMOSCREEN;
// some menus need some special treatment (needs to be adjusted for the various frontends.
switch (caller.GetIndex())
{
@ -824,7 +822,7 @@ bool M_DoResponder (event_t *ev)
{
M_StartControlPanel(true);
M_SetMenu(gi->CanSave()? NAME_IngameMenu : NAME_Mainmenu, -1);
if (gamestate == GS_FULLCONSOLE) gamestate = GS_DEMOSCREEN;
if (gamestate == GS_FULLCONSOLE) gamestate = GS_MENUSCREEN;
}
return true;
}
@ -912,7 +910,7 @@ void M_Drawer (void)
if (CurrentMenu != NULL && menuactive != MENU_Off)
{
if (CurrentMenu->DimAllowed() && fade && !DrawBackground) twod->AddColorOnlyQuad(0, 0, screen->GetWidth(), screen->GetHeight(), fade);
if (CurrentMenu->DimAllowed() && fade && gamestate != GS_MENUSCREEN) twod->AddColorOnlyQuad(0, 0, screen->GetWidth(), screen->GetHeight(), fade);
bool going = false;
if (transition.previous)

View file

@ -1088,7 +1088,7 @@ CCMD(testscreen)
auto gs = gamestate;
auto completion = [=](bool)
{
if (gs == GS_LEVEL || gs == GS_DEMOSCREEN) gamestate = gs;
if (gs == GS_LEVEL || gs == GS_MENUSCREEN) gamestate = gs;
else gamestate = GS_STARTUP;
};

View file

@ -647,7 +647,7 @@ CCMD(testrscreen)
auto gs = gamestate;
auto completion = [=](bool)
{
if (gs == GS_LEVEL || gs == GS_DEMOSCREEN) gamestate = gs;
if (gs == GS_LEVEL || gs == GS_MENUSCREEN) gamestate = gs;
else gamestate = GS_STARTUP;
};

View file

@ -387,7 +387,7 @@ bool GameTicker()
void startmainmenu()
{
gamestate = GS_DEMOSCREEN;
gamestate = GS_MENUSCREEN;
M_StartControlPanel(false);
M_SetMenu(NAME_Mainmenu);
FX_StopAllSounds();
@ -443,7 +443,7 @@ void app_loop()
}
break;
case GS_DEMOSCREEN:
case GS_MENUSCREEN:
case GS_FULLCONSOLE:
drawbackground();
break;

View file

@ -81,7 +81,7 @@ enum EGameState
GS_LEVEL,
GS_INTERMISSION,
GS_FINALE,
GS_DEMOSCREEN,
GS_MENUSCREEN,
GS_FULLCONSOLE,
GS_HIDECONSOLE,
GS_STARTUP,