diff --git a/broker.lua b/broker.lua index eb37890..642c493 100644 --- a/broker.lua +++ b/broker.lua @@ -18,6 +18,7 @@ local function cdbCheck(n,realm) db[realm] = db[realm] or {} db[realm][n] = db[realm][n] or { currentGold = 0 } end +addonTable.cdbCheck = cdbCheck local function getSumToday(d) if(faction=='Neutral') then return 0,0 end local sumIn,sumOut = 0,0 @@ -52,6 +53,7 @@ local function Helper_Tooltip3(realm) end end end +addonTable.Helper_Tooltip3 = Helper_Tooltip3 local function OnClick(self, button) if(IsShiftKeyDown() and button == "LeftButton") then local sb = addonTable['db']['global']['ldbicons'] @@ -132,11 +134,12 @@ local function OnTooltipShow(tip) if(m == realm or cr) then cdbCheck(n, m) if( faction == db[m][n]['faction']) then - sum = sum + db[m][n]['currentGold'] +-- sum = sum + db[m][n]['currentGold'] ttlist[k] = db[m][n]['currentGold'] end elseif(db['accountMoney']) then - sum = sum + db[m][n]['currentGold'] + +-- sum = sum + db[m][n]['currentGold'] end end end @@ -147,7 +150,7 @@ local function OnTooltipShow(tip) 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) + tip:AddDoubleLine(L['Gesamt'],addonTable:displayMoney(addonTable:GetGold(db['displaySelTT'] or 2), db['shortMoneyTip']),0,1,0,1,1,1) end function addonTable:GetBroker(objname) return LibStub:GetLibrary("zzLDB"):GetLDB(objname) diff --git a/core.lua b/core.lua index 4579007..e3b018e 100644 --- a/core.lua +++ b/core.lua @@ -58,10 +58,35 @@ local specs = { ['profile'] = { [childName] = { ['disableBanker'] = true, + ['displaySelTT'] = 2, + ['displaySel'] = 2, + ['connectedRealms'] = true } } } } +function addonTable:GetGold(val) + local val = val or 2 + local sums = { dbp['currentGold'], 0, 0, 0 } + 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 = addonTable.Helper_Tooltip3(m) + addonTable.cdbCheck(n, m) + local ch = db[m][n] + sums[3] = sums[3] + ch['currentGold'] -- global all + if(faction == ch['faction']) then + if(m == realm or cr) then + sums[2] = sums[2] + ch['currentGold'] -- realm/pool faction + end + sums[4] = sums[4] + ch['currentGold'] -- global faction + end + end + end + end + return sums[val] +end function addonTable:displayMoney(money, abr) if(abr) then if(db['shortMoney'] and money>10000)then @@ -103,7 +128,8 @@ function pew_events:PLAYER_MONEY(event) end dbp['currentGold'] = money end - addonTable:OnText(childName, addonTable:displayMoney(money, true)) + local sum = addonTable:GetGold(db['displaySel'] or 2) + addonTable:OnText(childName, addonTable:displayMoney(sum, true)) end function addonTable:PrefChanged(pref, value, oldvalue) pew_events:PLAYER_MONEY() diff --git a/locale_deDE.lua b/locale_deDE.lua index d51dcc8..21d3d6d 100644 --- a/locale_deDE.lua +++ b/locale_deDE.lua @@ -45,6 +45,12 @@ if L then L['noIconDesk'] = "Benutze Text statt M\195\188nzsymbole" L['Color text'] = "Farbtext" L['Color text desc'] = "F\195\164rbe den Text in M\195\188nzfarbe" + L['displayMoneyChar'] = "Spieler" + L['displayMoneyRealm'] = "Realm (Pool)" + L['displayMoneyGlobal'] = "Global" + L['displayMoneyGlobalFaction'] = "Global (nur deine Fraktion)" + L['Displayvalue'] = "Broker Anzeige" + L['DisplayvalueDesc'] = "Legt fest welcher Wert im Broker angezeigt wird. Global zeigt alle Fraktionen. Realm zeigt nur die eigene Fraktion (Falls aktiviert auch die verbundenen Realms)." end -- ö \195\182 ß \195\159 diff --git a/locale_enUS.lua b/locale_enUS.lua index a96db89..bdb686f 100644 --- a/locale_enUS.lua +++ b/locale_enUS.lua @@ -45,4 +45,10 @@ if L then L['noIconDesk'] = "Use text instead of coin texture" L['Color text'] = "Use color text" L['Color text desc'] = "Colorize text in coin colors" + L['displayMoneyChar'] = "Character" + L['displayMoneyRealm'] = "Realm (Pool)" + L['displayMoneyGlobal'] = "Global" + L['displayMoneyGlobalFaction'] = "Global (only your faction)" + L['Displayvalue'] = "Broker Display" + L['DisplayvalueDesc'] = "Selects the sum diplayed by the broker. Global is for all factions and chars or only your faction. Realm is for your faction (pool when selected)." end \ No newline at end of file diff --git a/locale_koKR.lua b/locale_koKR.lua index 469e785..35ff5c8 100644 --- a/locale_koKR.lua +++ b/locale_koKR.lua @@ -45,4 +45,10 @@ if L then L['noIconDesk'] = "Use text instead of coin texture" L['Color text'] = "Use color text" L['Color text desc'] = "Colorize text in coin colors" + L['displayMoneyChar'] = "Character" + L['displayMoneyRealm'] = "Realm (Pool)" + L['displayMoneyGlobal'] = "Global" + L['displayMoneyGlobalFaction'] = "Global (only your faction)" + L['Displayvalue'] = "Broker Display" + L['DisplayvalueDesc'] = "Selects the sum diplayed by the broker. Global is for all factions and chars. Realm is for your faction (pool when selected)." end \ No newline at end of file diff --git a/locale_ruRU.lua b/locale_ruRU.lua index 7c78fdd..654e2a9 100644 --- a/locale_ruRU.lua +++ b/locale_ruRU.lua @@ -45,4 +45,10 @@ if L then L['noIconDesk'] = "Use text instead of coin texture" L['Color text'] = "Use color text" L['Color text desc'] = "Colorize text in coin colors" + L['displayMoneyChar'] = "Character" + L['displayMoneyRealm'] = "Realm (Pool)" + L['displayMoneyGlobal'] = "Global" + L['displayMoneyGlobalFaction'] = "Global (only your faction)" + L['Displayvalue'] = "Broker Display" + L['DisplayvalueDesc'] = "Selects the sum diplayed by the broker. Global is for all factions and chars. Realm is for your faction (pool when selected)." end \ No newline at end of file diff --git a/prefs.lua b/prefs.lua index c10da46..77e9ab5 100644 --- a/prefs.lua +++ b/prefs.lua @@ -1,5 +1,7 @@ local addonName, addonTable = ... local db, dbr, faction +local childName = "zz_Money" +local L = LibStub("AceLocale-3.0"):GetLocale(childName, true) addonTable['bankHandler'] = { SetDB = function(self, db) self.db = db end, GetPref = function(self, pref) @@ -25,6 +27,11 @@ local function buildSelect() end return sel end + +local buildDisplayValue = { + L['displayMoneyChar'], L['displayMoneyRealm'], L['displayMoneyGlobal'], L['displayMoneyGlobalFaction'] +} + local function buildSelectAll() local sel = {} local n,m,_ @@ -55,11 +62,13 @@ function addonTable:SetupPrefs(childName) faction = addonTable['storage']['faction'] local config = LibStub:GetLibrary("zzConfig") local main = addonTable['options']['args'][childName] - config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 1) - config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 2) - config:AddConfigEntry(main, "disableBanker", "toggle", L['nobanker'], nil, 3) - config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 4) - config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 5) + config:AddConfigEntry(main, "displaySel", "select", L['Displayvalue'], L['DisplayvalueDesc'], 1, buildDisplayValue) + config:AddConfigEntry(main, "connectedRealms", "toggle", L['connectedRealms'], nil, 2) + config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 3) + config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 4) + config:AddConfigEntry(main, "disableBanker", "toggle", L['nobanker'], nil, 5) + config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 6) + config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 7) local noicon = config:AddConfigEntry(main, "noIcon", "toggle", L['noIcon'], L['noIconDesk'], 6) local noiconColor = config:AddConfigEntry(main, "noIconColor", "toggle", L['Color text'], L['Color text desc'], 7) noiconColor['disabled'] = function(self) if(not db['noIcon']) then return true end end @@ -69,7 +78,7 @@ end}) 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) local ttmenu = config:AddConfigEntry(main, "ttmenu", "group", L['ttmenu_title'], L['ttmenu_desc'], 9, config:GetDefaultHandler(addonTable['events']['PLAYER_MONEY'], db), true) - config:AddConfigEntry(ttmenu, "connectedRealms", "toggle", L['connectedRealms'], nil, 1) + config:AddConfigEntry(ttmenu, "displaySelTT", "select", L['Gesamt'], L['DisplayvalueDesc'], 1, buildDisplayValue) config:AddConfigEntry(ttmenu, "sortDir", "toggle", L['sortDir'], nil, 2) config:AddConfigEntry(ttmenu, "accountMoney", "toggle", L['accountMoney'], L['accountMoneyDesc'], 3) local short = config:AddConfigEntry(ttmenu, "shortMoneyTip", "toggle", L['shortMoneyTip'], nil, 4)