Commit c530a0bd authored by Simpy's avatar Simpy 🐹
Browse files

font outline wasn't updating when changing it without a reload, this fixes...

font outline wasn't updating when changing it without a reload, this fixes that and corrects mono not applying to system fonts as it should, also adds the other 2 mono styles in case someone wants them
parent ef66611d
......@@ -480,7 +480,7 @@ end
function E:UpdateFontTemplates()
for text in pairs(E.texts) do
if text then
text:FontTemplate(text.font, text.fontSize, text.fontStyle)
text:FontTemplate(text.font, text.fontSize, text.fontStyle, true)
else
E.texts[text] = nil
end
......
......@@ -2,6 +2,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
local LSM = E.Libs.LSM
local _G = _G
local strmatch = strmatch
local function SetFont(obj, font, size, style, sr, sg, sb, sa, sox, soy, r, g, b)
obj:SetFont(font, size, style)
......@@ -11,38 +12,20 @@ local function SetFont(obj, font, size, style, sr, sg, sb, sa, sox, soy, r, g, b
elseif r then obj:SetAlpha(r) end
end
local chatFontHeights = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
function E:UpdateBlizzardFonts()
local NORMAL = E.media.normFont
local NUMBER = E.media.normFont
local COMBAT = LSM:Fetch('font', E.private.general.dmgfont)
local NAMEFONT = LSM:Fetch('font', E.private.general.namefont)
local BUBBLE = LSM:Fetch('font', E.private.general.chatBubbleFont)
local SHADOWCOLOR = _G.SHADOWCOLOR
local NORMALOFFSET = _G.NORMALOFFSET
local BIGOFFSET = _G.BIGOFFSET
local MONOCHROME = ''
_G.CHAT_FONT_HEIGHTS = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
if E.db.general.font == 'Homespun' then
MONOCHROME = 'MONOCHROME'
end
if E.eyefinity then
-- set an invisible font for xp, honor kill, etc
COMBAT = E.Media.Fonts.Invisible
end
if E.private.general.replaceNameFont then
_G.UNIT_NAME_FONT = NAMEFONT
end
if E.private.general.replaceCombatFont then
_G.DAMAGE_TEXT_FONT = COMBAT
-- No matter what we do here with the Combat Font, the player Combat Font will always looks like shit, so just dont touch it.
--SetFont(_G.CombatTextFont, COMBAT, 200, 'OUTLINE') -- number here just increase the font quality.
end
local MONOCHROME = strmatch(E.db.general.fontStyle, 'MONOCHROME') and 'MONOCHROME' or ''
_G.CHAT_FONT_HEIGHTS = chatFontHeights
if E.eyefinity then COMBAT = E.Media.Fonts.Invisible end -- set an invisible font for xp, honor kill, etc
if E.private.general.replaceNameFont then _G.UNIT_NAME_FONT = NAMEFONT end
if E.private.general.replaceCombatFont then _G.DAMAGE_TEXT_FONT = COMBAT end
if E.private.general.replaceBlizzFonts then
--_G.NAMEPLATE_FONT = NAMEFONT
_G.STANDARD_TEXT_FONT = NORMAL
......@@ -53,7 +36,7 @@ function E:UpdateBlizzardFonts()
SetFont(_G.BossEmoteNormalHuge, NORMAL, 24) -- Talent Title
SetFont(_G.ChatBubbleFont, BUBBLE, E.private.general.chatBubbleFontSize, E.private.general.chatBubbleFontOutline)
SetFont(_G.CoreAbilityFont, NORMAL, 26) -- Core abilities(title)
SetFont(_G.DestinyFontHuge, NORMAL, 32, nil, SHADOWCOLOR, BIGOFFSET) -- Garrison Mission Report
SetFont(_G.DestinyFontHuge, NORMAL, 32) -- Garrison Mission Report
SetFont(_G.DestinyFontMed, NORMAL, 14) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy12Font, NORMAL, 12) -- Added in 7.3.5 used for ?
SetFont(_G.Fancy14Font, NORMAL, 14) -- Added in 7.3.5 used for ?
......@@ -73,11 +56,11 @@ function E:UpdateBlizzardFonts()
SetFont(_G.Game42Font, NORMAL, 42) -- PVP Stuff
SetFont(_G.Game46Font, NORMAL, 46) -- Added in 7.3.5 used for ?
SetFont(_G.Game48Font, NORMAL, 48)
SetFont(_G.Game48FontShadow, NORMAL, 48, nil, SHADOWCOLOR, BIGOFFSET)
SetFont(_G.Game48FontShadow, NORMAL, 48)
SetFont(_G.Game60Font, NORMAL, 60)
SetFont(_G.Game72Font, NORMAL, 72)
SetFont(_G.Game120Font, NORMAL, 120)
SetFont(_G.GameFont_Gigantic, NORMAL, 32, nil, SHADOWCOLOR, BIGOFFSET) -- Used at the install steps
SetFont(_G.GameFont_Gigantic, NORMAL, 32) -- Used at the install steps
SetFont(_G.GameFontHighlightMedium, NORMAL, 15) -- Fix QuestLog Title mouseover
SetFont(_G.GameFontHighlightSmall2, NORMAL, E.db.general.fontSize) -- Skill or Recipe description on TradeSkill frame
SetFont(_G.GameFontNormalHuge2, NORMAL, 24) -- Mythic weekly best dungeon name
......@@ -104,12 +87,12 @@ function E:UpdateBlizzardFonts()
SetFont(_G.PVPArenaTextString, NORMAL, 22, MONOCHROME..'OUTLINE')
SetFont(_G.PVPInfoTextString, NORMAL, 22, MONOCHROME..'OUTLINE')
SetFont(_G.QuestFont, NORMAL, E.db.general.fontSize)
SetFont(_G.QuestFont_Enormous, NORMAL, 24, nil, SHADOWCOLOR, NORMALOFFSET) -- Garrison Titles
SetFont(_G.QuestFont_Huge, NORMAL, 15, nil, SHADOWCOLOR, BIGOFFSET) -- Quest rewards title(Rewards)
SetFont(_G.QuestFont_Enormous, NORMAL, 24) -- Garrison Titles
SetFont(_G.QuestFont_Huge, NORMAL, 15) -- Quest rewards title(Rewards)
SetFont(_G.QuestFont_Large, NORMAL, 14)
SetFont(_G.QuestFont_Shadow_Huge, NORMAL, 15, nil, SHADOWCOLOR, NORMALOFFSET) -- Quest Title
SetFont(_G.QuestFont_Shadow_Small, NORMAL, 14, nil, SHADOWCOLOR, NORMALOFFSET)
SetFont(_G.QuestFont_Super_Huge, NORMAL, 22, nil, SHADOWCOLOR, BIGOFFSET)
SetFont(_G.QuestFont_Shadow_Huge, NORMAL, 15) -- Quest Title
SetFont(_G.QuestFont_Shadow_Small, NORMAL, 14)
SetFont(_G.QuestFont_Super_Huge, NORMAL, 22)
SetFont(_G.ReputationDetailFont, NORMAL, E.db.general.fontSize) -- Rep Desc when clicking a rep
SetFont(_G.SubZoneTextFont, NORMAL, 24, MONOCHROME..'OUTLINE') -- World Map(SubZone)
SetFont(_G.SubZoneTextString, NORMAL, 25, MONOCHROME..'OUTLINE')
......@@ -123,7 +106,7 @@ function E:UpdateBlizzardFonts()
SetFont(_G.SystemFont_OutlineThick_Huge2, NORMAL, 20, MONOCHROME..'THICKOUTLINE')
SetFont(_G.SystemFont_OutlineThick_WTF, NORMAL, 32, MONOCHROME..'OUTLINE') -- World Map
SetFont(_G.SystemFont_Shadow_Huge1, NORMAL, 20, MONOCHROME..'OUTLINE') -- Raid Warning, Boss emote frame too
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 22, nil, SHADOWCOLOR, BIGOFFSET) -- FlightMap
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 22) -- FlightMap
SetFont(_G.SystemFont_Shadow_Large, NORMAL, 15)
SetFont(_G.SystemFont_Shadow_Large2, NORMAL, 18) -- Auction House ItemDisplay
SetFont(_G.SystemFont_Shadow_Large_Outline, NUMBER, 20, 'OUTLINE')
......
......@@ -397,9 +397,12 @@ local function StripTexts(object, kill, alpha)
StripType(STRIP_FONT, object, kill, alpha)
end
local function FontTemplate(fs, font, size, style)
fs.font, fs.fontSize, fs.fontStyle = font or E.media.normFont, size or E.db.general.fontSize, style or E.db.general.fontStyle
fs:SetFont(fs.font, fs.fontSize, fs.fontStyle)
local function FontTemplate(fs, font, size, style, skip)
if not skip then -- ignore updates from UpdateFontTemplates
fs.font, fs.fontSize, fs.fontStyle = font, size, style
end
fs:SetFont(font or E.media.normFont, size or E.db.general.fontSize, style or E.db.general.fontStyle)
if style == 'NONE' then
fs:SetShadowOffset(1, -0.5)
......
......@@ -9,7 +9,14 @@ local C, L = Engine[1], Engine[2]
local _G, format, sort, tinsert, strmatch = _G, format, sort, tinsert, strmatch
C.Values = {
FontFlags = { NONE = L["NONE"], OUTLINE = 'OUTLINE', MONOCHROMEOUTLINE = 'MONOCROMEOUTLINE', THICKOUTLINE = 'THICKOUTLINE' },
FontFlags = {
NONE = L["NONE"],
OUTLINE = 'Outline',
THICKOUTLINE = 'Thick',
MONOCHROME = '|cffaaaaaaMono|r',
MONOCHROMEOUTLINE = '|cffaaaaaaMono|r Outline',
MONOCHROMETHICKOUTLINE = '|cffaaaaaaMono|r Thick',
},
FontSize = { min = 8, max = 64, step = 1 },
Strata = { BACKGROUND = 'BACKGROUND', LOW = 'LOW', MEDIUM = 'MEDIUM', HIGH = 'HIGH', DIALOG = 'DIALOG', TOOLTIP = 'TOOLTIP' },
GrowthDirection = {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment