Added option to use a string instead of pause graphic

This commit is contained in:
DyNaM1Kk 2025-07-15 23:14:54 +04:00 committed by Ricardo Luís Vaz Silva
commit c98042ed02
3 changed files with 26 additions and 10 deletions

View file

@ -1112,20 +1112,34 @@ void D_Display ()
VMCall(func, params, countof(params), &ret, 1);
skip = !!rv;
}
if ( !skip )
if (!skip)
{
auto tex = TexMan.GetGameTextureByName(gameinfo.PauseSign.GetChars(), true);
double x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
tex->GetDisplayLeftOffset() * CleanXfac;
DrawTexture(twod, tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
int pausePos = 0;
if (gameinfo.UsePauseString)
{
FFont* font = BigFont;
FString pauseString = GStrings.GetString("PAUSE_STRING");
DrawText(twod, font, CR_RED,
(twod->GetWidth() - font->StringWidth(pauseString) * CleanXfac) / 2, 4, pauseString.GetChars(),
DTA_CleanNoMove, true, TAG_DONE);
pausePos = font->GetHeight() * CleanYfac + 4;
}
else
{
auto tex = TexMan.GetGameTextureByName(gameinfo.PauseSign.GetChars(), true);
double x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac) / 2 +
tex->GetDisplayLeftOffset() * CleanXfac;
DrawTexture(twod, tex, x, 4, DTA_CleanNoMove, true, TAG_DONE);
pausePos = tex->GetDisplayHeight() * CleanYfac + 4;
}
if (paused && multiplayer)
{
FFont *font = generic_ui? NewSmallFont : SmallFont;
FString pstring = GStrings.GetString("TXT_BY");
pstring.Substitute("%s", players[paused - 1].userinfo.GetName());
FFont *font = generic_ui ? NewSmallFont : SmallFont;
FString plrString = GStrings.GetString("TXT_BY");
plrString.Substitute("%s", players[paused - 1].userinfo.GetName());
DrawText(twod, font, CR_RED,
(twod->GetWidth() - font->StringWidth(pstring)*CleanXfac) / 2,
(tex->GetDisplayHeight() * CleanYfac) + 4, pstring.GetChars(), DTA_CleanNoMove, true, TAG_DONE);
(twod->GetWidth() - font->StringWidth(plrString)*CleanXfac) / 2, pausePos, plrString.GetChars(),
DTA_CleanNoMove, true, TAG_DONE);
}
}
}

View file

@ -398,6 +398,7 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRING(BasicArmorClass, "BasicArmorClass")
GAMEINFOKEY_STRING(HexenArmorClass, "HexenArmorClass")
GAMEINFOKEY_STRING(PauseSign, "pausesign")
GAMEINFOKEY_BOOL(UsePauseString, "usepausestring")
GAMEINFOKEY_STRING(quitSound, "quitSound")
GAMEINFOKEY_STRING(BorderFlat, "borderFlat")
GAMEINFOKEY_DOUBLE(telefogheight, "telefogheight")

View file

@ -151,6 +151,7 @@ struct gameinfo_t
FName BasicArmorClass;
FName HexenArmorClass;
FString PauseSign;
bool UsePauseString;
FString Endoom;
double Armor2Percent;
FString quitSound;