Merge branch 'disable-powerup-hud' into 'next'

Make powerups HUD toggleable via Lua (again)

See merge request STJr/SRB2!2234
This commit is contained in:
sphere 2024-02-27 12:05:36 +00:00
commit 9b809fec6b
4 changed files with 8 additions and 3 deletions

View file

@ -19,6 +19,7 @@ enum hud {
hud_stagetitle = 0,
hud_textspectator,
hud_crosshair,
hud_powerups,
// Singleplayer / Co-op
hud_score,
hud_time,

View file

@ -41,6 +41,7 @@ static const char *const hud_disable_options[] = {
"stagetitle",
"textspectator",
"crosshair",
"powerups",
"score",
"time",

View file

@ -44,6 +44,8 @@
// SRB2Kart
#include "r_fps.h" // R_GetFramerateCap
#include "lua_hud.h" // LUA_HudEnabled
// --------------------------------------------
// assembly or c drawer routines for 8bpp/16bpp
// --------------------------------------------
@ -494,6 +496,7 @@ void SCR_ClosedCaptions(void)
basey -= 8;
else if ((modeattacking == ATTACKING_NIGHTS)
|| (!(maptol & TOL_NIGHTS)
&& LUA_HudEnabled(hud_powerups)
&& ((cv_powerupdisplay.value == 2) // "Always"
|| (cv_powerupdisplay.value == 1 && !camera.chase)))) // "First-person only"
basey -= 16;

View file

@ -2821,14 +2821,14 @@ static void ST_overlayDrawer(void)
|| ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase))
{
ST_drawFirstPersonHUD();
if (cv_powerupdisplay.value)
if (cv_powerupdisplay.value && LUA_HudEnabled(hud_powerups))
ST_drawPowerupHUD(); // same as it ever was...
}
else if (cv_powerupdisplay.value == 2)
else if (cv_powerupdisplay.value == 2 && LUA_HudEnabled(hud_powerups))
ST_drawPowerupHUD(); // same as it ever was...
}
else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2)
else if (!(netgame || multiplayer) && cv_powerupdisplay.value == 2 && LUA_HudEnabled(hud_powerups))
ST_drawPowerupHUD(); // same as it ever was...
if (!(netgame || multiplayer) || !hu_showscores)