From c939f8b322e87eec3adc2b0f9fd40d1b73f52841 Mon Sep 17 00:00:00 2001 From: shagu Date: Mon, 10 Jun 2019 13:19:48 +0200 Subject: [PATCH] core: use media mechanism for configurable paths --- api/unitframes.lua | 6 +++--- modules/actionbar.lua | 2 +- modules/castbar.lua | 2 +- modules/nameplates.lua | 2 +- modules/screenshot.lua | 2 +- modules/thirdparty.lua | 2 +- pfUI.lua | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 7ff0ceef..32df0540 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -232,7 +232,7 @@ function pfUI.uf:UpdateConfig() if tonumber(f.config.height) < 0 then f.hp:Hide() end pfUI.api.CreateBackdrop(f.hp, default_border) - f.hp.bar:SetStatusBarTexture(f.config.bartexture) + f.hp.bar:SetStatusBarTexture(pfUI.media[f.config.bartexture]) f.hp.bar:SetAllPoints(f.hp) if f.config.verticalbar == "1" then f.hp.bar:SetOrientation("VERTICAL") @@ -258,7 +258,7 @@ function pfUI.uf:UpdateConfig() if tonumber(f.config.pheight) < 0 then f.power:Hide() end pfUI.api.CreateBackdrop(f.power, default_border) - f.power.bar:SetStatusBarTexture(f.config.bartexture) + f.power.bar:SetStatusBarTexture(pfUI.media[f.config.bartexture]) f.power.bar:SetAllPoints(f.power) f.portrait:SetFrameStrata("LOW") @@ -321,7 +321,7 @@ function pfUI.uf:UpdateConfig() end if f.config.hitindicator == "1" then - f.feedbackText:SetFont(f.config.hitindicatorfont, f.config.hitindicatorsize, "OUTLINE") + f.feedbackText:SetFont(pfUI.media[f.config.hitindicatorfont], f.config.hitindicatorsize, "OUTLINE") f.feedbackFontHeight = f.config.hitindicatorsize f.feedbackStartTime = GetTime() if f.config.portrait == "bar" or f.config.portrait == "off" then diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 5428f9b0..5a883308 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -512,7 +512,7 @@ pfUI:RegisterModule("actionbar", 20400, function () local function CreateActionButton(parent, bar, button) -- load config local size = C.bars["bar"..bar].icon_size - local font = C.bars.font + local font = pfUI.media[C.bars.font] local font_offset = tonumber(C.bars.font_offset) local macro_size = tonumber(C.bars.macro_size) diff --git a/modules/castbar.lua b/modules/castbar.lua index ee550e07..391ce5a6 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -7,7 +7,7 @@ pfUI:RegisterModule("castbar", 20400, function () default_border = C.appearance.border.unitframes end - local cbtexture = C.appearance.castbar.texture + local cbtexture = pfUI.media[C.appearance.castbar.texture] local function CreateCastbar(name, parent, unitstr, unitname) local cb = CreateFrame("Frame", name, parent or UIParent) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 62a4568e..616aaef9 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -3,7 +3,7 @@ pfUI:RegisterModule("nameplates", 20400, function () local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size local inactive_alpha = tonumber(C.nameplates.notargalpha) local glowr, glowg, glowb, glowa = GetStringColor(C.nameplates.glowcolor) - local hptexture = C.nameplates.healthtexture + local hptexture = pfUI.media[C.nameplates.healthtexture] pfUI.nameplates = CreateFrame("Frame", nil, UIParent) diff --git a/modules/screenshot.lua b/modules/screenshot.lua index 74fb4503..ccaa4568 100644 --- a/modules/screenshot.lua +++ b/modules/screenshot.lua @@ -22,7 +22,7 @@ pfUI:RegisterModule("screenshot", function () pfUI.screenshot.caption:SetWidth(400) pfUI.screenshot.caption:SetHeight(200) pfUI.screenshot.caption.text = pfUI.screenshot.caption:CreateFontString("Label", "OVERLAY") - pfUI.screenshot.caption.text:SetFont(C.screenshot.caption_font, C.screenshot.caption_size, "THICKOUTLINE") + pfUI.screenshot.caption.text:SetFont(pfUI.media[C.screenshot.caption_font], C.screenshot.caption_size, "THICKOUTLINE") pfUI.screenshot.caption.text:SetAllPoints(pfUI.screenshot.caption) pfUI.screenshot.caption.text:SetJustifyH("CENTER") pfUI.screenshot.caption.text:SetJustifyV("TOP") diff --git a/modules/thirdparty.lua b/modules/thirdparty.lua index 8c239e11..825cf172 100644 --- a/modules/thirdparty.lua +++ b/modules/thirdparty.lua @@ -741,7 +741,7 @@ pfUI:RegisterModule("thirdparty", function () -- set pfUI bar font if TheoryCraft_Settings then - TheoryCraft_Settings["FontPath"] = C.bars.font + TheoryCraft_Settings["FontPath"] = pfUI.media[C.bars.font] end if not pfUI.bars then return end diff --git a/pfUI.lua b/pfUI.lua index 4df1ba50..9ea58473 100644 --- a/pfUI.lua +++ b/pfUI.lua @@ -122,9 +122,9 @@ function pfUI:UpdateFonts() unit = "Fonts\\2002.TTF" else -- use default entries - default = pfUI_config.global.font_default - combat = pfUI_config.global.font_combat - unit = pfUI_config.global.font_unit + default = pfUI.media[pfUI_config.global.font_default] + combat = pfUI.media[pfUI_config.global.font_combat] + unit = pfUI.media[pfUI_config.global.font_unit] end -- write setting shortcuts