mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 18:36:01 +00:00
fonts: integrate upgrade paths
This commit is contained in:
+14
-5
@@ -29,8 +29,8 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("global", nil, "offscreen", "0")
|
||||
pfUI:UpdateConfig("global", nil, "font_default", "Myriad-Pro")
|
||||
pfUI:UpdateConfig("global", nil, "font_size", "12")
|
||||
pfUI:UpdateConfig("global", nil, "font_square", "BigNoodleTitling")
|
||||
pfUI:UpdateConfig("global", nil, "font_square_size", "12")
|
||||
pfUI:UpdateConfig("global", nil, "font_unit", "BigNoodleTitling")
|
||||
pfUI:UpdateConfig("global", nil, "font_unit_size", "12")
|
||||
|
||||
pfUI:UpdateConfig("global", nil, "font_combat", "Continuum")
|
||||
pfUI:UpdateConfig("global", nil, "force_region", "1")
|
||||
@@ -393,7 +393,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("bars", "shapeshift", "formfactor", "10 x 1")
|
||||
pfUI:UpdateConfig("bars", "pet", "formfactor", "10 x 1")
|
||||
|
||||
pfUI:UpdateConfig("panel", nil, "use_unitfonts", "1")
|
||||
pfUI:UpdateConfig("panel", nil, "use_unitfonts", "0")
|
||||
pfUI:UpdateConfig("panel", "left", "left", "guild")
|
||||
pfUI:UpdateConfig("panel", "left", "center", "durability")
|
||||
pfUI:UpdateConfig("panel", "left", "right", "friends")
|
||||
@@ -406,7 +406,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("castbar", "player", "hide_blizz", "1")
|
||||
pfUI:UpdateConfig("castbar", "player", "hide_pfui", "0")
|
||||
pfUI:UpdateConfig("castbar", "target", "hide_pfui", "0")
|
||||
pfUI:UpdateConfig("castbar", nil, "use_unitfonts", "1")
|
||||
pfUI:UpdateConfig("castbar", nil, "use_unitfonts", "0")
|
||||
|
||||
pfUI:UpdateConfig("tooltip", nil, "position", "bottom")
|
||||
pfUI:UpdateConfig("tooltip", nil, "extguild", "1")
|
||||
@@ -439,7 +439,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("chat", "global", "fadeout", "0")
|
||||
pfUI:UpdateConfig("chat", "global", "fadetime", "300")
|
||||
|
||||
pfUI:UpdateConfig("nameplates", nil, "use_unitfonts", "1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "use_unitfonts", "0")
|
||||
pfUI:UpdateConfig("nameplates", nil, "showcastbar", "1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "spellname", "0")
|
||||
pfUI:UpdateConfig("nameplates", nil, "showdebuffs", "0")
|
||||
@@ -540,5 +540,14 @@ function pfUI:MigrateConfig()
|
||||
end
|
||||
end
|
||||
|
||||
-- migrating to new fontnames (> 2.6)
|
||||
if major <= 2 and minor <= 6 then
|
||||
-- migrate font_combat
|
||||
if pfUI_config.global.font_square then
|
||||
pfUI_config.global.font_unit = pfUI_config.global.font_square
|
||||
pfUI_config.global.font_square = nil
|
||||
end
|
||||
end
|
||||
|
||||
pfUI_config.version = pfUI.version.string
|
||||
end
|
||||
|
||||
+7
-7
@@ -90,7 +90,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
||||
f.power.bar:SetMinMaxValues(0, 100)
|
||||
|
||||
f.leftText = f:CreateFontString("Status", "OVERLAY", "GameFontNormalSmall")
|
||||
f.leftText:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.leftText:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.leftText:SetJustifyH("LEFT")
|
||||
f.leftText:SetFontObject(GameFontWhite)
|
||||
f.leftText:SetParent(f.hp.bar)
|
||||
@@ -99,7 +99,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
||||
f.leftText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0)
|
||||
|
||||
f.rightText = f:CreateFontString("Status", "OVERLAY", "GameFontNormalSmall")
|
||||
f.rightText:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.rightText:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.rightText:SetJustifyH("RIGHT")
|
||||
f.rightText:SetFontObject(GameFontWhite)
|
||||
f.rightText:SetParent(f.hp.bar)
|
||||
@@ -108,7 +108,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
||||
f.rightText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0)
|
||||
|
||||
f.centerText = f:CreateFontString("Status", "OVERLAY", "GameFontNormalSmall")
|
||||
f.centerText:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.centerText:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.centerText:SetJustifyH("CENTER")
|
||||
f.centerText:SetFontObject(GameFontWhite)
|
||||
f.centerText:SetParent(f.hp.bar)
|
||||
@@ -346,14 +346,14 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
||||
f.buffs[i]:SetID(i)
|
||||
|
||||
f.buffs[i].stacks = f.buffs[i]:CreateFontString(nil, "OVERLAY", f.buffs[i])
|
||||
f.buffs[i].stacks:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.buffs[i].stacks:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.buffs[i].stacks:SetPoint("BOTTOMRIGHT", f.buffs[i], 2, -2)
|
||||
f.buffs[i].stacks:SetJustifyH("LEFT")
|
||||
f.buffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
f.buffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
f.buffs[i].stacks:SetTextColor(1,1,.5)
|
||||
f.buffs[i].cd = f.buffs[i]:CreateFontString(nil, "OVERLAY", f.buffs[i])
|
||||
f.buffs[i].cd:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.buffs[i].cd:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.buffs[i].cd:SetPoint("CENTER", f.buffs[i], 0, 0)
|
||||
f.buffs[i].cd:SetJustifyH("LEFT")
|
||||
f.buffs[i].cd:SetShadowColor(0, 0, 0)
|
||||
@@ -434,14 +434,14 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
|
||||
f.debuffs[i] = CreateFrame("Button", "pfUI" .. f.fname .. "Debuff" .. i, f)
|
||||
f.debuffs[i]:SetID(i)
|
||||
f.debuffs[i].stacks = f.debuffs[i]:CreateFontString(nil, "OVERLAY", f.debuffs[i])
|
||||
f.debuffs[i].stacks:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.debuffs[i].stacks:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.debuffs[i].stacks:SetPoint("BOTTOMRIGHT", f.debuffs[i], 2, -2)
|
||||
f.debuffs[i].stacks:SetJustifyH("LEFT")
|
||||
f.debuffs[i].stacks:SetShadowColor(0, 0, 0)
|
||||
f.debuffs[i].stacks:SetShadowOffset(0.8, -0.8)
|
||||
f.debuffs[i].stacks:SetTextColor(1,1,.5)
|
||||
f.debuffs[i].cd = f.debuffs[i]:CreateFontString(nil, "OVERLAY", f.debuffs[i])
|
||||
f.debuffs[i].cd:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
f.debuffs[i].cd:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
f.debuffs[i].cd:SetPoint("CENTER", f.debuffs[i], 0, 0)
|
||||
f.debuffs[i].cd:SetJustifyH("LEFT")
|
||||
f.debuffs[i].cd:SetShadowColor(0, 0, 0)
|
||||
|
||||
Vendored
+6
-6
@@ -9,12 +9,12 @@ end
|
||||
|
||||
function pfUI.environment:UpdateFonts()
|
||||
if pfUI_config and pfUI_config.global and pfUI_config.global.font_default then
|
||||
pfUI.font_default = "Interface\\AddOns\\pfUI\\fonts\\" .. pfUI_config.global.font_default .. ".ttf"
|
||||
pfUI.font_combat = "Interface\\AddOns\\pfUI\\fonts\\" .. pfUI_config.global.font_combat .. ".ttf"
|
||||
pfUI.font_square = "Interface\\AddOns\\pfUI\\fonts\\" .. pfUI_config.global.font_square .. ".ttf"
|
||||
pfUI.font_default = "Interface\\AddOns\\pfUI\\fonts\\" .. (pfUI_config.global.font_default or "Myriad-Pro") .. ".ttf"
|
||||
pfUI.font_unit = "Interface\\AddOns\\pfUI\\fonts\\" .. (pfUI_config.global.font_unit or "BigNoodleTitling") .. ".ttf"
|
||||
pfUI.font_combat = "Interface\\AddOns\\pfUI\\fonts\\" .. (pfUI_config.global.font_combat or "Continuum") .. ".ttf"
|
||||
else
|
||||
pfUI.font_default = "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf"
|
||||
pfUI.font_square = "Interface\\AddOns\\pfUI\\fonts\\BigNoodleTitling.ttf"
|
||||
pfUI.font_unit = "Interface\\AddOns\\pfUI\\fonts\\BigNoodleTitling.ttf"
|
||||
pfUI.font_combat = "Interface\\AddOns\\pfUI\\fonts\\Continuum.ttf"
|
||||
end
|
||||
|
||||
@@ -23,11 +23,11 @@ function pfUI.environment:UpdateFonts()
|
||||
if GetLocale() == "zhCN" then
|
||||
pfUI.font_default = "Fonts\\FZXHLJW.TTF"
|
||||
pfUI.font_combat = "Fonts\\FZXHLJW.TTF"
|
||||
pfUI.font_square = "Fonts\\FZXHLJW.TTF"
|
||||
pfUI.font_unit = "Fonts\\FZXHLJW.TTF"
|
||||
elseif GetLocale() == "koKR" then
|
||||
pfUI.font_default = "Fonts\\2002.TTF"
|
||||
pfUI.font_combat = "Fonts\\2002.TTF"
|
||||
pfUI.font_square = "Fonts\\2002.TTF"
|
||||
pfUI.font_unit = "Fonts\\2002.TTF"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
|
||||
local hotkey = _G["ShapeshiftButton"..i..'HotKey']
|
||||
hotkey:SetAllPoints(button)
|
||||
hotkey:SetFont(pfUI.font_square, C.global.font_square_size -2, "OUTLINE")
|
||||
hotkey:SetFont(pfUI.font_unit, C.global.font_unit_size -2, "OUTLINE")
|
||||
hotkey:SetJustifyH("RIGHT")
|
||||
hotkey:SetJustifyV("TOP")
|
||||
end
|
||||
@@ -520,7 +520,7 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
local hotkey = _G[actionbutton..i..'HotKey']
|
||||
if C.bars.showkeybind == "1" then
|
||||
hotkey:SetAllPoints(button)
|
||||
hotkey:SetFont(pfUI.font_square, C.global.font_square_size -2, "OUTLINE")
|
||||
hotkey:SetFont(pfUI.font_unit, C.global.font_unit_size -2, "OUTLINE")
|
||||
hotkey:SetJustifyH("RIGHT")
|
||||
hotkey:SetJustifyV("TOP")
|
||||
else
|
||||
@@ -530,7 +530,7 @@ pfUI:RegisterModule("actionbar", function ()
|
||||
local name = _G[actionbutton..i..'Name']
|
||||
if C.bars.showmacro == "1" then
|
||||
name:SetAllPoints(button)
|
||||
name:SetFont(pfUI.font_square, C.global.font_square_size -2, "OUTLINE")
|
||||
name:SetFont(pfUI.font_unit, C.global.font_unit_size -2, "OUTLINE")
|
||||
name:SetJustifyH("CENTER")
|
||||
name:SetJustifyV("BOTTOM")
|
||||
else
|
||||
|
||||
+1
-1
@@ -291,7 +291,7 @@ pfUI:RegisterModule("bags", function ()
|
||||
end
|
||||
|
||||
local count = _G[pfUI.bags[bag].slots[slot].frame:GetName() .. "Count"]
|
||||
count:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
count:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
count:SetAllPoints()
|
||||
count:SetJustifyH("RIGHT")
|
||||
count:SetJustifyV("BOTTOM")
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
pfUI:RegisterModule("castbar", function ()
|
||||
|
||||
local font = C.castbar.use_unitfonts == "1" and pfUI.font_square or pfUI.font_default
|
||||
local font_size = C.castbar.use_unitfonts == "1" and C.global.font_square_size or C.global.font_size
|
||||
local font = C.castbar.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
|
||||
local font_size = C.castbar.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
|
||||
|
||||
local default_border = C.appearance.border.default
|
||||
if C.appearance.border.unitframes ~= "-1" then
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ pfUI:RegisterModule("chat", function ()
|
||||
"and world channels and lootinformation to the right chat.")
|
||||
end
|
||||
|
||||
local panelfont = C.panel.use_unitfonts == "1" and pfUI.font_square or pfUI.font_default
|
||||
local panelfont_size = C.panel.use_unitfonts == "1" and C.global.font_square_size or C.global.font_size
|
||||
local panelfont = C.panel.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
|
||||
local panelfont_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
|
||||
|
||||
local default_border = C.appearance.border.default
|
||||
if C.appearance.border.chat ~= "-1" then
|
||||
|
||||
@@ -13,7 +13,7 @@ pfUI:RegisterModule("cooldown", function ()
|
||||
cooldown.cd:SetFrameLevel(cooldown.cd:GetFrameLevel() + 1)
|
||||
|
||||
cooldown.cd.text = cooldown.cd:CreateFontString("pfCooldownFrameText", "OVERLAY")
|
||||
cooldown.cd.text:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE")
|
||||
cooldown.cd.text:SetFont(pfUI.font_unit, C.global.font_unit_size, "OUTLINE")
|
||||
cooldown.cd.text:SetPoint("CENTER", cooldown.cd, "CENTER", 0, 1)
|
||||
|
||||
cooldown.cd:SetScript("OnUpdate", function()
|
||||
|
||||
+2
-2
@@ -762,8 +762,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Enable Region Compatible Font", C.global, "force_region", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Text Font", C.global, "font_default", "dropdown", values)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Text Font Size", C.global, "font_size")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Unit Frame Font", C.global, "font_square", "dropdown", values)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Unit Frame Size", C.global, "font_square_size")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Unit Frame Font", C.global, "font_unit", "dropdown", values)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Unit Frame Size", C.global, "font_unit_size")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Scrolling Combat Text Font", C.global, "font_combat", "dropdown", values)
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Enable Pixel Perfect (Native Resolution)", C.global, "pixelperfect", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Enable Offscreen Frame Positions", C.global, "offscreen", "checkbox")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
pfUI:RegisterModule("nameplates", function ()
|
||||
local font = C.nameplates.use_unitfonts == "1" and pfUI.font_square or pfUI.font_default
|
||||
local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_square_size or C.global.font_size
|
||||
local font = C.nameplates.use_unitfonts == "1" and pfUI.font_unit or pfUI.font_default
|
||||
local font_size = C.nameplates.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
|
||||
|
||||
pfUI.nameplates = CreateFrame("Frame", nil, UIParent)
|
||||
pfUI.nameplates.mobs = {}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
pfUI:RegisterModule("panel", function ()
|
||||
|
||||
local font = C.panel.use_unitfonts == "1" and pfUI.font_square or pfUI.font_default
|
||||
local font_size = C.panel.use_unitfonts == "1" and C.global.font_square_size or C.global.font_size
|
||||
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 default_border = C.appearance.border.default
|
||||
if C.appearance.border.panels ~= "-1" then
|
||||
|
||||
Reference in New Issue
Block a user