mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 00:40:15 +00:00
feat: add UI_ERROR_MESSAGE events and quest removal notifications
Fire UI_ERROR_MESSAGE from addUIError() so Lua addons can react to error messages like "Not enough mana" or "Target is too far away". Previously only the C++ overlay callback was notified. Also add addUIInfoMessage() helper for informational system messages. Fire QUEST_REMOVED and QUEST_LOG_UPDATE when quests are removed from the quest log — both via server-driven removal (SMSG_QUEST_UPDATE_FAILED etc.) and player-initiated abandon (CMSG_QUESTLOG_REMOVE_QUEST). Quest tracking addons like Questie register for these events to update their map markers and objective displays.
This commit is contained in:
parent
8fd735f4a3
commit
e4da47b0d7
2 changed files with 15 additions and 1 deletions
|
|
@ -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<ptrdiff_t>(localIndex));
|
||||
if (addonEventCallback_) {
|
||||
addonEventCallback_("QUEST_LOG_UPDATE", {});
|
||||
addonEventCallback_("QUEST_REMOVED", {std::to_string(questId)});
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any quest POI minimap markers for this quest.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue