Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions Options/modules/indicators/Indicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,55 @@ function Grid2Options:MakeIndicatorCooldownTextOptions(indicator, options)
end,
hidden= function() return indicator.dbx.enableCooldownText==nil end,
}
options.ctFontJustify = {
type = 'select',
order = 144,
name = L["Text Location"],
desc = L["Text Location"],
values = Grid2Options.pointValueList,
get = function()
local JustifyH = indicator.dbx.ctFontJustifyH or "CENTER"
local JustifyV = indicator.dbx.ctFontJustifyV or "MIDDLE"
return self.pointMapText[ JustifyH..JustifyV ]
end,
set = function(_, v)
local justify = self.pointMapText[v]
indicator.dbx.ctFontJustifyH = justify[1]
indicator.dbx.ctFontJustifyV = justify[2]
self:RefreshIndicator( indicator, "Layout")
end,
hidden= function() return indicator.dbx.enableCooldownText==nil end,
}
options.ctFontOffsetX = {
type = "range",
order = 145,
name = L["X Offset"],
desc = L["Adjust the horizontal offset of the text"],
softMin = -50,
softMax = 50,
step = 1,
get = function () return indicator.dbx.ctFontOffsetX or 0 end,
set = function (_, v)
indicator.dbx.ctFontOffsetX = v
self:RefreshIndicator(indicator, "Layout")
end,
hidden= function() return indicator.dbx.enableCooldownText==nil end,
}
options.ctFontOffsetY = {
type = "range",
order = 146,
name = L["Y Offset"],
desc = L["Adjust the vertical offset of the text"],
softMin = -50,
softMax = 50,
step = 1,
get = function () return indicator.dbx.ctFontOffsetY or 0 end,
set = function (_, v)
indicator.dbx.ctFontOffsetY = v
self:RefreshIndicator(indicator, "Layout")
end,
hidden= function() return indicator.dbx.enableCooldownText==nil end,
}
end

-- Grid2Options:MakeIndicatorTooltipsOptions()
Expand Down
6 changes: 6 additions & 0 deletions modules/IndicatorIcon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ local function Icon_Layout(self, parent)
local color, text = self.ctColor, f.Cooldown:GetCountdownFontString()
text:SetFont(self.ctFont, self.ctFontSize, self.ctFontFlags)
text:SetTextColor(color.r, color.g, color.b, color.a)
text:ClearAllPoints()
text:SetPoint(self.ctFontPoint, self.ctFontOffsetX, self.ctFontOffsetY)
end

if not self.disableStack then
Expand Down Expand Up @@ -207,10 +209,14 @@ local function Icon_UpdateDB(self)
-- ignore icon and use a solid square texture
self.disableIcon = dbx.disableIcon
-- cooldown text
local ctJV,ctJH = dbx.ctFontJustifyV or 'MIDDLE', dbx.ctFontJustifyH or 'CENTER'
self.ctFontFlags = dbx.ctFontFlags or "OUTLINE"
self.ctFontSize = dbx.ctFontSize or 9
self.ctFont = Grid2:MediaFetch("font", dbx.ctFont or theme.font) or STANDARD_TEXT_FONT
self.ctColor = Grid2:MakeColor(dbx.ctColor, "WHITE")
self.ctFontPoint = (ctJV=='MIDDLE' and ctJH) or (ctJH=='CENTER' and ctJV) or ctJV..ctJH
self.ctFontOffsetX = dbx.ctFontOffsetX or 0
self.ctFontOffsetY = dbx.ctFontOffsetY or 0
-- backdrop
self.backdrop = Grid2:GetBackdropTable("Interface\\Addons\\Grid2\\media\\white16x16", self.borderSize or 1)
end
Expand Down
6 changes: 6 additions & 0 deletions modules/IndicatorIcons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ local function Icon_Layout(self, parent)
local color, text = self.ctColor, frame.cooldown:GetCountdownFontString()
text:SetFont(self.ctFont, self.ctFontSize, self.ctFontFlags)
text:SetTextColor(color.r, color.g, color.b, color.a)
text:ClearAllPoints()
text:SetPoint(self.ctFontPoint, self.ctFontOffsetX, self.ctFontOffsetY)
text:SetMaxLines(1)
end
frame.cooldown:Show()
Expand Down Expand Up @@ -297,10 +299,14 @@ local function Icon_UpdateDB(self)
self.font = Grid2:MediaFetch("font", dbx.font or theme.font) or STANDARD_TEXT_FONT
self.colorStack = Grid2:MakeColor(dbx.colorStack, "WHITE")
-- cooldown text
local ctJV,ctJH = dbx.ctFontJustifyV or 'MIDDLE', dbx.ctFontJustifyH or 'CENTER'
self.ctFontFlags = dbx.ctFontFlags or "OUTLINE"
self.ctFontSize = dbx.ctFontSize or 9
self.ctFont = Grid2:MediaFetch("font", dbx.ctFont or theme.font) or STANDARD_TEXT_FONT
self.ctColor = Grid2:MakeColor(dbx.ctColor, "WHITE")
self.ctFontPoint = (ctJV=='MIDDLE' and ctJH) or (ctJH=='CENTER' and ctJV) or ctJV..ctJH
self.ctFontOffsetX = dbx.ctFontOffsetX or 0
self.ctFontOffsetY = dbx.ctFontOffsetY or 0
-- backdrop
self.backdrop = self.borderSize>0 and Grid2:GetBackdropTable("Interface\\Addons\\Grid2\\media\\white16x16", self.borderSize) or nil
end
Expand Down