From 66ec35b106c0166f0324c6fdfb80004a2a46c3ae Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 03:48:12 -0700 Subject: [PATCH] feat: show decimal precision for short action bar cooldowns Display "1.5" instead of "1s" for cooldowns under 5 seconds, matching WoW's default cooldown text behaviour for GCDs and short ability cooldowns where sub-second timing matters. --- src/ui/game_screen.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index ae09ed3a..06bf184c 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -4985,9 +4985,10 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) { char cdText[16]; float cd = slot.cooldownRemaining; - 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); + 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 if (cd >= 5.0f) snprintf(cdText, sizeof(cdText), "%ds", (int)cd); + else snprintf(cdText, sizeof(cdText), "%.1f", cd); ImVec2 textSize = ImGui::CalcTextSize(cdText); float tx = cx - textSize.x * 0.5f; float ty = cy - textSize.y * 0.5f;