From 965a745b2e505674ba7b1d5ac099d23175a4fc12 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Tue, 27 Jan 2026 12:45:49 -0800 Subject: [PATCH] Support moving cooldown text OmniCC is not continuing to be supported for prepatch and Midnight retail releases. As such it is valuable to be able to at least move the cooldown text which OmniCC originally provided. This commit introduces this functionality within Grid2. --- Options/modules/indicators/Indicator.lua | 49 ++++++++++++++++++++++++ modules/IndicatorIcon.lua | 2 + modules/IndicatorIcons.lua | 2 + 3 files changed, 53 insertions(+) diff --git a/Options/modules/indicators/Indicator.lua b/Options/modules/indicators/Indicator.lua index a8326953..6af5d76a 100644 --- a/Options/modules/indicators/Indicator.lua +++ b/Options/modules/indicators/Indicator.lua @@ -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() diff --git a/modules/IndicatorIcon.lua b/modules/IndicatorIcon.lua index 3dfe50f2..342f1bf7 100644 --- a/modules/IndicatorIcon.lua +++ b/modules/IndicatorIcon.lua @@ -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 diff --git a/modules/IndicatorIcons.lua b/modules/IndicatorIcons.lua index 2002c771..fbc1927c 100644 --- a/modules/IndicatorIcons.lua +++ b/modules/IndicatorIcons.lua @@ -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()