diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 352fceb6..fefedffc 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -548,6 +548,11 @@ public: } std::string getCachedPlayerName(uint64_t guid) const; std::string getCachedCreatureName(uint32_t entry) const; + // Returns the creature subname/title (e.g. ""), empty if not cached + std::string getCachedCreatureSubName(uint32_t entry) const { + auto it = creatureInfoCache.find(entry); + return (it != creatureInfoCache.end()) ? it->second.subName : ""; + } // Returns the creature rank (0=Normal,1=Elite,2=RareElite,3=Boss,4=Rare) // or -1 if not cached yet int getCreatureRank(uint32_t entry) const { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index c1201aa4..feb0cee6 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -3315,6 +3315,15 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) { ImVec2(ImGui::CalcTextSize(name.c_str()).x, 0)); ImGui::PopStyleColor(4); + // Creature subtitle (e.g. "", "Captain of the Guard") + if (target->getType() == game::ObjectType::UNIT) { + auto unit = std::static_pointer_cast(target); + const std::string sub = gameHandler.getCachedCreatureSubName(unit->getEntry()); + if (!sub.empty()) { + ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 0.9f), "<%s>", sub.c_str()); + } + } + // Right-click context menu on the target name if (ImGui::BeginPopupContextItem("##TargetNameCtx")) { const bool isPlayer = (target->getType() == game::ObjectType::PLAYER);