mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
feat: fire SPELL_UPDATE_USABLE alongside ACTIONBAR_UPDATE_USABLE
Some addons register for SPELL_UPDATE_USABLE instead of ACTIONBAR_UPDATE_USABLE to detect when spell usability changes due to power fluctuations. Fire both events together when the player's mana/rage/energy changes.
This commit is contained in:
parent
661fba12c0
commit
491dd2b673
1 changed files with 6 additions and 2 deletions
|
|
@ -2201,8 +2201,10 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
else if (guid == petGuid_) unitId = "pet";
|
else if (guid == petGuid_) unitId = "pet";
|
||||||
if (!unitId.empty()) {
|
if (!unitId.empty()) {
|
||||||
addonEventCallback_("UNIT_POWER", {unitId});
|
addonEventCallback_("UNIT_POWER", {unitId});
|
||||||
if (guid == playerGuid)
|
if (guid == playerGuid) {
|
||||||
addonEventCallback_("ACTIONBAR_UPDATE_USABLE", {});
|
addonEventCallback_("ACTIONBAR_UPDATE_USABLE", {});
|
||||||
|
addonEventCallback_("SPELL_UPDATE_USABLE", {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -12681,8 +12683,10 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem
|
||||||
if (powerChanged) {
|
if (powerChanged) {
|
||||||
addonEventCallback_("UNIT_POWER", {unitId});
|
addonEventCallback_("UNIT_POWER", {unitId});
|
||||||
// When player power changes, action bar usability may change
|
// When player power changes, action bar usability may change
|
||||||
if (block.guid == playerGuid)
|
if (block.guid == playerGuid) {
|
||||||
addonEventCallback_("ACTIONBAR_UPDATE_USABLE", {});
|
addonEventCallback_("ACTIONBAR_UPDATE_USABLE", {});
|
||||||
|
addonEventCallback_("SPELL_UPDATE_USABLE", {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue