WoWInterface SVN zz_Money

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 80 to Rev 81
    Reverse comparison

Rev 80 → Rev 81

trunk/zz_Money/core.lua
21,37 → 21,28
local checkDelay = GetTime()
 
local posFrame = CreateFrame("Frame")
posFrame:SetWidth(32); posFrame:SetHeight(1)
posFrame:SetSize(32,1)
posFrame:SetPoint("TOPRIGHT",SendMailFrame,"TOPRIGHT",-10,-12)
local function MAIL_FAILED(self)
self:UnregisterEvent('MAIL_FAILED')
self:UnregisterEvent('MAIL_SEND_SUCCESS')
addon:Print(L['Fail'])
mailRec = nil
mailSum = nil
end
 
local function MAIL_SEND_SUCCESS(self)
posFrame:SetScript("OnEvent", function(self, event, ...)
self:UnregisterEvent('MAIL_FAILED')
self:UnregisterEvent('MAIL_SEND_SUCCESS')
if(mailRec and mailSum) then
db[realm][mailRec]['incoming'] = (db[realm][mailRec]['incoming'] or 0) + mailSum
addon:Print(L['Success'](mailRec,mailSum))
mailframes[mailRec]:Hide()
end
mailRec = nil
mailSum = nil
end
 
local mfl = CreateFrame("Frame")
mfl:SetScript("OnEvent", function(self, event, ...)
if(event == "MAIL_SEND_SUCCESS") then
MAIL_SEND_SUCCESS(self, event, ...)
if(mailRec and mailSum) then
db[realm][mailRec]['incoming'] = (db[realm][mailRec]['incoming'] or 0) + mailSum
addon:Print(L['Success'](mailRec,mailSum))
mailframes[mailRec]:Hide()
end
elseif(event == "MAIL_FAILED") then
MAIL_FAILED(self, event, ...)
addon:Print(L['Fail'])
end
mailRec = nil
mailSum = nil
end)
 
local Helper_Tooltip_tab
local function getHTT()
Helper_Tooltip_tab = Helper_Tooltip_tab or { ['iconSize'] = addon['db']['global']['iconSize'] or 12}
return Helper_Tooltip_tab
end
local function cdbCheck(n)
db[realm][n] = db[realm][n] or { currentGold = 0 }
end
84,7 → 75,7
if(addon['db']['global']['shortMoney'] and m>10000)then
m = addon:round(m / 10000,0) * 10000
end
OnText(addon:buildMoneyString(m,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,},addon['db']['global']['abrevK'] and L['abrK'] or nil,addon['db']['global']['abrevM'] and L['abrM'] or nil))
OnText(addon:buildMoneyString(m,false,getHTT(),addon['db']['global']['abrevK'] and L['abrK'] or nil,addon['db']['global']['abrevM'] and L['abrM'] or nil))
end
 
local function GetFactionList()
126,58 → 117,58
end
 
 
local function Click(button,name)
local sendSum = getDeliver(name)
if(addon:IsTwink(name) and name~=player) then
local function Click(self,button)
local sendSum = getDeliver(self['destName'])
if(addon:IsTwink(self['destName']) and self['destName']~=player) then
if(sendSum>0) then
if(SetSendMailMoney(sendSum)) then
mfl:RegisterEvent('MAIL_SEND_SUCCESS')
mfl:RegisterEvent('MAIL_FAILED')
mailRec = name
posFrame:RegisterEvent('MAIL_SEND_SUCCESS')
posFrame:RegisterEvent('MAIL_FAILED')
mailRec = self['destName']
mailSum = sendSum
SendMail(name,L['Subject'],nil)
SendMail(self['destName'],L['Subject'],nil)
end
end
end
end
 
