beta
This commit is contained in:
@@ -3,20 +3,19 @@ local AddonName, OptionsPrivate = ...
|
||||
|
||||
local L = WeakAuras.L
|
||||
|
||||
local removeFuncs = WeakAuras.commonOptions.removeFuncs
|
||||
local replaceNameDescFuncs = WeakAuras.commonOptions.replaceNameDescFuncs
|
||||
local replaceImageFuncs = WeakAuras.commonOptions.replaceImageFuncs
|
||||
local replaceValuesFuncs = WeakAuras.commonOptions.replaceValuesFuncs
|
||||
local disabledAll = WeakAuras.commonOptions.CreateDisabledAll("trigger")
|
||||
local hiddenAll = WeakAuras.commonOptions.CreateHiddenAll("trigger")
|
||||
local getAll = WeakAuras.commonOptions.CreateGetAll("trigger")
|
||||
local setAll = WeakAuras.commonOptions.CreateSetAll("trigger", getAll)
|
||||
local executeAll = WeakAuras.commonOptions.CreateExecuteAll("trigger")
|
||||
local removeFuncs = OptionsPrivate.commonOptions.removeFuncs
|
||||
local replaceNameDescFuncs = OptionsPrivate.commonOptions.replaceNameDescFuncs
|
||||
local replaceImageFuncs = OptionsPrivate.commonOptions.replaceImageFuncs
|
||||
local replaceValuesFuncs = OptionsPrivate.commonOptions.replaceValuesFuncs
|
||||
local disabledAll = OptionsPrivate.commonOptions.CreateDisabledAll("trigger")
|
||||
local hiddenAll = OptionsPrivate.commonOptions.CreateHiddenAll("trigger")
|
||||
local getAll = OptionsPrivate.commonOptions.CreateGetAll("trigger")
|
||||
local setAll = OptionsPrivate.commonOptions.CreateSetAll("trigger", getAll)
|
||||
local executeAll = OptionsPrivate.commonOptions.CreateExecuteAll("trigger")
|
||||
|
||||
local flattenRegionOptions = WeakAuras.commonOptions.flattenRegionOptions
|
||||
local fixMetaOrders = WeakAuras.commonOptions.fixMetaOrders
|
||||
local flattenRegionOptions = OptionsPrivate.commonOptions.flattenRegionOptions
|
||||
local fixMetaOrders = OptionsPrivate.commonOptions.fixMetaOrders
|
||||
|
||||
local subevent_actual_prefix_types = WeakAuras.subevent_actual_prefix_types;
|
||||
local spellCache = WeakAuras.spellCache
|
||||
|
||||
local function union(table1, table2)
|
||||
@@ -43,9 +42,9 @@ local function GetGlobalOptions(data)
|
||||
order = 2,
|
||||
values = function()
|
||||
if #data.triggers > 1 then
|
||||
return WeakAuras.trigger_require_types;
|
||||
return OptionsPrivate.Private.trigger_require_types;
|
||||
else
|
||||
return WeakAuras.trigger_require_types_one;
|
||||
return OptionsPrivate.Private.trigger_require_types_one;
|
||||
end
|
||||
end,
|
||||
get = function()
|
||||
@@ -68,14 +67,14 @@ local function GetGlobalOptions(data)
|
||||
order = 2.3,
|
||||
values = function()
|
||||
local vals = {};
|
||||
vals[WeakAuras.trigger_modes.first_active] = L["Dynamic information from first active trigger"];
|
||||
vals[OptionsPrivate.Private.trigger_modes.first_active] = L["Dynamic information from first active trigger"];
|
||||
for i = 1, #data.triggers do
|
||||
vals[i] = L["Dynamic information from Trigger %i"]:format(i);
|
||||
end
|
||||
return vals;
|
||||
end,
|
||||
get = function()
|
||||
return data.triggers.activeTriggerMode or WeakAuras.trigger_modes.first_active;
|
||||
return data.triggers.activeTriggerMode or OptionsPrivate.Private.trigger_modes.first_active;
|
||||
end,
|
||||
set = function(info, v)
|
||||
data.triggers.activeTriggerMode = v;
|
||||
@@ -90,7 +89,7 @@ local function GetGlobalOptions(data)
|
||||
local function hideTriggerCombiner()
|
||||
return not (data.triggers.disjunctive == "custom")
|
||||
end
|
||||
WeakAuras.commonOptions.AddCodeOption(globalTriggerOptions, data, L["Custom"], "custom_trigger_combination", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-activation",
|
||||
OptionsPrivate.commonOptions.AddCodeOption(globalTriggerOptions, data, L["Custom"], "custom_trigger_combination", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-activation",
|
||||
2.4, hideTriggerCombiner, {"triggers", "customTriggerLogic"}, false);
|
||||
|
||||
return {
|
||||
@@ -103,13 +102,13 @@ local function AddOptions(allOptions, data)
|
||||
|
||||
local triggerOptions = {}
|
||||
for index, trigger in ipairs(data.triggers) do
|
||||
local triggerSystemOptionsFunction = trigger.trigger.type and WeakAuras.triggerTypesOptions[trigger.trigger.type]
|
||||
local triggerSystemOptionsFunction = trigger.trigger.type and OptionsPrivate.Private.triggerTypesOptions[trigger.trigger.type]
|
||||
if (triggerSystemOptionsFunction) then
|
||||
triggerOptions = union(triggerOptions, triggerSystemOptionsFunction(data, index))
|
||||
else
|
||||
local options = {};
|
||||
WeakAuras.commonOptions.AddCommonTriggerOptions(options, data, index)
|
||||
WeakAuras.AddTriggerMetaFunctions(options, data, index)
|
||||
OptionsPrivate.commonOptions.AddCommonTriggerOptions(options, data, index)
|
||||
OptionsPrivate.AddTriggerMetaFunctions(options, data, index)
|
||||
triggerOptions = union(triggerOptions, {
|
||||
["trigger." .. index .. ".unknown"] = options
|
||||
})
|
||||
@@ -119,7 +118,7 @@ local function AddOptions(allOptions, data)
|
||||
return union(allOptions, triggerOptions)
|
||||
end
|
||||
|
||||
function WeakAuras.GetTriggerOptions(data)
|
||||
function OptionsPrivate.GetTriggerOptions(data)
|
||||
local allOptions = {}
|
||||
if data.controlledChildren then
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
@@ -223,7 +222,7 @@ local function moveTriggerDownImpl(data, i)
|
||||
return true;
|
||||
end
|
||||
|
||||
function WeakAuras.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
options.__title = L["Trigger %s"]:format(triggernum)
|
||||
options.__order = triggernum * 10
|
||||
options.__add = function()
|
||||
|
||||
Reference in New Issue
Block a user