panel: display account-wide gold value on tooltip

This commit is contained in:
Sour
2017-10-17 20:40:40 +02:00
committed by Shagu
parent 2210e6c904
commit bdf66b7ba1
3 changed files with 20 additions and 1 deletions
+16
View File
@@ -260,6 +260,15 @@ pfUI:RegisterModule("panel", function ()
pfUI.panel:OutputPanel("bagspace", freeslots .. " (" .. usedslots .. "/" .. maxslots .. ")", nil, OpenAllBags)
end
function pfUI.panel:WriteGold(group, subgroup, value)
if not pfUI_gold[group] then
pfUI_gold[group] = {}
end
if subgroup then
pfUI_gold[group][subgroup] = value
end
end
-- Update "gold"
function pfUI.panel:UpdateGold ()
local gold = floor(GetMoney()/ 100 / 100)
@@ -284,10 +293,17 @@ pfUI:RegisterModule("panel", function ()
GameTooltip:AddDoubleLine(T["Login"] .. ":", CreateGoldString(pfUI.panel.initMoney))
GameTooltip:AddDoubleLine(T["Now"] .. ":", CreateGoldString(GetMoney()))
GameTooltip:AddDoubleLine("|cffffffff","")
for key in pfUI_gold[GetRealmName()] do
if key ~= UnitName("player") then
GameTooltip:AddDoubleLine(T[key] .. ":", CreateGoldString(pfUI_gold[GetRealmName()][key]))
end
end
GameTooltip:AddDoubleLine("|cffffffff","")
GameTooltip:AddDoubleLine(T["This Session"] .. ":", dmod .. CreateGoldString(math.abs(pfUI.panel.diffMoney)))
GameTooltip:Show()
end
pfUI.panel:WriteGold(GetRealmName(), UnitName("player"), GetMoney())
pfUI.panel:OutputPanel("gold", gold .. "|cffffd700g|r " .. silver .. "|cffc7c7cfs|r " .. copper .. "|cffeda55fc|r", tooltip, OpenAllBags)
end
+3
View File
@@ -25,6 +25,9 @@ pfUI_playerDB = {}
pfUI_config = {}
pfUI_init = {}
pfUI_profiles = {}
if not pfUI_gold then
pfUI_gold = {}
end
-- localization
pfUI_locale = {}
+1 -1
View File
@@ -3,7 +3,7 @@
## Author: Shagu
## Notes: A complete user interface replacement.
## Version: 3.1.2
## SavedVariables: pfUI_profiles
## SavedVariables: pfUI_profiles, pfUI_gold
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
# main