local function Mouse(name)
if(mailframes[name]) then
local tip = GameTooltip
tip:SetOwner(mailframes[name], "ANCHOR_BOTTOM")
tip:ClearLines()
mailframes[name]['tooltip'] = tip
if(db[realm][faction]['banker'] ~= player) then
tip:AddLine(format("%s %s",L['Bankier'],db[realm][faction]['banker']))
tip:AddLine(format("%s %s",L['Goldgrenze'],db[realm][faction]['maxLimit']))
else
tip:AddLine(format("%s %s",L['Empfaenger'],name))
tip:AddLine(format("%s %s",L['Goldgrenze'],db[realm][faction]['minLimit']))
end
local sendSum = getDeliver(name)
tip:AddLine(format("%s %s",L['Sende'],addon:buildMoneyString(sendSum,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,})))
tip:Show()
local function Mouse(self)
local tip = GameTooltip
tip:SetOwner(self, "ANCHOR_BOTTOM")
tip:ClearLines()
self['tooltip'] = tip
if(db[realm][faction]['banker'] ~= player) then
tip:AddLine(format("%s %s",L['Bankier'],db[realm][faction]['banker']))
tip:AddLine(format("%s %s",L['Goldgrenze'],db[realm][faction]['maxLimit']))
else
tip:AddLine(format("%s %s",L['Empfaenger'],self['destName']))
tip:AddLine(format("%s %s",L['Goldgrenze'],db[realm][faction]['minLimit']))
end
local sendSum = getDeliver(self['destName'])
tip:AddLine(format("%s %s",L['Sende'],addon:buildMoneyString(sendSum,false,getHTT())))
tip:Show()
end
 
local function MouseOut(self)
self['tooltip']:Hide()
end
local function MainFrame(name)
if(getDeliver(name)<0) then return nil end
local mailframe = CreateFrame("Button",nil,SendMailFrame,"ActionButtonTemplate SecureActionButtonTemplate")
mailframe:SetWidth(32); mailframe:SetHeight(32);
mailframe:SetPoint("TOPRIGHT",lastframe,"BOTTOMRIGHT",0,-8);
local mailframe = mailframes[name] and mailframes[name] or CreateFrame("Button",nil,SendMailFrame,"ActionButtonTemplate SecureActionButtonTemplate")
mailframe:SetSize(32,32)
mailframe:SetPoint("TOPRIGHT",lastframe,"BOTTOMRIGHT",0,-8)
mailframe:EnableMouse(true)
mailframe:RegisterForClicks("AnyUp")
 
mailframe:SetScript("OnClick", function(_,button,_) Click(button,name) end)
mailframe:SetScript("OnEnter", function() Mouse(name) end)
mailframe:SetScript("OnLeave", function(self) mailframes[name]['tooltip']:Hide() end)
local tex = mailframe:CreateTexture(nil,"BACKGROUND")
tex:SetTexture("Interface\\Icons\\INV_Misc_Bag_10_Blue")
tex:SetAllPoints(mailframe)
mailframe['texture'] = tex
 
tex:SetPoint("CENTER",0,0)
tex:Show()
mailframe['destName'] = name
mailframe:SetScript("OnClick", Click)
mailframe:SetScript("OnEnter", Mouse)
mailframe:SetScript("OnLeave", MouseOut)
if(not mailframe['texture']) then
mailframe['texture'] = mailframe:CreateTexture(nil,"BACKGROUND")
mailframe['texture']:SetTexture("Interface\\Icons\\INV_Misc_Bag_10_Blue")
mailframe['texture']:SetAllPoints(mailframe)
mailframe['texture']:SetPoint("CENTER",0,0)
mailframe['texture']:Show()
end
return mailframe
end
local function buildMailFrames()
245,30 → 236,36
 
local ttlist = {}
 
