From 1d7e639f4284567e704a27d43628f1d033569785 Mon Sep 17 00:00:00 2001 From: Lars Lorenzen Date: Mon, 26 Jan 2026 08:46:40 +0100 Subject: [PATCH 1/4] feat: add ten Maelstrom Weapon ticks and configurable highlight threshold for Enhancement Shaman --- Bars/Abstract/Bar.lua | 32 ++++++++++++++-- Bars/SecondaryResourceBar.lua | 70 ++++++++++++++++++++++++++++++++++- Locales/enUS.lua | 2 + 3 files changed, 99 insertions(+), 5 deletions(-) diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua index 065e316..971d704 100644 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -839,7 +839,8 @@ function BarMixin:UpdateTicksLayout(layoutName) local resource = self:GetResource() local max = 0; if resource == "MAELSTROM_WEAPON" then - max = 5 + local maelstromWeaponUseTenBars = data and data.maelstromWeaponmaelstromWeaponUseTenBars + max = maelstromWeaponUseTenBars and 10 or 5 elseif resource == "TIP_OF_THE_SPEAR" then max = addonTable.TipOfTheSpear.TIP_MAX_STACKS elseif type(resource) == "number" then @@ -908,7 +909,13 @@ function BarMixin:CreateFragmentedPowerBars(layoutName) local resource = self:GetResource() if not resource then return end - local maxPower = resource == "MAELSTROM_WEAPON" and 5 or UnitPowerMax("player", resource) or 0 + local maxPower + if resource == "MAELSTROM_WEAPON" then + local maelstromWeaponUseTenBars = data and data.maelstromWeaponmaelstromWeaponUseTenBars + maxPower = maelstromWeaponUseTenBars and 10 or 5 + else + maxPower = UnitPowerMax("player", resource) or 0 + end for i = 1, maxPower or 0 do if not self.FragmentedPowerBars[i] then @@ -942,7 +949,15 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName) local resource = self:GetResource() if not resource then return end - local maxPower = resource == "MAELSTROM_WEAPON" and 5 or UnitPowerMax("player", resource) + + local maelstromWeaponUseTenBars = data and data.maelstromWeaponmaelstromWeaponUseTenBars + + local maxPower + if resource == "MAELSTROM_WEAPON" then + maxPower = maelstromWeaponUseTenBars and 10 or 5 + else + maxPower = UnitPowerMax("player", resource) + end if maxPower <= 0 then return end local barWidth = self.Frame:GetWidth() @@ -1206,6 +1221,15 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName) local mwFrame = self.FragmentedPowerBars[idx] local mwText = self.FragmentedPowerBarTexts[idx] + local highlightTreshold + if maelstromWeaponUseTenBars then + highlightTreshold = tonumber(data.maelstromHighlightThreshold) or 5 + else + highlightTreshold = 6 + end + + local segmentSize = maelstromWeaponUseTenBars and 10 or 5 + if mwFrame then mwFrame:ClearAllPoints() if self.StatusBar:GetOrientation() == "VERTICAL" then @@ -1220,7 +1244,7 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName) if idx <= current then mwFrame:SetValue(1, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil) - if current > 5 and idx <= math.fmod(current - 1, 5) + 1 then + if current >= highlightTreshold and idx <= math.fmod(current - 1, segmentSize) + 1 then mwFrame:SetStatusBarColor(above5MwColor.r, above5MwColor.g, above5MwColor.b, above5MwColor.a or 1) else mwFrame:SetStatusBarColor(color.r, color.g, color.b, color.a or 1) diff --git a/Bars/SecondaryResourceBar.lua b/Bars/SecondaryResourceBar.lua index 42027e0..9ab9788 100644 --- a/Bars/SecondaryResourceBar.lua +++ b/Bars/SecondaryResourceBar.lua @@ -139,7 +139,14 @@ function SecondaryResourceBarMixin:GetResourceValue(resource) local current = auraData and auraData.applications or 0 local max = 10 - return max / 2, current + local data = self:GetData() + local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars + + if maelstromWeaponUseTenBars then + return max, current + else + return max / 2, current + end end if resource == "TIP_OF_THE_SPEAR" then @@ -233,6 +240,7 @@ addonTable.RegisteredBar.SecondaryResourceBar = { tickColor = {r = 0, g = 0, b = 0, a = 1}, tickThickness = 1, useResourceAtlas = false, + maelstromWeaponUseTenBars = false, }, lemSettings = function(bar, defaults) local dbName = bar:GetConfig().dbName @@ -371,6 +379,66 @@ addonTable.RegisteredBar.SecondaryResourceBar = { bar:ApplyLayout(layoutName) end, }, + { + parentId = L["CATEGORY_BAR_STYLE"], + order = 406, + name = L["USE_TEN_TICK_MAELSTROM_BAR"], + kind = LEM.SettingType.Checkbox, + default = false, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.maelstromWeaponUseTenBars or false + end, + set = function(layoutName, value) + SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + + local data = SenseiClassResourceBarDB[dbName][layoutName] + data.maelstromWeaponUseTenBars = value + + bar:ApplyLayout(layoutName) + + end, + isEnabled = function(layoutName) + local _, playerClass = UnitClass("player") + local spec = C_SpecializationInfo.GetSpecialization() + local specID = C_SpecializationInfo.GetSpecializationInfo(spec) + return playerClass == "SHAMAN" and specID == 263 + end, + tooltip = L["USE_TEN_TICK_MAELSTROM_BAR"], + }, + { + parentId = L["CATEGORY_BAR_STYLE"], + order = 407, + name = L["MAELSTROM_HIGHLIGHT_THRESHOLD"], + kind = LEM.SettingType.Slider, + minValue = 6, + maxValue = 10, + valueStep = 1, + default = 6, + get = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.maelstromHighlightThreshold or 6 + end, + set = function(layoutName, value) + local data = SenseiClassResourceBarDB[dbName][layoutName] + if not data then + SenseiClassResourceBarDB[dbName][layoutName] = CopyTable(defaults) + data = SenseiClassResourceBarDB[dbName][layoutName] + end + + local num = tonumber(value) + if num and num >= 1 then + data.maelstromHighlightThreshold = num + bar:UpdateFragmentedPowerDisplay(layoutName) + end + end, + isEnabled = function(layoutName) + local data = SenseiClassResourceBarDB[dbName][layoutName] + return data and data.maelstromWeaponUseTenBars + end, + tooltip = L["MAELSTROM_HIGHLIGHT_THRESHOLD"] + }, + { parentId = L["CATEGORY_TEXT_SETTINGS"], order = 505, diff --git a/Locales/enUS.lua b/Locales/enUS.lua index f6bb99e..78f589b 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -115,6 +115,8 @@ local baseLocale = { ["BACKGROUND"] = "Background", ["USE_BAR_COLOR_FOR_BACKGROUND_COLOR"] = "Use Bar Color For Background Color", ["BORDER"] = "Border", + ["USE_TEN_TICK_MAELSTROM_BAR"] = "Use Ten Tick Maelstrom Bar", + ["MAELSTROM_HIGHLIGHT_THRESHOLD"] = "Maelstrom Weapon Highlight Threshold", -- Text settings category - Edit Mode ["CATEGORY_TEXT_SETTINGS"] = "Text Settings", From 3a2395dc47efe3d53b3476cd45b643cbcb22d9d0 Mon Sep 17 00:00:00 2001 From: Lars Lorenzen Date: Mon, 26 Jan 2026 14:10:53 +0100 Subject: [PATCH 2/4] refactor: remove maelstrom weapon threshold slider --- Bars/Abstract/Bar.lua | 15 ++++----------- Bars/SecondaryResourceBar.lua | 33 --------------------------------- Locales/enUS.lua | 1 - 3 files changed, 4 insertions(+), 45 deletions(-) diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua index 971d704..6dcd553 100644 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -839,7 +839,7 @@ function BarMixin:UpdateTicksLayout(layoutName) local resource = self:GetResource() local max = 0; if resource == "MAELSTROM_WEAPON" then - local maelstromWeaponUseTenBars = data and data.maelstromWeaponmaelstromWeaponUseTenBars + local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars max = maelstromWeaponUseTenBars and 10 or 5 elseif resource == "TIP_OF_THE_SPEAR" then max = addonTable.TipOfTheSpear.TIP_MAX_STACKS @@ -911,7 +911,7 @@ function BarMixin:CreateFragmentedPowerBars(layoutName) local maxPower if resource == "MAELSTROM_WEAPON" then - local maelstromWeaponUseTenBars = data and data.maelstromWeaponmaelstromWeaponUseTenBars + local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars maxPower = maelstromWeaponUseTenBars and 10 or 5 else maxPower = UnitPowerMax("player", resource) or 0 @@ -950,7 +950,7 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName) local resource = self:GetResource() if not resource then return end - local maelstromWeaponUseTenBars = data and data.maelstromWeaponmaelstromWeaponUseTenBars + local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars local maxPower if resource == "MAELSTROM_WEAPON" then @@ -1221,13 +1221,6 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName) local mwFrame = self.FragmentedPowerBars[idx] local mwText = self.FragmentedPowerBarTexts[idx] - local highlightTreshold - if maelstromWeaponUseTenBars then - highlightTreshold = tonumber(data.maelstromHighlightThreshold) or 5 - else - highlightTreshold = 6 - end - local segmentSize = maelstromWeaponUseTenBars and 10 or 5 if mwFrame then @@ -1244,7 +1237,7 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName) if idx <= current then mwFrame:SetValue(1, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil) - if current >= highlightTreshold and idx <= math.fmod(current - 1, segmentSize) + 1 then + if current > 5 and idx <= math.fmod(current - 1, segmentSize) + 1 then mwFrame:SetStatusBarColor(above5MwColor.r, above5MwColor.g, above5MwColor.b, above5MwColor.a or 1) else mwFrame:SetStatusBarColor(color.r, color.g, color.b, color.a or 1) diff --git a/Bars/SecondaryResourceBar.lua b/Bars/SecondaryResourceBar.lua index 9ab9788..26ddf06 100644 --- a/Bars/SecondaryResourceBar.lua +++ b/Bars/SecondaryResourceBar.lua @@ -406,39 +406,6 @@ addonTable.RegisteredBar.SecondaryResourceBar = { end, tooltip = L["USE_TEN_TICK_MAELSTROM_BAR"], }, - { - parentId = L["CATEGORY_BAR_STYLE"], - order = 407, - name = L["MAELSTROM_HIGHLIGHT_THRESHOLD"], - kind = LEM.SettingType.Slider, - minValue = 6, - maxValue = 10, - valueStep = 1, - default = 6, - get = function(layoutName) - local data = SenseiClassResourceBarDB[dbName][layoutName] - return data and data.maelstromHighlightThreshold or 6 - end, - set = function(layoutName, value) - local data = SenseiClassResourceBarDB[dbName][layoutName] - if not data then - SenseiClassResourceBarDB[dbName][layoutName] = CopyTable(defaults) - data = SenseiClassResourceBarDB[dbName][layoutName] - end - - local num = tonumber(value) - if num and num >= 1 then - data.maelstromHighlightThreshold = num - bar:UpdateFragmentedPowerDisplay(layoutName) - end - end, - isEnabled = function(layoutName) - local data = SenseiClassResourceBarDB[dbName][layoutName] - return data and data.maelstromWeaponUseTenBars - end, - tooltip = L["MAELSTROM_HIGHLIGHT_THRESHOLD"] - }, - { parentId = L["CATEGORY_TEXT_SETTINGS"], order = 505, diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 78f589b..ed5b49d 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -116,7 +116,6 @@ local baseLocale = { ["USE_BAR_COLOR_FOR_BACKGROUND_COLOR"] = "Use Bar Color For Background Color", ["BORDER"] = "Border", ["USE_TEN_TICK_MAELSTROM_BAR"] = "Use Ten Tick Maelstrom Bar", - ["MAELSTROM_HIGHLIGHT_THRESHOLD"] = "Maelstrom Weapon Highlight Threshold", -- Text settings category - Edit Mode ["CATEGORY_TEXT_SETTINGS"] = "Text Settings", From fce4a013ac3340e1ada33c7ef2d83599c7d2b117 Mon Sep 17 00:00:00 2001 From: Lars Lorenzen Date: Mon, 26 Jan 2026 19:52:33 +0100 Subject: [PATCH 3/4] refactor: apply review feedback --- Bars/Abstract/Bar.lua | 6 ++---- Bars/SecondaryResourceBar.lua | 19 +++++-------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua index 6dcd553..1666158 100644 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -839,8 +839,7 @@ function BarMixin:UpdateTicksLayout(layoutName) local resource = self:GetResource() local max = 0; if resource == "MAELSTROM_WEAPON" then - local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars - max = maelstromWeaponUseTenBars and 10 or 5 + max = data.maelstromWeaponUseTenBars and 10 or 5 elseif resource == "TIP_OF_THE_SPEAR" then max = addonTable.TipOfTheSpear.TIP_MAX_STACKS elseif type(resource) == "number" then @@ -911,8 +910,7 @@ function BarMixin:CreateFragmentedPowerBars(layoutName) local maxPower if resource == "MAELSTROM_WEAPON" then - local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars - maxPower = maelstromWeaponUseTenBars and 10 or 5 + maxPower = data.maelstromWeaponUseTenBars and 10 or 5 else maxPower = UnitPowerMax("player", resource) or 0 end diff --git a/Bars/SecondaryResourceBar.lua b/Bars/SecondaryResourceBar.lua index 26ddf06..c8d4804 100644 --- a/Bars/SecondaryResourceBar.lua +++ b/Bars/SecondaryResourceBar.lua @@ -137,16 +137,9 @@ function SecondaryResourceBarMixin:GetResourceValue(resource) if resource == "MAELSTROM_WEAPON" then local auraData = C_UnitAuras.GetPlayerAuraBySpellID(344179) -- Maelstrom Weapon local current = auraData and auraData.applications or 0 - local max = 10 + local max = data.maelstromWeaponUseTenBars and 10 or 5 - local data = self:GetData() - local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars - - if maelstromWeaponUseTenBars then - return max, current - else - return max / 2, current - end + return max, current end if resource == "TIP_OF_THE_SPEAR" then @@ -392,19 +385,17 @@ addonTable.RegisteredBar.SecondaryResourceBar = { set = function(layoutName, value) SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) - local data = SenseiClassResourceBarDB[dbName][layoutName] - data.maelstromWeaponUseTenBars = value + SenseiClassResourceBarDB[dbName][layoutName].maelstromWeaponUseTenBars = value bar:ApplyLayout(layoutName) end, isEnabled = function(layoutName) - local _, playerClass = UnitClass("player") + local playerClass = select(2, UnitClass("player")) local spec = C_SpecializationInfo.GetSpecialization() local specID = C_SpecializationInfo.GetSpecializationInfo(spec) - return playerClass == "SHAMAN" and specID == 263 + return playerClass == "SHAMAN" and specID == 263 -- Enhancement end, - tooltip = L["USE_TEN_TICK_MAELSTROM_BAR"], }, { parentId = L["CATEGORY_TEXT_SETTINGS"], From 3644e900dbc51c4a9ff2a904962579f0b8b89279 Mon Sep 17 00:00:00 2001 From: Lars Lorenzen Date: Tue, 27 Jan 2026 19:40:06 +0100 Subject: [PATCH 4/4] refactor: apply review feedback v2 - Fix text formatting to adjust to max maelstrom weapon buffs - Auto-disable 10-tick bar if Raging Maelstrom talent is unlearned - 10-tick bar can only be enabled if Raging Maelstrom talent is learned --- Bars/Abstract/Bar.lua | 20 ++++++++++++++------ Bars/SecondaryResourceBar.lua | 23 ++++++++++++++++++----- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Bars/Abstract/Bar.lua b/Bars/Abstract/Bar.lua index 331debd..52a4135 100644 --- a/Bars/Abstract/Bar.lua +++ b/Bars/Abstract/Bar.lua @@ -1263,6 +1263,15 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName, data, maxPower) local auraData = C_UnitAuras.GetPlayerAuraBySpellID(344179) -- Maelstrom Weapon local current = auraData and auraData.applications or 0 local above5MwColor = addonTable:GetOverrideResourceColor("MAELSTROM_WEAPON_ABOVE_5") or color + + local isRagingMaelstromTalented = C_SpellBook.IsSpellKnown(384143) -- Raging Maelstrom + + if data.maelstromWeaponUseTenBars and not isRagingMaelstromTalented then + data.maelstromWeaponUseTenBars = false; + self:ApplyLayout(layoutName) + end + + local segmentSize = (data and data.maelstromWeaponUseTenBars) and 10 or 5 -- Reuse pre-allocated table for performance local displayOrder = self._displayOrder @@ -1281,8 +1290,7 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName, data, maxPower) local idx = displayOrder[pos] local mwFrame = self.FragmentedPowerBars[idx] local mwText = self.FragmentedPowerBarTexts[idx] - - local segmentSize = maelstromWeaponUseTenBars and 10 or 5 + if mwFrame then mwFrame:ClearAllPoints() @@ -1299,10 +1307,10 @@ function BarMixin:UpdateFragmentedPowerDisplay(layoutName, data, maxPower) if idx <= current then mwFrame:SetValue(1, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil) if current > 5 and idx <= math.fmod(current - 1, segmentSize) + 1 then - mwFrame:SetStatusBarColor(above5MwColor.r, above5MwColor.g, above5MwColor.b, above5MwColor.a or 1) - else - mwFrame:SetStatusBarColor(color.r, color.g, color.b, color.a or 1) - end + mwFrame:SetStatusBarColor(above5MwColor.r, above5MwColor.g, above5MwColor.b, above5MwColor.a or 1) + else + mwFrame:SetStatusBarColor(color.r, color.g, color.b, color.a or 1) + end else mwFrame:SetValue(0, data.smoothProgress and Enum.StatusBarInterpolation.ExponentialEaseOut or nil) mwFrame:SetStatusBarColor(color.r * 0.5, color.g * 0.5, color.b * 0.5, color.a or 1) diff --git a/Bars/SecondaryResourceBar.lua b/Bars/SecondaryResourceBar.lua index 60f360c..d84273a 100644 --- a/Bars/SecondaryResourceBar.lua +++ b/Bars/SecondaryResourceBar.lua @@ -178,7 +178,7 @@ end function SecondaryResourceBarMixin:GetTagValues(resource, max, current, precision) local pFormat = "%." .. (precision or 0) .. "f" - + local data = self:GetData() local tagValues = addonTable.PowerBarMixin.GetTagValues(self, resource, max, current, precision) if resource == "STAGGER" then @@ -202,8 +202,11 @@ function SecondaryResourceBarMixin:GetTagValues(resource, max, current, precisio end if resource == "MAELSTROM_WEAPON" then - local percentStr = string.format(pFormat, (current / (max * 2)) * 100) - local maxStr = string.format("%s", AbbreviateNumbers(max * 2)) + local isRagingMaelstromTalented = C_SpellBook.IsSpellKnown(384143) + local effectiveMax = (data.maelstromWeaponUseTenBars or isRagingMaelstromTalented) and 10 or 5 + + local percentStr = string.format(pFormat, (current / (effectiveMax)) * 100) + local maxStr = string.format("%s", AbbreviateNumbers(effectiveMax)) tagValues["[percent]"] = function() return percentStr end tagValues["[max]"] = function() return maxStr end end @@ -412,11 +415,20 @@ addonTable.RegisteredBar.SecondaryResourceBar = { default = false, get = function(layoutName) local data = SenseiClassResourceBarDB[dbName][layoutName] - return data and data.maelstromWeaponUseTenBars or false + if data and data.maelstromWeaponUseTenBars ~= nil then + return data.maelstromWeaponUseTenBars + else + return defaults.maelstromWeaponUseTenBars + end end, set = function(layoutName, value) SenseiClassResourceBarDB[dbName][layoutName] = SenseiClassResourceBarDB[dbName][layoutName] or CopyTable(defaults) + local isRagingMaelstromTalented = C_SpellBook.IsSpellKnown(384143) -- Raging Maelstrom + if not isRagingMaelstromTalented then + value = false + end + SenseiClassResourceBarDB[dbName][layoutName].maelstromWeaponUseTenBars = value bar:ApplyLayout(layoutName) @@ -426,7 +438,8 @@ addonTable.RegisteredBar.SecondaryResourceBar = { local playerClass = select(2, UnitClass("player")) local spec = C_SpecializationInfo.GetSpecialization() local specID = C_SpecializationInfo.GetSpecializationInfo(spec) - return playerClass == "SHAMAN" and specID == 263 -- Enhancement + local isRagingMaelstromTalented = C_SpellBook.IsSpellKnown(384143) -- Raging Maelstrom + return playerClass == "SHAMAN" and isRagingMaelstromTalented and specID == 263 -- Enhancement end, }, {