from retail
This commit is contained in:
@@ -868,12 +868,12 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
end
|
||||
|
||||
if data.controlledChildren then
|
||||
for _, childId in pairs(data.controlledChildren) do
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
local startGet = function(key)
|
||||
return childData.actions.start["message_format_" .. key]
|
||||
end
|
||||
OptionsPrivate.AddTextFormatOption(childData.actions and childData.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
|
||||
OptionsPrivate.AddTextFormatOption(childData.actions and childData.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden, index, #data.controlledChildren)
|
||||
end
|
||||
else
|
||||
OptionsPrivate.AddTextFormatOption(data.actions and data.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
|
||||
@@ -927,12 +927,12 @@ function OptionsPrivate.GetActionOptions(data)
|
||||
end
|
||||
|
||||
if data.controlledChildren then
|
||||
for _, childId in pairs(data.controlledChildren) do
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
local finishGet = function(key)
|
||||
return childData.actions.finish["message_format_" .. key]
|
||||
end
|
||||
OptionsPrivate.AddTextFormatOption(childData.actions and childData.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
|
||||
OptionsPrivate.AddTextFormatOption(childData.actions and childData.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden, index, #data.controlledChildren)
|
||||
end
|
||||
else
|
||||
OptionsPrivate.AddTextFormatOption(data.actions and data.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
|
||||
|
||||
@@ -770,9 +770,13 @@ local function addControlsForChange(args, order, data, conditionVariable, condit
|
||||
end
|
||||
|
||||
if data.controlledChildren then
|
||||
local ordered = {}
|
||||
for id, reference in pairs(conditions[i].changes[j].references) do
|
||||
tinsert(ordered, reference)
|
||||
end
|
||||
for index, reference in ipairs(ordered) do
|
||||
local input = reference.value and reference.value.message
|
||||
hasTextFormatOption = OptionsPrivate.AddTextFormatOption(input, true, formatGet, addOption, hidden, setHidden)
|
||||
hasTextFormatOption = OptionsPrivate.AddTextFormatOption(input, true, formatGet, addOption, hidden, setHidden, index, #ordered)
|
||||
end
|
||||
else
|
||||
local input = type(conditions[i].changes[j].value) == "table" and conditions[i].changes[j].value["message"]
|
||||
|
||||
@@ -615,7 +615,7 @@ local function ConstructTextEditor(frame)
|
||||
if (not multipath) then
|
||||
for index, field in pairs(path) do
|
||||
if (type(field) == "number") then
|
||||
field = "Trigger " .. field + 1
|
||||
field = "Trigger " .. field
|
||||
end
|
||||
title = title .. " " .. field:sub(1, 1):upper() .. field:sub(2)
|
||||
end
|
||||
|
||||
@@ -266,7 +266,6 @@ local function createOptions(id, data)
|
||||
37, function() return not OptionsPrivate.Private.ContainsCustomPlaceHolder(data.displayText) end, {"customText"}, false);
|
||||
|
||||
-- Add Text Format Options
|
||||
local input = data.displayText
|
||||
local hidden = function()
|
||||
return OptionsPrivate.IsCollapsed("format_option", "text", "displayText", true)
|
||||
end
|
||||
@@ -275,10 +274,6 @@ local function createOptions(id, data)
|
||||
OptionsPrivate.SetCollapsed("format_option", "text", "displayText", hidden)
|
||||
end
|
||||
|
||||
local get = function(key)
|
||||
return data["displayText_format_" .. key]
|
||||
end
|
||||
|
||||
local order = 12
|
||||
local function addOption(key, option)
|
||||
option.order = order
|
||||
@@ -294,7 +289,22 @@ local function createOptions(id, data)
|
||||
options["displayText_format_" .. key] = option
|
||||
end
|
||||
|
||||
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
|
||||
if data.controlledChildren then
|
||||
for index, childId in pairs(data.controlledChildren) do
|
||||
local childData = WeakAuras.GetData(childId)
|
||||
local get = function(key)
|
||||
return childData["displayText_format_" .. key]
|
||||
end
|
||||
local input = childData.displayText
|
||||
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden, index, #data.controlledChildren)
|
||||
end
|
||||
else
|
||||
local get = function(key)
|
||||
return data["displayText_format_" .. key]
|
||||
end
|
||||
local input = data.displayText
|
||||
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
|
||||
end
|
||||
addOption("footer", {
|
||||
type = "description",
|
||||
name = "",
|
||||
|
||||
@@ -469,9 +469,8 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
end
|
||||
|
||||
if parentData.controlledChildren then
|
||||
for _, childId in pairs(parentData.controlledChildren) do
|
||||
for childIndex, childId in pairs(parentData.controlledChildren) do
|
||||
local parentChildData = WeakAuras.GetData(childId)
|
||||
|
||||
if parentChildData.subRegions then
|
||||
local childData = parentChildData.subRegions[index]
|
||||
if childData then
|
||||
@@ -479,7 +478,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
return childData["text_text_format_" .. key]
|
||||
end
|
||||
local input = childData["text_text"]
|
||||
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
|
||||
OptionsPrivate.AddTextFormatOption(input, true, get, addOption, hidden, setHidden, childIndex, #parentData.controlledChildren)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1561,9 +1561,9 @@ function OptionsPrivate.InsertCollapsed(id, namespace, path, value)
|
||||
data[insertPoint] = {[collapsed] = value}
|
||||
end
|
||||
|
||||
function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, hidden, setHidden)
|
||||
function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, hidden, setHidden, index, total)
|
||||
local headerOption
|
||||
if withHeader then
|
||||
if withHeader and (not index or index == 1) then
|
||||
headerOption = {
|
||||
type = "execute",
|
||||
control = "WeakAurasExpandSmall",
|
||||
@@ -1620,7 +1620,7 @@ function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, h
|
||||
end
|
||||
end)
|
||||
|
||||
if withHeader then
|
||||
if withHeader and (not index or index == total) then
|
||||
addOption("header_anchor",
|
||||
{
|
||||
type = "description",
|
||||
@@ -1634,7 +1634,7 @@ function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, h
|
||||
)
|
||||
end
|
||||
|
||||
if not next(seenSymbols) and withHeader then
|
||||
if not next(seenSymbols) and headerOption and not index then
|
||||
headerOption.hidden = true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user