From 7d77a2fdf05a1bb73d12b6eb2fac4a7a43fd3910 Mon Sep 17 00:00:00 2001 From: shagu Date: Wed, 7 Jun 2017 18:51:26 +0200 Subject: [PATCH] fonts: add option to change unit fontsize --- api/config.lua | 6 ++++-- api/unitframes.lua | 20 ++++++++++---------- env/fonts.lua | 2 +- modules/gui.lua | 7 ++++--- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/api/config.lua b/api/config.lua index ea1e97d1..192f37dd 100644 --- a/api/config.lua +++ b/api/config.lua @@ -27,9 +27,11 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("global", nil, "profile", "default") pfUI:UpdateConfig("global", nil, "pixelperfect", "0") pfUI:UpdateConfig("global", nil, "offscreen", "0") - pfUI:UpdateConfig("global", nil, "font_size", "12") pfUI:UpdateConfig("global", nil, "font_default", "Myriad-Pro") - pfUI:UpdateConfig("global", nil, "font_square", "Homespun") + 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_combat", "Continuum") pfUI:UpdateConfig("global", nil, "force_region", "1") pfUI:UpdateConfig("global", nil, "errors_limit", "1") diff --git a/api/unitframes.lua b/api/unitframes.lua index e8c21022..e73e9bc5 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -89,8 +89,8 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) f.power.bar:SetAllPoints(f.power) f.power.bar:SetMinMaxValues(0, 100) - f.leftText = f:CreateFontString("Status", "OVERLAY", "GameFontNormal") - f.leftText:SetFont(pfUI.font_square, C.global.font_size, "OUTLINE") + f.leftText = f:CreateFontString("Status", "OVERLAY", "GameFontNormalSmall") + f.leftText:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE") f.leftText:SetJustifyH("LEFT") f.leftText:SetFontObject(GameFontWhite) f.leftText:SetParent(f.hp.bar) @@ -98,8 +98,8 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) f.leftText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*default_border, 1) f.leftText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0) - f.rightText = f:CreateFontString("Status", "OVERLAY", "GameFontNormal") - f.rightText:SetFont(pfUI.font_square, C.global.font_size, "OUTLINE") + f.rightText = f:CreateFontString("Status", "OVERLAY", "GameFontNormalSmall") + f.rightText:SetFont(pfUI.font_square, C.global.font_square_size, "OUTLINE") f.rightText:SetJustifyH("RIGHT") f.rightText:SetFontObject(GameFontWhite) f.rightText:SetParent(f.hp.bar) @@ -107,8 +107,8 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick) f.rightText:SetPoint("TOPLEFT",f.hp.bar, "TOPLEFT", 2*default_border, 1) f.rightText:SetPoint("BOTTOMRIGHT",f.hp.bar, "BOTTOMRIGHT", -2*default_border, 0) - f.centerText = f:CreateFontString("Status", "OVERLAY", "GameFontNormal") - f.centerText:SetFont(pfUI.font_square, C.global.font_size, "OUTLINE") + f.centerText = f:CreateFontString("Status", "OVERLAY", "GameFontNormalSmall") + f.centerText:SetFont(pfUI.font_square, C.global.font_square_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_size, "OUTLINE") + f.buffs[i].stacks:SetFont(pfUI.font_square, C.global.font_square_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_size, "OUTLINE") + f.buffs[i].cd:SetFont(pfUI.font_square, C.global.font_square_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_size, "OUTLINE") + f.debuffs[i].stacks:SetFont(pfUI.font_square, C.global.font_square_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_size, "OUTLINE") + f.debuffs[i].cd:SetFont(pfUI.font_square, C.global.font_square_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) diff --git a/env/fonts.lua b/env/fonts.lua index a13b8954..3a7bc6d2 100644 --- a/env/fonts.lua +++ b/env/fonts.lua @@ -14,7 +14,7 @@ function pfUI.environment:UpdateFonts() pfUI.font_square = "Interface\\AddOns\\pfUI\\fonts\\" .. pfUI_config.global.font_square .. ".ttf" else pfUI.font_default = "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf" - pfUI.font_square = "Interface\\AddOns\\pfUI\\fonts\\Homespun.ttf" + pfUI.font_square = "Interface\\AddOns\\pfUI\\fonts\\BigNoodleTitling.ttf" pfUI.font_combat = "Interface\\AddOns\\pfUI\\fonts\\Continuum.ttf" end diff --git a/modules/gui.lua b/modules/gui.lua index 72f8dacf..e087cca9 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -760,10 +760,11 @@ pfUI:RegisterModule("gui", function () pfUI.gui.global = pfUI.gui:CreateConfigTab("General Settings") local values = { "BigNoodleTitling", "Continuum", "DieDieDie", "Expressway", "Homespun", "Myriad-Pro", "PT-Sans-Narrow-Bold", "PT-Sans-Narrow-Regular" } pfUI.gui:CreateConfig(pfUI.gui.global, "Enable Region Compatible Font", C.global, "force_region", "checkbox") - pfUI.gui:CreateConfig(pfUI.gui.global, "General Font", C.global, "font_default", "dropdown", values) - pfUI.gui:CreateConfig(pfUI.gui.global, "Unit Frame & Action Bar Font", C.global, "font_square", "dropdown", values) + 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, "Scrolling Combat Text Font", C.global, "font_combat", "dropdown", values) - pfUI.gui:CreateConfig(pfUI.gui.global, "Font Size", C.global, "font_size") 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") pfUI.gui:CreateConfig(pfUI.gui.global, "Enable Single Line UIErrors", C.global, "errors_limit", "checkbox")