feat: display creature type on target frame

Show creature classification (Beast, Humanoid, Demon, etc.) next to the
level on the target frame. Useful for knowing which CC abilities apply
(Polymorph → Humanoid/Beast, Banish → Demon/Elemental, etc.).
This commit is contained in:
Kelsi 2026-03-18 10:12:03 -07:00
parent 1ea9334eca
commit c8f80339f1
2 changed files with 34 additions and 0 deletions

View file

@ -674,6 +674,16 @@ public:
auto it = creatureInfoCache.find(entry);
return (it != creatureInfoCache.end()) ? static_cast<int>(it->second.rank) : -1;
}
// Returns creature type (1=Beast,2=Dragonkin,...,7=Humanoid,...) or 0 if not cached
uint32_t getCreatureType(uint32_t entry) const {
auto it = creatureInfoCache.find(entry);
return (it != creatureInfoCache.end()) ? it->second.creatureType : 0;
}
// Returns creature family (e.g. pet family for beasts) or 0
uint32_t getCreatureFamily(uint32_t entry) const {
auto it = creatureInfoCache.find(entry);
return (it != creatureInfoCache.end()) ? it->second.family : 0;
}
// ---- Phase 2: Combat ----
void startAutoAttack(uint64_t targetGuid);

View file

@ -4291,6 +4291,30 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) {
if (ImGui::IsItemHovered()) ImGui::SetTooltip("Rare — uncommon spawn with better loot");
}
}
// Creature type label (Beast, Humanoid, Demon, etc.)
if (target->getType() == game::ObjectType::UNIT) {
uint32_t ctype = gameHandler.getCreatureType(unit->getEntry());
const char* ctypeName = nullptr;
switch (ctype) {
case 1: ctypeName = "Beast"; break;
case 2: ctypeName = "Dragonkin"; break;
case 3: ctypeName = "Demon"; break;
case 4: ctypeName = "Elemental"; break;
case 5: ctypeName = "Giant"; break;
case 6: ctypeName = "Undead"; break;
case 7: ctypeName = "Humanoid"; break;
case 8: ctypeName = "Critter"; break;
case 9: ctypeName = "Mechanical"; break;
case 11: ctypeName = "Totem"; break;
case 12: ctypeName = "Non-combat Pet"; break;
case 13: ctypeName = "Gas Cloud"; break;
default: break;
}
if (ctypeName) {
ImGui::SameLine(0, 4);
ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 0.9f), "(%s)", ctypeName);
}
}
if (confirmedCombatWithTarget) {
float cPulse = 0.75f + 0.25f * std::sin(static_cast<float>(ImGui::GetTime()) * 4.0f);
ImGui::SameLine();