WoWInterface SVN zz_Mailbox

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 50 to Rev 51
    Reverse comparison

Rev 50 → Rev 51

trunk/zz_Mailbox/core.lua
17,12 → 17,9
local faction,_ = UnitFactionGroup('player')
 
local function mailupdate()
-- print(db[faction][realm][character]['mail'],GetInboxNumItems() == 0)
--print(scanned)
if(not scanned) then
return db[faction][realm][character]['mailunread'],db[faction][realm][character]['mail']
else
-- print(GetInboxNumItems())
local cur,tot = GetInboxNumItems()
db[faction][realm][character]['mail'] = tot
return db[faction][realm][character]['mailunread'], tot
33,7 → 30,6
local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, hasItem, wasRead, wasReturned, textCreated, canReply, isGM
local index,newunread = 0,0
local unread, tot = mailupdate()
-- print("+",unread, tot)
subject = "start"
while(subject) do
index = index + 1
48,12 → 44,9
if(not(db[faction][realm][character]['mail'] > 0 and GetInboxNumItems() == 0)) then
db[faction][realm][character]['mailunread'] = newunread
end
-- db[faction][realm][character]['mailunread'] = unread
-- print("-",unread, tot, newunread,not(db[faction][realm][character]['mail'] > 0 and GetInboxNumItems() == 0),db[faction][realm][character]['mailunread'])
if(db[faction][realm][character]['newmail']) then
if(HasNewMail() and tot == 0) then
tot = #{GetLatestThreeSenders()}
-- print(scanned, select(2,GetInboxNumItems()))
if(scanned and select(2,GetInboxNumItems()) == 0) then
tot = 0
end
81,9 → 74,7
end
 
local function updateText(self, event)
-- print(mail())
db[faction][realm][character]['newmail'] = HasNewMail()
-- print(event,MailFrame:IsVisible(),select(2,GetInboxNumItems()))
if(MailFrame:IsVisible() and GetInboxNumItems() > 0) then
db[faction][realm][character]['newmail'] = iterateMail()
end
104,9 → 95,8
end
 
local function init()
-- print("init",childName)
addon['RegisterFunc']({'MAIL_SHOW',"MAIL_INBOX_UPDATE","UPDATE_PENDING_MAIL"},"OnEvent", updateText)
options = addon['InitConfig'](addon, childName, true, {
options = addon:InitConfig(childName, true, {
['name'] = childName,
['type'] = "data source",
['OnTooltipShow'] = OnTooltip,