feat: display creature subtitle in target frame

Shows the NPC subtitle (e.g. '<Warchief of the Horde>') below the
creature name in the target frame, using the subName field already
parsed from SMSG_CREATURE_QUERY_RESPONSE. Adds getCachedCreatureSubName()
accessor to GameHandler. Matches the official client's presentation.
This commit is contained in:
Kelsi 2026-03-12 14:14:25 -07:00
parent 8cb0f1d0ef
commit 1165aa6e74
2 changed files with 14 additions and 0 deletions

View file

@ -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. "<Warchief of the Horde>", "Captain of the Guard")
if (target->getType() == game::ObjectType::UNIT) {
auto unit = std::static_pointer_cast<game::Unit>(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);