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

Merged
merged 5 commits into from
Oct 21, 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
2 changes: 1 addition & 1 deletion .github/scripts/discordupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def has_k(text):
return False

def checkChar(char):
for name in ('CJK','CHINESE','KATAKANA', 'LATIN', 'DIGIT', 'SPACE', 'HANGUL'):
for name in ('CJK','CHINESE','KATAKANA', 'LATIN', 'DIGIT', 'SPACE', 'HANGUL', 'CYRILLIC'):
if unicodedata.name(char).startswith(name):
return True
return False
Expand Down
5 changes: 3 additions & 2 deletions WeakAuras/BuffTrigger2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4278,7 +4278,8 @@ function BuffTrigger.InitMultiAura()
end

function BuffTrigger.HandleMultiEvent(frame, event, ...)
Private.StartProfileSystem("bufftrigger2 - multi")
local system = "bufftrigger2 - multi - " .. event
Private.StartProfileSystem(system)
if event == "COMBAT_LOG_EVENT_UNFILTERED" then
CombatLog(CombatLogGetCurrentEventInfo())
elseif event == "UNIT_TARGET" then
Expand Down Expand Up @@ -4308,7 +4309,7 @@ function BuffTrigger.HandleMultiEvent(frame, event, ...)
end
wipe(matchDataMulti)
end
Private.StopProfileSystem("bufftrigger2 - multi")
Private.StopProfileSystem(system)
end

function BuffTrigger.GetTriggerDescription(data, triggernum, namestable)
Expand Down
38 changes: 38 additions & 0 deletions WeakAuras/GenericTrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3844,6 +3844,44 @@ function WeakAuras.GetEquipmentSetInfo(itemSetName, partial)
return bestMatchName, bestMatchIcon, bestMatchNumEquipped, bestMatchNumItems;
end

-- Workaround Stagger's last tick not resulting in UNIT_ABSORB_AMOUNT_CHANGED
local staggerWatchFrame
function Private.WatchStagger()
if not staggerWatchFrame then
staggerWatchFrame = CreateFrame("FRAME")
Private.frames["WeakAuras Stagger Frame"] = staggerWatchFrame
staggerWatchFrame:RegisterUnitEvent("UNIT_ABSORB_AMOUNT_CHANGED", "player")
staggerWatchFrame:SetScript("OnEvent", function()
Private.StartProfileSystem("stagger")
local stagger = UnitStagger("player")
InfusOnWoW marked this conversation as resolved.
Show resolved Hide resolved
if stagger > 0 then
if not staggerWatchFrame.onupdate then
staggerWatchFrame.onupdate = true
staggerWatchFrame:SetScript("OnUpdate", function()
Private.StartProfileSystem("stagger")
local stagger = UnitStagger("player")
if stagger ~= staggerWatchFrame.stagger then
staggerWatchFrame.stagger = stagger
WeakAuras.ScanEvents("WA_UNIT_STAGGER_CHANGED", "player", stagger)
end
if stagger == 0 then
staggerWatchFrame:SetScript("OnUpdate", nil)
staggerWatchFrame.onupdate = nil
end
Private.StopProfileSystem("stagger")
end)
end
end

if stagger ~= staggerWatchFrame.stagger then
staggerWatchFrame.stagger = stagger
WeakAuras.ScanEvents("WA_UNIT_STAGGER_CHANGED", "player", stagger)
end
Private.StopProfileSystem("stagger")
end)
end
end

