Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Merge commit '4ec133a98cc860adcffd8a3775e8a10fe00405ef' into master
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/scripts/.lastclassicwowbuild
#	.github/scripts/.lastwowbuild
#	.github/scripts/csv_to_lua.lua
#	.github/scripts/wowtools.sh
#	.github/workflows/build.yml
#	.pkgmeta-bcc
#	.pkgmeta-classic
#	WeakAuras/Init.lua
#	WeakAuras/Prototypes.lua
#	WeakAuras/Types.lua
#	WeakAuras/WeakAuras.lua
#	WeakAuras/WeakAuras.toc
#	WeakAurasArchive/WeakAurasArchive.toc
#	WeakAurasModelPaths/ModelPaths.lua
#	WeakAurasModelPaths/WeakAurasModelPaths.toc
#	WeakAurasOptions/WeakAurasOptions.toc
#	WeakAurasTemplates/TriggerTemplatesDataBCC.lua
#	WeakAurasTemplates/TriggerTemplatesDataClassic.lua
#	WeakAurasTemplates/WeakAurasTemplates.toc
  • Loading branch information
Maczuga committed May 18, 2021
2 parents 3530e11 + 4ec133a commit 88ea3e2
Show file tree
Hide file tree
Showing 24 changed files with 12,604 additions and 599 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ jobs:
name: WeakAuras-PR${{ github.event.number }}-classic
path: .release/

- name: Create BC Package
- name: Create BCC Package
uses: BigWigsMods/packager@master
with:
args: -d -z -g bc -m .pkgmeta-bc
args: -d -z -g bcc -m .pkgmeta-bcc

- uses: actions/upload-artifact@v2
with:
name: WeakAuras-PR${{ github.event.number }}-bc
name: WeakAuras-PR${{ github.event.number }}-bcc
path: .release/

- name: Send Status to Discord
Expand Down
6 changes: 4 additions & 2 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ externals:
WeakAuras/Libs/LibCustomGlow-1.0: https://github.com/Stanzilla/LibCustomGlow
WeakAuras/Libs/LibDBIcon-1.0: https://repos.curseforge.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0
WeakAuras/Libs/LibGetFrame-1.0: https://github.com/mrbuds/LibGetFrame
WeakAuras/Libs/Archivist: https://github.com/emptyrivers/Archivist
WeakAuras/Libs/Archivist:
url: https://github.com/emptyrivers/Archivist
tag: v1.0.8
WeakAuras/Libs/LibSerialize:
url: https://github.com/rossnichols/LibSerialize
tag: v1.0.0
Expand All @@ -38,7 +40,7 @@ ignore:
- generate_changelog.sh
- WeakAurasModelPaths/ModelPathsClassic.lua
- WeakAurasTemplates/TriggerTemplatesDataClassic.lua
- WeakAurasTemplates/TriggerTemplatesDataTBC.lua
- WeakAurasTemplates/TriggerTemplatesDataBCC.lua

move-folders:
WeakAuras/WeakAuras: WeakAuras
Expand Down
4 changes: 1 addition & 3 deletions WeakAuras/AuraEnvironment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,12 @@ local FakeWeakAurasMixin = {
GetDisplayButton = true,
Import = true,
NewDisplayButton = true,
NewAura = true,
OpenTriggerTemplate = true,
OpenCodeReview = true,
PickDisplay = true,
SetMoverSizer = true,
SetImporting = true,
SortDisplayButtons = true,
ShowOptions = true,
ToggleOptions = true,
UpdateDisplayButton = true,
UpdateGroupOrders = true,
Expand Down Expand Up @@ -444,7 +442,7 @@ function WeakAuras.LoadFunction(string, id, inTrigger)
if function_cache[string] then
return function_cache[string]
else
local loadedFunction, errorString = loadstring("--[==[ Error in '" .. (id or "Unknown") .. (inTrigger and ("':'".. inTrigger) or "") .."' ]==] " .. string)
local loadedFunction, errorString = loadstring(string, "Error in: " .. (id or "Unknown") .. (inTrigger and ("':'".. inTrigger) or ""))
if errorString then
print(errorString)
else
Expand Down
37 changes: 24 additions & 13 deletions WeakAuras/GenericTrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,21 @@ function ConstructTest(trigger, arg)
test = TestForMultiSelect(trigger, arg);
elseif(arg.type == "toggle") then
test = TestForToggle(trigger, arg);
elseif (arg.type == "spell") then
if arg.test then
if arg.showExactOption then
test = "("..arg.test:format(trigger[name], tostring(trigger["use_exact_" .. name]) or "false") ..")";
else
test = "("..arg.test:format(trigger[name])..")";
end
else
test = "(".. name .." and "..name.."==" ..(number or "\""..(trigger[name] or "").."\"")..")";
end
elseif(arg.test) then
test = "("..arg.test:format(trigger[name])..")";
test = "("..arg.test:format(tostring(trigger[name]) or "")..")";
elseif(arg.type == "longstring" and trigger[name.."_operator"]) then
test = TestForLongString(trigger, arg);
elseif (arg.type == "string" or arg.type == "select" or arg.type == "spell" or arg.type == "item") then
elseif (arg.type == "string" or arg.type == "select" or arg.type == "item") then
test = "(".. name .." and "..name.."==" ..(number or "\""..(trigger[name] or "").."\"")..")";
else
if(type(trigger[name]) == "table") then
Expand Down Expand Up @@ -1418,7 +1428,7 @@ local oldPowerTriggers = {
do
local mh = GetInventorySlotInfo("MainHandSlot")
local oh = GetInventorySlotInfo("SecondaryHandSlot")
local ranged = (WeakAuras.IsClassic() or WeakAuras.IsBC()) and GetInventorySlotInfo("RangedSlot")
local ranged = (WeakAuras.IsClassic() or WeakAuras.IsBCC()) and GetInventorySlotInfo("RangedSlot")

local swingTimerFrame;
local lastSwingMain, lastSwingOff, lastSwingRange;
Expand Down Expand Up @@ -1563,12 +1573,13 @@ do
end
mainTimer = timer:ScheduleTimerFixed(swingEnd, mainSpeed, "main");
WeakAuras.ScanEvents(event);
elseif Private.reset_ranged_swing_spells[spell] then
end
if Private.reset_ranged_swing_spells[spell] then
local event;
local currentTime = GetTime();
local speed = UnitRangedDamage("player");
if(lastSwingRange) then
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
timer:CancelTimer(rangeTimer, true)
else
timer:CancelTimer(mainTimer, true)
Expand All @@ -1579,7 +1590,7 @@ do
end
lastSwingRange = currentTime;
swingDurationRange = speed;
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
rangeTimer = timer:ScheduleTimerFixed(swingEnd, speed, "ranged");
else
mainTimer = timer:ScheduleTimerFixed(swingEnd, speed, "main");
Expand All @@ -1605,7 +1616,7 @@ do
swingTimerFrame:RegisterEvent("PLAYER_ENTER_COMBAT");
swingTimerFrame:RegisterUnitEvent("UNIT_ATTACK_SPEED", "player");
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player");
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_START", "player")
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_INTERRUPTED", "player")
swingTimerFrame:RegisterUnitEvent("UNIT_SPELLCAST_FAILED", "player")
Expand Down Expand Up @@ -1675,7 +1686,7 @@ do
local function CheckGCD()
local event;
local startTime, duration
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
startTime, duration = GetSpellCooldown(29515);
shootStart, shootDuration = GetSpellCooldown(5019)
else
Expand Down Expand Up @@ -1758,7 +1769,7 @@ do

if duration > 0 then
if (startTime == gcdStart and duration == gcdDuration)
or ((WeakAuras.IsClassic() or WeakAuras.IsBC()) and duration == shootDuration and startTime == shootStart)
or ((WeakAuras.IsClassic() or WeakAuras.IsBCC()) and duration == shootDuration and startTime == shootStart)
then
-- GCD cooldown, this could mean that the spell reset!
if self.expirationTime[id] and self.expirationTime[id] > endTime and self.expirationTime[id] ~= 0 then
Expand Down Expand Up @@ -2538,7 +2549,7 @@ function WeakAuras.WatchUnitChange(unit)
if inRaidChanged then
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
else
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
local newRaidRole = WeakAuras.UnitRaidRole(unit)
if watchUnitChange.unitRaidRole[unit] ~= newRaidRole then
watchUnitChange.unitRaidRole[unit] = newRaidRole
Expand Down Expand Up @@ -3110,7 +3121,7 @@ do
if not(tenchFrame) then
tenchFrame = CreateFrame("Frame");
tenchFrame:RegisterEvent("UNIT_INVENTORY_CHANGED");
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
tenchFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED");
end

Expand Down Expand Up @@ -3469,7 +3480,7 @@ function GenericTrigger.SetToolTip(trigger, state)
local lines = { strsplit("\n", state.tooltip) };
GameTooltip:ClearLines();
for i, line in ipairs(lines) do
GameTooltip:AddLine(line);
GameTooltip:AddLine(line, nil, nil, nil, state.tooltipWrap);
end
return true
elseif (state.spellId) then
Expand Down Expand Up @@ -3887,7 +3898,7 @@ WeakAuras.GetItemSubClassInfo = function(i)
return select(subClassId, GetAuctionItemSubClasses(classId))
end

if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
WeakAuras.GetCritChance = function()
return max(GetRangedCritChance(), GetCritChance())
end
Expand Down
2 changes: 1 addition & 1 deletion WeakAuras/Init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function WeakAuras.IsClassic()
return false
end

function WeakAuras.IsBC()
function WeakAuras.IsBCC()
return false
end

Expand Down
63 changes: 43 additions & 20 deletions WeakAuras/Prototypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ local constants = {
nameRealmFilterDesc = L[" Filter formats: 'Name', 'Name-Realm', '-Realm'. \n\nSupports multiple entries, separated by commas\n"],
}

if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
WeakAuras.UnitRaidRole = function(unit)
local raidID = UnitInRaid(unit)
if raidID then
Expand Down Expand Up @@ -838,6 +838,14 @@ function WeakAuras.IsSpellKnownIncludingPet(spell)
-- end
end

function WeakAuras.CompareSpellIds(a, b, exactCheck)
if exactCheck then
return tonumber(a) == tonumber(b)
else
return GetSpellInfo(a) == GetSpellInfo(b)
end
end

function WeakAuras.UnitPowerDisplayMod(powerType)
if (powerType == 7 or powerType == 14) then
return 10;
Expand Down Expand Up @@ -952,12 +960,12 @@ Private.load_prototype = {
},
{
name = "vehicle",
display = (WeakAuras.IsClassic() or WeakAuras.IsBC()) and L["On Taxi"] or L["In Vehicle"],
display = (WeakAuras.IsClassic() or WeakAuras.IsBCC()) and L["On Taxi"] or L["In Vehicle"],
type = "tristate",
init = "arg",
width = WeakAuras.normalWidth,
optional = true,
events = (WeakAuras.IsClassic() or WeakAuras.IsBC()) and {"UNIT_FLAGS"}
events = (WeakAuras.IsClassic() or WeakAuras.IsBCC()) and {"UNIT_FLAGS"}
or {"VEHICLE_UPDATE", "UNIT_ENTERED_VEHICLE", "UNIT_EXITED_VEHICLE", "UPDATE_OVERRIDE_ACTIONBAR", "UNIT_FLAGS"}
},
{
Expand Down Expand Up @@ -1327,6 +1335,20 @@ local function AddUnitRoleChangeInternalEvents(triggerUnit, t)
end
end

local function AddRemainingCastInternalEvents(triggerUnit, t)
if (triggerUnit == nil) then
return
end

if Private.multiUnitUnits[triggerUnit] then
for unit in pairs(Private.multiUnitUnits[triggerUnit]) do
tinsert(t, "CAST_REMAINING_CHECK_" .. string.lower(unit))
end
else
tinsert(t, "CAST_REMAINING_CHECK_" .. string.lower(triggerUnit))
end
end

local function AddUnitEventForEvents(result, unit, event)
if unit then
if not result.unit_events then
Expand Down Expand Up @@ -3234,7 +3256,7 @@ Private.event_prototypes = {
local stacks = maxCharges and maxCharges ~= 1 and charges or (spellCount and spellCount > 0 and spellCount) or nil;
if (charges == nil) then
-- Use fake charges for spells that use GetSpellCooldown
charges = (duration == 0) and 1 or 0;
charges = (duration == 0 or gcdCooldown) and 1 or 0;
end
local genericShowOn = %s
local expirationTime = startTime and duration and startTime + duration
Expand Down Expand Up @@ -4811,10 +4833,10 @@ Private.event_prototypes = {
trigger.realSpellName = spellName; -- Cache
local ret = [=[
local spellName = %s
local startTime, duration, _, readyTime = WeakAuras.GetSpellCooldown(spellName);
local startTime, duration, gcdCooldown, readyTime = WeakAuras.GetSpellCooldown(spellName);
local charges, _, spellCount, chargeGainTime, chargeLostTime = WeakAuras.GetSpellCharges(spellName);
if (charges == nil) then
charges = (duration == 0) and 1 or 0;
charges = (duration == 0 or gcdCooldown) and 1 or 0;
end
local ready = startTime == 0 or charges > 0
local active = IsUsableSpell(spellName) and ready
Expand Down Expand Up @@ -6097,7 +6119,7 @@ Private.event_prototypes = {
return L["Set IDs can be found on websites such as wowhead.com/item-sets"]
elseif WeakAuras.IsClassic() then
return L["Set IDs can be found on websites such as classic.wowhead.com/item-sets"]
elseif WeakAuras.IsBC() then
elseif WeakAuras.IsBCC() then
return L["Set IDs can be found on websites such as tbc.wowhead.com/item-sets"]
end
end
Expand Down Expand Up @@ -6484,12 +6506,13 @@ Private.event_prototypes = {
end,
internal_events = function(trigger)
local unit = trigger.unit
local result = {"CAST_REMAINING_CHECK_" .. string.lower(unit)}
local result = {}
if WeakAuras.IsClassic() and unit ~= "player" then
tinsert(result, "UNIT_SPELLCAST_START")
tinsert(result, "UNIT_SPELLCAST_DELAYED")
tinsert(result, "UNIT_SPELLCAST_CHANNEL_START")
end
AddRemainingCastInternalEvents(unit, result)
AddUnitChangeInternalEvents(unit, result)
AddUnitRoleChangeInternalEvents(unit, result)
return result
Expand Down Expand Up @@ -6585,8 +6608,8 @@ Private.event_prototypes = {
type = "spell",
enable = function(trigger) return not trigger.use_inverse end,
conditionType = "number",
forceExactOption = true,
test = "GetSpellInfo(%s) == spell",
showExactOption = true,
test = "WeakAuras.CompareSpellIds(spellId, %s, %s)",
store = true,
},
{
Expand All @@ -6602,10 +6625,10 @@ Private.event_prototypes = {
name = "interruptible",
display = L["Interruptible"],
type = "tristate",
enable = function(trigger) return not WeakAuras.IsBC() and not trigger.use_inverse end,
enable = function(trigger) return not WeakAuras.IsBCC() and not trigger.use_inverse end,
store = true,
conditionType = "bool",
hidden = WeakAuras.IsBC()
hidden = WeakAuras.IsBCC()
},
{
name = "remaining",
Expand Down Expand Up @@ -7008,7 +7031,7 @@ Private.event_prototypes = {
type = "number",
init = "select(2, UnitResistance('player', 1))",
store = true,
enable = WeakAuras.IsClassic() or WeakAuras.IsBC(),
enable = WeakAuras.IsClassic() or WeakAuras.IsBCC(),
conditionType = "number",
hidden = WeakAuras.IsRetail()
},
Expand All @@ -7018,7 +7041,7 @@ Private.event_prototypes = {
type = "number",
init = "select(2, UnitResistance('player', 2))",
store = true,
enable = WeakAuras.IsClassic() or WeakAuras.IsBC(),
enable = WeakAuras.IsClassic() or WeakAuras.IsBCC(),
conditionType = "number",
hidden = WeakAuras.IsRetail()
},
Expand All @@ -7028,7 +7051,7 @@ Private.event_prototypes = {
type = "number",
init = "select(2, UnitResistance('player', 3))",
store = true,
enable = WeakAuras.IsClassic() or WeakAuras.IsBC(),
enable = WeakAuras.IsClassic() or WeakAuras.IsBCC(),
conditionType = "number",
hidden = WeakAuras.IsRetail()
},
Expand All @@ -7038,7 +7061,7 @@ Private.event_prototypes = {
type = "number",
init = "select(2, UnitResistance('player', 4))",
store = true,
enable = WeakAuras.IsClassic() or WeakAuras.IsBC(),
enable = WeakAuras.IsClassic() or WeakAuras.IsBCC(),
conditionType = "number",
hidden = WeakAuras.IsRetail()
},
Expand All @@ -7048,7 +7071,7 @@ Private.event_prototypes = {
type = "number",
init = "select(2, UnitResistance('player', 5))",
store = true,
enable = WeakAuras.IsClassic() or WeakAuras.IsBC(),
enable = WeakAuras.IsClassic() or WeakAuras.IsBCC(),
conditionType = "number",
hidden = WeakAuras.IsRetail()
},
Expand All @@ -7058,7 +7081,7 @@ Private.event_prototypes = {
type = "number",
init = "select(2, UnitResistance('player', 6))",
store = true,
enable = WeakAuras.IsClassic() or WeakAuras.IsBC(),
enable = WeakAuras.IsClassic() or WeakAuras.IsBCC(),
conditionType = "number",
hidden = WeakAuras.IsRetail()
},
Expand Down Expand Up @@ -7232,7 +7255,7 @@ Private.event_prototypes = {
local unit_events = {}
local pet_unit_events = {}
if trigger.use_vehicle ~= nil then
if WeakAuras.IsClassic() or WeakAuras.IsBC() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
tinsert(unit_events, "UNIT_FLAGS")
else
tinsert(unit_events, "UNIT_ENTERED_VEHICLE")
Expand Down Expand Up @@ -7684,7 +7707,7 @@ Private.event_prototypes = {
};

Private.event_prototypes["Item Set"] = nil
if WeakAuras.IsClassic() then
if WeakAuras.IsClassic() or WeakAuras.IsBCC() then
if not UnitDetailedThreatSituation then
Private.event_prototypes["Threat Situation"] = nil
end
Expand Down
Loading

0 comments on commit 88ea3e2

Please sign in to comment.