diff --git a/Mail.lua b/Mail.lua index cdaa7ef..437d78d 100644 --- a/Mail.lua +++ b/Mail.lua @@ -201,6 +201,44 @@ function Inbox_Load() btn:SetScript('OnClick', Inbox_OpenAll) end +do + local i, update + local f = CreateFrame'Frame' + f:Hide() + f:SetScript('OnUpdate', function() + if update then + update = false + local _, _, _, _, _, COD = GetInboxHeaderInfo(i) + if i > GetInboxNumItems() then + Inbox_Abort() + elseif Inbox_Skip or COD > 0 then + Inbox_Skip = false + i = i + 1 + else + Inbox_Open(i) + end + end + end) + function MAIL_INBOX_UPDATE() + if Inbox_opening then + update = true + end + end + function Inbox_OpenAll() + Inbox_opening = true + Inbox_UpdateLock() + i = 1 + Inbox_skip = false + update = true + f:Show() + end + function Inbox_Abort() + Inbox_opening = false + Inbox_UpdateLock() + f:Hide() + end +end + do local i local function update()