mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
8d7391d73e
commit
abfb6ecdb5
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue