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 #5460

Merged
merged 7 commits into from
Oct 3, 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
4 changes: 4 additions & 0 deletions WeakAuras/GenericTrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
elseif (data.statesParameter == "unit") then
if arg1 then
if Private.multiUnitUnits[data.trigger.unit] then
if data.trigger.unit == "group" and IsInRaid() and Private.multiUnitUnits.party[arg1] then
return
end

unitForUnitTrigger = arg1
cloneIdForUnitTrigger = arg1
else
Expand Down
18 changes: 18 additions & 0 deletions WeakAuras/Modernize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,24 @@ function Private.Modernize(data, oldSnapshot)
fixData(data.load, loadFix)
end

if data.internalVersion < 78 then
if data.triggers then
for triggerId, triggerData in ipairs(data.triggers) do
local trigger = triggerData.trigger
-- Item Type is now always a multi selection
if trigger and trigger.type == "item" and trigger.event == "Item Type Equipped" then
local value = trigger.itemTypeName and trigger.itemTypeName.single or nil
if trigger.use_itemTypeName and value then
trigger.use_itemTypeName = false
trigger.itemTypeName = {multi = {[value] = true}}
else
trigger.itemTypeName = {multi = {}}
end
end
end
end
end

data.internalVersion = max(data.internalVersion or 0, WeakAuras.InternalVersion())
end

Expand Down
13 changes: 10 additions & 3 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3677,7 +3677,7 @@ Private.event_prototypes = {
if powerType == 4 then
table.insert(ret, [[
local power = GetComboPoints(unit, unit .. '-target')
local total = math.max(1, UnitPowerMax(unit, 14))
local total = math.max(1, UnitPowerMax(unit, 4))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
🤔 what was powertype 14 before it was obsoleted?

]])
else
table.insert(ret, [[
Expand Down Expand Up @@ -5981,7 +5981,13 @@ Private.event_prototypes = {
test = "true",
conditionType = "bool",
conditionTest = function(state, needle)
return state and state.show and (UnitExists('target') and C_Item.IsItemInRange(state.itemname, 'target')) == (needle == 1)
if not state or not state.show or not UnitExists('target') then
return false
end
if InCombatLockdown() and not UnitCanAttack('player', 'target') then
return false
end
return C_Item.IsItemInRange(state.itemname, 'target') == (needle == 1)
end,
conditionEvents = AddTargetConditionEvents({
"WA_SPELL_RANGECHECK",
Expand Down Expand Up @@ -8754,7 +8760,8 @@ Private.event_prototypes = {
type = "multiselect",
values = "item_weapon_types",
required = true,
test = "Private.ExecEnv.IsEquippedItemType(%s, itemSlot)"
test = "Private.ExecEnv.IsEquippedItemType(%s, itemSlot)",
multiNoSingle = true
},
},
automaticrequired = true,
Expand Down
2 changes: 1 addition & 1 deletion WeakAuras/WeakAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local AddonName = ...
---@class Private
local Private = select(2, ...)

local internalVersion = 77
local internalVersion = 78

-- Lua APIs
local insert = table.insert
Expand Down
2 changes: 2 additions & 0 deletions WeakAurasOptions/CommonOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ local function ProgressOptions(data)
local options = {
__title = L["Progress Settings"],
__order = 98,
__collapsed = true
}

options.progressSource = {
Expand Down Expand Up @@ -1244,6 +1245,7 @@ local function PositionOptions(id, data, _, hideWidthHeight, disableSelfPoint, g
local positionOptions = {
__title = L["Position Settings"],
__order = metaOrder,
__collapsed = true,
width = {
type = "range",
control = "WeakAurasSpinBox",
Expand Down
1 change: 1 addition & 0 deletions WeakAurasOptions/DisplayOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ function OptionsPrivate.GetDisplayOptions(data)
subIndex[subRegionType] = subIndex[subRegionType] and subIndex[subRegionType] + 1 or 1
local options, common = OptionsPrivate.Private.subRegionOptions[subRegionType].create(data, subRegionData, index, subIndex[subRegionType])
options.__order = 200 + index
options.__collapsed = true
regionOption["sub." .. index .. "." .. subRegionType] = options
commonOption[subRegionType] = common
end
Expand Down
6 changes: 5 additions & 1 deletion WeakAurasOptions/LoadOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ function OptionsPrivate.ConstructOptions(prototype, data, startorder, triggernum
options["use_"..name].desc = arg.desc;
end
if(arg.required) then
trigger["use_"..realname] = true;
if arg.type == "multiselect" and arg.multiNoSingle then
trigger["use_"..realname] = false
else
trigger["use_"..realname] = true
end
if not(triggertype) then
options["use_"..name].disabled = true;
else
Expand Down
50 changes: 17 additions & 33 deletions WeakAurasTemplates/TriggerTemplatesData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ templates.class.WARRIOR = {
{ spell = 107574, type = "ability", buff = true, talent = 112232 }, -- Avatar
{ spell = 118038, type = "ability", buff = true, talent = 112128 }, -- Die by the Sword
{ spell = 163201, type = "ability", overlayGlow = true, requiresTarget = true, usable = true }, -- Execute
{ spell = 167105, type = "ability", requiresTarget = true, debuff = true }, -- Colossus Smash
{ spell = 190456, type = "ability", buff = true, talent = 114738 }, -- Ignore Pain
{ spell = 202168, type = "ability", requiresTarget = true, talent = 112183 }, -- Impending Victory
{ spell = 227847, type = "ability", buff = true, talent = 112314 }, -- Bladestorm
Expand Down Expand Up @@ -2281,39 +2282,22 @@ templates.class.PRIEST = {
[2] = {
title = L["Debuffs"],
args = {
{ spell = 17, type = "buff", unit = "player" }, -- Power Word: Shield
{ spell = 139, type = "buff", unit = "player", talent = 103869 }, -- Renew
{ spell = 586, type = "buff", unit = "player" }, -- Fade
{ spell = 10060, type = "buff", unit = "player", talent = 103844 }, -- Power Infusion
{ spell = 15286, type = "buff", unit = "player", talent = 103841 }, -- Vampiric Embrace
{ spell = 21562, type = "buff", unit = "player" }, -- Power Word: Fortitude
{ spell = 41635, type = "buff", unit = "player", talent = 103870 }, -- Prayer of Mending
{ spell = 47585, type = "buff", unit = "player", talent = 103806 }, -- Dispersion
{ spell = 65081, type = "buff", unit = "player", talent = 103856 }, -- Body and Soul
{ spell = 111759, type = "buff", unit = "player" }, -- Levitate
{ spell = 114255, type = "buff", unit = "player", talent = 103823 }, -- Surge of Light
{ spell = 121557, type = "buff", unit = "player", talent = 103853 }, -- Angelic Feather
{ spell = 193065, type = "buff", unit = "player", talent = 103858 }, -- Protective Light
{ spell = 194249, type = "buff", unit = "player" }, -- Voidform
{ spell = 232698, type = "buff", unit = "player" }, -- Shadowform
{ spell = 247776, type = "buff", unit = "player" }, -- Mind Trauma
{ spell = 341282, type = "buff", unit = "player", talent = 103804 }, -- Unfurling Darkness
{ spell = 373204, type = "buff", unit = "player", talent = 103684 }, -- Mind Devourer
{ spell = 373213, type = "buff", unit = "player", talent = 103683 }, -- Insidious Ire
{ spell = 373276, type = "buff", unit = "player", talent = 103817 }, -- Idol of Yogg-Saron
{ spell = 375981, type = "buff", unit = "player", talent = 103805 }, -- Shadowy Insight
{ spell = 377066, type = "buff", unit = "player", talent = 103800 }, -- Mental Fortitude
{ spell = 390617, type = "buff", unit = "player", talent = 103857 }, -- From Darkness Comes Light
{ spell = 390636, type = "buff", unit = "player", talent = 103850 }, -- Rhapsody
{ spell = 390933, type = "buff", unit = "player", talent = 103873 }, -- Words of the Pious
{ spell = 390978, type = "buff", unit = "player", talent = 103833 }, -- Twist of Fate
{ spell = 391092, type = "buff", unit = "player", talent = 115449 }, -- Mind Melt
{ spell = 391099, type = "buff", unit = "player", talent = 103802 }, -- Dark Evangelism
{ spell = 391109, type = "buff", unit = "player", talent = 103680 }, -- Dark Ascension
{ spell = 391401, type = "buff", unit = "player" }, -- Mind Flay: Insanity
{ spell = 392511, type = "buff", unit = "player", talent = 103681 }, -- Deathspeaker
{ spell = 393919, type = "buff", unit = "player", talent = 103789 }, -- Screams of the Void
{ spell = 407468, type = "buff", unit = "player" }, -- Mind Spike: Insanity
{ spell = 589, type = "debuff", unit = "target" }, -- Shadow Word: Pain
{ spell = 8122, type = "debuff", unit = "target" }, -- Psychic Scream
{ spell = 15407, type = "debuff", unit = "target" }, -- Mind Flay
{ spell = 15487, type = "debuff", unit = "target", talent = 103792 }, -- Silence
{ spell = 34914, type = "debuff", unit = "target" }, -- Vampiric Touch
{ spell = 64044, type = "debuff", unit = "target", talent = 103793 }, -- Psychic Horror
{ spell = 114404, type = "debuff", unit = "target" }, -- Void Tendril's Grasp
{ spell = 247777, type = "debuff", unit = "target" }, -- Mind Trauma
{ spell = 263165, type = "debuff", unit = "target", talent = 103796 }, -- Void Torrent
{ spell = 322098, type = "debuff", unit = "target", talent = 103863 }, -- Death and Madness
{ spell = 335467, type = "debuff", unit = "target", talent = 103808 }, -- Devouring Plague
{ spell = 373281, type = "debuff", unit = "target" }, -- Echoing Void
{ spell = 390669, type = "debuff", unit = "target", talent = 103839 }, -- Apathy
{ spell = 391403, type = "debuff", unit = "target" }, -- Mind Flay: Insanity
{ spell = 394976, type = "debuff", unit = "target" }, -- Mind Sear
{ spell = 453850, type = "debuff", unit = "target", herotalent = 117284 }, -- Resonant Energy
},
icon = 136207
},
Expand Down