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