function Private.ExecEnv.CheckTotemName(totemName, triggerTotemName, triggerTotemPattern, triggerTotemOperator)
if not totemName or totemName == "" then
return false
Expand Down
33 changes: 7 additions & 26 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3542,9 +3542,7 @@ Private.event_prototypes = {
AddUnitEventForEvents(result, "player", "UNIT_SPELLCAST_FAILED")
AddUnitEventForEvents(result, "player", "UNIT_SPELLCAST_SUCCEEDED")
end
if trigger.use_powertype and trigger.powertype == 99 then
AddUnitEventForEvents(result, unit, "UNIT_ABSORB_AMOUNT_CHANGED")
end

if trigger.use_ignoreDead or trigger.use_ignoreDisconnected then
AddUnitEventForEvents(result, unit, "UNIT_FLAGS")
end
Expand Down Expand Up @@ -3572,6 +3570,10 @@ Private.event_prototypes = {
AddUnitRoleChangeInternalEvents(unit, result)
end
AddUnitSpecChangeInternalEvents(unit, result)
if trigger.use_powertype and trigger.powertype == 99 and trigger.unit == "player" then
Private.WatchStagger()
tinsert(result, "WA_UNIT_STAGGER_CHANGED");
end
if WeakAuras.IsClassicEra() and trigger.use_showCost and trigger.unit == "player" then
tinsert(result, "WA_UNIT_QUEUED_SPELL_CHANGED");
end
Expand Down Expand Up @@ -3626,11 +3628,9 @@ Private.event_prototypes = {
]]):format(trigger.use_scaleStagger and trigger.scaleStagger or 1))
elseif powerType == 4 and trigger.unit == 'player' then
table.insert(ret, ([[
local chargedAsSeven = %s
local comboPoint = UnitPower(unit, 4)
local chargedComboPoint = GetUnitChargedPowerPoints('player') or {}
if state.chargedComboPoint1 ~= chargedComboPoint[1] then
state.chargedComboPoint = chargedComboPoint[1] -- For backwards compability
state.chargedComboPoint1 = chargedComboPoint[1]
state.changed = true
end
Expand All @@ -3654,18 +3654,9 @@ Private.event_prototypes = {
state.currentCharged = currentCharged
state.changed = true
end
local power
if chargedAsSeven then
if tContains(chargedComboPoint, comboPoint) then
power = 7
else
power = comboPoint
end
else
power = UnitPower(unit, powerType)
end
local power = UnitPower(unit, powerType)
local total = math.max(1, UnitPowerMax(unit, powerType))
]]):format(trigger.use_chargedAsSeven and "true" or "false"))
]]))
else
table.insert(ret, [[
local power = UnitPower(unit, powerType)
Expand Down Expand Up @@ -3764,16 +3755,6 @@ Private.event_prototypes = {
end,
hidden = not WeakAuras.IsRetail()
},
{
name = "chargedAsSeven",
display = L["Treat charged combo point as 7 combo points"],
type = "toggle",
test = "true",
enable = function(trigger)
return WeakAuras.IsRetail() and trigger.unit == 'player' and trigger.use_powertype and trigger.powertype == 4
end,
hidden = not WeakAuras.IsRetail()
},
{
name = "currentCharged",
type = "bool",
Expand Down
3 changes: 2 additions & 1 deletion WeakAurasTemplates/TriggerTemplatesData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4162,6 +4162,7 @@ templates.class.DRUID = {
{ spell = 391528, type = "buff", unit = "player", talent = 103177 }, -- Convoke the Spirits
{ spell = 391873, type = "buff", unit = "player", talent = 103168 }, -- Tiger's Tenacity
{ spell = 391876, type = "buff", unit = "player", talent = 103179 }, -- Frantic Momentum
{ spell = 391882, type = "buff", unit = "player", talent = 103152 }, -- Apex Predator's Craving
{ spell = 391974, type = "buff", unit = "player", talent = 103165 }, -- Sudden Ambush
{ spell = 393903, type = "buff", unit = "player", talent = 103313 }, -- Ursine Vigor
{ spell = 400126, type = "buff", unit = "player", talent = 123792 }, -- Forestwalk
Expand Down Expand Up @@ -4228,7 +4229,7 @@ templates.class.DRUID = {
{ spell = 6795, type = "ability", debuff = true, requiresTarget = true, usable = true }, -- Growl
{ spell = 8921, type = "ability", requiresTarget = true }, -- Moonfire
{ spell = 20484, type = "ability" }, -- Rebirth
{ spell = 22568, type = "ability", requiresTarget = true, usable = true }, -- Ferocious Bite
{ spell = 22568, type = "ability", overlayGlow = true, requiresTarget = true, usable = true }, -- Ferocious Bite
{ spell = 22570, type = "ability", requiresTarget = true, usable = true, talent = 103299 }, -- Maim
{ spell = 22812, type = "ability", buff = true }, -- Barkskin
{ spell = 22842, type = "ability", charges = true, buff = true, usable = true, talent = 103298 }, -- Frenzied Regeneration
Expand Down