feat: fire ACTIONBAR_SLOT_CHANGED event on action bar updates

Fire when SMSG_ACTION_BUTTONS populates the action bar on login and when
SMSG_SUPERCEDED_SPELL upgrades spell ranks on the bar. Used by action bar
addons (Bartender, Dominos) to refresh their displays.
This commit is contained in:
Kelsi 2026-03-20 22:13:57 -07:00
parent fc182f8653
commit 37a5b4c9d9

View file

@ -4592,6 +4592,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
}
}
LOG_INFO("SMSG_ACTION_BUTTONS: populated action bar from server");
if (addonEventCallback_) addonEventCallback_("ACTIONBAR_SLOT_CHANGED", {});
packet.setReadPos(packet.getSize());
break;
}
@ -19575,7 +19576,10 @@ void GameHandler::handleSupercededSpell(network::Packet& packet) {
LOG_DEBUG("Action bar slot upgraded: spell ", oldSpellId, " -> ", newSpellId);
}
}
if (barChanged) saveCharacterConfig();
if (barChanged) {
saveCharacterConfig();
if (addonEventCallback_) addonEventCallback_("ACTIONBAR_SLOT_CHANGED", {});
}
// Show "Upgraded to X" only when the new spell wasn't already announced by the
// trainer-buy handler. For non-trainer supersedes (e.g. quest rewards), the new