This commit is contained in:
Bunny67
2020-08-03 00:12:52 +03:00
parent fcd7277800
commit 9956fb7ede
20 changed files with 2562 additions and 4746 deletions
+2 -101
View File
@@ -76,12 +76,11 @@ local event_prototypes = WeakAuras.event_prototypes;
local timer = WeakAuras.timer;
local debug = WeakAuras.debug;
local events = WeakAuras.events;
local loaded_events = WeakAuras.loaded_events;
local events = {}
local loaded_events = {}
local loaded_unit_events = {};
local loaded_auras = {}; -- id to bool map
local timers = WeakAuras.timers;
local specificBosses = WeakAuras.specificBosses;
-- Local functions
local LoadEvent, HandleEvent, HandleUnitEvent, TestForTriState, TestForToggle, TestForLongString, TestForMultiSelect
@@ -1128,7 +1127,6 @@ end
function GenericTrigger.Add(data, region)
local id = data.id;
events[id] = nil;
WeakAuras.forceable_events[id] = {};
for triggernum, triggerData in ipairs(data.triggers) do
local trigger, untrigger = triggerData.trigger, triggerData.untrigger
@@ -1473,103 +1471,6 @@ local oldPowerTriggers = {
["Shards"] = 7,
}
function GenericTrigger.Modernize(data)
for triggernum, triggerData in ipairs(data.triggers) do
local trigger, untrigger = triggerData.trigger, triggerData.untrigger
if (data.internalVersion < 2) then
-- Convert any references to "COMBAT_LOG_EVENT_UNFILTERED_CUSTOM" to "COMBAT_LOG_EVENT_UNFILTERED"
if(trigger and trigger.custom) then
trigger.custom = trigger.custom:gsub("COMBAT_LOG_EVENT_UNFILTERED_CUSTOM", "COMBAT_LOG_EVENT_UNFILTERED");
end
if(untrigger and untrigger.custom) then
untrigger.custom = untrigger.custom:gsub("COMBAT_LOG_EVENT_UNFILTERED_CUSTOM", "COMBAT_LOG_EVENT_UNFILTERED");
end
if trigger and trigger["event"] and trigger["event"] == "DBM Timer" then
if (type(trigger.spellId) == "number") then
trigger.spellId = tostring(trigger.spellId);
end
end
if trigger and trigger["event"] and trigger["event"] == "Item Set Equipped" then
trigger.event = "Equipment Set";
end
-- Convert ember trigger
local fixEmberTrigger = function(trigger)
if (trigger.power and not trigger.ember) then
trigger.ember = tostring(tonumber(trigger.power) * 10);
trigger.use_ember = trigger.use_power
trigger.ember_operator = trigger.power_operator;
trigger.power = nil;
trigger.use_power = nil;
trigger.power_operator = nil;
end
end
if (trigger and trigger.type and trigger.event and trigger.type == "status" and trigger.event == "Burning Embers") then
fixEmberTrigger(trigger);
fixEmberTrigger(untrigger);
end
if (trigger and trigger.type and trigger.event and trigger.type == "status"
and (trigger.event == "Cooldown Progress (Spell)"
or trigger.event == "Cooldown Progress (Item)"
or trigger.event == "Death Knight Rune")) then
if (not trigger.showOn) then
if (trigger.use_inverse) then
trigger.showOn = "showOnReady"
else
trigger.showOn = "showOnCooldown"
end
if (trigger.event == "Death Knight Rune") then
trigger.use_genericShowOn = true;
end
trigger.use_inverse = nil
end
end
for old, new in pairs(combatLogUpgrade) do
if (trigger and trigger[old]) then
local useOld = "use_" .. old;
local useNew = "use_" .. new;
trigger[useNew] = trigger[useOld];
trigger[new] = trigger[old];
trigger[old] = nil;
trigger[useOld] = nil;
end
end
-- Convert separated Power Triggers to sub options of the Power trigger
if (trigger and trigger.type and trigger.event and trigger.type == "status" and oldPowerTriggers[trigger.event]) then
trigger.powertype = oldPowerTriggers[trigger.event]
trigger.use_powertype = true;
trigger.use_percentpower = false;
if (trigger.event == "Combo Points") then
trigger.power = trigger.combopoints;
trigger.power_operator = trigger.combopoints_operator
trigger.use_power = trigger.use_combopoints;
end
trigger.event = "Power";
trigger.unit = "player";
end
end
if data.internalVersion < 6 then
if trigger and trigger.type ~= "aura" then
trigger.genericShowOn = trigger.showOn or "showOnActive"
trigger.showOn = nil
trigger.use_genericShowOn = trigger.use_showOn
end
end
end
end
function GenericTrigger.AllAdded()
-- Remove GTFO options if GTFO isn't enabled and there are no saved GTFO auras
local hideGTFO = true;