local function Helper_Tooltip(str,col,sum,bol)
return col and addon:colorize(str,col) or str,addon:buildMoneyString(sum,bol,getHTT()),1,1,1,1,1,1
end
local function Helper_Tooltip2(tex,str,sum,bol)
return format("|T%s:0|t%s",tex,str),addon:buildMoneyString(sum,bol,getHTT()),1,1,1,1,1,1
end
local function OnTooltip(tip)
tip:AddLine(childName)
if(faction == 'Neutral') then
tip:AddLine(L['neutral'])
return
end
tip:AddDoubleLine(addon:colorize(L['Sitzung'],'ffff00'), addon:buildMoneyString(db[realm][player]['currentGold'] - sessionStart,true,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath..":0|t"..L['Einnahmen'], addon:buildMoneyString(sessionIn,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath2..":0|t"..L['Ausgaben'], addon:buildMoneyString(sessionOut,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine(Helper_Tooltip(L['Sitzung'],'ffff00',db[realm][player]['currentGold'] - sessionStart,true))
tip:AddDoubleLine(Helper_Tooltip2(texturePath,L['Einnahmen'],sessionIn,false))
tip:AddDoubleLine(Helper_Tooltip2(texturePath2,L['Ausgaben'],sessionOut,false))
tip:AddLine(' ')
local sumOut,sumIn = getSumToday()
tip:AddDoubleLine(addon:colorize(L['Heute'],'ffff00'), addon:buildMoneyString(sumOut+sumIn,true,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath..":0|t"..L['Einnahmen'], addon:buildMoneyString(sumIn,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath2..":0|t"..L['Ausgaben'], addon:buildMoneyString(sumOut,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine(Helper_Tooltip(L['Heute'],'ffff00',sumOut+sumIn,true))
tip:AddDoubleLine(Helper_Tooltip2(texturePath,L['Einnahmen'],sumIn,false))
tip:AddDoubleLine(Helper_Tooltip2(texturePath2,L['Ausgaben'],sumOut,false))
tip:AddLine(' ')
sumOut,sumIn = getSumToday(-1)
tip:AddDoubleLine(addon:colorize(L['Gestern'],'ffff00'), addon:buildMoneyString(sumOut+sumIn,true,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath..":0|t"..L['Einnahmen'], addon:buildMoneyString(sumIn,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath2..":0|t"..L['Ausgaben'], addon:buildMoneyString(sumOut,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine(Helper_Tooltip(L['Gestern'],'ffff00',sumOut+sumIn,true))
tip:AddDoubleLine(Helper_Tooltip2(texturePath,L['Einnahmen'],sumIn,false))
tip:AddDoubleLine(Helper_Tooltip2(texturePath2,L['Ausgaben'],sumOut,false))
tip:AddLine(' ')
sumOut,sumIn = getSumWeek()
tip:AddDoubleLine(addon:colorize(L['7-Tage'],'ffff00'), addon:buildMoneyString(sumIn+sumOut,true,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath..":0|t"..L['Einnahmen'], addon:buildMoneyString(sumIn,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine("|T"..texturePath2..":0|t"..L['Ausgaben'], addon:buildMoneyString(sumOut,false,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine(Helper_Tooltip(L['7-Tage'],'ffff00',sumIn+sumOut,true))
tip:AddDoubleLine(Helper_Tooltip2(texturePath,L['Einnahmen'],sumIn,false))
tip:AddDoubleLine(Helper_Tooltip2(texturePath2,L['Ausgaben'],sumOut,false))
tip:AddLine(' ')
local sum = 0
wipe(ttlist)
287,10 → 284,10
end
end
for _,v in pairs(addon:sortArray(ttlist,addon['db']['global']['sortDir'])) do
tip:AddDoubleLine(addon:classcolor(v,db[realm][v]['class']), addon:buildMoneyString((db[realm][v]['currentGold']+(db[realm][v]['incoming'] or 0)) or 0,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine(Helper_Tooltip(addon:classcolor(v,db[realm][v]['class']),nil,db[realm][v]['currentGold']+(db[realm][v]['incoming'] or 0) or 0,false))
end
tip:AddLine(' ')
tip:AddDoubleLine(addon:colorize(L['Gesamt'],'ffff00'),addon:buildMoneyString(sum,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12,}),1,1,1,1,1,1)
tip:AddDoubleLine(Helper_Tooltip(L['Gesamt'],'ffff00',sum,false))
end
 
local oldMoney = 0
375,13 → 372,13
end
 
local function getPref2(info)
return db[realm][faction][info[#info]]
return db[realm][faction][info[#info]]
end
 
local function setPref2(info,value)
db[realm][faction][info[#info]] = value
buildMailFrames()
OnDataUpdate()
db[realm][faction][info[#info]] = value
buildMailFrames()
OnDataUpdate()
end
 
local function getPref(info)
391,6 → 388,7
local function setPref(info,value)
oldMoney = 0
addon['db']['global'][info[#info]] = value
Helper_Tooltip_tab = nil
buildMailFrames()
OnDataUpdate()
end
trunk/zz_Money/zz_Money.toc
1,4 → 1,4
## Interface: 70300
## Interface: 80000
## X-WoWI-Slug: zz_Money-847
## X-Curse-Project-Slug: zz_money
## X-Repository: svn://svn.wowinterface.com/zz_Money-847