From 1764cdc6e34a04ae563ae2b5c7848c388147a2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Sun, 8 Feb 2026 06:54:07 +0100 Subject: [PATCH] Add frame:IsVisible check to certain mailbox functions --- TradeSkillMaster_Mailing/Modules/Inbox.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/TradeSkillMaster_Mailing/Modules/Inbox.lua b/TradeSkillMaster_Mailing/Modules/Inbox.lua index ea812f1..4b5b0e6 100644 --- a/TradeSkillMaster_Mailing/Modules/Inbox.lua +++ b/TradeSkillMaster_Mailing/Modules/Inbox.lua @@ -247,7 +247,7 @@ function private:UpdateTopLabel() end function private:InboxUpdate() - if not private.frame or not private.frame:IsVisible() then return end + if not private.frame or (not private.frame:IsVisible() and private.frame.buttonsEnabled) then return end TSMAPI:CancelFrame("inboxLootTextDelay") local numMail, totalMail = GetInboxNumItems() @@ -409,6 +409,7 @@ end -- Deals with auto looting of mail! function private:StartAutoLooting(mode) + if not MailFrame or not MailFrame:IsShown() then return end private.mode = mode local canCollectMail if private.mode == "all" then @@ -556,6 +557,10 @@ end function private:AutoLoot() TSMAPI:CancelFrame("mailSkipDelay") + if not MailFrame or not MailFrame:IsShown() then + private:StopAutoLooting() + return + end -- Already looted everything after the invalid indexes we had, so fail it if private.lootIndex > 1 and private.lootIndex > GetInboxNumItems() then @@ -607,6 +612,10 @@ function private:AutoLoot() end function private:LootMailItem(index) + if not MailFrame or not MailFrame:IsShown() then + private:StopAutoLooting() + return + end if TSM.db.global.inboxMessages then --local _, _, sender, subject, money, cod, _, hasItem = GetInboxHeaderInfo(index) local _, _, sender, subject, money, cod, daysLeft, hasItem, _, _, _, _, _, itemQuantity = GetInboxHeaderInfo(index) @@ -783,6 +792,7 @@ function private:StopAutoLooting(failed) private.autoLootTotal = nil if not private.frame then return end private.frame:EnableButtons() + TSMAPI:CancelFrame("mailWaitDelay") --Tell user how much money has been collected if they don't have it turned off in TradeSkillMaster_Mailing options if private.moneyCollected and private.moneyCollected > 0 and TSM.db.global.displayMoneyCollected then