From 18e42c22d45cfb972dde4934bcf25cae9be2c6e6 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 22:31:55 -0700 Subject: [PATCH] Add HP percentage text to raid frame health bars Each raid member cell now shows the health percentage centered on the health bar, with a drop shadow for readability. The text is omitted when no health data is available. --- src/ui/game_screen.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 28321e88..a071151f 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -5689,6 +5689,14 @@ void GameScreen::renderPartyFrames(game::GameHandler& gameHandler) { pct > 0.2f ? IM_COL32(200, 180, 50, 255) : IM_COL32(200, 60, 60, 255); draw->AddRectFilled(barFill, barFillEnd, hpCol, 2.0f); + // HP percentage text centered on bar + char hpPct[8]; + snprintf(hpPct, sizeof(hpPct), "%d%%", static_cast(pct * 100.0f + 0.5f)); + ImVec2 ts = ImGui::CalcTextSize(hpPct); + float tx = (barBg.x + barBgEnd.x - ts.x) * 0.5f; + float ty = barBg.y + (BAR_H - ts.y) * 0.5f; + draw->AddText(ImVec2(tx + 1.0f, ty + 1.0f), IM_COL32(0, 0, 0, 180), hpPct); + draw->AddText(ImVec2(tx, ty), IM_COL32(255, 255, 255, 230), hpPct); } // Power bar