From a2f8b7d0dfe0b901d883d8517c8409abcc48b839 Mon Sep 17 00:00:00 2001 From: Alexander Kromm Date: Tue, 24 Nov 2020 22:40:30 +0700 Subject: [PATCH] add "hidepartimes" MAPINFO/GameInfo property --- src/gamedata/gi.cpp | 2 ++ src/gamedata/gi.h | 1 + wadsrc/static/zscript/doombase.zs | 1 + wadsrc/static/zscript/ui/statscreen/statscreen.zs | 7 +++++++ 4 files changed, 11 insertions(+) diff --git a/src/gamedata/gi.cpp b/src/gamedata/gi.cpp index 9a764755f3..9e5bd537bf 100644 --- a/src/gamedata/gi.cpp +++ b/src/gamedata/gi.cpp @@ -76,6 +76,7 @@ DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, berserkpic) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, defaultdropstyle) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, normforwardmove) DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, normsidemove) +DEFINE_FIELD_X(GameInfoStruct, gameinfo_t, mHideParTimes) const char *GameNames[17] = { @@ -443,6 +444,7 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_TWODOUBLES(normforwardmove, "normforwardmove") GAMEINFOKEY_TWODOUBLES(normsidemove, "normsidemove") GAMEINFOKEY_BOOL(nomergepickupmsg, "nomergepickupmsg") + GAMEINFOKEY_BOOL(mHideParTimes, "hidepartimes") else { diff --git a/src/gamedata/gi.h b/src/gamedata/gi.h index e59a2afaf6..0d5f259a8c 100644 --- a/src/gamedata/gi.h +++ b/src/gamedata/gi.h @@ -208,6 +208,7 @@ struct gameinfo_t double normsidemove[2]; int fullscreenautoaspect = 3; bool nomergepickupmsg; + bool mHideParTimes; const char *GetFinalePage(unsigned int num) const; }; diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 6c3bd45f80..aec68a3e9d 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -107,6 +107,7 @@ extend struct GameInfoStruct native TextureID berserkpic; native double normforwardmove[2]; native double normsidemove[2]; + native bool mHideParTimes; } extend class Object diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index 5b15471333..fe46b7f6a5 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -915,6 +915,13 @@ class StatusScreen abstract play version("2.5") Plrs[i] = wbs.plyr[i]; otherkills -= Plrs[i].skills; } + + if (gameinfo.mHideParTimes) + { + // par time and suck time are not displayed if zero. + wbs.partime = 0; + wbs.sucktime = 0; + } entering.Init(gameinfo.mStatscreenEnteringFont); finished.Init(gameinfo.mStatscreenFinishedFont);