From f04a5c8f3e8f267aa148bddb7d1ae79682341454 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 04:34:00 -0700 Subject: [PATCH] feat: add buff expiry color warning on timer overlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Buff/debuff countdown timers now change color as expiry approaches: white (>30s) → orange (<30s) → pulsing red (<10s). This gives players a clear visual cue to reapply important buffs before they fall off. --- src/ui/game_screen.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 6930b9ed..a7aceb78 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -8676,11 +8676,26 @@ void GameScreen::renderBuffBar(game::GameHandler& gameHandler) { ImVec2 textSize = ImGui::CalcTextSize(timeStr); float cx = iconMin.x + (iconMax.x - iconMin.x - textSize.x) * 0.5f; float cy = iconMax.y - textSize.y - 2.0f; + // Choose timer color based on urgency + ImU32 timerColor; + if (remainMs < 10000) { + // < 10s: pulse red + float pulse = 0.7f + 0.3f * std::sin( + static_cast(ImGui::GetTime()) * 6.0f); + timerColor = IM_COL32( + static_cast(255 * pulse), + static_cast(80 * pulse), + static_cast(60 * pulse), 255); + } else if (remainMs < 30000) { + timerColor = IM_COL32(255, 165, 0, 255); // orange + } else { + timerColor = IM_COL32(255, 255, 255, 255); // white + } // Drop shadow for readability over any icon colour ImGui::GetWindowDrawList()->AddText(ImVec2(cx + 1, cy + 1), IM_COL32(0, 0, 0, 200), timeStr); ImGui::GetWindowDrawList()->AddText(ImVec2(cx, cy), - IM_COL32(255, 255, 255, 255), timeStr); + timerColor, timeStr); } // Stack / charge count overlay — upper-left corner of the icon