feat: fire UNIT_NAME_UPDATE event when player names are resolved

Fire UNIT_NAME_UPDATE for target/focus/player when SMSG_NAME_QUERY_RESPONSE
resolves a player's name. Nameplate and unit frame addons use this event
to update displayed names when they become available asynchronously.
This commit is contained in:
Kelsi 2026-03-21 02:58:55 -07:00
parent 3b8165cbef
commit 8f2a2dfbb4

View file

@ -14841,6 +14841,16 @@ void GameHandler::handleNameQueryResponse(network::Packet& packet) {
if (friendGuids_.count(data.guid)) {
friendsCache[data.name] = data.guid;
}
// Fire UNIT_NAME_UPDATE so nameplate/unit frame addons know the name is available
if (addonEventCallback_) {
std::string unitId;
if (data.guid == targetGuid) unitId = "target";
else if (data.guid == focusGuid) unitId = "focus";
else if (data.guid == playerGuid) unitId = "player";
if (!unitId.empty())
addonEventCallback_("UNIT_NAME_UPDATE", {unitId});
}
}
}