diff --git a/Core/Defaults.lua b/Core/Defaults.lua index 523a147..85a87bf 100755 --- a/Core/Defaults.lua +++ b/Core/Defaults.lua @@ -20,6 +20,7 @@ local Defaults = { Fonts = { Font = "Friz Quadrata TT", FontFlag = "OUTLINE", + Colour = {1, 1, 1}, Shadow = { Enabled = false, Colour = {0, 0, 0, 1}, @@ -114,6 +115,8 @@ local Defaults = { }, }, CooldownText = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 15, Colour = {1, 1, 1}, Layout = {"CENTER", "CENTER", 0, 0}, @@ -128,6 +131,8 @@ local Defaults = { CenterHorizontally = false, Layout = {"CENTER", "CENTER", 0, -275.1}, Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 15, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 3} @@ -141,6 +146,8 @@ local Defaults = { CenterHorizontally = false, Layout = {"TOP", "EssentialCooldownViewer", "BOTTOM", 0, -1.1}, Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 15, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 3} @@ -154,6 +161,8 @@ local Defaults = { CenterBuffs = false, Layout = {"BOTTOM", "BCDM_SecondaryPowerBar", "TOP", 0, 1.1}, Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 15, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 3} @@ -198,6 +207,8 @@ local Defaults = { Spacing = 1, GrowthDirection = "RIGHT", Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2} @@ -294,6 +305,8 @@ local Defaults = { Spacing = 1, GrowthDirection = "RIGHT", Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2} @@ -392,6 +405,8 @@ local Defaults = { OffsetByParentHeight = true, HideZeroCharges = false, Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2} @@ -409,6 +424,13 @@ local Defaults = { Spacing = 1, GrowthDirection = "LEFT", OffsetByParentHeight = true, + Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", + FontSize = 15, + Colour = {1, 1, 1}, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 3} + }, }, ItemSpell = { IconSize = 38, @@ -422,6 +444,8 @@ local Defaults = { OffsetByParentHeight = true, HideZeroCharges = false, Text = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2} @@ -444,6 +468,8 @@ local Defaults = { Layout = {"BOTTOM", "EssentialCooldownViewer", "TOP", 0, 1}, Text = { Enabled = true, + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 18, Colour = {1, 1, 1}, Layout = {"BOTTOM", "BOTTOM", 0, 1} @@ -467,6 +493,8 @@ local Defaults = { Layout = {"BOTTOM", "BCDM_PowerBar", "TOP", 0, 1}, Text = { Enabled = false, + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"CENTER", "CENTER", 0, 0}, @@ -485,12 +513,16 @@ local Defaults = { Layout = {"TOP", "UtilityCooldownViewer", "BOTTOM", 0, -1}, Text = { SpellName = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"LEFT", "LEFT", 3, 0}, MaxCharacters = 12, }, CastTime = { + Font = "Friz Quadrata TT", + FontFlag = "OUTLINE", FontSize = 12, Colour = {1, 1, 1}, Layout = {"RIGHT", "RIGHT", -3, 0} diff --git a/Core/GUI.lua b/Core/GUI.lua index 18029ff..7b3e755 100755 --- a/Core/GUI.lua +++ b/Core/GUI.lua @@ -499,6 +499,27 @@ local function CreateCooldownTextSettings(containerParent) cooldownTextContainer:SetLayout("Flow") containerParent:AddChild(cooldownTextContainer) + local fontDropdown = AG:Create("LSM30_Font") + fontDropdown:SetLabel(LL("Font")) + fontDropdown:SetList(LSM:HashTable("font")) + fontDropdown:SetValue(CooldownTextDB.Font or BCDM.db.profile.General.Fonts.Font) + fontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) CooldownTextDB.Font = value BCDM:UpdateCooldownViewers() end) + fontDropdown:SetRelativeWidth(0.5) + cooldownTextContainer:AddChild(fontDropdown) + + local fontFlagDropdown = AG:Create("Dropdown") + fontFlagDropdown:SetLabel(LL("Font Flag")) + fontFlagDropdown:SetList({ + ["NONE"] = "NONE", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + }) + fontFlagDropdown:SetValue(CooldownTextDB.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) + fontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) CooldownTextDB.FontFlag = value BCDM:UpdateCooldownViewers() end) + fontFlagDropdown:SetRelativeWidth(0.5) + cooldownTextContainer:AddChild(fontFlagDropdown) + local colourPicker = AG:Create("ColorPicker") colourPicker:SetLabel(LL("Text Colour")) colourPicker:SetColor(unpack(CooldownTextDB.Colour)) @@ -1061,6 +1082,27 @@ local function CreateGlobalSettings(parentContainer) CreateCustomGlowSettings(globalSettingsContainer) + local function PropagateGlobalFontSettings(font, fontFlag, colour) + local db = BCDM.db.profile + local elements = {"Essential", "Utility", "Buffs", "Custom", "AdditionalCustom", "Item", "Trinket", "ItemSpell"} + for _, el in ipairs(elements) do + if db.CooldownManager[el] and db.CooldownManager[el].Text then + if font then db.CooldownManager[el].Text.Font = font end + if fontFlag then db.CooldownManager[el].Text.FontFlag = fontFlag end + if colour then db.CooldownManager[el].Text.Colour = {unpack(colour)} end + end + end + local barTextDBs = {db.PowerBar.Text, db.SecondaryPowerBar.Text, db.CastBar.Text.SpellName, db.CastBar.Text.CastTime} + for _, textDB in ipairs(barTextDBs) do + if font then textDB.Font = font end + if fontFlag then textDB.FontFlag = fontFlag end + if colour then textDB.Colour = {unpack(colour)} end + end + local cooldownTextDB = db.CooldownManager.General.CooldownText + if font then cooldownTextDB.Font = font end + if fontFlag then cooldownTextDB.FontFlag = fontFlag end + end + local FontContainer = AG:Create("InlineGroup") FontContainer:SetTitle(LL("Font Settings")) FontContainer:SetFullWidth(true) @@ -1071,8 +1113,8 @@ local function CreateGlobalSettings(parentContainer) CooldownManagerFontDropdown:SetLabel(LL("Font")) CooldownManagerFontDropdown:SetList(LSM:HashTable("font")) CooldownManagerFontDropdown:SetValue(GeneralDB.Fonts.Font) - CooldownManagerFontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) GeneralDB.Fonts.Font = value BCDM:UpdateBCDM() end) - CooldownManagerFontDropdown:SetRelativeWidth(0.5) + CooldownManagerFontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) GeneralDB.Fonts.Font = value PropagateGlobalFontSettings(value, nil, nil) BCDM:UpdateBCDM() end) + CooldownManagerFontDropdown:SetRelativeWidth(0.33) FontContainer:AddChild(CooldownManagerFontDropdown) local CooldownManagerFontFlagDropdown = AG:Create("Dropdown") @@ -1084,10 +1126,17 @@ local function CreateGlobalSettings(parentContainer) ["MONOCHROME"] = "Monochrome", }) CooldownManagerFontFlagDropdown:SetValue(GeneralDB.Fonts.FontFlag) - CooldownManagerFontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) GeneralDB.Fonts.FontFlag = value BCDM:UpdateBCDM() end) - CooldownManagerFontFlagDropdown:SetRelativeWidth(0.5) + CooldownManagerFontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) GeneralDB.Fonts.FontFlag = value PropagateGlobalFontSettings(nil, value, nil) BCDM:UpdateBCDM() end) + CooldownManagerFontFlagDropdown:SetRelativeWidth(0.33) FontContainer:AddChild(CooldownManagerFontFlagDropdown) + local CooldownManagerFontColour = AG:Create("ColorPicker") + CooldownManagerFontColour:SetLabel(LL("Font Colour")) + CooldownManagerFontColour:SetColor(unpack(GeneralDB.Fonts.Colour)) + CooldownManagerFontColour:SetCallback("OnValueChanged", function(_, _, r, g, b) GeneralDB.Fonts.Colour = {r, g, b} PropagateGlobalFontSettings(nil, nil, {r, g, b}) BCDM:UpdateBCDM() end) + CooldownManagerFontColour:SetRelativeWidth(0.33) + FontContainer:AddChild(CooldownManagerFontColour) + local FontShadowsContainer = AG:Create("InlineGroup") FontShadowsContainer:SetTitle(LL("Font Shadows")) FontShadowsContainer:SetFullWidth(true) @@ -1250,6 +1299,27 @@ local function CreateCooldownViewerTextSettings(parentContainer, viewerType) textContainer:SetLayout("Flow") parentContainer:AddChild(textContainer) + local fontDropdown = AG:Create("LSM30_Font") + fontDropdown:SetLabel(LL("Font")) + fontDropdown:SetList(LSM:HashTable("font")) + fontDropdown:SetValue(BCDM.db.profile.CooldownManager[viewerType].Text.Font or BCDM.db.profile.General.Fonts.Font) + fontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) BCDM.db.profile.CooldownManager[viewerType].Text.Font = value BCDM:UpdateCooldownViewer(viewerType) end) + fontDropdown:SetRelativeWidth(0.5) + textContainer:AddChild(fontDropdown) + + local fontFlagDropdown = AG:Create("Dropdown") + fontFlagDropdown:SetLabel(LL("Font Flag")) + fontFlagDropdown:SetList({ + ["NONE"] = "NONE", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + }) + fontFlagDropdown:SetValue(BCDM.db.profile.CooldownManager[viewerType].Text.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) + fontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) BCDM.db.profile.CooldownManager[viewerType].Text.FontFlag = value BCDM:UpdateCooldownViewer(viewerType) end) + fontFlagDropdown:SetRelativeWidth(0.5) + textContainer:AddChild(fontFlagDropdown) + local anchorFromDropdown = AG:Create("Dropdown") anchorFromDropdown:SetLabel(LL("Anchor From")) anchorFromDropdown:SetList(AnchorPoints[1], AnchorPoints[2]) @@ -1877,9 +1947,7 @@ local function CreateCooldownViewerSettings(parentContainer, viewerType) layoutContainer:AddChild(frameStrataDropdown) end - if viewerType ~= "Trinket" then - CreateCooldownViewerTextSettings(ScrollFrame, viewerType) - end + CreateCooldownViewerTextSettings(ScrollFrame, viewerType) if viewerType == "Custom" or viewerType == "AdditionalCustom" then local spellContainer = AG:Create("InlineGroup") @@ -1930,6 +1998,27 @@ local function CreatePowerBarTextSettings(parentContainer) toggleCheckbox:SetRelativeWidth(1) textContainer:AddChild(toggleCheckbox) + local fontDropdown = AG:Create("LSM30_Font") + fontDropdown:SetLabel(LL("Font")) + fontDropdown:SetList(LSM:HashTable("font")) + fontDropdown:SetValue(BCDM.db.profile.PowerBar.Text.Font or BCDM.db.profile.General.Fonts.Font) + fontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) BCDM.db.profile.PowerBar.Text.Font = value BCDM:UpdatePowerBar() end) + fontDropdown:SetRelativeWidth(0.5) + textContainer:AddChild(fontDropdown) + + local fontFlagDropdown = AG:Create("Dropdown") + fontFlagDropdown:SetLabel(LL("Font Flag")) + fontFlagDropdown:SetList({ + ["NONE"] = "NONE", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + }) + fontFlagDropdown:SetValue(BCDM.db.profile.PowerBar.Text.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) + fontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) BCDM.db.profile.PowerBar.Text.FontFlag = value BCDM:UpdatePowerBar() end) + fontFlagDropdown:SetRelativeWidth(0.5) + textContainer:AddChild(fontFlagDropdown) + local anchorFromDropdown = AG:Create("Dropdown") anchorFromDropdown:SetLabel(LL("Anchor From")) anchorFromDropdown:SetList(AnchorPoints[1], AnchorPoints[2]) @@ -1951,7 +2040,7 @@ local function CreatePowerBarTextSettings(parentContainer) xOffsetSlider:SetValue(BCDM.db.profile.PowerBar.Text.Layout[3]) xOffsetSlider:SetSliderValues(-500, 500, 0.1) xOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.PowerBar.Text.Layout[3] = value BCDM:UpdatePowerBar() end) - xOffsetSlider:SetRelativeWidth(0.33) + xOffsetSlider:SetRelativeWidth(0.25) textContainer:AddChild(xOffsetSlider) local yOffsetSlider = AG:Create("Slider") @@ -1959,7 +2048,7 @@ local function CreatePowerBarTextSettings(parentContainer) yOffsetSlider:SetValue(BCDM.db.profile.PowerBar.Text.Layout[4]) yOffsetSlider:SetSliderValues(-500, 500, 0.1) yOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.PowerBar.Text.Layout[4] = value BCDM:UpdatePowerBar() end) - yOffsetSlider:SetRelativeWidth(0.33) + yOffsetSlider:SetRelativeWidth(0.25) textContainer:AddChild(yOffsetSlider) local fontSizeSlider = AG:Create("Slider") @@ -1967,16 +2056,26 @@ local function CreatePowerBarTextSettings(parentContainer) fontSizeSlider:SetValue(BCDM.db.profile.PowerBar.Text.FontSize) fontSizeSlider:SetSliderValues(6, 72, 1) fontSizeSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.PowerBar.Text.FontSize = value BCDM:UpdatePowerBar() end) - fontSizeSlider:SetRelativeWidth(0.33) + fontSizeSlider:SetRelativeWidth(0.25) textContainer:AddChild(fontSizeSlider) + local colourPicker = AG:Create("ColorPicker") + colourPicker:SetLabel(LL("Font Colour")) + colourPicker:SetColor(unpack(BCDM.db.profile.PowerBar.Text.Colour)) + colourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) BCDM.db.profile.PowerBar.Text.Colour = {r, g, b} BCDM:UpdatePowerBar() end) + colourPicker:SetRelativeWidth(0.25) + textContainer:AddChild(colourPicker) + function RefreshPowerBarTextGUISettings() local enabled = BCDM.db.profile.PowerBar.Text.Enabled + fontDropdown:SetDisabled(not enabled) + fontFlagDropdown:SetDisabled(not enabled) anchorFromDropdown:SetDisabled(not enabled) anchorToDropdown:SetDisabled(not enabled) xOffsetSlider:SetDisabled(not enabled) yOffsetSlider:SetDisabled(not enabled) fontSizeSlider:SetDisabled(not enabled) + colourPicker:SetDisabled(not enabled) end RefreshPowerBarTextGUISettings() @@ -2193,6 +2292,27 @@ local function CreateSecondaryPowerBarTextSettings(parentContainer) enabledCheckbox:SetRelativeWidth(1) textContainer:AddChild(enabledCheckbox) + local fontDropdown = AG:Create("LSM30_Font") + fontDropdown:SetLabel(LL("Font")) + fontDropdown:SetList(LSM:HashTable("font")) + fontDropdown:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.Font or BCDM.db.profile.General.Fonts.Font) + fontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) BCDM.db.profile.SecondaryPowerBar.Text.Font = value BCDM:UpdateSecondaryPowerBar() end) + fontDropdown:SetRelativeWidth(0.5) + textContainer:AddChild(fontDropdown) + + local fontFlagDropdown = AG:Create("Dropdown") + fontFlagDropdown:SetLabel(LL("Font Flag")) + fontFlagDropdown:SetList({ + ["NONE"] = "NONE", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + }) + fontFlagDropdown:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) + fontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) BCDM.db.profile.SecondaryPowerBar.Text.FontFlag = value BCDM:UpdateSecondaryPowerBar() end) + fontFlagDropdown:SetRelativeWidth(0.5) + textContainer:AddChild(fontFlagDropdown) + local anchorFromDropdown = AG:Create("Dropdown") anchorFromDropdown:SetLabel(LL("Anchor From")) anchorFromDropdown:SetList(AnchorPoints[1], AnchorPoints[2]) @@ -2214,7 +2334,7 @@ local function CreateSecondaryPowerBarTextSettings(parentContainer) xOffsetSlider:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.Layout[3]) xOffsetSlider:SetSliderValues(-500, 500, 0.1) xOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.Text.Layout[3] = value BCDM:UpdateSecondaryPowerBar() end) - xOffsetSlider:SetRelativeWidth(0.33) + xOffsetSlider:SetRelativeWidth(0.25) textContainer:AddChild(xOffsetSlider) local yOffsetSlider = AG:Create("Slider") @@ -2222,7 +2342,7 @@ local function CreateSecondaryPowerBarTextSettings(parentContainer) yOffsetSlider:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.Layout[4]) yOffsetSlider:SetSliderValues(-500, 500, 0.1) yOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.Text.Layout[4] = value BCDM:UpdateSecondaryPowerBar() end) - yOffsetSlider:SetRelativeWidth(0.33) + yOffsetSlider:SetRelativeWidth(0.25) textContainer:AddChild(yOffsetSlider) local fontSizeSlider = AG:Create("Slider") @@ -2230,16 +2350,26 @@ local function CreateSecondaryPowerBarTextSettings(parentContainer) fontSizeSlider:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.FontSize) fontSizeSlider:SetSliderValues(6, 72, 1) fontSizeSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.Text.FontSize = value BCDM:UpdateSecondaryPowerBar() end) - fontSizeSlider:SetRelativeWidth(0.33) + fontSizeSlider:SetRelativeWidth(0.25) textContainer:AddChild(fontSizeSlider) + local colourPicker = AG:Create("ColorPicker") + colourPicker:SetLabel(LL("Font Colour")) + colourPicker:SetColor(unpack(BCDM.db.profile.SecondaryPowerBar.Text.Colour)) + colourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) BCDM.db.profile.SecondaryPowerBar.Text.Colour = {r, g, b} BCDM:UpdateSecondaryPowerBar() end) + colourPicker:SetRelativeWidth(0.25) + textContainer:AddChild(colourPicker) + function RefreshSecondaryPowerBarTextGUISettings() local enabled = BCDM.db.profile.SecondaryPowerBar.Text.Enabled + fontDropdown:SetDisabled(not enabled) + fontFlagDropdown:SetDisabled(not enabled) anchorFromDropdown:SetDisabled(not enabled) anchorToDropdown:SetDisabled(not enabled) xOffsetSlider:SetDisabled(not enabled) yOffsetSlider:SetDisabled(not enabled) fontSizeSlider:SetDisabled(not enabled) + colourPicker:SetDisabled(not enabled) end RefreshSecondaryPowerBarTextGUISettings() @@ -2504,6 +2634,27 @@ local function CreateCastBarTextSettings(parentContainer) spellNameContainer:SetLayout("Flow") textContainer:AddChild(spellNameContainer) + local spellName_FontDropdown = AG:Create("LSM30_Font") + spellName_FontDropdown:SetLabel(LL("Font")) + spellName_FontDropdown:SetList(LSM:HashTable("font")) + spellName_FontDropdown:SetValue(BCDM.db.profile.CastBar.Text.SpellName.Font or BCDM.db.profile.General.Fonts.Font) + spellName_FontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) BCDM.db.profile.CastBar.Text.SpellName.Font = value BCDM:UpdateCastBar() end) + spellName_FontDropdown:SetRelativeWidth(0.5) + spellNameContainer:AddChild(spellName_FontDropdown) + + local spellName_FontFlagDropdown = AG:Create("Dropdown") + spellName_FontFlagDropdown:SetLabel(LL("Font Flag")) + spellName_FontFlagDropdown:SetList({ + ["NONE"] = "NONE", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + }) + spellName_FontFlagDropdown:SetValue(BCDM.db.profile.CastBar.Text.SpellName.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) + spellName_FontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) BCDM.db.profile.CastBar.Text.SpellName.FontFlag = value BCDM:UpdateCastBar() end) + spellName_FontFlagDropdown:SetRelativeWidth(0.5) + spellNameContainer:AddChild(spellName_FontFlagDropdown) + local spellName_AnchorFromDropdown = AG:Create("Dropdown") spellName_AnchorFromDropdown:SetLabel(LL("Anchor From")) spellName_AnchorFromDropdown:SetList(AnchorPoints[1], AnchorPoints[2]) @@ -2552,12 +2703,40 @@ local function CreateCastBarTextSettings(parentContainer) spellName_MaxCharactersSlider:SetRelativeWidth(0.25) spellNameContainer:AddChild(spellName_MaxCharactersSlider) + local spellName_ColourPicker = AG:Create("ColorPicker") + spellName_ColourPicker:SetLabel(LL("Font Colour")) + spellName_ColourPicker:SetColor(unpack(BCDM.db.profile.CastBar.Text.SpellName.Colour)) + spellName_ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) BCDM.db.profile.CastBar.Text.SpellName.Colour = {r, g, b} BCDM:UpdateCastBar() end) + spellName_ColourPicker:SetRelativeWidth(0.25) + spellNameContainer:AddChild(spellName_ColourPicker) + local castTimeContainer = AG:Create("InlineGroup") castTimeContainer:SetTitle(LL("Cast Time Settings")) castTimeContainer:SetFullWidth(true) castTimeContainer:SetLayout("Flow") textContainer:AddChild(castTimeContainer) + local castTime_FontDropdown = AG:Create("LSM30_Font") + castTime_FontDropdown:SetLabel(LL("Font")) + castTime_FontDropdown:SetList(LSM:HashTable("font")) + castTime_FontDropdown:SetValue(BCDM.db.profile.CastBar.Text.CastTime.Font or BCDM.db.profile.General.Fonts.Font) + castTime_FontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) BCDM.db.profile.CastBar.Text.CastTime.Font = value BCDM:UpdateCastBar() end) + castTime_FontDropdown:SetRelativeWidth(0.5) + castTimeContainer:AddChild(castTime_FontDropdown) + + local castTime_FontFlagDropdown = AG:Create("Dropdown") + castTime_FontFlagDropdown:SetLabel(LL("Font Flag")) + castTime_FontFlagDropdown:SetList({ + ["NONE"] = "NONE", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + }) + castTime_FontFlagDropdown:SetValue(BCDM.db.profile.CastBar.Text.CastTime.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) + castTime_FontFlagDropdown:SetCallback("OnValueChanged", function(_, _, value) BCDM.db.profile.CastBar.Text.CastTime.FontFlag = value BCDM:UpdateCastBar() end) + castTime_FontFlagDropdown:SetRelativeWidth(0.5) + castTimeContainer:AddChild(castTime_FontFlagDropdown) + local castTime_AnchorFromDropdown = AG:Create("Dropdown") castTime_AnchorFromDropdown:SetLabel(LL("Anchor From")) castTime_AnchorFromDropdown:SetList(AnchorPoints[1], AnchorPoints[2]) @@ -2579,7 +2758,7 @@ local function CreateCastBarTextSettings(parentContainer) castTime_XOffsetSlider:SetValue(BCDM.db.profile.CastBar.Text.CastTime.Layout[3]) castTime_XOffsetSlider:SetSliderValues(-500, 500, 0.1) castTime_XOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CastBar.Text.CastTime.Layout[3] = value BCDM:UpdateCastBar() end) - castTime_XOffsetSlider:SetRelativeWidth(0.33) + castTime_XOffsetSlider:SetRelativeWidth(0.25) castTimeContainer:AddChild(castTime_XOffsetSlider) local castTime_YOffsetSlider = AG:Create("Slider") @@ -2587,7 +2766,7 @@ local function CreateCastBarTextSettings(parentContainer) castTime_YOffsetSlider:SetValue(BCDM.db.profile.CastBar.Text.CastTime.Layout[4]) castTime_YOffsetSlider:SetSliderValues(-500, 500, 0.1) castTime_YOffsetSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CastBar.Text.CastTime.Layout[4] = value BCDM:UpdateCastBar() end) - castTime_YOffsetSlider:SetRelativeWidth(0.33) + castTime_YOffsetSlider:SetRelativeWidth(0.25) castTimeContainer:AddChild(castTime_YOffsetSlider) local castTime_FontSizeSlider = AG:Create("Slider") @@ -2595,9 +2774,16 @@ local function CreateCastBarTextSettings(parentContainer) castTime_FontSizeSlider:SetValue(BCDM.db.profile.CastBar.Text.CastTime.FontSize) castTime_FontSizeSlider:SetSliderValues(6, 72, 1) castTime_FontSizeSlider:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.CastBar.Text.CastTime.FontSize = value BCDM:UpdateCastBar() end) - castTime_FontSizeSlider:SetRelativeWidth(0.33) + castTime_FontSizeSlider:SetRelativeWidth(0.25) castTimeContainer:AddChild(castTime_FontSizeSlider) + local castTime_ColourPicker = AG:Create("ColorPicker") + castTime_ColourPicker:SetLabel(LL("Font Colour")) + castTime_ColourPicker:SetColor(unpack(BCDM.db.profile.CastBar.Text.CastTime.Colour)) + castTime_ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) BCDM.db.profile.CastBar.Text.CastTime.Colour = {r, g, b} BCDM:UpdateCastBar() end) + castTime_ColourPicker:SetRelativeWidth(0.25) + castTimeContainer:AddChild(castTime_ColourPicker) + return textContainer end diff --git a/Core/Globals.lua b/Core/Globals.lua index 1f483cf..1058a8f 100755 --- a/Core/Globals.lua +++ b/Core/Globals.lua @@ -36,6 +36,14 @@ if BCDM.LSM then BCDM.LSM:Register("statusbar", "Better Blizzard", [[Interface\A function BCDM:PrettyPrint(MSG) print(BCDM.ADDON_NAME .. ":|r " .. MSG) end +function BCDM:ResolveElementFont(fontName) + if fontName then + local resolved = BCDM.LSM:Fetch("font", fontName) + if resolved then return resolved end + end + return BCDM.Media.Font +end + function BCDM:ResolveLSM() local LSM = BCDM.LSM local General = BCDM.db.profile.General diff --git a/Modules/AdditionalCustomCooldownViewer.lua b/Modules/AdditionalCustomCooldownViewer.lua index 7fd444a..24046fa 100755 --- a/Modules/AdditionalCustomCooldownViewer.lua +++ b/Modules/AdditionalCustomCooldownViewer.lua @@ -19,12 +19,14 @@ local function ApplyCooldownText() if icon and icon.Cooldown then local textRegion = FetchCooldownTextRegion(icon.Cooldown) if textRegion then + local cooldownFont = BCDM:ResolveElementFont(CooldownTextDB.Font) + local cooldownFontFlag = CooldownTextDB.FontFlag or GeneralDB.Fonts.FontFlag if CooldownTextDB.ScaleByIconSize then local iconWidth = icon:GetWidth() local scaleFactor = iconWidth / 36 - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize * scaleFactor, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize * scaleFactor, cooldownFontFlag) else - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize, cooldownFontFlag) end textRegion:SetTextColor(CooldownTextDB.Colour[1], CooldownTextDB.Colour[2], CooldownTextDB.Colour[3], 1) textRegion:ClearAllPoints() @@ -81,7 +83,7 @@ local function CreateCustomIcon(spellId) HighLevelContainer:SetFrameLevel(customIcon:GetFrameLevel() + 999) customIcon.Charges = HighLevelContainer:CreateFontString(nil, "OVERLAY") - customIcon.Charges:SetFont(BCDM.Media.Font, CustomDB.Text.FontSize, GeneralDB.Fonts.FontFlag) + customIcon.Charges:SetFont(BCDM:ResolveElementFont(CustomDB.Text.Font), CustomDB.Text.FontSize, CustomDB.Text.FontFlag or GeneralDB.Fonts.FontFlag) customIcon.Charges:SetPoint(CustomDB.Text.Layout[1], customIcon, CustomDB.Text.Layout[2], CustomDB.Text.Layout[3], CustomDB.Text.Layout[4]) customIcon.Charges:SetTextColor(CustomDB.Text.Colour[1], CustomDB.Text.Colour[2], CustomDB.Text.Colour[3], 1) if GeneralDB.Fonts.Shadow.Enabled then diff --git a/Modules/CastBar.lua b/Modules/CastBar.lua index 4812af8..8abd6bf 100755 --- a/Modules/CastBar.lua +++ b/Modules/CastBar.lua @@ -191,7 +191,7 @@ function BCDM:CreateCastBar() end CastBar.SpellNameText = CastBar.Status:CreateFontString(nil, "OVERLAY") - CastBar.SpellNameText:SetFont(BCDM.Media.Font, CastBarDB.Text.SpellName.FontSize, GeneralDB.Fonts.FontFlag) + CastBar.SpellNameText:SetFont(BCDM:ResolveElementFont(CastBarDB.Text.SpellName.Font), CastBarDB.Text.SpellName.FontSize, CastBarDB.Text.SpellName.FontFlag or GeneralDB.Fonts.FontFlag) CastBar.SpellNameText:SetTextColor(CastBarDB.Text.SpellName.Colour[1], CastBarDB.Text.SpellName.Colour[2], CastBarDB.Text.SpellName.Colour[3], 1) CastBar.SpellNameText:SetPoint(CastBarDB.Text.SpellName.Layout[1], CastBar.Status, CastBarDB.Text.SpellName.Layout[2], CastBarDB.Text.SpellName.Layout[3], CastBarDB.Text.SpellName.Layout[4]) if GeneralDB.Fonts.Shadow.Enabled then @@ -204,7 +204,7 @@ function BCDM:CreateCastBar() CastBar.SpellNameText:SetText("") CastBar.CastTimeText = CastBar.Status:CreateFontString(nil, "OVERLAY") - CastBar.CastTimeText:SetFont(BCDM.Media.Font, CastBarDB.Text.CastTime.FontSize, GeneralDB.Fonts.FontFlag) + CastBar.CastTimeText:SetFont(BCDM:ResolveElementFont(CastBarDB.Text.CastTime.Font), CastBarDB.Text.CastTime.FontSize, CastBarDB.Text.CastTime.FontFlag or GeneralDB.Fonts.FontFlag) CastBar.CastTimeText:SetTextColor(CastBarDB.Text.CastTime.Colour[1], CastBarDB.Text.CastTime.Colour[2], CastBarDB.Text.CastTime.Colour[3], 1) CastBar.CastTimeText:SetPoint(CastBarDB.Text.CastTime.Layout[1], CastBar.Status, CastBarDB.Text.CastTime.Layout[2], CastBarDB.Text.CastTime.Layout[3], CastBarDB.Text.CastTime.Layout[4]) if GeneralDB.Fonts.Shadow.Enabled then @@ -289,7 +289,7 @@ function BCDM:UpdateCastBar() CastBar.Status:SetPoint("BOTTOMRIGHT", CastBar.Icon, "BOTTOMLEFT", 0, 0) end - CastBar.SpellNameText:SetFont(BCDM.Media.Font, CastBarDB.Text.SpellName.FontSize, BCDM.db.profile.General.Fonts.FontFlag) + CastBar.SpellNameText:SetFont(BCDM:ResolveElementFont(CastBarDB.Text.SpellName.Font), CastBarDB.Text.SpellName.FontSize, CastBarDB.Text.SpellName.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) CastBar.SpellNameText:SetTextColor(CastBarDB.Text.SpellName.Colour[1], CastBarDB.Text.SpellName.Colour[2], CastBarDB.Text.SpellName.Colour[3], 1) CastBar.SpellNameText:ClearAllPoints() CastBar.SpellNameText:SetPoint(CastBarDB.Text.SpellName.Layout[1], CastBar.Status, CastBarDB.Text.SpellName.Layout[2], CastBarDB.Text.SpellName.Layout[3], CastBarDB.Text.SpellName.Layout[4]) @@ -301,7 +301,7 @@ function BCDM:UpdateCastBar() CastBar.SpellNameText:SetShadowOffset(0, 0) end - CastBar.CastTimeText:SetFont(BCDM.Media.Font, CastBarDB.Text.CastTime.FontSize, BCDM.db.profile.General.Fonts.FontFlag) + CastBar.CastTimeText:SetFont(BCDM:ResolveElementFont(CastBarDB.Text.CastTime.Font), CastBarDB.Text.CastTime.FontSize, CastBarDB.Text.CastTime.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) CastBar.CastTimeText:SetTextColor(CastBarDB.Text.CastTime.Colour[1], CastBarDB.Text.CastTime.Colour[2], CastBarDB.Text.CastTime.Colour[3], 1) CastBar.CastTimeText:ClearAllPoints() CastBar.CastTimeText:SetPoint(CastBarDB.Text.CastTime.Layout[1], CastBar.Status, CastBarDB.Text.CastTime.Layout[2], CastBarDB.Text.CastTime.Layout[3], CastBarDB.Text.CastTime.Layout[4]) diff --git a/Modules/CooldownManager.lua b/Modules/CooldownManager.lua index 95e51c1..aaaf48d 100755 --- a/Modules/CooldownManager.lua +++ b/Modules/CooldownManager.lua @@ -34,12 +34,14 @@ local function ApplyCooldownText(cooldownViewer) if icon and icon.Cooldown then local textRegion = FetchCooldownTextRegion(icon.Cooldown) if textRegion then + local cooldownFont = BCDM:ResolveElementFont(CooldownTextDB.Font) + local cooldownFontFlag = CooldownTextDB.FontFlag or GeneralDB.Fonts.FontFlag if CooldownTextDB.ScaleByIconSize then local iconWidth = icon:GetWidth() local scaleFactor = iconWidth / 36 - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize * scaleFactor, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize * scaleFactor, cooldownFontFlag) else - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize, cooldownFontFlag) end textRegion:SetTextColor(CooldownTextDB.Colour[1], CooldownTextDB.Colour[2], CooldownTextDB.Colour[3], 1) textRegion:ClearAllPoints() @@ -121,7 +123,8 @@ local function StyleChargeCount() for _, childFrame in ipairs({ _G[viewerName]:GetChildren() }) do if childFrame and childFrame.ChargeCount and childFrame.ChargeCount.Current then local currentChargeText = childFrame.ChargeCount.Current - currentChargeText:SetFont(BCDM.Media.Font, cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.FontSize, generalSettings.Fonts.FontFlag) + local viewerTextDB = cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text + currentChargeText:SetFont(BCDM:ResolveElementFont(viewerTextDB.Font), viewerTextDB.FontSize, viewerTextDB.FontFlag or generalSettings.Fonts.FontFlag) currentChargeText:ClearAllPoints() currentChargeText:SetPoint(cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[1], childFrame, cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[2], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[3], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[4]) currentChargeText:SetTextColor(cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Colour[1], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Colour[2], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Colour[3], 1) @@ -138,7 +141,8 @@ local function StyleChargeCount() for _, childFrame in ipairs({ _G[viewerName]:GetChildren() }) do if childFrame and childFrame.Applications then local applicationsText = childFrame.Applications.Applications - applicationsText:SetFont(BCDM.Media.Font, cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.FontSize, generalSettings.Fonts.FontFlag) + local viewerTextDB = cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text + applicationsText:SetFont(BCDM:ResolveElementFont(viewerTextDB.Font), viewerTextDB.FontSize, viewerTextDB.FontFlag or generalSettings.Fonts.FontFlag) applicationsText:ClearAllPoints() applicationsText:SetPoint(cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[1], childFrame, cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[2], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[3], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Layout[4]) applicationsText:SetTextColor(cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Colour[1], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Colour[2], cooldownManagerSettings[BCDM.CooldownManagerViewerToDBViewer[viewerName]].Text.Colour[3], 1) diff --git a/Modules/CustomCooldownViewer.lua b/Modules/CustomCooldownViewer.lua index b4c8e2d..bd0c130 100755 --- a/Modules/CustomCooldownViewer.lua +++ b/Modules/CustomCooldownViewer.lua @@ -19,12 +19,14 @@ local function ApplyCooldownText() if icon and icon.Cooldown then local textRegion = FetchCooldownTextRegion(icon.Cooldown) if textRegion then + local cooldownFont = BCDM:ResolveElementFont(CooldownTextDB.Font) + local cooldownFontFlag = CooldownTextDB.FontFlag or GeneralDB.Fonts.FontFlag if CooldownTextDB.ScaleByIconSize then local iconWidth = icon:GetWidth() local scaleFactor = iconWidth / 36 - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize * scaleFactor, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize * scaleFactor, cooldownFontFlag) else - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize, cooldownFontFlag) end textRegion:SetTextColor(CooldownTextDB.Colour[1], CooldownTextDB.Colour[2], CooldownTextDB.Colour[3], 1) textRegion:ClearAllPoints() @@ -79,7 +81,7 @@ local function CreateCustomIcon(spellId) HighLevelContainer:SetFrameLevel(customIcon:GetFrameLevel() + 999) customIcon.Charges = HighLevelContainer:CreateFontString(nil, "OVERLAY") - customIcon.Charges:SetFont(BCDM.Media.Font, CustomDB.Text.FontSize, GeneralDB.Fonts.FontFlag) + customIcon.Charges:SetFont(BCDM:ResolveElementFont(CustomDB.Text.Font), CustomDB.Text.FontSize, CustomDB.Text.FontFlag or GeneralDB.Fonts.FontFlag) customIcon.Charges:SetPoint(CustomDB.Text.Layout[1], customIcon, CustomDB.Text.Layout[2], CustomDB.Text.Layout[3], CustomDB.Text.Layout[4]) customIcon.Charges:SetTextColor(CustomDB.Text.Colour[1], CustomDB.Text.Colour[2], CustomDB.Text.Colour[3], 1) if GeneralDB.Fonts.Shadow.Enabled then diff --git a/Modules/CustomItemSpellViewer.lua b/Modules/CustomItemSpellViewer.lua index eabdd7a..ca40d83 100755 --- a/Modules/CustomItemSpellViewer.lua +++ b/Modules/CustomItemSpellViewer.lua @@ -19,12 +19,14 @@ local function ApplyCooldownText() if icon and icon.Cooldown then local textRegion = FetchCooldownTextRegion(icon.Cooldown) if textRegion then + local cooldownFont = BCDM:ResolveElementFont(CooldownTextDB.Font) + local cooldownFontFlag = CooldownTextDB.FontFlag or GeneralDB.Fonts.FontFlag if CooldownTextDB.ScaleByIconSize then local iconWidth = icon:GetWidth() local scaleFactor = iconWidth / 36 - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize * scaleFactor, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize * scaleFactor, cooldownFontFlag) else - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize, cooldownFontFlag) end textRegion:SetTextColor(CooldownTextDB.Colour[1], CooldownTextDB.Colour[2], CooldownTextDB.Colour[3], 1) textRegion:ClearAllPoints() @@ -96,7 +98,7 @@ local function CreateCustomItemIcon(itemId) HighLevelContainer:SetFrameLevel(customIcon:GetFrameLevel() + 999) customIcon.Charges = HighLevelContainer:CreateFontString(nil, "OVERLAY") - customIcon.Charges:SetFont(BCDM.Media.Font, CustomDB.Text.FontSize, GeneralDB.Fonts.FontFlag) + customIcon.Charges:SetFont(BCDM:ResolveElementFont(CustomDB.Text.Font), CustomDB.Text.FontSize, CustomDB.Text.FontFlag or GeneralDB.Fonts.FontFlag) customIcon.Charges:SetPoint(CustomDB.Text.Layout[1], customIcon, CustomDB.Text.Layout[2], CustomDB.Text.Layout[3], CustomDB.Text.Layout[4]) customIcon.Charges:SetTextColor(CustomDB.Text.Colour[1], CustomDB.Text.Colour[2], CustomDB.Text.Colour[3], 1) customIcon.Charges:SetText(tostring(select(1, FetchItemData(itemId)) or "")) @@ -177,7 +179,7 @@ local function CreateCustomSpellIcon(spellId) HighLevelContainer:SetFrameLevel(customIcon:GetFrameLevel() + 999) customIcon.Charges = HighLevelContainer:CreateFontString(nil, "OVERLAY") - customIcon.Charges:SetFont(BCDM.Media.Font, CustomDB.Text.FontSize, GeneralDB.Fonts.FontFlag) + customIcon.Charges:SetFont(BCDM:ResolveElementFont(CustomDB.Text.Font), CustomDB.Text.FontSize, CustomDB.Text.FontFlag or GeneralDB.Fonts.FontFlag) customIcon.Charges:SetPoint(CustomDB.Text.Layout[1], customIcon, CustomDB.Text.Layout[2], CustomDB.Text.Layout[3], CustomDB.Text.Layout[4]) customIcon.Charges:SetTextColor(CustomDB.Text.Colour[1], CustomDB.Text.Colour[2], CustomDB.Text.Colour[3], 1) if GeneralDB.Fonts.Shadow.Enabled then diff --git a/Modules/CustomItemViewer.lua b/Modules/CustomItemViewer.lua index a0b6fa0..43eaf23 100755 --- a/Modules/CustomItemViewer.lua +++ b/Modules/CustomItemViewer.lua @@ -19,12 +19,14 @@ local function ApplyCooldownText() if icon and icon.Cooldown then local textRegion = FetchCooldownTextRegion(icon.Cooldown) if textRegion then + local cooldownFont = BCDM:ResolveElementFont(CooldownTextDB.Font) + local cooldownFontFlag = CooldownTextDB.FontFlag or GeneralDB.Fonts.FontFlag if CooldownTextDB.ScaleByIconSize then local iconWidth = icon:GetWidth() local scaleFactor = iconWidth / 36 - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize * scaleFactor, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize * scaleFactor, cooldownFontFlag) else - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize, cooldownFontFlag) end textRegion:SetTextColor(CooldownTextDB.Colour[1], CooldownTextDB.Colour[2], CooldownTextDB.Colour[3], 1) textRegion:ClearAllPoints() @@ -97,7 +99,7 @@ local function CreateCustomIcon(itemId) HighLevelContainer:SetFrameLevel(customIcon:GetFrameLevel() + 999) customIcon.Charges = HighLevelContainer:CreateFontString(nil, "OVERLAY") - customIcon.Charges:SetFont(BCDM.Media.Font, CustomDB.Text.FontSize, GeneralDB.Fonts.FontFlag) + customIcon.Charges:SetFont(BCDM:ResolveElementFont(CustomDB.Text.Font), CustomDB.Text.FontSize, CustomDB.Text.FontFlag or GeneralDB.Fonts.FontFlag) customIcon.Charges:SetPoint(CustomDB.Text.Layout[1], customIcon, CustomDB.Text.Layout[2], CustomDB.Text.Layout[3], CustomDB.Text.Layout[4]) customIcon.Charges:SetTextColor(CustomDB.Text.Colour[1], CustomDB.Text.Colour[2], CustomDB.Text.Colour[3], 1) customIcon.Charges:SetText(tostring(select(1, FetchItemData(itemId)) or "")) diff --git a/Modules/PowerBar.lua b/Modules/PowerBar.lua index a22889e..8e3612f 100755 --- a/Modules/PowerBar.lua +++ b/Modules/PowerBar.lua @@ -148,7 +148,7 @@ function BCDM:CreatePowerBar() PowerBar.Status:SetValue(UnitPower("player")) PowerBar.Text = PowerBar.Status:CreateFontString(nil, "OVERLAY") - PowerBar.Text:SetFont(BCDM.Media.Font, PowerBarDB.Text.FontSize, GeneralDB.Fonts.FontFlag) + PowerBar.Text:SetFont(BCDM:ResolveElementFont(PowerBarDB.Text.Font), PowerBarDB.Text.FontSize, PowerBarDB.Text.FontFlag or GeneralDB.Fonts.FontFlag) PowerBar.Text:SetTextColor(PowerBarDB.Text.Colour[1], PowerBarDB.Text.Colour[2], PowerBarDB.Text.Colour[3], 1) PowerBar.Text:SetPoint(PowerBarDB.Text.Layout[1], PowerBar, PowerBarDB.Text.Layout[2], PowerBarDB.Text.Layout[3], PowerBarDB.Text.Layout[4]) if GeneralDB.Fonts.Shadow.Enabled then @@ -208,7 +208,7 @@ function BCDM:UpdatePowerBar() PowerBar:SetHeight(hasSecondary and PowerBarDB.Height or PowerBarDB.HeightWithoutSecondary) PowerBar:SetBackdropColor(PowerBarDB.BackgroundColour[1], PowerBarDB.BackgroundColour[2], PowerBarDB.BackgroundColour[3], PowerBarDB.BackgroundColour[4]) PowerBar.Status:SetStatusBarTexture(BCDM.Media.Foreground) - PowerBar.Text:SetFont(BCDM.Media.Font, PowerBarDB.Text.FontSize, BCDM.db.profile.General.Fonts.FontFlag) + PowerBar.Text:SetFont(BCDM:ResolveElementFont(PowerBarDB.Text.Font), PowerBarDB.Text.FontSize, PowerBarDB.Text.FontFlag or BCDM.db.profile.General.Fonts.FontFlag) PowerBar.Text:SetTextColor(PowerBarDB.Text.Colour[1], PowerBarDB.Text.Colour[2], PowerBarDB.Text.Colour[3], 1) PowerBar.Text:SetPoint(PowerBarDB.Text.Layout[1], PowerBar, PowerBarDB.Text.Layout[2], PowerBarDB.Text.Layout[3], PowerBarDB.Text.Layout[4]) if GeneralDB.Fonts.Shadow.Enabled then diff --git a/Modules/SecondaryPowerBar.lua b/Modules/SecondaryPowerBar.lua index 9fff9d0..72f1fd1 100755 --- a/Modules/SecondaryPowerBar.lua +++ b/Modules/SecondaryPowerBar.lua @@ -710,7 +710,7 @@ function BCDM:CreateSecondaryPowerBar() secondaryPowerBar.Status:SetScript("OnSizeChanged", function() CreateTicksBasedOnPowerType() end) secondaryPowerBar.Text = secondaryPowerBar.Status:CreateFontString(nil, "OVERLAY") - secondaryPowerBar.Text:SetFont(BCDM.Media.Font, secondaryPowerBarDB.Text.FontSize, generalDB.Fonts.FontFlag) + secondaryPowerBar.Text:SetFont(BCDM:ResolveElementFont(secondaryPowerBarDB.Text.Font), secondaryPowerBarDB.Text.FontSize, secondaryPowerBarDB.Text.FontFlag or generalDB.Fonts.FontFlag) secondaryPowerBar.Text:SetTextColor(secondaryPowerBarDB.Text.Colour[1], secondaryPowerBarDB.Text.Colour[2], secondaryPowerBarDB.Text.Colour[3], 1) secondaryPowerBar.Text:SetPoint(secondaryPowerBarDB.Text.Layout[1], secondaryPowerBar, secondaryPowerBarDB.Text.Layout[2], secondaryPowerBarDB.Text.Layout[3], secondaryPowerBarDB.Text.Layout[4]) @@ -814,7 +814,7 @@ function BCDM:UpdateSecondaryPowerBar() secondaryPowerBar.Status:SetStatusBarColor(GetPowerBarColor()) secondaryPowerBar.Status:SetMinMaxValues(0, UnitPowerMax("player")) secondaryPowerBar.Status:SetValue(UnitPower("player")) - secondaryPowerBar.Text:SetFont(BCDM.Media.Font, secondaryPowerBarDB.Text.FontSize, generalDB.Fonts.FontFlag) + secondaryPowerBar.Text:SetFont(BCDM:ResolveElementFont(secondaryPowerBarDB.Text.Font), secondaryPowerBarDB.Text.FontSize, secondaryPowerBarDB.Text.FontFlag or generalDB.Fonts.FontFlag) secondaryPowerBar.Text:SetTextColor(secondaryPowerBarDB.Text.Colour[1], secondaryPowerBarDB.Text.Colour[2], secondaryPowerBarDB.Text.Colour[3], 1) secondaryPowerBar.Text:ClearAllPoints() secondaryPowerBar.Text:SetPoint(secondaryPowerBarDB.Text.Layout[1], secondaryPowerBar, secondaryPowerBarDB.Text.Layout[2], secondaryPowerBarDB.Text.Layout[3], secondaryPowerBarDB.Text.Layout[4]) diff --git a/Modules/TrinketBar.lua b/Modules/TrinketBar.lua index 3dff3ad..b2d5e72 100755 --- a/Modules/TrinketBar.lua +++ b/Modules/TrinketBar.lua @@ -19,12 +19,14 @@ local function ApplyCooldownText() if icon and icon.Cooldown then local textRegion = FetchCooldownTextRegion(icon.Cooldown) if textRegion then + local cooldownFont = BCDM:ResolveElementFont(CooldownTextDB.Font) + local cooldownFontFlag = CooldownTextDB.FontFlag or GeneralDB.Fonts.FontFlag if CooldownTextDB.ScaleByIconSize then local iconWidth = icon:GetWidth() local scaleFactor = iconWidth / 36 - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize * scaleFactor, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize * scaleFactor, cooldownFontFlag) else - textRegion:SetFont(BCDM.Media.Font, CooldownTextDB.FontSize, GeneralDB.Fonts.FontFlag) + textRegion:SetFont(cooldownFont, CooldownTextDB.FontSize, cooldownFontFlag) end textRegion:SetTextColor(CooldownTextDB.Colour[1], CooldownTextDB.Colour[2], CooldownTextDB.Colour[3], 1) textRegion:ClearAllPoints()