Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
rilgamon | a9d930139a | |
rilgamon | 8622e79081 | |
rilgamon | 69a30ffc55 | |
rilgamon | 9dd6316289 |
|
@ -1,3 +0,0 @@
|
|||
[submodule "Common"]
|
||||
path = Common
|
||||
url = https://git.grml.de/rilgamon/Common.git
|
1
Common
1
Common
|
@ -1 +0,0 @@
|
|||
Subproject commit 0832ab9a78425480d8a2095ffaa77521029bd7b9
|
|
@ -0,0 +1,163 @@
|
|||
local addonName, addonTable = ...
|
||||
addonTable['events'] = addonTable['events'] or {}
|
||||
local db, mailSum, mailRec, player, dbb, dbr, dbf, L, faction, realm
|
||||
local events = addonTable['events']
|
||||
function addonTable:SetupBanker()
|
||||
player = UnitName('player')
|
||||
L = addonTable['storage']['L']
|
||||
db = addonTable['storage']['db']
|
||||
dbr = addonTable['storage']['dbr']
|
||||
dbf = addonTable['storage']['dbf']
|
||||
dbb = dbf['banker']
|
||||
faction = addonTable['storage']['faction']
|
||||
realm = addonTable['storage']['realm']
|
||||
addonTable['bankHandler'] :SetDB(db[faction]['banker'])
|
||||
end
|
||||
local mailframes = {}
|
||||
local posFrame = CreateFrame("Frame")
|
||||
posFrame:SetSize(32,1)
|
||||
posFrame:SetPoint("TOPRIGHT",SendMailFrame,"TOPRIGHT",-10,-12)
|
||||
posFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
self:UnregisterEvent('MAIL_FAILED')
|
||||
self:UnregisterEvent('MAIL_SEND_SUCCESS')
|
||||
if(event == "MAIL_SEND_SUCCESS") then
|
||||
if(mailRec and mailSum) then
|
||||
dbr[mailRec]['incoming'] = (dbr[mailRec]['incoming'] or 0) + mailSum
|
||||
print(L['Success'](mailRec,mailSum))
|
||||
mailframes[mailRec]:Hide()
|
||||
end
|
||||
elseif(event == "MAIL_FAILED") then
|
||||
print(L['Fail'])
|
||||
end
|
||||
mailRec = nil
|
||||
mailSum = nil
|
||||
end)
|
||||
local function GetFactionList()
|
||||
local n,m,_
|
||||
local l = {}
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
if(m == realm) then
|
||||
if(faction == dbr[n]['faction']) then
|
||||
l[n] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return l
|
||||
end
|
||||
local function getDeliver(name)
|
||||
if(not dbr[name] or not dbr[name]['currentGold']) then return 0 end
|
||||
local sendSum,offset
|
||||
local lim, mon
|
||||
if(dbb['banker'] ~= player) then
|
||||
lim = dbb['maxLimit'] or 100
|
||||
mon = GetMoney()
|
||||
sendSum = mon - lim*10000 - 30
|
||||
offset = 0
|
||||
else
|
||||
lim = dbb['minLimit'] or 100
|
||||
mon = dbr[name]['currentGold']
|
||||
sendSum = lim*10000 - mon
|
||||
offset = 30
|
||||
end
|
||||
if(sendSum + offset > GetMoney()) then
|
||||
sendSum = GetMoney()
|
||||
end
|
||||
return sendSum - (dbb['banker'] == name and 0 or (dbr[name]['incoming'] or 0))
|
||||
end
|
||||
local function Click(self,button)
|
||||
local sendSum = getDeliver(self['destName'])
|
||||
if(addonTable:IsTwink(self['destName']) and self['destName']~=player) then
|
||||
if(sendSum>0) then
|
||||
if(SetSendMailMoney(sendSum)) then
|
||||
posFrame:RegisterEvent('MAIL_SEND_SUCCESS')
|
||||
posFrame:RegisterEvent('MAIL_FAILED')
|
||||
mailRec = self['destName']
|
||||
mailSum = sendSum
|
||||
SendMail(self['destName'],L['Subject'],nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function Mouse(self)
|
||||
local tip = GameTooltip
|
||||
tip:SetOwner(self, "ANCHOR_BOTTOM")
|
||||
tip:ClearLines()
|
||||
self['tooltip'] = tip
|
||||
if(dbb['banker'] ~= player) then
|
||||
tip:AddLine(format("%s %s",L['Bankier'],dbb['banker']))
|
||||
tip:AddLine(format("%s %s",L['Goldgrenze'],dbb['maxLimit']))
|
||||
else
|
||||
tip:AddLine(format("%s %s",L['Empfaenger'],self['destName']))
|
||||
tip:AddLine(format("%s %s",L['Goldgrenze'],dbb['minLimit']))
|
||||
end
|
||||
local sendSum = getDeliver(self['destName'])
|
||||
tip:AddLine(format("%s %s",L['Sende'],GetCoinTextureString(sendSum)))
|
||||
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 = 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['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()
|
||||
local banker = dbb['banker']
|
||||
if(banker and mailframes) then
|
||||
for k,v in pairs(mailframes) do
|
||||
mailframes[k]:Hide()
|
||||
mailframes[k] = nil
|
||||
end
|
||||
mailframes = {}
|
||||
end
|
||||
if(db["disableBanker"]) then return end
|
||||
posFrame:Show()
|
||||
lastframe = posFrame
|
||||
|
||||
if(player == banker) then
|
||||
local fl = GetFactionList()
|
||||
if(fl) then
|
||||
local money = GetMoney()
|
||||
for k,v in pairs(fl) do
|
||||
if(k ~= banker) then
|
||||
if(getDeliver(k) > 0 and getDeliver(k) < money - 10000) then
|
||||
mailframes[k] = MainFrame(k)
|
||||
mailframes[k]:Show()
|
||||
lastframe = mailframes[k]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local money = GetMoney()
|
||||
if(getDeliver(banker) > 0 and getDeliver(banker) < money - 10000) then
|
||||
mailframes[banker] = MainFrame(banker)
|
||||
mailframes[banker]:Show()
|
||||
end
|
||||
end
|
||||
end
|
||||
function events:MAIL_SHOW()
|
||||
buildMailFrames()
|
||||
end
|
|
@ -0,0 +1,164 @@
|
|||
local addonName, addonTable = ...
|
||||
local childName = "zzMoney2"
|
||||
local db, dbr, dbp, L, lineIn, lineOut, session, faction, realm
|
||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||
function addonTable:SetupBroker()
|
||||
L = addonTable['storage']['L']
|
||||
db = addonTable['storage']['db']
|
||||
dbr = addonTable['storage']['dbr']
|
||||
dbp = addonTable['storage']['dbp']
|
||||
session = addonTable['storage']['session']
|
||||
faction = addonTable['storage']['faction']
|
||||
realm = addonTable['storage']['realm']
|
||||
local folder = addonName ~= childName and format("Interface\\AddOns\\%s\\%s", addonName, childName) or format("Interface\\AddOns\\%s", childName)
|
||||
lineIn = format("|T%s:0|t %s", format("%s\\in.tga", folder), L['Einnahmen'])
|
||||
lineOut = format("|T%s:0|t %s", format("%s\\out.tga", folder), L['Ausgaben'])
|
||||
end
|
||||
local function cdbCheck(n,realm)
|
||||
db[realm] = db[realm] or {}
|
||||
db[realm][n] = db[realm][n] or { currentGold = 0 }
|
||||
end
|
||||
local function getSumToday(d)
|
||||
if(faction=='Neutral') then return 0,0 end
|
||||
local sumIn,sumOut = 0,0
|
||||
d = d or 0
|
||||
local day = addonTable:getDateString() + d
|
||||
for a,b in pairs(dbr['activity'][faction][tostring(day)] or {}) do
|
||||
if(b < 0) then
|
||||
sumOut = sumOut + b
|
||||
else
|
||||
sumIn = sumIn + b
|
||||
end
|
||||
end
|
||||
return sumOut,sumIn
|
||||
end
|
||||
local function getSumWeek()
|
||||
local sumIn, sumOut = 0,0
|
||||
local sumWeekIn, sumWeekOut = 0,0
|
||||
for a=0,6 do
|
||||
sumOut, sumIn = getSumToday(a * -1)
|
||||
sumWeekIn = sumWeekIn + sumIn
|
||||
sumWeekOut = sumWeekOut + sumOut
|
||||
end
|
||||
return sumWeekOut,sumWeekIn
|
||||
end
|
||||
local function Helper_Tooltip3(realm)
|
||||
if(not db['connectedRealms']) then return end
|
||||
connectedRealms = connectedRealms or GetAutoCompleteRealms()
|
||||
for k, v in pairs(connectedRealms) do
|
||||
if(v == realm) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
local function OnClick(self, button)
|
||||
if(IsShiftKeyDown() and button == "LeftButton") then
|
||||
local sb = addonTable['db']['global']['ldbicons']
|
||||
sb[childName]['hide'] = not sb[childName]['hide']
|
||||
if(ldbicon) then
|
||||
if(sb[childName]['hide']) then
|
||||
ldbicon:Hide(childName)
|
||||
else
|
||||
ldbicon:Show(childName)
|
||||
end
|
||||
end
|
||||
else
|
||||
if(not InCombatLockdown()) then
|
||||
if(InterfaceOptionsFrame:IsVisible()) then
|
||||
InterfaceOptionsFrame:Hide()
|
||||
else
|
||||
InterfaceOptionsFrame_OpenToCategory(childName)
|
||||
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local function OnTooltipShow(tip)
|
||||
tip:AddLine(childName)
|
||||
if(faction == 'Neutral') then
|
||||
tip:AddLine(L['neutral'])
|
||||
return
|
||||
end
|
||||
local sessdiff = dbp['currentGold'] - session['start']
|
||||
local sdr,sdg,sdb = 1, 1, 1
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
end
|
||||
tip:AddDoubleLine(L['Sitzung'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(session['income'], db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(session['expense']), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumToday()
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['Heute'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumToday(-1)
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['Gestern'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumWeek()
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['7-Tage'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sum = 0
|
||||
local ttlist = {}
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
local n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
local cr = Helper_Tooltip3(m)
|
||||
if(m == realm or cr) then
|
||||
cdbCheck(n,cr and m or realm)
|
||||
if( faction == db[cr and m or realm][n]['faction']) then
|
||||
sum = sum + db[cr and m or realm][n]['currentGold']
|
||||
ttlist[k] = db[cr and m or realm][n]['currentGold']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,v in pairs(addonTable:sortArray(ttlist,db['sortDir'])) do
|
||||
local n,_,m = strsplit(' ',v,3)
|
||||
local cr = Helper_Tooltip3(m)
|
||||
tip:AddDoubleLine(addonTable:classcolor(n,db[cr and m or realm][n]['class']),addonTable:displayMoney(db[cr and m or realm][n]['currentGold']+(db[cr and m or realm][n]['incoming'] or 0), db['shortMoneyTip']),0,1,0,1,1,1)
|
||||
end
|
||||
tip:AddLine(' ')
|
||||
tip:AddDoubleLine(L['Gesamt'],addonTable:displayMoney(sum, db['shortMoneyTip']),0,1,0,1,1,1)
|
||||
end
|
||||
function addonTable:GetBroker(objname)
|
||||
return LibStub:GetLibrary("zzLDB"):GetLDB(objname)
|
||||
end
|
||||
function addonTable:OnText(objname, message)
|
||||
local ldbobj = addonTable:GetBroker(objname)
|
||||
if(ldbobj['text'] ~= message) then
|
||||
ldbobj['text'] = message
|
||||
end
|
||||
end
|
||||
addonTable['ldb'] = { -- https://github.com/tekkub/libdatabroker-1-1/wiki/Data-Specifications
|
||||
['type'] = 'data source', -- required: 'data source' or 'launcher'
|
||||
['text'] = childName, -- required/optional for launcher
|
||||
['icon'] = 'Interface\\Icons\\INV_Misc_Bag_10_Blue', -- optional/required for launcher
|
||||
['OnClick'] = OnClick, -- optional/required for launcher
|
||||
['OnTooltipShow'] = OnTooltipShow, -- optional
|
||||
}
|
635
core.lua
635
core.lua
|
@ -1,505 +1,130 @@
|
|||
local name, addon = ...
|
||||
local parentName = addon['parentName'] or "BrokerPack"
|
||||
local childName = "zz_Money"
|
||||
local defaults = {
|
||||
['sortDir'] = true,
|
||||
}
|
||||
local options = {
|
||||
}
|
||||
|
||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
||||
local db
|
||||
|
||||
local texturePath = name == "BrokerPack" and "Interface\\AddOns\\BrokerPack\\zz_Money\\in.tga" or "Interface\\AddOns\\zz_Money\\in.tga"
|
||||
local texturePath2 = name == "BrokerPack" and "Interface\\AddOns\\BrokerPack\\zz_Money\\out.tga" or "Interface\\AddOns\\zz_Money\\out.tga"
|
||||
|
||||
local goldicon,silvericon,coppericon
|
||||
local sessionStart,sessionIn,sessionOut = 0,0,0
|
||||
local mailframes = {}
|
||||
local lastframe
|
||||
local mailRec,mailSum
|
||||
local realm, faction, player
|
||||
local checkDelay = GetTime()
|
||||
local connectedRealms
|
||||
local posFrame = CreateFrame("Frame")
|
||||
posFrame:SetSize(32,1)
|
||||
posFrame:SetPoint("TOPRIGHT",SendMailFrame,"TOPRIGHT",-10,-12)
|
||||
posFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
self:UnregisterEvent('MAIL_FAILED')
|
||||
self:UnregisterEvent('MAIL_SEND_SUCCESS')
|
||||
if(event == "MAIL_SEND_SUCCESS") then
|
||||
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
|
||||
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 Helper_Tooltip3(realm)
|
||||
if(not addon['db']['global']['connectedRealms']) then return end
|
||||
for k, v in pairs(connectedRealms) do
|
||||
if(v == realm) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
local function cdbCheck(n,realm)
|
||||
db[realm] = db[realm] or {}
|
||||
db[realm][n] = db[realm][n] or { currentGold = 0 }
|
||||
end
|
||||
local function OnText(message)
|
||||
addon:OnText(childName, message)
|
||||
end
|
||||
|
||||
local function OnText2()
|
||||
local m = 0
|
||||
if(addon['db']['global']['accountMoney']) then
|
||||
local sum = 0
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
local n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
local cr = Helper_Tooltip3(m)
|
||||
if(m == realm or cr) then
|
||||
cdbCheck(n,cr and m or realm)
|
||||
if( faction == db[cr and m or realm][n]['faction']) then
|
||||
sum = sum + db[cr and m or realm][n]['currentGold']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
m = sum
|
||||
else
|
||||
m = GetMoney()
|
||||
end
|
||||
if(addon['db']['global']['shortMoney'] and m>10000)then
|
||||
m = addon:round(m / 10000,0) * 10000
|
||||
end
|
||||
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()
|
||||
local n,m,_
|
||||
local l = {}
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
if(m == realm) then
|
||||
if(faction == db[realm][n]['faction']) then
|
||||
l[n] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return l
|
||||
end
|
||||
|
||||
local function getDeliver(name)
|
||||
local sendSum,offset
|
||||
local lim, mon
|
||||
if(db[realm][faction]['banker'] ~= player) then
|
||||
lim = db[realm][faction]['maxLimit'] or 100
|
||||
mon = GetMoney()
|
||||
sendSum = mon - lim*10000 - 30
|
||||
offset = 0
|
||||
else
|
||||
lim = db[realm][faction]['minLimit'] or 100
|
||||
mon = db[realm][name]['currentGold']
|
||||
sendSum = lim*10000 - mon
|
||||
offset = 30
|
||||
end
|
||||
if(sendSum + offset > GetMoney()) then
|
||||
sendSum = GetMoney()
|
||||
end
|
||||
return sendSum - (db[realm][faction]['banker'] ~= player and 0 or (db[realm][name]['incoming'] or 0))
|
||||
end
|
||||
|
||||
|
||||
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
|
||||
posFrame:RegisterEvent('MAIL_SEND_SUCCESS')
|
||||
posFrame:RegisterEvent('MAIL_FAILED')
|
||||
mailRec = self['destName']
|
||||
mailSum = sendSum
|
||||
SendMail(self['destName'],L['Subject'],nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
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 = 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['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()
|
||||
local banker = db[realm][faction]['banker']
|
||||
if(mailframes) then
|
||||
for k,v in pairs(mailframes) do
|
||||
mailframes[k]:Hide()
|
||||
mailframes[k] = nil
|
||||
end
|
||||
mailframes = {}
|
||||
end
|
||||
if(addon['db']['global']["disableBanker"]) then return end
|
||||
posFrame:Show()
|
||||
lastframe = posFrame
|
||||
|
||||
if(player == banker) then
|
||||
local fl = GetFactionList()
|
||||
if(fl) then
|
||||
for k,v in pairs(fl) do
|
||||
if(k ~= banker) then
|
||||
if(getDeliver(k) > 0 and getDeliver(k) < GetMoney() - 10000) then
|
||||
mailframes[k] = MainFrame(k)
|
||||
mailframes[k]:Show()
|
||||
lastframe = mailframes[k]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if(getDeliver(banker) > 0 and getDeliver(banker) < GetMoney() - 10000) then
|
||||
mailframes[banker] = MainFrame(banker)
|
||||
mailframes[banker]:Show()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function getDateString()
|
||||
return format("%s%s",tostring(date("%Y")),tostring(1000 + date("%j")))
|
||||
end
|
||||
local function getSumToday(d)
|
||||
if(faction=='Neutral') then return 0,0 end
|
||||
local sumIn,sumOut = 0,0
|
||||
d = d or 0
|
||||
local day = getDateString() + d
|
||||
for a,b in pairs(db[realm]['activity'][faction][tostring(day)] or {}) do
|
||||
if(b < 0) then
|
||||
sumOut = sumOut + b
|
||||
else
|
||||
sumIn = sumIn + b
|
||||
end
|
||||
end
|
||||
return sumOut,sumIn
|
||||
end
|
||||
|
||||
local function getSumWeek()
|
||||
local sumIn, sumOut = 0,0
|
||||
local sumWeekIn, sumWeekOut = 0,0
|
||||
for a=0,6 do
|
||||
sumOut, sumIn = getSumToday(a * -1)
|
||||
sumWeekIn = sumWeekIn + sumIn
|
||||
sumWeekOut = sumWeekOut + sumOut
|
||||
end
|
||||
return sumWeekOut,sumWeekIn
|
||||
end
|
||||
|
||||
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 OnClick(self, button)
|
||||
if(IsShiftKeyDown() and button == "LeftButton") then
|
||||
addon['db']['global']['ldbicons'][childName]['hide'] = not addon['db']['global']['ldbicons'][childName]['hide']
|
||||
if(ldbicon) then
|
||||
if(addon['db']['global']['ldbicons'][childName]['hide']) then
|
||||
ldbicon:Hide(childName)
|
||||
else
|
||||
ldbicon:Show(childName)
|
||||
end
|
||||
end
|
||||
else
|
||||
if(InterfaceOptionsFrame:IsVisible() and not InCombatLockdown()) then
|
||||
InterfaceOptionsFrame:Hide()
|
||||
else
|
||||
InterfaceOptionsFrame_OpenToCategory(childName)
|
||||
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory
|
||||
end
|
||||
end
|
||||
end
|
||||
local function OnTooltip(tip)
|
||||
tip:AddLine(childName)
|
||||
if(faction == 'Neutral') then
|
||||
tip:AddLine(L['neutral'])
|
||||
return
|
||||
end
|
||||
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(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(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(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)
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
local n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
local cr = Helper_Tooltip3(m)
|
||||
if(m == realm or cr) then
|
||||
cdbCheck(n,cr and m or realm)
|
||||
if( faction == db[cr and m or realm][n]['faction']) then
|
||||
sum = sum + db[cr and m or realm][n]['currentGold']
|
||||
ttlist[k] = db[cr and m or realm][n]['currentGold']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,v in pairs(addon:sortArray(ttlist,addon['db']['global']['sortDir'])) do
|
||||
local n,_,m = strsplit(' ',v,3)
|
||||
local cr = Helper_Tooltip3(m)
|
||||
tip:AddDoubleLine(Helper_Tooltip(addon:classcolor(n,db[cr and m or realm][n]['class']),nil,db[cr and m or realm][n]['currentGold']+(db[cr and m or realm][n]['incoming'] or 0) or 0,false))
|
||||
end
|
||||
tip:AddLine(' ')
|
||||
tip:AddDoubleLine(Helper_Tooltip(L['Gesamt'],'ffff00',sum,false))
|
||||
end
|
||||
|
||||
local oldMoney = 0
|
||||
|
||||
local function OnDataUpdate()
|
||||
if(faction == 'Neutral') then
|
||||
faction = UnitFactionGroup('player')
|
||||
if(faction == 'Neutral') then
|
||||
OnText2()
|
||||
C_Timer.After(2, OnDataUpdate)
|
||||
return
|
||||
end
|
||||
end
|
||||
local m = GetMoney()
|
||||
if(m == oldMoney) then return end
|
||||
local stamp = time()
|
||||
local day = getDateString()
|
||||
db[realm][player] = db[realm][player] or { ['currentGold'] = m,['faction'] = faction }
|
||||
db[realm][player]['incoming'] = 0
|
||||
db[realm]['activity'] = db[realm]['activity'] or { Horde = {}, Alliance={}}
|
||||
db[realm][faction] = db[realm][faction] or {}
|
||||
db[realm][faction]['banker'] = db[realm][faction]['banker'] or player
|
||||
db[realm][faction]['minLimit'] = db[realm][faction]['minLimit'] or 300
|
||||
db[realm][faction]['maxLimit'] = db[realm][faction]['maxLimit'] or 300
|
||||
if(db[realm][player]['currentGold'] ~= m) then
|
||||
db[realm]['activity'][faction][day] = db[realm]['activity'][faction][day] or {}
|
||||
while(db[realm]['activity'][faction][day][stamp]) do
|
||||
stamp = stamp + 1
|
||||
end
|
||||
local d = m-db[realm][player]['currentGold']
|
||||
if(d < 0) then
|
||||
sessionOut = sessionOut + d
|
||||
else
|
||||
sessionIn = sessionIn + d
|
||||
end
|
||||
db[realm]['activity'][faction][day][stamp] = d
|
||||
db[realm][player]['currentGold'] = m
|
||||
end
|
||||
OnText2()
|
||||
C_Timer.After(2, OnDataUpdate)
|
||||
end
|
||||
|
||||
local function MAIL_SHOW()
|
||||
OnDataUpdate()
|
||||
buildMailFrames()
|
||||
end
|
||||
|
||||
local function resetSession()
|
||||
player = UnitName('player')
|
||||
realm = GetRealmName()
|
||||
sessionStart = db[realm][player]['currentGold'] or 0
|
||||
sessionIn = 0
|
||||
sessionOut = 0
|
||||
OnDataUpdate()
|
||||
end
|
||||
|
||||
local function cleanUp()
|
||||
local ci = 7
|
||||
local day = getDateString()
|
||||
if(faction == 'Neutral') then return end
|
||||
for k,v in pairs(db[realm]['activity'][faction]) do
|
||||
if(tonumber(k) < tonumber(day)-ci) then
|
||||
db[realm]['activity'][faction][tostring(k)] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function buildSelect()
|
||||
local sel = {}
|
||||
local n,m,_
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
if(addon:IsTwink(n)) then
|
||||
if(faction == db[realm][n]['faction']) then
|
||||
sel[n] = n
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return sel
|
||||
end
|
||||
local function buildSelectAll()
|
||||
local sel = {}
|
||||
local n,m,_
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
sel[format("%s-%s",n,m)] = format("%s-%s",n,m)
|
||||
end
|
||||
end
|
||||
return sel
|
||||
end
|
||||
|
||||
local function getPref2(info)
|
||||
return db[realm][faction][info[#info]]
|
||||
end
|
||||
|
||||
local function setPref2(info,value)
|
||||
db[realm][faction][info[#info]] = value
|
||||
buildMailFrames()
|
||||
OnDataUpdate()
|
||||
end
|
||||
|
||||
local function getPref(info)
|
||||
return addon['db']['global'][info[#info]]
|
||||
end
|
||||
|
||||
local function setPref(info,value)
|
||||
oldMoney = 0
|
||||
addon['db']['global'][info[#info]] = value
|
||||
Helper_Tooltip_tab = nil
|
||||
buildMailFrames()
|
||||
OnDataUpdate()
|
||||
end
|
||||
local function deleteChar()
|
||||
if(addon['db']['global']['deleteCharOk']) then
|
||||
local charName, charRealm = strsplit('-', addon['db']['global']['deleteChar'],2)
|
||||
if(db[charRealm] and db[charRealm][charName]) then
|
||||
db[charRealm][charName] = nil
|
||||
addon['db']['sv']['profileKeys'][format("%s - %s", charName, charRealm)] = nil
|
||||
end
|
||||
end
|
||||
setPref({'deleteCharOk'}, nil)
|
||||
end
|
||||
local function init()
|
||||
player = UnitName('player')
|
||||
realm = GetRealmName()
|
||||
faction = UnitFactionGroup('player')
|
||||
connectedRealms = GetAutoCompleteRealms()
|
||||
options = addon:InitConfig(childName, true, {
|
||||
['name'] = childName,
|
||||
['type'] = "data source",
|
||||
['OnClick'] = OnClick,
|
||||
['OnTooltipShow'] = OnTooltip,
|
||||
['icon'] ="Interface\\Icons\\INV_Misc_Bag_10_Blue",
|
||||
}, getPref, setPref)
|
||||
db = addon['db']['profile'][childName]
|
||||
db[realm] = db[realm] or {
|
||||
['activity'] = { Horde = {}, Alliance={}},
|
||||
[faction] = {},
|
||||
[player] = { currentGold = 0, ['faction'] = faction },
|
||||
['banker'] = player,
|
||||
}
|
||||
db[realm][faction] = db[realm][faction] or {}
|
||||
db[realm][player] = db[realm][player] or { currentGold = 0, ['faction'] = faction }
|
||||
db[realm][player]['faction'] = faction
|
||||
db[realm][player]['incoming'] = db[realm][player]['incoming'] or 0
|
||||
local _, class, _ = UnitClass('player')
|
||||
db[realm][player]['class'] = class
|
||||
local menu = addon:AddConfigMenu({
|
||||
['name'] = L['Bankier'],
|
||||
['order'] = 2,
|
||||
['menuGet'] = getPref2,
|
||||
['menuSet'] = setPref2,
|
||||
['disabled'] = function() return addon['db']['global']["disableBanker"] end,
|
||||
}, options)
|
||||
addon:AddConfigEntry(childName, "range","minLimit",L['Minimum Limit'],L['Desc MinL'],1,10,150000,5,false,menu)
|
||||
addon:AddConfigEntry(childName, "range","maxLimit",L['Maximum Limit'],L['Desc MaxL'],2,10,150000,5,false,menu)
|
||||
addon:AddConfigEntry(childName, "select","banker",L['Bankier'],nil,3,buildSelect,nil,nil,nil,menu)
|
||||
addon:AddConfigEntry(childName, "header","deleteCharHeader",L['DeleteChar'],nil,9,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "select","deleteChar",L['DeleteChar'],L['DeleteCharDesc'],10,buildSelectAll,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","deleteCharOk",L['DeleteCharOk'],nil,11,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "execute","deleteCharExec",L['DeleteChar'],L['DeleteCharDesc'],12,deleteChar,nil,nil,nil,options['args'][childName])
|
||||
|
||||
addon:AddConfigEntry(childName, "range","iconSize",L['iconSize'],nil,2,5,32,1,false,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","sortDir",L['sortDir'],nil,2,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","connectedRealms",L['connectedRealms'],nil,2,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","disableBanker",L['nobanker'],nil,3,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","accountMoney",L['accountMoney'],L['accountMoneyDesc'],4,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","shortMoney",L['shortMoney'],nil,5,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","abrevK",L['abrevK'],nil,6,nil,nil,nil,nil,options['args'][childName])
|
||||
addon:AddConfigEntry(childName, "toggle","abrevM",L['abrevM'],nil,6,nil,nil,nil,nil,options['args'][childName])
|
||||
C_Timer.After(2, OnDataUpdate)
|
||||
addon:RegisterFunc({"PLAYER_MONEY"},"OnEvent", OnDataUpdate)
|
||||
addon:RegisterFunc({"MAIL_SHOW"},"OnEvent", MAIL_SHOW)
|
||||
resetSession()
|
||||
cleanUp()
|
||||
end
|
||||
|
||||
addon:startup(name, childName, init, true, defaults)
|
||||
local addonName, addonTable = ...
|
||||
local childName = "zzMoney2"
|
||||
local db, dbr, dbp, faction, realm, connectedRealms
|
||||
addonTable['events'] = addonTable['events'] or {}
|
||||
local events = addonTable['events']
|
||||
local session = { start = 0, income = 0, expense = 0 }
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
||||
local function prepareDB()
|
||||
local player = UnitName('player')
|
||||
realm = GetNormalizedRealmName()
|
||||
if(not realm) then return end
|
||||
faction = UnitFactionGroup('player')
|
||||
local className, classFilename, classId = UnitClass('player')
|
||||
addonTable['db']['profile'][childName] = addonTable['db']['profile'][childName] or {}
|
||||
db = addonTable['db']['profile'][childName]
|
||||
db[realm] = db[realm] or {}
|
||||
db[faction] = db[faction] or {}
|
||||
db[faction]['banker'] = db[faction]['banker'] or {}
|
||||
db[faction]['banker']['banker'] = db[faction]['banker']['banker'] or player
|
||||
dbr = db[realm]
|
||||
dbr['activity'] = dbr['activity'] or { Horde = {}, Alliance={}}
|
||||
dbr['Horde'] = dbr['Horde'] or {}
|
||||
dbr['Alliance'] = dbr['Alliance'] or {}
|
||||
dbr[player] = dbr[player] or {}
|
||||
dbp = dbr[player]
|
||||
dbp['faction'] = faction
|
||||
dbp['currentGold'] = dbp['currentGold'] or 0
|
||||
dbp['class'] = classFilename
|
||||
dbp['faction'] = faction
|
||||
addonTable['storage'] = {
|
||||
['db'] = db,
|
||||
['dbr'] = dbr,
|
||||
['dbp'] = dbp,
|
||||
['dbf'] = db[faction],
|
||||
['L'] = L,
|
||||
['session'] = session,
|
||||
['faction'] = faction,
|
||||
['realm'] = realm,
|
||||
}
|
||||
addonTable:SetupPrefs(childName)
|
||||
addonTable:SetupBroker()
|
||||
addonTable:SetupBanker()
|
||||
end
|
||||
function addonTable:getDateString()
|
||||
return format("%s%s",tostring(date("%Y")),tostring(1000 + date("%j")))
|
||||
end
|
||||
local specs = {
|
||||
['name'] = childName,
|
||||
['sv'] = true,
|
||||
['cfg'] = true,
|
||||
['cfgReset'] = prepareDB,
|
||||
['ldb'] = addonTable['ldb'] ,
|
||||
['defaults'] = {
|
||||
['profile'] = {
|
||||
[childName] = {
|
||||
['disableBanker'] = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function addonTable:displayMoney(money, abr)
|
||||
if(abr) then
|
||||
local ab = false
|
||||
if(db['abrevM'] and money >= 10000000000) then
|
||||
ab = L['abrM']
|
||||
money = addonTable:round(money / 10000000000,1) * 10000
|
||||
elseif(db['abrevK'] and money >= 10000000) then
|
||||
ab = L['abrK']
|
||||
money = addonTable:round(money / 10000000,1) * 10000
|
||||
end
|
||||
if(ab) then
|
||||
if(db['shortMoney'] and money>10000)then
|
||||
money = addonTable:round(money / 10000,0) * 10000
|
||||
end
|
||||
return gsub(GetCoinTextureString(money), "(%d+)", function(num) return format('%i%s',num, ab) end,1)
|
||||
end
|
||||
end
|
||||
if(db['shortMoney'] and money>10000)then
|
||||
money = addonTable:round(money / 10000,0) * 10000
|
||||
end
|
||||
return GetCoinTextureString(money)
|
||||
end
|
||||
local pew_events = {}
|
||||
function pew_events:PLAYER_MONEY(event)
|
||||
local money = GetMoney()
|
||||
if(money == 0) then return end
|
||||
if(session['start'] == 0) then
|
||||
session['start'] = money
|
||||
end
|
||||
dbp['currentGold'] = dbp['currentGold'] or 0
|
||||
dbp['incoming'] = 0
|
||||
if(money ~= dbp['currentGold']) then
|
||||
local diff = money - dbp['currentGold']
|
||||
local out = GetCoinTextureString(abs(diff))
|
||||
local color = "ffffff"
|
||||
local stamp = time()
|
||||
local day = addonTable:getDateString()
|
||||
local dba = dbr['activity'][faction]
|
||||
dba[day] = dba[day] or {}
|
||||
local dbd = dba[day]
|
||||
while(dbd[stamp]) do
|
||||
stamp = stamp + 1
|
||||
end
|
||||
if(diff < 0) then
|
||||
color = "ff0000"
|
||||
session['expense'] = session['expense'] + diff
|
||||
else
|
||||
session['income'] = session['income'] + diff
|
||||
end
|
||||
dbd[stamp] = diff
|
||||
if(db['showLog']) then
|
||||
print(addonTable:colorize(out, color))
|
||||
end
|
||||
dbp['currentGold'] = money
|
||||
end
|
||||
addonTable:OnText(childName, addonTable:displayMoney(money, true))
|
||||
end
|
||||
function addonTable:PrefChanged(pref, value, oldvalue)
|
||||
pew_events:PLAYER_MONEY()
|
||||
end
|
||||
function events:PLAYER_ENTERING_WORLD(event)
|
||||
addonTable['db']['profile'][childName ] = addonTable['db']['profile'][childName] or {}
|
||||
db = addonTable['db']['profile'][childName]
|
||||
prepareDB()
|
||||
addonTable:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||
addonTable:RegisterEvent(pew_events)
|
||||
pew_events:PLAYER_MONEY()
|
||||
end
|
||||
LibStub:GetLibrary("zzAddOn"):NewAddOn(specs, ...)
|
||||
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
local addonName, addonTable = ...
|
||||
function addonTable:colorize(text, color)
|
||||
return string.format("|cff%s%s|r",color and color or 'ffffff',text and text or '')
|
||||
end
|
||||
function addonTable:classcolor(text,class)
|
||||
class = RAID_CLASS_COLORS[class] and class or "PRIEST"
|
||||
return string.format("|c%s%s|r",RAID_CLASS_COLORS[class]['colorStr'],text)
|
||||
end
|
||||
function addonTable:round(num, idp)
|
||||
return math.floor(num * (10^(idp or 0)) + 0.5) / (10^(idp or 0))
|
||||
end
|
||||
function addonTable:sortArray(tmp,dir)
|
||||
local newtmp = {}
|
||||
local n = 1
|
||||
local cnt = 0
|
||||
local maximum = 0
|
||||
local first
|
||||
for k,v in pairs(tmp) do
|
||||
cnt = cnt + 1
|
||||
if(v > maximum) then
|
||||
maximum = v + 1
|
||||
end
|
||||
first = first or k
|
||||
end
|
||||
while(cnt > 0) do
|
||||
local mx, mn = dir and maximum or 0,first
|
||||
for k,v in pairs(tmp) do
|
||||
if(dir) then
|
||||
if(tonumber(v)<=tonumber(mx)) then
|
||||
mx = v
|
||||
mn = k
|
||||
end
|
||||
else
|
||||
if(tonumber(v)>=tonumber(mx)) then
|
||||
mx = v
|
||||
mn = k
|
||||
end
|
||||
end
|
||||
end
|
||||
newtmp[n] = mn
|
||||
tmp[mn] = nil
|
||||
cnt = 0
|
||||
for k,v in pairs(tmp) do
|
||||
cnt = cnt + 1
|
||||
end
|
||||
n = n + 1
|
||||
mn = 0
|
||||
mx = dir and mx or 0
|
||||
end
|
||||
return newtmp
|
||||
end
|
||||
function addonTable:IsTwink(name)
|
||||
local realm = GetRealmName()
|
||||
local _
|
||||
if(self['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(self['db']['sv']['profileKeys']) do
|
||||
local n,m = strsplit(" - ",k,2)
|
||||
_,m = strsplit(" ",m,2)
|
||||
if(n) then
|
||||
if(n == name and m == realm) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
|
@ -1,46 +1,48 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "deDE", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Einstellungen'
|
||||
L['Sitzung']='Sitzung'
|
||||
L['Einnahmen']='Einnahmen'
|
||||
L['Ausgaben']='Ausgaben'
|
||||
L['Heute']='Heute'
|
||||
L['Gestern']='Gestern'
|
||||
L['7-Tage']='7-Tage'
|
||||
L['Gesamt']='Gesamt'
|
||||
L['Bankier']='Bankier'
|
||||
L['Goldgrenze']='Goldgrenze'
|
||||
L['Sende'] = 'Sende'
|
||||
L['Subject'] = 'Ab in den Sparstrumpf'
|
||||
L['Minimum Limit']='Minimum Limit'
|
||||
L['Desc MinL']='Spieler mit Gold unter diesem Limit werden dem Bankier angzeigt'
|
||||
L['Maximum Limit']='Maximum Limit'
|
||||
L['Desc MaxL']='Spieler mit Gold \195\188ber diesem Limit bekommen einen Knopf im Postfenster um es an den Bankier zu schicken'
|
||||
L['Empfaenger']='Empf\195\164nger'
|
||||
L['Fail']='Sendung fehlgeschlagen'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s",addon:buildMoneyString(sum,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12}),name) end
|
||||
L['iconSize']='M\195\188nzgr\195\182\195\159e'
|
||||
L['sortDir'] = 'Tooltip-Sortierung Auf-/Absteigend'
|
||||
L['nobanker'] = 'Bankier deaktivieren'
|
||||
L['neutral'] = 'Deaktiviert solange neutral'
|
||||
L['accountMoneyDesc'] = 'Zeige accountweiten Goldbestand'
|
||||
L['accountMoney'] = 'Globales Gold'
|
||||
L['shortMoney'] = 'Gold runden'
|
||||
L['abrevK'] = "Geldanzeige k\195\188rzen k"
|
||||
L['abrevM'] = "Geldanzeige k\195\188rzen m"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "Zeige verbundene Realms"
|
||||
L['DeleteChar'] = "L\195\182sche Char"
|
||||
L['DeleteCharDesc'] = "Entferne alle Daten zu diesem Character"
|
||||
L['DeleteCharOk'] = "Ja, ich bin sicher!"
|
||||
end
|
||||
|
||||
-- ö \195\182 ß \195\159
|
||||
-- ü \195\188 ä \195\164
|
||||
-- Ä \195\132
|
||||
-- ö \195\182
|
||||
local addonname, addon = ...
|
||||
local name = "zzMoney2"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "deDE", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Einstellungen'
|
||||
L['Sitzung']='Sitzung'
|
||||
L['Einnahmen']='Einnahmen'
|
||||
L['Ausgaben']='Ausgaben'
|
||||
L['Heute']='Heute'
|
||||
L['Gestern']='Gestern'
|
||||
L['7-Tage']='7-Tage'
|
||||
L['Gesamt']='Gesamt'
|
||||
L['Bankier']='Bankier'
|
||||
L['Goldgrenze']='Goldgrenze'
|
||||
L['Sende'] = 'Sende'
|
||||
L['Subject'] = 'Ab in den Sparstrumpf'
|
||||
L['Minimum Limit']='Minimum Limit'
|
||||
L['Desc MinL']='Spieler mit Gold unter diesem Limit werden dem Bankier angzeigt'
|
||||
L['Maximum Limit']='Maximum Limit'
|
||||
L['Desc MaxL']='Spieler mit Gold \195\188ber diesem Limit bekommen einen Knopf im Postfenster um es an den Bankier zu schicken'
|
||||
L['Empfaenger']='Empf\195\164nger'
|
||||
L['Fail']='Sendung fehlgeschlagen'
|
||||
L['Success']=function(name,sum) return format("Betrag von %s an %s gesendet", GetCoinTextureString(sum), name) end
|
||||
L['iconSize']='M\195\188nzgr\195\182\195\159e'
|
||||
L['sortDir'] = 'Tooltip-Sortierung Auf-/Absteigend'
|
||||
L['nobanker'] = 'Bankier deaktivieren'
|
||||
L['neutral'] = 'Deaktiviert solange neutral'
|
||||
L['accountMoneyDesc'] = 'Zeige accountweiten Goldbestand'
|
||||
L['accountMoney'] = 'Globales Gold'
|
||||
L['shortMoney'] = 'Gold runden'
|
||||
L['shortMoneyTip'] = 'Gold im Tooltip k\195\188rzen'
|
||||
L['abrevK'] = "Geldanzeige k\195\188rzen k"
|
||||
L['abrevM'] = "Geldanzeige k\195\188rzen m"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "Zeige verbundene Realms"
|
||||
L['DeleteChar'] = "L\195\182sche Char"
|
||||
L['DeleteCharDesc'] = "Entferne alle Daten zu diesem Character"
|
||||
L['DeleteCharOk'] = "Ja, ich bin sicher!"
|
||||
L['showLog'] = "Logge Ver\195\164nderungen im Chat"
|
||||
end
|
||||
|
||||
-- ö \195\182 ß \195\159
|
||||
-- ü \195\188 ä \195\164
|
||||
-- Ä \195\132
|
||||
-- ö \195\182
|
||||
-- ワ \195\156
|
|
@ -1,40 +1,42 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "enUS", true)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Settings'
|
||||
L['Sitzung']='Session'
|
||||
L['Einnahmen']='Income'
|
||||
L['Ausgaben']='Expenses'
|
||||
L['Heute']='Today'
|
||||
L['Gestern']='Yesterday'
|
||||
L['7-Tage']='7-Days'
|
||||
L['Gesamt']='Total'
|
||||
L['Bankier']='Banker'
|
||||
L['Goldgrenze']='Goldlimit'
|
||||
L['Sende'] = 'Send'
|
||||
L['Subject'] = 'Sock away'
|
||||
L['Minimum Limit']='Minimum Limit'
|
||||
L['Desc MinL']='Chars with less than this limit will be show to the banker'
|
||||
L['Maximum Limit']='Maximum Limit'
|
||||
L['Desc MaxL']='Chars with more than this limit will see a button in the send mail window to send it to the banker'
|
||||
L['Empfaenger']='Beneficiary'
|
||||
L['Fail']='Mail failed'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s",addon:buildMoneyString(sum,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12}),name) end
|
||||
L['iconSize']='Coinsize'
|
||||
L['sortDir'] = 'Sort Tooltip Up/Down'
|
||||
L['nobanker'] = 'Disable banker functionality'
|
||||
L['neutral'] = 'Disabled while neutral'
|
||||
L['accountMoney'] = 'Global Money'
|
||||
L['accountMoneyDesc'] = 'Show accountwide Money'
|
||||
L['shortMoney'] = 'Display gold only'
|
||||
L['abrevK'] = "Shorten money display k"
|
||||
L['abrevM'] = "Shorten money display m"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "List connected Realms"
|
||||
L['DeleteChar'] = "Delete Char"
|
||||
L['DeleteCharDesc'] = "Removes all data for this character"
|
||||
L['DeleteCharOk'] = "Yes, I'm sure!"
|
||||
local addonname, addon = ...
|
||||
local name = "zzMoney2"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "enUS", true)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Settings'
|
||||
L['Sitzung']='Session'
|
||||
L['Einnahmen']='Income'
|
||||
L['Ausgaben']='Expenses'
|
||||
L['Heute']='Today'
|
||||
L['Gestern']='Yesterday'
|
||||
L['7-Tage']='7-Days'
|
||||
L['Gesamt']='Total'
|
||||
L['Bankier']='Banker'
|
||||
L['Goldgrenze']='Goldlimit'
|
||||
L['Sende'] = 'Send'
|
||||
L['Subject'] = 'Sock away'
|
||||
L['Minimum Limit']='Minimum Limit'
|
||||
L['Desc MinL']='Chars with less than this limit will be shown to the banker'
|
||||
L['Maximum Limit']='Maximum Limit'
|
||||
L['Desc MaxL']='Chars with more than this limit will see a button in the send mail window to send it to the banker'
|
||||
L['Empfaenger']='Beneficiary'
|
||||
L['Fail']='Mail failed'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s", GetCoinTextureString(sum), name) end
|
||||
L['iconSize']='Coinsize'
|
||||
L['sortDir'] = 'Sort Tooltip Up/Down'
|
||||
L['nobanker'] = 'Disable banker functionality'
|
||||
L['neutral'] = 'Disabled while neutral'
|
||||
L['accountMoney'] = 'Global Money'
|
||||
L['accountMoneyDesc'] = 'Show accountwide Money'
|
||||
L['shortMoney'] = 'Display gold only'
|
||||
L['shortMoneyTip'] = 'Shorten money in tooltip'
|
||||
L['abrevK'] = "Shorten money display k"
|
||||
L['abrevM'] = "Shorten money display m"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "List connected Realms"
|
||||
L['DeleteChar'] = "Delete Char"
|
||||
L['DeleteCharDesc'] = "Removes all data for this character"
|
||||
L['DeleteCharOk'] = "Yes, I'm sure!"
|
||||
L['showLog'] = "Log changes in chat"
|
||||
end
|
|
@ -1,40 +1,42 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "koKR", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' 설정'
|
||||
L['Sitzung']='세션'
|
||||
L['Einnahmen']='수입'
|
||||
L['Ausgaben']='지출'
|
||||
L['Heute']='오늘'
|
||||
L['Gestern']='어제'
|
||||
L['7-Tage']='7일'
|
||||
L['Gesamt']='전체'
|
||||
L['Bankier']='은행'
|
||||
L['Goldgrenze']='골드 제한'
|
||||
L['Sende'] = '보내기'
|
||||
L['Subject'] = '모우기'
|
||||
L['Minimum Limit']='최소 제한'
|
||||
L['Desc MinL']='Chars with less than this limit will be show to the banker'
|
||||
L['Maximum Limit']='최대 제한'
|
||||
L['Desc MaxL']='Chars with more than this limit will see a button in the send mail window to send it to the banker'
|
||||
L['Empfaenger']='수령인'
|
||||
L['Fail']='우편물 발송 실패'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s",addon:buildMoneyString(sum,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12}),name) end
|
||||
L['iconSize']='골드 아이콘 크기'
|
||||
L['sortDir'] = '위/아래로 툴팁 정렬'
|
||||
L['nobanker'] = '은행 기능 비활성화'
|
||||
L['neutral'] = '중립적인 동안 비활성화'
|
||||
L['accountMoney'] = 'Global Money'
|
||||
L['accountMoneyDesc'] = 'Show accountwide Money'
|
||||
L['shortMoney'] = '골드만 표시'
|
||||
L['abrevK'] = "Shorten money display k"
|
||||
L['abrevM'] = "Shorten money display m"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "List connected Realms"
|
||||
L['DeleteChar'] = "Delete Char"
|
||||
L['DeleteCharDesc'] = "Removes all data for this character"
|
||||
L['DeleteCharOk'] = "Yes, I'm sure!"
|
||||
local addonname, addon = ...
|
||||
local name = "zzMoney2"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "koKR", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' 설정'
|
||||
L['Sitzung']='세션'
|
||||
L['Einnahmen']='수입'
|
||||
L['Ausgaben']='지출'
|
||||
L['Heute']='오늘'
|
||||
L['Gestern']='어제'
|
||||
L['7-Tage']='7일'
|
||||
L['Gesamt']='전체'
|
||||
L['Bankier']='은행'
|
||||
L['Goldgrenze']='골드 제한'
|
||||
L['Sende'] = '보내기'
|
||||
L['Subject'] = '모우기'
|
||||
L['Minimum Limit']='최소 제한'
|
||||
L['Desc MinL']='Chars with less than this limit will be shown to the banker'
|
||||
L['Maximum Limit']='최대 제한'
|
||||
L['Desc MaxL']='Chars with more than this limit will see a button in the send mail window to send it to the banker'
|
||||
L['Empfaenger']='수령인'
|
||||
L['Fail']='우편물 발송 실패'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s", GetCoinTextureString(sum), name) end
|
||||
L['iconSize']='골드 아이콘 크기'
|
||||
L['sortDir'] = '위/아래로 툴팁 정렬'
|
||||
L['nobanker'] = '은행 기능 비활성화'
|
||||
L['neutral'] = '중립적인 동안 비활성화'
|
||||
L['accountMoney'] = 'Global Money'
|
||||
L['accountMoneyDesc'] = 'Show accountwide Money'
|
||||
L['shortMoney'] = '골드만 표시'
|
||||
L['shortMoneyTip'] = 'Shorten money in tooltip'
|
||||
L['abrevK'] = "Shorten money display k"
|
||||
L['abrevM'] = "Shorten money display m"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "List connected Realms"
|
||||
L['DeleteChar'] = "Delete Char"
|
||||
L['DeleteCharDesc'] = "Removes all data for this character"
|
||||
L['DeleteCharOk'] = "Yes, I'm sure!"
|
||||
L['showLog'] = "Log changes in chat"
|
||||
end
|
|
@ -1,40 +1,42 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "ruRU", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Настройки'
|
||||
L['Sitzung']='Сессия'
|
||||
L['Einnahmen']='Доход'
|
||||
L['Ausgaben']='Расход'
|
||||
L['Heute']='Сегодня'
|
||||
L['Gestern']='Вчера'
|
||||
L['7-Tage']='7-Дней'
|
||||
L['Gesamt']='Всего'
|
||||
L['Bankier']='Банкир'
|
||||
L['Goldgrenze']='Лимит золота'
|
||||
L['Sende'] = 'Отправить'
|
||||
L['Subject'] = 'Лишнее золото'
|
||||
L['Minimum Limit']='Минимальный лимит'
|
||||
L['Desc MinL']='Персонажи с золотом меньше указанного значения будут показаны банкиру'
|
||||
L['Maximum Limit']='Максимальный лимит'
|
||||
L['Desc MaxL']='Персонажи с золотом больше указанного лимита будут видеть кнопку для отправки избытка золота банкиру'
|
||||
L['Empfaenger']='Бенефициар'
|
||||
L['Fail']='Не удалось отправить письмо'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s",addon:buildMoneyString(sum,nil,{ ['iconSize'] = addon['db']['global']['iconSize'] or 12}),name) end
|
||||
L['iconSize']='Размер монеты'
|
||||
L['sortDir'] = 'Сортировка Верх/Низ'
|
||||
L['nobanker'] = 'Отключить функцию банкира'
|
||||
L['neutral'] = 'Отключено пока не выбрана фракция'
|
||||
L['accountMoney'] = 'Золота на аккаунте'
|
||||
L['accountMoneyDesc'] = 'Показать все золото на аккаунте'
|
||||
L['shortMoney'] = 'Показывать только золото'
|
||||
L['abrevK'] = "Сокращать золото до тысяч"
|
||||
L['abrevM'] = "Сокращать золото до миллионов"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "List connected Realms"
|
||||
L['DeleteChar'] = "Delete Char"
|
||||
L['DeleteCharDesc'] = "Removes all data for this character"
|
||||
L['DeleteCharOk'] = "Yes, I'm sure!"
|
||||
local addonname, addon = ...
|
||||
local name = "zzMoney2"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "ruRU", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Настройки'
|
||||
L['Sitzung']='Сессия'
|
||||
L['Einnahmen']='Доход'
|
||||
L['Ausgaben']='Расход'
|
||||
L['Heute']='Сегодня'
|
||||
L['Gestern']='Вчера'
|
||||
L['7-Tage']='7-Дней'
|
||||
L['Gesamt']='Всего'
|
||||
L['Bankier']='Банкир'
|
||||
L['Goldgrenze']='Лимит золота'
|
||||
L['Sende'] = 'Отправить'
|
||||
L['Subject'] = 'Лишнее золото'
|
||||
L['Minimum Limit']='Минимальный лимит'
|
||||
L['Desc MinL']='Персонажи с золотом меньше указанного значения будут показаны банкиру'
|
||||
L['Maximum Limit']='Максимальный лимит'
|
||||
L['Desc MaxL']='Персонажи с золотом больше указанного лимита будут видеть кнопку для отправки избытка золота банкиру'
|
||||
L['Empfaenger']='Бенефициар'
|
||||
L['Fail']='Не удалось отправить письмо'
|
||||
L['Success']=function(name,sum) return format("Sent %s to %s", GetCoinTextureString(sum), name) end
|
||||
L['iconSize']='Размер монеты'
|
||||
L['sortDir'] = 'Сортировка Верх/Низ'
|
||||
L['nobanker'] = 'Отключить функцию банкира'
|
||||
L['neutral'] = 'Отключено пока не выбрана фракция'
|
||||
L['accountMoney'] = 'Золота на аккаунте'
|
||||
L['accountMoneyDesc'] = 'Показать все золото на аккаунте'
|
||||
L['shortMoney'] = 'Показывать только золото'
|
||||
L['shortMoneyTip'] = 'Shorten money in tooltip'
|
||||
L['abrevK'] = "Сокращать золото до тысяч"
|
||||
L['abrevM'] = "Сокращать золото до миллионов"
|
||||
L['abrK'] = "k"
|
||||
L['abrM'] = "m"
|
||||
L['connectedRealms'] = "List connected Realms"
|
||||
L['DeleteChar'] = "Delete Char"
|
||||
L['DeleteCharDesc'] = "Removes all data for this character"
|
||||
L['DeleteCharOk'] = "Yes, I'm sure!"
|
||||
L['showLog'] = "Log changes in chat"
|
||||
end
|
|
@ -1,7 +1,11 @@
|
|||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
||||
<script file="locale_deDE.lua"/>
|
||||
<script file="locale_koKR.lua"/>
|
||||
<script file="locale_enUS.lua"/>
|
||||
<script file="locale_ruRU.lua"/>
|
||||
<Script file="core.lua"/>
|
||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
||||
<script file="locale_deDE.lua"/>
|
||||
<script file="locale_koKR.lua"/>
|
||||
<script file="locale_enUS.lua"/>
|
||||
<script file="locale_ruRU.lua"/>
|
||||
<Script file="helper.lua"/>
|
||||
<Script file="prefs.lua"/>
|
||||
<Script file="broker.lua"/>
|
||||
<Script file="banker.lua"/>
|
||||
<Script file="core.lua"/>
|
||||
</Ui>
|
|
@ -0,0 +1,74 @@
|
|||
local addonName, addonTable = ...
|
||||
local db, dbr, faction
|
||||
addonTable['bankHandler'] = {
|
||||
SetDB = function(self, db) self.db = db end,
|
||||
GetPref = function(self, pref)
|
||||
return self['db'][pref[#pref]]
|
||||
end,
|
||||
SetPref = function (self, pref, value)
|
||||
self['db'][pref[#pref]] = value
|
||||
addonTable['events']['MAIL_SHOW'](addonTable)
|
||||
end,
|
||||
}
|
||||
local function buildSelect()
|
||||
local sel = {}
|
||||
local n,m,_
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
if(addonTable:IsTwink(n)) then
|
||||
if(dbr[n] and faction == dbr[n]['faction']) then
|
||||
sel[n] = n
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return sel
|
||||
end
|
||||
local function buildSelectAll()
|
||||
local sel = {}
|
||||
local n,m,_
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
sel[format("%s-%s",n,m)] = format("%s-%s",n,m)
|
||||
end
|
||||
end
|
||||
return sel
|
||||
end
|
||||
local function deleteChar()
|
||||
if(db['deleteCharOk']) then
|
||||
local charName, charRealm = strsplit('-', db['deleteChar'],2)
|
||||
if(db[charRealm] and db[charRealm][charName]) then
|
||||
db[charRealm][charName] = nil
|
||||
addonTable['db']['sv']['profileKeys'][format("%s - %s", charName, charRealm)] = nil
|
||||
end
|
||||
end
|
||||
db['deleteCharOk'] = nil
|
||||
end
|
||||
function addonTable:SetupPrefs(childName)
|
||||
local L = addonTable['storage']['L']
|
||||
dbr = addonTable['storage']['dbr']
|
||||
db = addonTable['storage']['db']
|
||||
faction = addonTable['storage']['faction']
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
local main = addonTable['options']['args'][childName]
|
||||
local menu = config:AddConfigMenu(addonTable['options'], L['Bankier'], addonTable['bankHandler'] , 2, { disabled = function() return db['disableBanker']
|
||||
end})
|
||||
config:AddConfigEntry(menu, "minLimit", "range", L['Minimum Limit'],L['Desc MinL'],1,10,150000,5, false)
|
||||
config:AddConfigEntry(menu, "maxLimit", "range", L['Maximum Limit'],L['Desc MaxL'],2,10,150000,5,false)
|
||||
config:AddConfigEntry(menu, "banker","select",L['Bankier'],nil,3,buildSelect)
|
||||
config:AddConfigEntry(main, "disableBanker", "toggle", L['nobanker'], nil, 3)
|
||||
config:AddConfigEntry(main, "deleteCharHeader", "header", L['DeleteChar'], nil, 9)
|
||||
config:AddConfigEntry(main, "deleteChar", "select", L['DeleteChar'], L['DeleteCharDesc'], 10, buildSelectAll)
|
||||
config:AddConfigEntry(main, "deleteCharOk", "toggle", L['DeleteCharOk'], nil , 11)
|
||||
config:AddConfigEntry(main, "deleteCharExec", "execute", L['DeleteChar'], L['DeleteCharDesc'], 12, deleteChar)
|
||||
config:AddConfigEntry(main, "sortDir", "toggle", L['sortDir'], nil, 2)
|
||||
config:AddConfigEntry(main, "connectedRealms", "toggle", L['connectedRealms'], nil, 2)
|
||||
config:AddConfigEntry(main, "accountMoney", "toggle", L['accountMoney'], L['accountMoneyDesc'], 4)
|
||||
config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 5)
|
||||
config:AddConfigEntry(main, "shortMoneyTip", "toggle", L['shortMoneyTip'], nil, 5)
|
||||
config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 6)
|
||||
config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 6)
|
||||
config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 7)
|
||||
end
|
20
zz_Money.toc
20
zz_Money.toc
|
@ -1,16 +1,4 @@
|
|||
## Interface: 90002
|
||||
## X-Repository: https://svn.grml.de/zz_Money
|
||||
## X-WoWI-ID: 15621
|
||||
## X-Curse-Project-ID: 39054
|
||||
## X-TOC-Classic: 11302
|
||||
## Title: Money
|
||||
## Notes: Broker Money display
|
||||
## Notes-deDE: Broker zur Goldanzeige
|
||||
## Author: Rilgamon
|
||||
## SavedVariables: zz_MoneyDB
|
||||
## LoadManagers: AddonLoader
|
||||
## X-LoadOn-Always: delayed
|
||||
## OptionalDeps: Ace3,BrokerPack,zzLibCommon
|
||||
Common\common.xml
|
||||
pack.xml
|
||||
|
||||
## Interface: 90005
|
||||
## OptionalDeps: zzLib
|
||||
## SavedVariables: zz_MoneyDB
|
||||
pack.xml
|
||||
|
|
Loading…
Reference in New Issue