mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-15 09:40:49 +00:00
panel: move gold cache into the global pfUI_cache
This commit is contained in:
+5
-3
@@ -1,4 +1,6 @@
|
|||||||
pfUI:RegisterModule("panel", function()
|
pfUI:RegisterModule("panel", function()
|
||||||
|
-- initialize gold cache if not yet happened
|
||||||
|
pfUI_cache["gold"] = pfUI_cache["gold"] or {}
|
||||||
|
|
||||||
local font = C.panel.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
|
local font = C.panel.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
|
||||||
local font_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
|
local font_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
|
||||||
@@ -241,7 +243,7 @@ pfUI:RegisterModule("panel", function()
|
|||||||
GameTooltip:AddDoubleLine(T["Login"] .. ":", CreateGoldString(pfUI.panel.initMoney))
|
GameTooltip:AddDoubleLine(T["Login"] .. ":", CreateGoldString(pfUI.panel.initMoney))
|
||||||
GameTooltip:AddDoubleLine(T["Now"] .. ":", CreateGoldString(GetMoney()))
|
GameTooltip:AddDoubleLine(T["Now"] .. ":", CreateGoldString(GetMoney()))
|
||||||
GameTooltip:AddDoubleLine("|cffffffff","")
|
GameTooltip:AddDoubleLine("|cffffffff","")
|
||||||
for name, gold in pfUI_gold[GetRealmName()] do
|
for name, gold in pfUI_cache["gold"][GetRealmName()] do
|
||||||
if name ~= UnitName("player") then
|
if name ~= UnitName("player") then
|
||||||
GameTooltip:AddDoubleLine(name .. ":", CreateGoldString(gold))
|
GameTooltip:AddDoubleLine(name .. ":", CreateGoldString(gold))
|
||||||
end
|
end
|
||||||
@@ -261,8 +263,8 @@ pfUI:RegisterModule("panel", function()
|
|||||||
local realm = GetRealmName()
|
local realm = GetRealmName()
|
||||||
local unit = UnitName("player")
|
local unit = UnitName("player")
|
||||||
local money = GetMoney()
|
local money = GetMoney()
|
||||||
pfUI_gold[realm] = pfUI_gold[realm] or {}
|
pfUI_cache["gold"][realm] = pfUI_cache["gold"][realm] or {}
|
||||||
pfUI_gold[realm][unit] = money
|
pfUI_cache["gold"][realm][unit] = money
|
||||||
|
|
||||||
pfUI.panel:OutputPanel("gold", gold .. "|cffffd700g|r " .. silver .. "|cffc7c7cfs|r " .. copper .. "|cffeda55fc|r", widget.Tooltip, OpenAllBags)
|
pfUI.panel:OutputPanel("gold", gold .. "|cffffd700g|r " .. silver .. "|cffc7c7cfs|r " .. copper .. "|cffeda55fc|r", widget.Tooltip, OpenAllBags)
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ pfUI_config = {}
|
|||||||
pfUI_init = {}
|
pfUI_init = {}
|
||||||
pfUI_profiles = {}
|
pfUI_profiles = {}
|
||||||
pfUI_addon_profiles = {}
|
pfUI_addon_profiles = {}
|
||||||
pfUI_gold = {}
|
|
||||||
pfUI_cache = {}
|
pfUI_cache = {}
|
||||||
|
|
||||||
-- localization
|
-- localization
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
## Author: Shagu
|
## Author: Shagu
|
||||||
## Notes: A complete user interface replacement.
|
## Notes: A complete user interface replacement.
|
||||||
## Version: 3.12.0
|
## Version: 3.12.0
|
||||||
## SavedVariables: pfUI_profiles, pfUI_gold, pfUI_addon_profiles, pfUI_cache
|
## SavedVariables: pfUI_profiles, pfUI_addon_profiles, pfUI_cache
|
||||||
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
|
## SavedVariablesPerCharacter: pfUI_config, pfUI_init, pfUI_playerDB
|
||||||
|
|
||||||
# main
|
# main
|
||||||
|
|||||||
Reference in New Issue
Block a user