diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 5bb40efa..c8971854 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -1989,7 +1989,13 @@ public: // UI error frame: prominent on-screen error messages (spell can't be cast, etc.) using UIErrorCallback = std::function; void setUIErrorCallback(UIErrorCallback cb) { uiErrorCallback_ = std::move(cb); } - void addUIError(const std::string& msg) { if (uiErrorCallback_) uiErrorCallback_(msg); } + void addUIError(const std::string& msg) { + if (uiErrorCallback_) uiErrorCallback_(msg); + if (addonEventCallback_) addonEventCallback_("UI_ERROR_MESSAGE", {msg}); + } + void addUIInfoMessage(const std::string& msg) { + if (addonEventCallback_) addonEventCallback_("UI_INFO_MESSAGE", {msg}); + } // Reputation change toast: factionName, delta, new standing using RepChangeCallback = std::function; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index cf3b2d51..e648c2b4 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -5714,6 +5714,10 @@ void GameHandler::handlePacket(network::Packet& packet) { } else { addSystemChatMessage("Quest removed (ID " + std::to_string(questId) + ")."); } + if (addonEventCallback_) { + addonEventCallback_("QUEST_LOG_UPDATE", {}); + addonEventCallback_("QUEST_REMOVED", {std::to_string(questId)}); + } } break; } @@ -21883,6 +21887,10 @@ void GameHandler::abandonQuest(uint32_t questId) { if (localIndex >= 0) { questLog_.erase(questLog_.begin() + static_cast(localIndex)); + if (addonEventCallback_) { + addonEventCallback_("QUEST_LOG_UPDATE", {}); + addonEventCallback_("QUEST_REMOVED", {std::to_string(questId)}); + } } // Remove any quest POI minimap markers for this quest.