From c8f80339f13e5647975ffc1ea3c2215baff9f475 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 18 Mar 2026 10:12:03 -0700 Subject: [PATCH] feat: display creature type on target frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.). --- include/game/game_handler.hpp | 10 ++++++++++ src/ui/game_screen.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 0a44957d..7ef14f76 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -674,6 +674,16 @@ public: auto it = creatureInfoCache.find(entry); return (it != creatureInfoCache.end()) ? static_cast(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); diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index fa3755b5..f74a4332 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -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(ImGui::GetTime()) * 4.0f); ImGui::SameLine();