mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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.
This commit is contained in:
parent
6068d0d68d
commit
66ec35b106
1 changed files with 4 additions and 3 deletions
|
|
@ -4987,7 +4987,8 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) {
|
|||
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);
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue