mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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:
parent
3b8165cbef
commit
8f2a2dfbb4
1 changed files with 10 additions and 0 deletions
|
|
@ -14841,6 +14841,16 @@ void GameHandler::handleNameQueryResponse(network::Packet& packet) {
|
||||||
if (friendGuids_.count(data.guid)) {
|
if (friendGuids_.count(data.guid)) {
|
||||||
friendsCache[data.name] = 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});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue