From 22798d1c76f881dac6d172fa2e3af8fd10ffe7a4 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 22:43:29 -0700 Subject: [PATCH] feat: fire MAIL_SHOW/CLOSED and AUCTION_HOUSE_SHOW/CLOSED events Fire MAIL_SHOW when mailbox opens (SMSG_SHOW_MAILBOX) and MAIL_CLOSED when it closes. Fire AUCTION_HOUSE_SHOW when AH opens and AUCTION_HOUSE_CLOSED when it closes. Used by mail addons (Postal) and AH addons (Auctionator). --- src/game/game_handler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 37c004e6..47f0756f 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -24793,11 +24793,13 @@ void GameHandler::updateAttachedTransportChildren(float /*deltaTime*/) { // ============================================================ void GameHandler::closeMailbox() { + bool wasOpen = mailboxOpen_; mailboxOpen_ = false; mailboxGuid_ = 0; mailInbox_.clear(); selectedMailIndex_ = -1; showMailCompose_ = false; + if (wasOpen && addonEventCallback_) addonEventCallback_("MAIL_CLOSED", {}); } void GameHandler::refreshMailList() { @@ -24974,6 +24976,7 @@ void GameHandler::handleShowMailbox(network::Packet& packet) { hasNewMail_ = false; selectedMailIndex_ = -1; showMailCompose_ = false; + if (addonEventCallback_) addonEventCallback_("MAIL_SHOW", {}); // Request inbox contents refreshMailList(); } @@ -25285,8 +25288,10 @@ void GameHandler::openAuctionHouse(uint64_t guid) { } void GameHandler::closeAuctionHouse() { + bool wasOpen = auctionOpen_; auctionOpen_ = false; auctioneerGuid_ = 0; + if (wasOpen && addonEventCallback_) addonEventCallback_("AUCTION_HOUSE_CLOSED", {}); } void GameHandler::auctionSearch(const std::string& name, uint8_t levelMin, uint8_t levelMax, @@ -25367,6 +25372,7 @@ void GameHandler::handleAuctionHello(network::Packet& packet) { auctionHouseId_ = data.auctionHouseId; auctionOpen_ = true; gossipWindowOpen = false; // Close gossip when auction house opens + if (addonEventCallback_) addonEventCallback_("AUCTION_HOUSE_SHOW", {}); auctionActiveTab_ = 0; auctionBrowseResults_ = AuctionListResult{}; auctionOwnerResults_ = AuctionListResult{};