fix: apply interruptibility coloring to target-of-target cast bar

The ToT (target-of-target) cast bar was still using a fixed orange-yellow
color regardless of spell interruptibility. Now uses the same green/red
scheme as the target frame and nameplate cast bars: green = interruptible
(can Kick/Counterspell), red = not interruptible, both pulse at >80%.
This commit is contained in:
Kelsi 2026-03-17 20:02:02 -07:00
parent 4ce6fdb5f3
commit 63f4d10ab1

View file

@ -4645,16 +4645,20 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
ImGui::PopStyleColor();
}
// ToT cast bar — orange-yellow, pulses when near completion
// ToT cast bar — green if interruptible, red if not; pulses near completion
if (auto* totCs = gameHandler.getUnitCastState(totGuid)) {
float totCastPct = (totCs->timeTotal > 0.0f)
? (totCs->timeTotal - totCs->timeRemaining) / totCs->timeTotal : 0.0f;
ImVec4 tcColor;
if (totCastPct > 0.8f) {
float pulse = 0.7f + 0.3f * std::sin(static_cast<float>(ImGui::GetTime()) * 8.0f);
tcColor = ImVec4(1.0f * pulse, 0.5f * pulse, 0.0f, 1.0f);
tcColor = totCs->interruptible
? ImVec4(0.2f * pulse, 0.9f * pulse, 0.2f * pulse, 1.0f)
: ImVec4(1.0f * pulse, 0.1f * pulse, 0.1f * pulse, 1.0f);
} else {
tcColor = ImVec4(0.8f, 0.5f, 0.1f, 1.0f);
tcColor = totCs->interruptible
? ImVec4(0.2f, 0.75f, 0.2f, 1.0f)
: ImVec4(0.85f, 0.15f, 0.15f, 1.0f);
}
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, tcColor);
char tcLabel[48];