feat: elite/boss/rare border decorations on nameplates

Add rank-specific outer borders on NPC nameplates: gold for Elite and
Rare Elite, red for Boss, silver for Rare. Provides immediate visual
identification of dangerous mobs without needing to target them.
This commit is contained in:
Kelsi 2026-03-18 10:07:40 -07:00
parent fd7886f4ce
commit 402bbc2f14

View file

@ -11032,6 +11032,10 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) {
isTargetingPlayer = (unitTarget == playerGuid);
}
}
// Creature rank for border styling (Elite=gold double border, Boss=red, Rare=silver)
int creatureRank = -1;
if (!isPlayer) creatureRank = gameHandler.getCreatureRank(unit->getEntry());
// Border: gold = currently selected, orange = targeting player, dark = default
ImU32 borderColor = isTarget
? IM_COL32(255, 215, 0, A(255))
@ -11055,6 +11059,24 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) {
}
drawList->AddRect (ImVec2(barX - 1.0f, sy - 1.0f), ImVec2(barX + barW + 1.0f, sy + barH + 1.0f), borderColor, 2.0f);
// Elite/Boss/Rare decoration: extra outer border with rank-specific color
if (creatureRank == 1 || creatureRank == 2) {
// Elite / Rare Elite: gold double border
drawList->AddRect(ImVec2(barX - 3.0f, sy - 3.0f),
ImVec2(barX + barW + 3.0f, sy + barH + 3.0f),
IM_COL32(255, 200, 50, A(200)), 3.0f);
} else if (creatureRank == 3) {
// Boss: red double border
drawList->AddRect(ImVec2(barX - 3.0f, sy - 3.0f),
ImVec2(barX + barW + 3.0f, sy + barH + 3.0f),
IM_COL32(255, 40, 40, A(200)), 3.0f);
} else if (creatureRank == 4) {
// Rare: silver double border
drawList->AddRect(ImVec2(barX - 3.0f, sy - 3.0f),
ImVec2(barX + barW + 3.0f, sy + barH + 3.0f),
IM_COL32(170, 200, 230, A(200)), 3.0f);
}
// HP % text centered on health bar (non-corpse, non-full-health for readability)
if (!isCorpse && unit->getMaxHealth() > 0) {
int hpPct = static_cast<int>(healthPct * 100.0f + 0.5f);