From 1693abffd3d467a5978a741a0cbcfa0b41911fda Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 22:25:15 -0700 Subject: [PATCH] Improve cooldown text format and show HP values on party health bars Cooldowns now display as "Xs" (seconds), "XmYs" (minutes+seconds), or "Xh" (hours) instead of the previous bare number or "Xm"-only format. Party member health bars now show "current/max" HP text (abbreviated to "Xk/Yk" for large values) directly on the progress bar. --- src/ui/game_screen.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 08380204..28321e88 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -4483,8 +4483,9 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) { char cdText[16]; float cd = slot.cooldownRemaining; - if (cd >= 60.0f) snprintf(cdText, sizeof(cdText), "%dm", (int)cd / 60); - else snprintf(cdText, sizeof(cdText), "%.0f", cd); + if (cd >= 3600.0f) snprintf(cdText, sizeof(cdText), "%dh", (int)cd / 3600); + else if (cd >= 60.0f) snprintf(cdText, sizeof(cdText), "%dm%ds", (int)cd / 60, (int)cd % 60); + else snprintf(cdText, sizeof(cdText), "%ds", (int)cd); ImVec2 textSize = ImGui::CalcTextSize(cdText); float tx = cx - textSize.x * 0.5f; float ty = cy - textSize.y * 0.5f; @@ -5830,7 +5831,13 @@ void GameScreen::renderPartyFrames(game::GameHandler& gameHandler) { pct > 0.5f ? ImVec4(0.2f, 0.8f, 0.2f, 1.0f) : pct > 0.2f ? ImVec4(0.8f, 0.8f, 0.2f, 1.0f) : ImVec4(0.8f, 0.2f, 0.2f, 1.0f)); - ImGui::ProgressBar(pct, ImVec2(-1, 12), ""); + char hpText[32]; + if (maxHp >= 10000) + snprintf(hpText, sizeof(hpText), "%dk/%dk", + (int)hp / 1000, (int)maxHp / 1000); + else + snprintf(hpText, sizeof(hpText), "%u/%u", hp, maxHp); + ImGui::ProgressBar(pct, ImVec2(-1, 14), hpText); ImGui::PopStyleColor(); }