refactoring

This commit is contained in:
Manuel Simon Hirsig
2017-03-23 19:21:01 +01:00
parent 0cc2a0b7ac
commit b09297f208
+11 -14
View File
@@ -114,13 +114,13 @@ function hook.InboxFrame_Update()
Inbox_UpdateLock()
end
function hook.InboxFrame_OnClick(index)
if Inbox_opening or arg1 == 'RightButton' and ({GetInboxHeaderInfo(index)})[6] > 0 then
function hook.InboxFrame_OnClick(i)
if Inbox_opening or arg1 == 'RightButton' and ({GetInboxHeaderInfo(i)})[6] > 0 then
this:SetChecked(nil)
elseif arg1 == 'RightButton' then
Inbox_Open(index)
Inbox_Open(i)
else
return orig.InboxFrame_OnClick(index)
return orig.InboxFrame_OnClick(i)
end
end
@@ -159,11 +159,14 @@ do
f:Hide()
f:SetScript('OnUpdate', function()
Inbox_opening = true
local _, _, _, _, _, COD = GetInboxHeaderInfo(i)
if i > GetInboxNumItems() then
Inbox_Abort()
elseif Inbox_Skip or not Inbox_Open(i) then
elseif Inbox_Skip or COD > 0 then
Inbox_Skip = false
i = i + 1
else
Inbox_Open(i)
end
end)
function Inbox_OpenAll()
@@ -181,15 +184,9 @@ do
end
function Inbox_Open(i)
local _, _, _, _, _, COD = GetInboxHeaderInfo(i)
if COD > 0 then
return false
else
TakeInboxMoney(i)
TakeInboxItem(i)
DeleteInboxItem(i)
return true
end
TakeInboxMoney(i)
TakeInboxItem(i)
DeleteInboxItem(i)
end
function Inbox_UpdateLock()