From 812b9d76d6e7b6ce7f1fd6dc95b6877458040158 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 15 Apr 2023 09:33:46 +0200 Subject: [PATCH] - Blood: display the charge meter for the dynamite also on the alternative HUD. --- source/core/statusbar2.cpp | 5 +++++ wadsrc/static/zscript/games/blood/ui/sbar.zs | 8 ++++++++ wadsrc/static/zscript/statusbar.zs | 2 ++ 3 files changed, 15 insertions(+) diff --git a/source/core/statusbar2.cpp b/source/core/statusbar2.cpp index e92cb1409..f7c8e6a1a 100644 --- a/source/core/statusbar2.cpp +++ b/source/core/statusbar2.cpp @@ -202,6 +202,11 @@ void UpdateStatusBar(SummaryInfo* info) if (hud_size == Hud_Althud) { DrawAltHUD(info); + IFVIRTUALPTRNAME(StatusBar, NAME_RazeStatusBar, AltHUDOverlay) + { + VMValue params[] = { StatusBar, info }; + VMCall(func, params, 2, nullptr, 0); + } return; } IFVIRTUALPTRNAME(StatusBar, NAME_RazeStatusBar, UpdateStatusBar) diff --git a/wadsrc/static/zscript/games/blood/ui/sbar.zs b/wadsrc/static/zscript/games/blood/ui/sbar.zs index c4af37a27..bd38f18ac 100644 --- a/wadsrc/static/zscript/games/blood/ui/sbar.zs +++ b/wadsrc/static/zscript/games/blood/ui/sbar.zs @@ -770,6 +770,14 @@ class BloodStatusBar : RazeStatusBar drawMultiHUD(pPlayer, nGameType); } + override void AltHUDOverlay(SummaryInfo summary) + { + BeginStatusBar(false, 320, 200, 28); + let pPlayer = Blood.GetViewPlayer(); + if (pPlayer.throwPower) + TileHGauge("ThrowGauge", 124, 175, pPlayer.throwPower, 1); + } + //--------------------------------------------------------------------------- // // diff --git a/wadsrc/static/zscript/statusbar.zs b/wadsrc/static/zscript/statusbar.zs index 5a590bc9c..e248aea46 100644 --- a/wadsrc/static/zscript/statusbar.zs +++ b/wadsrc/static/zscript/statusbar.zs @@ -31,6 +31,8 @@ class RazeStatusBar : StatusBarCore virtual void Tick() {} virtual void Reset() {} virtual void UpdateStatusBar(SummaryInfo info) {} + virtual void AltHUDOverlay(SummaryInfo summary) {} + void drawStatText(Font statFont, double x, double y, String text, double scale) {