diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 4e6adebaa..010b7e1d6 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -3212,6 +3212,22 @@ static void K_drawKartAccessibilityIcons(boolean gametypeinfoshown, INT32 fx) mirror = true; } } + + // Adjust for Lua disabling things underneath or to the left of the speedometer. + if (!LUA_HudEnabled(hud_rings)) + { + if (r_splitscreen < 2) + { + fy += 14; + } + // For 4P race, only check if it's a race. + // For 4P battle/capsules, check if it's either prisons or battle, AND check if that element isn't disabled. + else if ((gametyperules & GTR_CIRCUIT) == GTR_CIRCUIT || + ((battleprisons || (gametyperules & GTR_BUMPERS) == GTR_BUMPERS) && !LUA_HudEnabled(hud_gametypeinfo))) + { + fx -= 44; + } + } // Kickstart Accel if (stplyr->pflags & PF_KICKSTARTACCEL) @@ -3338,6 +3354,12 @@ static void K_drawKartSpeedometer(boolean gametypeinfoshown) { fy += 9; } + + // Adjust for Lua disabling things underneath the speedometer. + if (!LUA_HudEnabled(hud_rings)) + { + fy += 14; + } using srb2::Draw; Draw(LAPS_X+7, fy+1).flags(V_HUDTRANS|V_SLIDEIN|splitflags).align(Draw::Align::kCenter).width(42).small_sticker(); @@ -6400,13 +6422,16 @@ void K_drawKartHUD(void) K_drawKartAccessibilityIcons(gametypeinfoshown, 0); } - if (gametyperules & GTR_SPHERES) + if (LUA_HudEnabled(hud_rings)) { - K_drawBlueSphereMeter(gametypeinfoshown); - } - else - { - K_drawRingCounter(gametypeinfoshown); + if (gametyperules & GTR_SPHERES) + { + K_drawBlueSphereMeter(gametypeinfoshown); + } + else + { + K_drawRingCounter(gametypeinfoshown); + } } // Draw the item window diff --git a/src/lua_hud.h b/src/lua_hud.h index 7416ee324..3dcf053ba 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -39,6 +39,7 @@ enum hud { hud_speedometer, hud_freeplay, hud_rankings, // Tab rankings + hud_rings, // Rings and Spheres HUD element // Intermission hud_intermissiontally, diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 791348a27..fa6927721 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -59,6 +59,7 @@ static const char *const hud_disable_options[] = { "speedometer", "freeplay", "rankings", + "rings", "intermissiontally", "intermissionmessages",