Skip to content

Commit

Permalink
add font outline options (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
wardz committed Jan 23, 2021
1 parent 7d305eb commit 5a2274c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
7 changes: 6 additions & 1 deletion ClassicCastbars/core/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ namespace.castModifiers = {

-- Addon Savedvariables
namespace.defaultConfig = {
version = "26", -- settings version
version = "27", -- settings version
locale = GetLocale(),
npcCastUninterruptibleCache = {},
usePerCharacterSettings = false,
Expand Down Expand Up @@ -1891,6 +1891,7 @@ namespace.defaultConfig = {
textPositionX = 0,
textPositionY = 0,
textPoint = "CENTER",
textOutline = "",
frameLevel = 10,
statusBackgroundColor = { 0, 0, 0, 0.535 },
ignoreParentAlpha = false,
Expand Down Expand Up @@ -1923,6 +1924,7 @@ namespace.defaultConfig = {
textPositionX = 0,
textPositionY = 0,
textPoint = "CENTER",
textOutline = "",
frameLevel = 10,
statusBackgroundColor = { 0, 0, 0, 0.535 },
ignoreParentAlpha = false,
Expand Down Expand Up @@ -1955,6 +1957,7 @@ namespace.defaultConfig = {
textPositionX = 0,
textPositionY = 0,
textPoint = "CENTER",
textOutline = "",
frameLevel = 10,
statusBackgroundColor = { 0, 0, 0, 0.535 },
ignoreParentAlpha = false,
Expand Down Expand Up @@ -1987,6 +1990,7 @@ namespace.defaultConfig = {
textPositionX = 0,
textPositionY = 0,
textPoint = "CENTER",
textOutline = "",
frameLevel = 10,
statusBackgroundColor = { 0, 0, 0, 0.535 },
ignoreParentAlpha = false,
Expand Down Expand Up @@ -2019,6 +2023,7 @@ namespace.defaultConfig = {
textPositionX = 0,
textPositionY = 1,
textPoint = "CENTER",
textOutline = "",
frameLevel = 10,
statusBackgroundColor = { 0, 0, 0, 0.535 },
ignoreParentAlpha = false,
Expand Down
11 changes: 7 additions & 4 deletions ClassicCastbars/core/Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,13 @@ function addon:SetLSMBorders(castbar, cast, db)
end

function addon:SetCastbarFonts(castbar, cast, db)
local fontName, fontHeight = castbar.Text:GetFont()
if fontName ~= db.castFont or db.castFontSize ~= fontHeight then
castbar.Text:SetFont(db.castFont, db.castFontSize)
castbar.Timer:SetFont(db.castFont, db.castFontSize)
local fontName, fontHeight, fontFlags = castbar.Text:GetFont()
if fontName ~= db.castFont or db.castFontSize ~= fontHeight or db.textOutline ~= fontFlags then
castbar.Text:SetFont(db.castFont, db.castFontSize, db.textOutline)
castbar.Timer:SetFont(db.castFont, db.castFontSize, db.textOutline)

castbar.Text:SetShadowColor(0, 0, 0, db.textOutline == "" and 1 or 0)
castbar.Timer:SetShadowColor(0, 0, 0, db.textOutline == "" and 1 or 0)
end

local c = db.textColor
Expand Down
14 changes: 14 additions & 0 deletions ClassicCastbars_Options/ClassicCastbars_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ local TEXT_POINTS = {
["LEFT"] = "LEFT",
}

local TEXT_OUTLINES = {
[""] = L.DEFAULT,
["OUTLINE"] = "OUTLINE",
["THICKOUTLINE"] = "THICKOUTLINE",
["MONOCHROME"] = "MONOCHROME",
["MONOCHROME,OUTLINE"] = "MONOCHROME OUTLINE"
}

local function GetLSMTable(lsmType)
local tbl = CopyTable(LSM:HashTable(lsmType)) -- copy to prevent modifying LSM table

Expand Down Expand Up @@ -376,6 +384,12 @@ local function CreateUnitTabGroup(unitID, localizedUnit, order)
type = "select",
values = TEXT_POINTS,
},
textOutline = {
order = 7,
name = L.TEXT_OUTLINE,
type = "select",
values = TEXT_OUTLINES,
},
},
},

Expand Down
1 change: 1 addition & 0 deletions ClassicCastbars_Options/Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ L["TARGET"] = "Target"
L["TEST"] = "Toggle Testing"
L["TEST_MODE_DRAG"] = "Test Mode - Drag To Move"
L["TEXT_COLOR"] = "Select Text Color"
L["TEXT_OUTLINE"] = "Text Outline"
L["TEXT_POINT"] = "Text Alignment"
L["TEXT_POS_X"] = "Text Position X"
L["TEXT_POS_Y"] = "Text Position Y"
Expand Down

0 comments on commit 5a2274c

Please sign in to comment.