mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: fire UNIT_FLAGS event when unit flags change
Fire UNIT_FLAGS for player/target/focus when UNIT_FIELD_FLAGS updates. Covers PvP flag, combat state, silenced, disarmed, and other flag changes. Used by nameplate addons for PvP indicators and by unit frame addons tracking CC/silence state.
This commit is contained in:
parent
e7be60c624
commit
82990f5891
1 changed files with 11 additions and 1 deletions
|
|
@ -11915,7 +11915,17 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem
|
|||
addonEventCallback_("UNIT_FACTION", {uid});
|
||||
}
|
||||
}
|
||||
else if (key == ufFlags) { unit->setUnitFlags(val); }
|
||||
else if (key == ufFlags) {
|
||||
unit->setUnitFlags(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";
|
||||
if (!uid.empty())
|
||||
addonEventCallback_("UNIT_FLAGS", {uid});
|
||||
}
|
||||
}
|
||||
else if (key == ufBytes0) {
|
||||
unit->setPowerType(static_cast<uint8_t>((val >> 24) & 0xFF));
|
||||
} else if (key == ufDisplayId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue