Parse SMSG_ENVIRONMENTAL_DAMAGE_LOG and color nameplate names by hostility

- Implement SMSG_ENVIRONMENTAL_DAMAGE_LOG: show fall/lava/fire/drowning
  damage as ENVIRONMENTAL combat text (orange -N) for the local player
- Color nameplate unit names: hostile units red, non-hostile yellow
  (matches WoW's standard red=enemy / yellow=neutral convention)
This commit is contained in:
Kelsi 2026-03-09 17:18:18 -07:00
parent 18a3a0fd01
commit 70dcb6ef43
2 changed files with 19 additions and 2 deletions

View file

@ -4637,8 +4637,12 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) {
ImVec2 textSize = ImGui::CalcTextSize(labelBuf);
float nameX = sx - textSize.x * 0.5f;
float nameY = sy - barH - 12.0f;
// Name color: hostile=red, non-hostile=yellow (WoW convention)
ImU32 nameColor = unit->isHostile()
? IM_COL32(220, 80, 80, A(230))
: IM_COL32(240, 200, 100, A(230));
drawList->AddText(ImVec2(nameX + 1.0f, nameY + 1.0f), IM_COL32(0, 0, 0, A(160)), labelBuf);
drawList->AddText(ImVec2(nameX, nameY), IM_COL32(255, 255, 255, A(220)), labelBuf);
drawList->AddText(ImVec2(nameX, nameY), nameColor, labelBuf);
}
}