add possibility to exchange the default fonts

This commit is contained in:
shagu
2016-11-08 22:09:13 +01:00
parent e9eb3a0332
commit 41653e445f
23 changed files with 159 additions and 121 deletions
+21 -12
View File
@@ -19,8 +19,22 @@ end
pfUI = CreateFrame("Frame",nil,UIParent)
pfUI:RegisterEvent("ADDON_LOADED")
pfUI:SetScript("OnEvent", function()
--pfUI:RegisterEvent("PLAYER_ENTERING_WORLD")
-- initialize default variables
pfUI.cache = {}
pfUI.module = {}
pfUI.modules = {}
pfUI.environment = {}
pfLocaleClass = {}
pfLocaleBagtypes = {}
pfLocaleShift = {}
pfLocaleSpells = {}
pfLocaleSpellEvents = {}
pfLocaleSpellInterrupts = {}
pfUI:SetScript("OnEvent", function()
pfUI.cache["locale"] = GetLocale()
if pfUI.cache["locale"] ~= "enUS" and
pfUI.cache["locale"] ~= "frFR" and
@@ -35,6 +49,11 @@ pfUI:SetScript("OnEvent", function()
end
pfUI:LoadConfig()
-- reload environment
pfUI.environment:UpdateFonts()
pfUI.environment:UpdateColors()
if arg1 == "pfUI" then
for i,m in pairs(this.modules) do
-- do not load disabled modules
@@ -47,16 +66,6 @@ pfUI:SetScript("OnEvent", function()
end
end)
pfUI.cache = {}
pfUI.module = {}
pfUI.modules = {}
pfLocaleClass = {}
pfLocaleBagtypes = {}
pfLocaleShift = {}
pfLocaleSpells = {}
pfLocaleSpellEvents = {}
pfLocaleSpellInterrupts = {}
function pfUI:RegisterModule(n, f)
pfUI.module[n] = f
table.insert(pfUI.modules, n)
@@ -109,7 +118,6 @@ pfUI.info = CreateFrame("Button", "pfInfoBox", UIParent)
pfUI.info:Hide()
pfUI.info.text = pfUI.info:CreateFontString("Status", "HIGH", "GameFontNormal")
pfUI.info.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\arial.ttf", 14, "OUTLINE")
pfUI.info.text:ClearAllPoints()
pfUI.info.text:SetFontObject(GameFontWhite)
@@ -127,6 +135,7 @@ function pfUI.info:ShowInfoBox(text, time, parent, height)
pfUI.info:ClearAllPoints()
pfUI.info.text:SetAllPoints(pfUI.info)
pfUI.info.text:SetText(text)
pfUI.info.text:SetFont("Interface\\AddOns\\pfUI\\fonts\\" .. pfUI_config.global.font_default .. ".ttf", 14, "OUTLINE")
pfUI.info:SetWidth(pfUI.info.text:GetStringWidth() + 50)
pfUI.info:SetHeight(height)