mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-05 21:20:00 +00:00
core: add option to change unit name font
Allows changing the font of the unit names, PvP ranks and guild names (above players' heads) in the general settings. Requires game restart to be applied.
This commit is contained in:
@@ -41,6 +41,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("global", nil, "font_unit", "Interface\\AddOns\\pfUI\\fonts\\BigNoodleTitling.ttf")
|
||||
pfUI:UpdateConfig("global", nil, "font_unit_size", "12")
|
||||
pfUI:UpdateConfig("global", nil, "font_unit_style", "OUTLINE")
|
||||
pfUI:UpdateConfig("global", nil, "font_unit_name", "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf")
|
||||
pfUI:UpdateConfig("global", nil, "font_combat", "Interface\\AddOns\\pfUI\\fonts\\Continuum.ttf")
|
||||
|
||||
pfUI:UpdateConfig("global", nil, "force_region", "1")
|
||||
|
||||
@@ -1453,6 +1453,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
||||
CreateConfig(nil, T["Enable Region Compatible Font"], C.global, "force_region", "checkbox")
|
||||
CreateConfig(nil, T["Standard Text Font"], C.global, "font_default", "dropdown", pfUI.gui.dropdowns.fonts)
|
||||
CreateConfig(nil, T["Standard Text Font Size"], C.global, "font_size")
|
||||
CreateConfig(nil, T["Unit Name Font"], C.global, "font_unit_name", "dropdown", pfUI.gui.dropdowns.fonts)
|
||||
CreateConfig(nil, T["Scrolling Combat Text Font"], C.global, "font_combat", "dropdown", combatfonts)
|
||||
CreateConfig(U["pixelperfect"], T["Enable UI-Scale"], C.global, "pixelperfect", "dropdown", pfUI.gui.dropdowns.scaling)
|
||||
CreateConfig(nil, T["Enable Offscreen Frame Positions"], C.global, "offscreen", "checkbox")
|
||||
|
||||
@@ -118,7 +118,7 @@ function pfUI:UpdateFonts()
|
||||
if not pfUI_config or not pfUI_config.global then return end
|
||||
|
||||
-- load font configuration
|
||||
local default, unit, combat
|
||||
local default, unit, unit_name, combat
|
||||
if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "vanilla" then
|
||||
-- force locale compatible fonts
|
||||
default = "Fonts\\FZXHLJW.TTF"
|
||||
@@ -139,12 +139,14 @@ function pfUI:UpdateFonts()
|
||||
default = pfUI.media[pfUI_config.global.font_default]
|
||||
combat = pfUI.media[pfUI_config.global.font_combat]
|
||||
unit = pfUI.media[pfUI_config.global.font_unit]
|
||||
unit_name = pfUI.media[pfUI_config.global.font_unit_name]
|
||||
end
|
||||
|
||||
-- write setting shortcuts
|
||||
pfUI.font_default = default
|
||||
pfUI.font_combat = combat
|
||||
pfUI.font_unit = unit
|
||||
pfUI.font_unit_name = unit_name
|
||||
|
||||
-- skip setting fonts, keep blizzard defaults
|
||||
if pfUI_config.global.font_blizzard == "1" then
|
||||
@@ -155,7 +157,7 @@ function pfUI:UpdateFonts()
|
||||
STANDARD_TEXT_FONT = default
|
||||
DAMAGE_TEXT_FONT = combat
|
||||
NAMEPLATE_FONT = default
|
||||
UNIT_NAME_FONT = default
|
||||
UNIT_NAME_FONT = unit_name
|
||||
|
||||
-- set dropdown font to default size
|
||||
UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = 11
|
||||
|
||||
Reference in New Issue
Block a user