feat: add spell name tooltips to nameplate debuff dots on hover

When hovering over a player-applied DoT/debuff indicator square on an
enemy nameplate, the spell name is now shown as a tooltip. Uses direct
mouse-position hit test since nameplates render into the background
draw list rather than an ImGui window.
This commit is contained in:
Kelsi 2026-03-12 13:36:06 -07:00
parent 8d7391d73e
commit abfb6ecdb5

View file

@ -8005,6 +8005,18 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) {
drawList->AddRect (ImVec2(dotX - 1.0f, nameplateBottom - 1.0f),
ImVec2(dotX + dotSize + 1.0f, nameplateBottom + dotSize + 1.0f),
IM_COL32(0, 0, 0, A(150)), 1.0f);
// Spell name tooltip on hover
{
ImVec2 mouse = ImGui::GetMousePos();
if (mouse.x >= dotX && mouse.x < dotX + dotSize &&
mouse.y >= nameplateBottom && mouse.y < nameplateBottom + dotSize) {
const std::string& dotSpellName = gameHandler.getSpellName(aura.spellId);
if (!dotSpellName.empty())
ImGui::SetTooltip("%s", dotSpellName.c_str());
}
}
dotX += dotSize + dotGap;
if (dotX + dotSize > barX + barW) break;
}