|
|
|
|
@ -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 |
|
|
|
|
|