Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smallpatches #5488

Merged
merged 3 commits into from
Oct 23, 2024
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
114 changes: 8 additions & 106 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3630,30 +3630,12 @@ Private.event_prototypes = {
table.insert(ret, ([[
local comboPoint = UnitPower(unit, 4)
local chargedComboPoint = GetUnitChargedPowerPoints('player') or {}
if state.chargedComboPoint1 ~= chargedComboPoint[1] then
state.chargedComboPoint1 = chargedComboPoint[1]
local countCharged = #chargedComboPoint
if state.countCharged ~= countCharged then
state.countCharged = countCharged
state.changed = true
end

if state.chargedComboPoint2 ~= chargedComboPoint[2] then
state.chargedComboPoint2 = chargedComboPoint[2]
state.changed = true
end

if state.chargedComboPoint3 ~= chargedComboPoint[3] then
state.chargedComboPoint3 = chargedComboPoint[3]
state.changed = true
end

if state.chargedComboPoint4 ~= chargedComboPoint[4] then
state.chargedComboPoint4 = chargedComboPoint[4]
state.changed = true
end
local currentCharged = tContains(chargedComboPoint, comboPoint)
if state.currentCharged ~= currentCharged then
state.currentCharged = currentCharged
state.changed = true
end
local power = UnitPower(unit, powerType)
local total = math.max(1, UnitPowerMax(unit, powerType))
]]))
Expand Down Expand Up @@ -3756,53 +3738,9 @@ Private.event_prototypes = {
hidden = not WeakAuras.IsRetail()
},
{
name = "currentCharged",
type = "bool",
display = L["Current Combo Point charged"],
conditionType = "bool",
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player'and trigger.use_powertype and trigger.powertype == 4
end,
hidden = true,
test = "true"
},
{
name = "chargedComboPoint1",
type = "number",
display = L["Charged Combo Point 1"],
conditionType = "number",
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player'and trigger.use_powertype and trigger.powertype == 4
end,
hidden = true,
test = "true"
},
{
name = "chargedComboPoint2",
type = "number",
display = L["Charged Combo Point 2"],
conditionType = "number",
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player'and trigger.use_powertype and trigger.powertype == 4
end,
hidden = true,
test = "true"
},
{
name = "chargedComboPoint3",
name = "countCharged",
type = "number",
display = L["Charged Combo Point 3"],
conditionType = "number",
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player'and trigger.use_powertype and trigger.powertype == 4
end,
hidden = true,
test = "true"
},
{
name = "chargedComboPoint4",
type = "number",
display = L["Charged Combo Point 4"],
display = L["Charged Combo Points"],
conditionType = "number",
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player'and trigger.use_powertype and trigger.powertype == 4
Expand Down Expand Up @@ -4115,53 +4053,17 @@ Private.event_prototypes = {
end
},
{
name = L["Charged Combo Point (1)"],
func = function(trigger, state)
if type(state.chargedComboPoint1) == "number" then
return state.chargedComboPoint1 - 1, state.chargedComboPoint1
end
return 0, 0
end,
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player' and trigger.use_powertype and trigger.powertype == 4 and trigger.use_showChargedComboPoints
end,
},
{
name = L["Charged Combo Point (2)"],
name = L["Charged Combo Points"],
func = function(trigger, state)
if type(state.chargedComboPoint2) == "number" then
return state.chargedComboPoint2 - 1, state.chargedComboPoint2
if type(state.countCharged) == "number" then
return 0, state.countCharged
end
return 0, 0
end,
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player' and trigger.use_powertype and trigger.powertype == 4 and trigger.use_showChargedComboPoints
end,
},
{
name = L["Charged Combo Point (3)"],
func = function(trigger, state)
if type(state.chargedComboPoint3) == "number" then
return state.chargedComboPoint3 - 1, state.chargedComboPoint3
end
return 0, 0
end,
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player' and trigger.use_powertype and trigger.powertype == 4 and trigger.use_showChargedComboPoints
end,
},
{
name = L["Charged Combo Point (4)"],
func = function(trigger, state)
if type(state.chargedComboPoint4) == "number" then
return state.chargedComboPoint4 - 1, state.chargedComboPoint4
end
return 0, 0
end,
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player' and trigger.use_powertype and trigger.powertype == 4 and trigger.use_showChargedComboPoints
end,
}
},
automaticrequired = true
},
Expand Down
1 change: 1 addition & 0 deletions WeakAurasOptions/LoadOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,7 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
v = arg.multiConvertKey(trigger, v)
end
if v then
trigger[realname] = trigger[realname] or {}
trigger[realname].multi = trigger[realname].multi or {};
if (calledFromSetAll or arg.multiTristate) then
trigger[realname].multi[v] = calledFromSetAll;
Expand Down
Loading