feat: add ten Maelstrom Weapon ticks and configurable highlight threshold for Enhancement Shaman#65
Conversation
…hold for Enhancement Shaman
|
Hi, thanks. Can you remove the slider to change the threshold please, I intend to something for that. I will accept the 10 bars mode though. |
Removed the slider and everything related to threshold. Now it's just a toggle for using 10 bar for maelstrom. Threshold is back to "> 5" whether it's 5 or 10 bars. |
Snsei987
left a comment
There was a problem hiding this comment.
Most of the time you can do something quicker because data is not null, so no need to check against that.
Bars/SecondaryResourceBar.lua
Outdated
| local specID = C_SpecializationInfo.GetSpecializationInfo(spec) | ||
| return playerClass == "SHAMAN" and specID == 263 | ||
| end, | ||
| tooltip = L["USE_TEN_TICK_MAELSTROM_BAR"], |
There was a problem hiding this comment.
| tooltip = L["USE_TEN_TICK_MAELSTROM_BAR"], |
No need.
|
|
||
| local data = SenseiClassResourceBarDB[dbName][layoutName] | ||
| data.maelstromWeaponUseTenBars = value | ||
|
|
||
| bar:ApplyLayout(layoutName) | ||
|
|
There was a problem hiding this comment.
| local data = SenseiClassResourceBarDB[dbName][layoutName] | |
| data.maelstromWeaponUseTenBars = value | |
| bar:ApplyLayout(layoutName) | |
| SenseiClassResourceBarDB[dbName][layoutName].maelstromWeaponUseTenBars = value | |
| bar:ApplyLayout(layoutName) |
Bars/SecondaryResourceBar.lua
Outdated
|
|
||
| end, | ||
| isEnabled = function(layoutName) | ||
| local _, playerClass = UnitClass("player") |
There was a problem hiding this comment.
| local _, playerClass = UnitClass("player") | |
| local playerClass = select(2, UnitClass("player")) |
Bars/SecondaryResourceBar.lua
Outdated
| local _, playerClass = UnitClass("player") | ||
| local spec = C_SpecializationInfo.GetSpecialization() | ||
| local specID = C_SpecializationInfo.GetSpecializationInfo(spec) | ||
| return playerClass == "SHAMAN" and specID == 263 |
There was a problem hiding this comment.
| return playerClass == "SHAMAN" and specID == 263 | |
| return playerClass == "SHAMAN" and specID == 263 -- Enhancement |
Bars/SecondaryResourceBar.lua
Outdated
| @@ -139,7 +139,14 @@ | |||
| local current = auraData and auraData.applications or 0 | |||
| local max = 10 | |||
There was a problem hiding this comment.
| local max = 10 | |
| local max = data.maelstromWeaponUseTenBars and 10 or 5 |
Bars/SecondaryResourceBar.lua
Outdated
| local data = self:GetData() | ||
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | ||
|
|
||
| if maelstromWeaponUseTenBars then | ||
| return max, current | ||
| else | ||
| return max / 2, current | ||
| end |
There was a problem hiding this comment.
| 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 |
Bars/Abstract/Bar.lua
Outdated
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | ||
|
|
||
| local maxPower | ||
| if resource == "MAELSTROM_WEAPON" then | ||
| maxPower = maelstromWeaponUseTenBars and 10 or 5 |
There was a problem hiding this comment.
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | |
| local maxPower | |
| if resource == "MAELSTROM_WEAPON" then | |
| maxPower = maelstromWeaponUseTenBars and 10 or 5 | |
| local maxPower | |
| if resource == "MAELSTROM_WEAPON" then | |
| maxPower = data.maelstromWeaponUseTenBars and 10 or 5 |
There was a problem hiding this comment.
Tried inlining data.maelstromWeaponUseTenBars as suggested, but in testing it caused incorrect bar filling for the ten tick bar. Coloring only the first 5 bars, even at 10 maelstrom.
The current implementation keeps the behavior as expected and stable in-game, so i have kept it as is.
If there is another preferred pattern for guarding against data being nil during refresh, i am happy to adjust.
There was a problem hiding this comment.
Use this in the getter in the file SecondaryResourceBar.lua l.401
local data = SenseiClassResourceBarDB[dbName][layoutName]
if data and data.maelstromWeaponUseTenBars ~= nil then
return data.maelstromWeaponUseTenBars
else
return defaults.maelstromWeaponUseTenBars
end
This will assure you always have something
Bars/Abstract/Bar.lua
Outdated
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | ||
| maxPower = maelstromWeaponUseTenBars and 10 or 5 |
There was a problem hiding this comment.
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | |
| maxPower = maelstromWeaponUseTenBars and 10 or 5 | |
| maxPower = data.maelstromWeaponUseTenBars and 10 or 5 |
Bars/Abstract/Bar.lua
Outdated
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | ||
| max = maelstromWeaponUseTenBars and 10 or 5 |
There was a problem hiding this comment.
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | |
| max = maelstromWeaponUseTenBars and 10 or 5 | |
| max = data.maelstromWeaponUseTenBars and 10 or 5 |
Snsei987
left a comment
There was a problem hiding this comment.
Check the formats option for the text, I think they are broken.
Bars/Abstract/Bar.lua
Outdated
| local maelstromWeaponUseTenBars = data and data.maelstromWeaponUseTenBars | ||
|
|
||
| local maxPower | ||
| if resource == "MAELSTROM_WEAPON" then | ||
| maxPower = maelstromWeaponUseTenBars and 10 or 5 |
There was a problem hiding this comment.
Use this in the getter in the file SecondaryResourceBar.lua l.401
local data = SenseiClassResourceBarDB[dbName][layoutName]
if data and data.maelstromWeaponUseTenBars ~= nil then
return data.maelstromWeaponUseTenBars
else
return defaults.maelstromWeaponUseTenBars
end
This will assure you always have something
…-ten-tick-maelstrom-bar
…-ten-tick-maelstrom-bar
- 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
This pull request adds a new feature for Enhancement Shamans:
This change adds a bit of customization for Enhancement Shamans tracking Maelstrom Weapon stacks.
Tested in-game with Enhancement Specialization. Not enabled when playing other classes or other shaman specs.
Located under Bar Style in Edit Mode (Not sure about the placement there though) - Can be moved if like the changes but wants the settings elsewhere.