mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: fire UNIT_MODEL_CHANGED event when unit display model changes
Fire UNIT_MODEL_CHANGED for player/target/focus/pet when their UNIT_FIELD_DISPLAYID update field changes. This covers polymorph, mount display changes, shapeshifting, and model swaps. Used by unit frame addons that display 3D portraits and by nameplate addons that track model state changes.
This commit is contained in:
parent
a4d54e83bc
commit
2c6a345e32
1 changed files with 12 additions and 1 deletions
|
|
@ -11908,7 +11908,18 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem
|
|||
else if (key == ufFlags) { unit->setUnitFlags(val); }
|
||||
else if (key == ufBytes0) {
|
||||
unit->setPowerType(static_cast<uint8_t>((val >> 24) & 0xFF));
|
||||
} else if (key == ufDisplayId) { unit->setDisplayId(val); }
|
||||
} else if (key == ufDisplayId) {
|
||||
unit->setDisplayId(val);
|
||||
if (addonEventCallback_) {
|
||||
std::string uid;
|
||||
if (block.guid == playerGuid) uid = "player";
|
||||
else if (block.guid == targetGuid) uid = "target";
|
||||
else if (block.guid == focusGuid) uid = "focus";
|
||||
else if (block.guid == petGuid_) uid = "pet";
|
||||
if (!uid.empty())
|
||||
addonEventCallback_("UNIT_MODEL_CHANGED", {uid});
|
||||
}
|
||||
}
|
||||
else if (key == ufNpcFlags) { unit->setNpcFlags(val); }
|
||||
else if (key == ufDynFlags) {
|
||||
unit->setDynamicFlags(val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue