mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
feat: fire PLAYER_TARGET_CHANGED and PLAYER_LEVEL_UP addon events
Add a generic AddonEventCallback to GameHandler for firing named events with string arguments directly from game logic. Wire it to the addon system in Application. New events fired: - PLAYER_TARGET_CHANGED — when target is set or cleared - PLAYER_LEVEL_UP(newLevel) — on level up The generic callback pattern makes it easy to add more events from game_handler.cpp without touching Application/AddonManager code. Total addon events: 16 (2 world + 12 chat + 2 gameplay).
This commit is contained in:
parent
c284a971c2
commit
269d9e2d40
3 changed files with 14 additions and 0 deletions
|
|
@ -360,6 +360,12 @@ bool Application::initialize() {
|
|||
addonManager_->fireEvent(eventName, {msg.message, msg.senderName});
|
||||
}
|
||||
});
|
||||
// Wire generic game events to addon dispatch
|
||||
gameHandler->setAddonEventCallback([this](const std::string& event, const std::vector<std::string>& args) {
|
||||
if (addonManager_ && addonsLoaded_) {
|
||||
addonManager_->fireEvent(event, args);
|
||||
}
|
||||
});
|
||||
LOG_INFO("Addon system initialized, found ", addonManager_->getAddons().size(), " addon(s)");
|
||||
} else {
|
||||
LOG_WARNING("Failed to initialize addon system");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue