beta
This commit is contained in:
+121
-107
@@ -45,9 +45,28 @@ local function addCollapsibleHeader(options, key, input, order, isGroupTab)
|
||||
local hasDown = input.__down
|
||||
local hasDuplicate = input.__duplicate
|
||||
local hasApplyTemplate = input.__applyTemplate
|
||||
local defaultCollapsed = input.__collapsed
|
||||
local hiddenFunc = input.__hidden
|
||||
local nooptions = input.__nooptions
|
||||
local notcollapsable = input.__notcollapsable
|
||||
local marginTop = input.__topLine
|
||||
local withoutheader = input.__withoutheader
|
||||
local isCollapsed = input.__isCollapsed
|
||||
local setCollapsed = input.__setCollapsed
|
||||
|
||||
if not isCollapsed then
|
||||
isCollapsed = function()
|
||||
return OptionsPrivate.IsCollapsed("collapse", "region", key, defaultCollapsed)
|
||||
end
|
||||
end
|
||||
|
||||
if not setCollapsed then
|
||||
setCollapsed = function(info, button, secondCall)
|
||||
if not notcollapsable and not secondCall then
|
||||
local isCollapsed = OptionsPrivate.IsCollapsed("collapse", "region", key, defaultCollapsed)
|
||||
OptionsPrivate.SetCollapsed("collapse", "region", key, not isCollapsed)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local titleWidth = WeakAuras.doubleWidth - (hasAdd and 0.15 or 0) - (hasDelete and 0.15 or 0) - (hasUp and 0.15 or 0)
|
||||
- (hasDown and 0.15 or 0) - (hasDuplicate and 0.15 or 0) - (hasApplyTemplate and 0.15 or 0)
|
||||
@@ -59,127 +78,122 @@ local function addCollapsibleHeader(options, key, input, order, isGroupTab)
|
||||
width = "full",
|
||||
hidden = hiddenFunc,
|
||||
}
|
||||
options[key .. "collapseButton"] = {
|
||||
type = "execute",
|
||||
name = title,
|
||||
order = order + 0.1,
|
||||
width = titleWidth,
|
||||
func = function(info, button, secondCall)
|
||||
if not nooptions and not secondCall then
|
||||
local isCollapsed = OptionsPrivate.IsCollapsed("collapse", "region", key, false)
|
||||
OptionsPrivate.SetCollapsed("collapse", "region", key, not isCollapsed)
|
||||
end
|
||||
end,
|
||||
image = function()
|
||||
if nooptions then
|
||||
return "Interface\\AddOns\\WeakAuras\\Media\\Textures\\bullet1", 18, 18
|
||||
else
|
||||
local isCollapsed = OptionsPrivate.IsCollapsed("collapse", "region", key, false)
|
||||
return isCollapsed and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\expand" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\collapse", 18, 18
|
||||
end
|
||||
end,
|
||||
control = "WeakAurasExpand",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
|
||||
if hasAdd then
|
||||
options[key .. "addButton"] = {
|
||||
if not withoutheader then
|
||||
options[key .. "collapseButton"] = {
|
||||
type = "execute",
|
||||
name = L["Add"],
|
||||
order = order + 0.2,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\add",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
name = title,
|
||||
order = order + 0.1,
|
||||
width = titleWidth,
|
||||
func = setCollapsed,
|
||||
image = function()
|
||||
if notcollapsable then
|
||||
return "Interface\\AddOns\\WeakAuras\\Media\\Textures\\bullet1", 18, 18
|
||||
else
|
||||
return isCollapsed() and "Interface\\AddOns\\WeakAuras\\Media\\Textures\\expand" or "Interface\\AddOns\\WeakAuras\\Media\\Textures\\collapse", 18, 18
|
||||
end
|
||||
end,
|
||||
control = "WeakAurasExpand",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "addButton"], input.__add)
|
||||
end
|
||||
|
||||
if hasUp then
|
||||
options[key .. "upButton"] = {
|
||||
type = "execute",
|
||||
name = L["Move Up"],
|
||||
order = order + 0.3,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\moveup",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "upButton"], input.__up)
|
||||
end
|
||||
if hasAdd then
|
||||
options[key .. "addButton"] = {
|
||||
type = "execute",
|
||||
name = L["Add"],
|
||||
order = order + 0.2,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\add",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "addButton"], input.__add)
|
||||
end
|
||||
|
||||
if hasDown then
|
||||
options[key .. "downButton"] = {
|
||||
type = "execute",
|
||||
name = L["Move Down"],
|
||||
order = order + 0.4,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\movedown",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "downButton"], input.__down)
|
||||
end
|
||||
if hasUp then
|
||||
options[key .. "upButton"] = {
|
||||
type = "execute",
|
||||
name = L["Move Up"],
|
||||
order = order + 0.3,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\moveup",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "upButton"], input.__up)
|
||||
end
|
||||
|
||||
if hasDuplicate then
|
||||
options[key .. "duplicateButton"] = {
|
||||
type = "execute",
|
||||
name = L["Duplicate"],
|
||||
order = order + 0.5,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\duplicate",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "duplicateButton"], input.__duplicate)
|
||||
end
|
||||
if hasDown then
|
||||
options[key .. "downButton"] = {
|
||||
type = "execute",
|
||||
name = L["Move Down"],
|
||||
order = order + 0.4,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\movedown",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "downButton"], input.__down)
|
||||
end
|
||||
|
||||
if hasDelete then
|
||||
options[key .. "deleteButton"] = {
|
||||
type = "execute",
|
||||
name = L["Delete"],
|
||||
order = order + 0.6,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\delete",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "deleteButton"], input.__delete)
|
||||
end
|
||||
if hasDuplicate then
|
||||
options[key .. "duplicateButton"] = {
|
||||
type = "execute",
|
||||
name = L["Duplicate"],
|
||||
order = order + 0.5,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\duplicate",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "duplicateButton"], input.__duplicate)
|
||||
end
|
||||
|
||||
if hasApplyTemplate then
|
||||
options[key .. "applyTemplate"] = {
|
||||
type = "execute",
|
||||
name = L["Apply Template"],
|
||||
order = order + 0.7,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\template",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "applyTemplate"], input.__applyTemplate)
|
||||
if hasDelete then
|
||||
options[key .. "deleteButton"] = {
|
||||
type = "execute",
|
||||
name = L["Delete"],
|
||||
order = order + 0.6,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\delete",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "deleteButton"], input.__delete)
|
||||
end
|
||||
|
||||
if hasApplyTemplate then
|
||||
options[key .. "applyTemplate"] = {
|
||||
type = "execute",
|
||||
name = L["Apply Template"],
|
||||
order = order + 0.7,
|
||||
width = 0.15,
|
||||
image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\template",
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
control = "WeakAurasIcon",
|
||||
hidden = hiddenFunc
|
||||
}
|
||||
setFuncs(options[key .. "applyTemplate"], input.__applyTemplate)
|
||||
end
|
||||
end
|
||||
|
||||
if hiddenFunc then
|
||||
return function()
|
||||
return hiddenFunc() or OptionsPrivate.IsCollapsed("collapse", "region", key, false)
|
||||
return hiddenFunc() or isCollapsed()
|
||||
end
|
||||
else
|
||||
return function()
|
||||
return OptionsPrivate.IsCollapsed("collapse", "region", key, false)
|
||||
end
|
||||
return isCollapsed
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1766,17 +1766,18 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
return;
|
||||
end
|
||||
|
||||
local defaultCollapsed = #conditions > 2
|
||||
local collapsed = false;
|
||||
if data.controlledChildren then
|
||||
for id, reference in pairs(conditions[i].check.references) do
|
||||
local index = reference.conditionIndex;
|
||||
if OptionsPrivate.IsCollapsed(id, "condition", index, false) then
|
||||
if OptionsPrivate.IsCollapsed(id, "condition", index, defaultCollapsed) then
|
||||
collapsed = true;
|
||||
break;
|
||||
end
|
||||
end
|
||||
else
|
||||
collapsed = OptionsPrivate.IsCollapsed(data.id, "condition", i, false);
|
||||
collapsed = OptionsPrivate.IsCollapsed(data.id, "condition", i, defaultCollapsed);
|
||||
end
|
||||
|
||||
args["condition" .. i .. "header"] = {
|
||||
@@ -1830,6 +1831,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
tinsert(auraData[conditionVariable], reference.conditionIndex - 1, tmp);
|
||||
fixUpLinkedInFirstCondition(auraData[conditionVariable])
|
||||
WeakAuras.Add(auraData);
|
||||
OptionsPrivate.MoveCollapseDataUp(auraData.id, "condition", {reference.conditionIndex})
|
||||
end
|
||||
end
|
||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||
@@ -1840,6 +1842,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
tinsert(conditions, i - 1, tmp);
|
||||
fixUpLinkedInFirstCondition(conditions)
|
||||
WeakAuras.Add(data);
|
||||
OptionsPrivate.MoveCollapseDataUp(data.id, "condition", {i})
|
||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||
end
|
||||
end
|
||||
@@ -1881,6 +1884,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
tinsert(auraData[conditionVariable], reference.conditionIndex + 1, tmp);
|
||||
fixUpLinkedInFirstCondition(auraData[conditionVariable])
|
||||
WeakAuras.Add(auraData);
|
||||
OptionsPrivate.MoveCollapseDataDown(auraData.id, "condition", {reference.conditionIndex})
|
||||
end
|
||||
end
|
||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||
@@ -1892,6 +1896,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
tinsert(conditions, i + 1, tmp);
|
||||
fixUpLinkedInFirstCondition(conditions)
|
||||
WeakAuras.Add(data);
|
||||
OptionsPrivate.MoveCollapseDataDown(data.id, "condition", {i})
|
||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||
return;
|
||||
end
|
||||
@@ -1916,6 +1921,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
tremove(auraData[conditionVariable], reference.conditionIndex);
|
||||
fixUpLinkedInFirstCondition(auraData[conditionVariable])
|
||||
WeakAuras.Add(auraData);
|
||||
OptionsPrivate.RemoveCollapsed(auraData.id, "condition", {reference.conditionIndex})
|
||||
end
|
||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||
return;
|
||||
@@ -1923,6 +1929,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, con
|
||||
tremove(conditions, i);
|
||||
fixUpLinkedInFirstCondition(conditions)
|
||||
WeakAuras.Add(data);
|
||||
OptionsPrivate.RemoveCollapsed(data.id, "condition", {i})
|
||||
WeakAuras.ClearAndUpdateOptions(data.id, true)
|
||||
return;
|
||||
end
|
||||
@@ -2535,6 +2542,14 @@ function OptionsPrivate.GetConditionOptions(data)
|
||||
order = addControlsForCondition(args, order, data, conditionVariable, conditions, i, conditionTemplates, conditionTemplateWithoutCombinations, allProperties);
|
||||
end
|
||||
|
||||
args["addConditionHeader"] = {
|
||||
type = "header",
|
||||
width = WeakAuras.doubleWidth,
|
||||
name = "",
|
||||
order = order
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
args["addCondition"] = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
|
||||
@@ -46,16 +46,17 @@ local function AddOptionsForSupportedSubRegion(regionOption, data, supported)
|
||||
result.__order = 300
|
||||
result.__title = L["Add Extra Elements"]
|
||||
result.__topLine = true
|
||||
result.__withoutheader = true
|
||||
result["subregiontypespace"] = {
|
||||
type = "description",
|
||||
width = WeakAuras.doubleWidth,
|
||||
name = "",
|
||||
order = order,
|
||||
}
|
||||
order = order + 1
|
||||
for subRegionType in pairs(supported) do
|
||||
if OptionsPrivate.Private.subRegionTypes[subRegionType].supportsAdd then
|
||||
hasSubRegions = true
|
||||
result[subRegionType .. "space"] = {
|
||||
type = "description",
|
||||
width = WeakAuras.doubleWidth,
|
||||
name = "",
|
||||
order = order,
|
||||
}
|
||||
order = order + 1
|
||||
result[subRegionType] = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
|
||||
@@ -144,7 +144,7 @@ function OptionsPrivate.GetInformationOptions(data)
|
||||
end
|
||||
end
|
||||
|
||||
-- Show warnings onyl for single selection for now
|
||||
-- Show warnings only for single selection for now
|
||||
if not isGroup then
|
||||
local icon, title, message = OptionsPrivate.Private.AuraWarnings.FormatWarnings(data.uid)
|
||||
if title and message then
|
||||
@@ -167,5 +167,60 @@ function OptionsPrivate.GetInformationOptions(data)
|
||||
end
|
||||
end
|
||||
|
||||
-- Compability Options
|
||||
args.compabilityTitle = {
|
||||
type = "header",
|
||||
name = L["Compability Options"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = order,
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
local sameIgnoreOptionsEvents = true
|
||||
local commonIgnoreOptionsEvents
|
||||
local ignoreOptionsEventDesc = ""
|
||||
if data.controlledChildren then
|
||||
for _, childId in ipairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
ignoreOptionsEventDesc = ignoreOptionsEventDesc .. "|cFFE0E000"..childData.id..": |r".. (childData.ignoreOptionsEventErrors and "true" or "false") .. "\n"
|
||||
if commonIgnoreOptionsEvents == nil then
|
||||
commonIgnoreOptionsEvents = childData.ignoreOptionsEventErrors ~= nil and childData.ignoreOptionsEventErrors or false
|
||||
elseif childData.ignoreOptionsEventErrors ~= commonIgnoreOptionsEvents then
|
||||
sameIgnoreOptionsEvents = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
args.ignoreOptionsEventErrors = {
|
||||
type = "toggle",
|
||||
name = sameIgnoreOptionsEvents and L["Ignore Lua Errors on OPTIONS event"] or "|cFF4080FF" .. L["Ignore Lua Errors on OPTIONS event"],
|
||||
width = WeakAuras.doubleWidth,
|
||||
get = function()
|
||||
if data.controlledChildren then
|
||||
return sameIgnoreOptionsEvents and commonIgnoreOptionsEvents or false
|
||||
else
|
||||
return data.ignoreOptionsEventErrors
|
||||
end
|
||||
end,
|
||||
set = function(info, v)
|
||||
if data.controlledChildren then
|
||||
for _, childId in ipairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
childData.ignoreOptionsEventErrors = v
|
||||
WeakAuras.Add(childData)
|
||||
OptionsPrivate.ClearOptions(childData.id)
|
||||
end
|
||||
else
|
||||
data.ignoreOptionsEventErrors = v
|
||||
WeakAuras.Add(data)
|
||||
OptionsPrivate.ClearOptions(data.id)
|
||||
end
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end,
|
||||
desc = sameIgnoreOptionsEvents and "" or ignoreOptionsEventDesc,
|
||||
order = order
|
||||
}
|
||||
order = order + 1
|
||||
|
||||
return options
|
||||
end
|
||||
|
||||
@@ -289,9 +289,6 @@ function OptionsPrivate.CreateFrame()
|
||||
self.bottomLeftResizer:Hide()
|
||||
self.bottomRightResizer:Hide()
|
||||
else
|
||||
if self.tipFrameIsVisible then
|
||||
self.tipFrame.frame:Show()
|
||||
end
|
||||
self.bottomLeftResizer:Show()
|
||||
self.bottomRightResizer:Show()
|
||||
if self.window == "default" then
|
||||
@@ -979,6 +976,9 @@ function OptionsPrivate.CreateFrame()
|
||||
tremove(tempGroup.controlledChildren, index)
|
||||
displayButtons[id]:ClearPick()
|
||||
|
||||
-- Clear trigger expand state
|
||||
OptionsPrivate.ClearTriggerExpandState()
|
||||
|
||||
self:ClearOptions(tempGroup.id)
|
||||
self:FillOptions()
|
||||
end
|
||||
@@ -1002,6 +1002,9 @@ function OptionsPrivate.CreateFrame()
|
||||
self.moversizer:Hide()
|
||||
|
||||
OptionsPrivate.Private.ResumeAllDynamicGroups()
|
||||
|
||||
-- Clear trigger expand state
|
||||
OptionsPrivate.ClearTriggerExpandState()
|
||||
end
|
||||
|
||||
local function GetTarget(pickedDisplay)
|
||||
|
||||
@@ -743,7 +743,7 @@ local function subCreateOptions(parentData, data, index, subIndex)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id, parentData)
|
||||
end
|
||||
end,
|
||||
__nooptions = true
|
||||
__notcollapsable = true
|
||||
}
|
||||
return options
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
end
|
||||
end,
|
||||
__duplicate = function()
|
||||
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subtext")) then
|
||||
if (OptionsPrivate.Private.ApplyToDataOrChildData(parentData, OptionsPrivate.DuplicateSubRegion, index, "subborder")) then
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -97,6 +97,9 @@ local function GetGlobalOptions(data)
|
||||
}
|
||||
end
|
||||
|
||||
local collapsedId = {}
|
||||
local maxTriggerNumForExpand = 0
|
||||
|
||||
local function AddOptions(allOptions, data)
|
||||
allOptions = union(allOptions, GetGlobalOptions(data))
|
||||
|
||||
@@ -115,6 +118,35 @@ local function AddOptions(allOptions, data)
|
||||
end
|
||||
end
|
||||
|
||||
triggerOptions["addTriggerOption"] = {
|
||||
__title = L["Add Trigger"],
|
||||
__order = 5000,
|
||||
__withoutheader = true,
|
||||
__topLine = true,
|
||||
__collapsed = false,
|
||||
addTrigger = {
|
||||
type = "execute",
|
||||
width = WeakAuras.normalWidth,
|
||||
name = L["Add Trigger"],
|
||||
order = 1,
|
||||
func = function()
|
||||
tinsert(data.triggers,
|
||||
{
|
||||
trigger =
|
||||
{
|
||||
type = "aura2"
|
||||
},
|
||||
untrigger = {
|
||||
}
|
||||
})
|
||||
WeakAuras.Add(data)
|
||||
OptionsPrivate.SetCollapsed(collapsedId, "trigger", #data.triggers, false)
|
||||
maxTriggerNumForExpand = max(maxTriggerNumForExpand, #data.triggers)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
return union(allOptions, triggerOptions)
|
||||
end
|
||||
|
||||
@@ -222,21 +254,26 @@ local function moveTriggerDownImpl(data, i)
|
||||
return true;
|
||||
end
|
||||
|
||||
function OptionsPrivate.ClearTriggerExpandState()
|
||||
for i = 1, maxTriggerNumForExpand do
|
||||
OptionsPrivate.SetCollapsed(collapsedId, "trigger", i, nil)
|
||||
end
|
||||
maxTriggerNumForExpand = 0
|
||||
end
|
||||
|
||||
function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
options.__title = L["Trigger %s"]:format(triggernum)
|
||||
options.__order = triggernum * 10
|
||||
options.__add = function()
|
||||
tinsert(data.triggers,
|
||||
{
|
||||
trigger =
|
||||
{
|
||||
type = "aura2"
|
||||
},
|
||||
untrigger = {
|
||||
}
|
||||
})
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
options.__collapsed = #data.triggers > 1
|
||||
options.__isCollapsed = function()
|
||||
return OptionsPrivate.IsCollapsed(collapsedId, "trigger", triggernum, #data.triggers > 1)
|
||||
end
|
||||
options.__setCollapsed = function(info, button, secondCall)
|
||||
if not secondCall then
|
||||
local isCollapsed = OptionsPrivate.IsCollapsed(collapsedId, "trigger", triggernum, #data.triggers > 1)
|
||||
OptionsPrivate.SetCollapsed(collapsedId, "trigger", triggernum, not isCollapsed)
|
||||
maxTriggerNumForExpand = max(maxTriggerNumForExpand, triggernum)
|
||||
end
|
||||
end
|
||||
options.__up =
|
||||
{
|
||||
@@ -246,6 +283,7 @@ function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
func = function()
|
||||
if (moveTriggerDownImpl(data, triggernum - 1)) then
|
||||
WeakAuras.Add(data);
|
||||
OptionsPrivate.MoveCollapseDataUp(collapsedId, "trigger", {triggernum})
|
||||
WeakAuras.ClearAndUpdateOptions(data.id);
|
||||
end
|
||||
end
|
||||
@@ -258,6 +296,7 @@ function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
func = function()
|
||||
if (moveTriggerDownImpl(data, triggernum)) then
|
||||
WeakAuras.Add(data);
|
||||
OptionsPrivate.MoveCollapseDataDown(collapsedId, "trigger", {triggernum})
|
||||
WeakAuras.ClearAndUpdateOptions(data.id);
|
||||
end
|
||||
end
|
||||
@@ -282,6 +321,7 @@ function OptionsPrivate.AddTriggerMetaFunctions(options, data, triggernum)
|
||||
tremove(data.triggers, triggernum)
|
||||
DeleteConditionsForTrigger(data, triggernum)
|
||||
WeakAuras.Add(data)
|
||||
OptionsPrivate.RemoveCollapsed(collapsedId, "trigger", {triggernum})
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
WeakAuras.FillOptions()
|
||||
end,
|
||||
|
||||
@@ -229,6 +229,9 @@ function OptionsPrivate.MultipleDisplayTooltipMenu()
|
||||
id = WeakAuras.FindUnusedId(tempGroup.controlledChildren[1].." Group"),
|
||||
regionType = "group",
|
||||
};
|
||||
|
||||
WeakAuras.DeepMixin(data, WeakAuras.data_stub)
|
||||
data.internalVersion = WeakAuras.InternalVersion()
|
||||
WeakAuras.Add(data);
|
||||
WeakAuras.NewDisplayButton(data);
|
||||
|
||||
@@ -263,6 +266,8 @@ function OptionsPrivate.MultipleDisplayTooltipMenu()
|
||||
regionType = "dynamicgroup",
|
||||
};
|
||||
|
||||
WeakAuras.DeepMixin(data, WeakAuras.data_stub)
|
||||
data.internalVersion = WeakAuras.InternalVersion()
|
||||
WeakAuras.Add(data);
|
||||
WeakAuras.NewDisplayButton(data);
|
||||
|
||||
@@ -724,8 +729,9 @@ function WeakAuras.ShowOptions(msg)
|
||||
frame.codereview:Close();
|
||||
end
|
||||
|
||||
-- TODO check if it should be shown
|
||||
frame:ShowTip()
|
||||
if firstLoad then
|
||||
frame:ShowTip()
|
||||
end
|
||||
end
|
||||
|
||||
function OptionsPrivate.UpdateOptions()
|
||||
@@ -1308,9 +1314,9 @@ function WeakAuras.NewAura(sourceData, regionType, targetId)
|
||||
end
|
||||
local new_id = WeakAuras.FindUnusedId("New")
|
||||
local data = {id = new_id, regionType = regionType, uid = WeakAuras.GenerateUniqueID()}
|
||||
WeakAuras.Mixin(data, WeakAuras.data_stub);
|
||||
WeakAuras.DeepMixin(data, WeakAuras.data_stub);
|
||||
if (sourceData) then
|
||||
WeakAuras.Mixin(data, sourceData)
|
||||
WeakAuras.DeepMixin(data, sourceData);
|
||||
end
|
||||
data.internalVersion = WeakAuras.InternalVersion();
|
||||
WeakAuras.validate(data, WeakAuras.regionTypes[regionType].default);
|
||||
|
||||
Reference in New Issue
Block a user