from retail
This commit is contained in:
@@ -9,22 +9,22 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
__order = 1,
|
||||
__up = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subbarmodel")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__down = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subbarmodel")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__duplicate = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subbarmodel")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__delete = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subbarmodel")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
bar_model_visible = {
|
||||
|
||||
@@ -11,22 +11,22 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
__order = 1,
|
||||
__up = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subborder")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__down = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subborder")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__duplicate = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subtext")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__delete = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subborder")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
border_visible = {
|
||||
|
||||
@@ -20,22 +20,22 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
__order = 1,
|
||||
__up = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subglow")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__down = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subglow")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__duplicate = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subglow")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__delete = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subglow")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
glow = {
|
||||
@@ -112,7 +112,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
func = function()
|
||||
func = function(info, button)
|
||||
local collapsed = WeakAuras.IsCollapsed("glow", "glow", "glowextra" .. index, true);
|
||||
WeakAuras.SetCollapsed("glow", "glow", "glowextra" .. index, not collapsed);
|
||||
end,
|
||||
|
||||
@@ -29,7 +29,7 @@ function WeakAuras.DeleteSubRegion(data, index, regionType)
|
||||
if data.subRegions[index] and data.subRegions[index].type == regionType then
|
||||
tremove(data.subRegions, index)
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ReloadOptions2(data.id, data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
|
||||
local replacements = {
|
||||
["sub." .. index .. "."] = deleteCondition
|
||||
@@ -50,7 +50,7 @@ function WeakAuras.MoveSubRegionUp(data, index, regionType)
|
||||
if data.subRegions[index] and data.subRegions[index].type == regionType then
|
||||
data.subRegions[index - 1], data.subRegions[index] = data.subRegions[index], data.subRegions[index - 1]
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ReloadOptions2(data.id, data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
|
||||
local replacements = {
|
||||
["sub." .. (index -1) .. "."] = "sub." .. index .. ".",
|
||||
@@ -68,7 +68,7 @@ function WeakAuras.MoveSubRegionDown(data, index, regionType)
|
||||
if data.subRegions[index] and data.subRegions[index].type == regionType and data.subRegions[index + 1] then
|
||||
data.subRegions[index], data.subRegions[index + 1] = data.subRegions[index + 1], data.subRegions[index]
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ReloadOptions2(data.id, data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
|
||||
local replacements = {
|
||||
["sub." .. index .. "."] = "sub." .. (index + 1) .. ".",
|
||||
@@ -86,7 +86,7 @@ function WeakAuras.DuplicateSubRegion(data, index, regionType)
|
||||
if data.subRegions[index] and data.subRegions[index].type == regionType then
|
||||
tinsert(data.subRegions, index, CopyTable(data.subRegions[index]))
|
||||
WeakAuras.Add(data)
|
||||
WeakAuras.ReloadOptions2(data.id, data)
|
||||
WeakAuras.ClearAndUpdateOptions(data.id)
|
||||
|
||||
local replacements = {}
|
||||
for i = index + 1, #data.subRegions do
|
||||
|
||||
@@ -32,22 +32,22 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
__order = 1,
|
||||
__up = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionUp, index, "subtext")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__down = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.MoveSubRegionDown, index, "subtext")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__duplicate = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DuplicateSubRegion, index, "subtext")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
__delete = function()
|
||||
if (WeakAuras.ApplyToDataOrChildData(parentData, WeakAuras.DeleteSubRegion, index, "subtext")) then
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
end,
|
||||
text_visible = {
|
||||
@@ -74,7 +74,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
set = function(info, v)
|
||||
data.text_text = WeakAuras.ReplaceLocalizedRaidMarkers(v)
|
||||
WeakAuras.Add(parentData)
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
},
|
||||
text_font = {
|
||||
@@ -136,7 +136,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
end,
|
||||
width = WeakAuras.doubleWidth,
|
||||
order = 44,
|
||||
func = function()
|
||||
func = function(info, button)
|
||||
local collapsed = WeakAuras.IsCollapsed("subtext", "subtext", "fontflags" .. index, true)
|
||||
WeakAuras.SetCollapsed("subtext", "subtext", "fontflags" .. index, not collapsed)
|
||||
end,
|
||||
@@ -325,7 +325,7 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
end,
|
||||
imageWidth = 24,
|
||||
imageHeight = 24,
|
||||
func = function()
|
||||
func = function(info, button)
|
||||
local collapsed = WeakAuras.IsCollapsed("subregion", "text_anchors", tostring(index), true)
|
||||
WeakAuras.SetCollapsed("subregion", "text_anchors", tostring(index), not collapsed)
|
||||
end
|
||||
@@ -408,21 +408,6 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
return true
|
||||
end
|
||||
|
||||
local function CheckTextOptions(placeholders)
|
||||
return function()
|
||||
if not parentData.subRegions then
|
||||
return true
|
||||
end
|
||||
|
||||
for index, subRegion in ipairs(parentData.subRegions) do
|
||||
if subRegion.type == "subtext" and WeakAuras.ContainsPlaceHolders(subRegion.text_text, placeholders) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local commonTextOptions = {
|
||||
__title = L["Common Text"],
|
||||
__hidden = function() return hideCustomTextOption() end,
|
||||
@@ -437,16 +422,15 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
set = function(info, v)
|
||||
parentData.customTextUpdate = v
|
||||
WeakAuras.Add(parentData)
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id)
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
WeakAuras.AddCodeOption(commonTextOptions, parentData, L["Custom Function"], "customText", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-text",
|
||||
WeakAuras.commonOptions.AddCodeOption(commonTextOptions, parentData, L["Custom Function"], "customText", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-text",
|
||||
4, hideCustomTextOption, {"customText"}, false)
|
||||
|
||||
-- Add Text Format Options
|
||||
local input = data["text_text"]
|
||||
local hidden = function()
|
||||
return WeakAuras.IsCollapsed("format_option", "text", "text_text", true)
|
||||
end
|
||||
@@ -455,10 +439,6 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
WeakAuras.SetCollapsed("format_option", "text", "text_text", hidden)
|
||||
end
|
||||
|
||||
local get = function(key)
|
||||
return data["text_text_format_" .. key]
|
||||
end
|
||||
|
||||
local order = 12
|
||||
local function addOption(key, option)
|
||||
option.order = order
|
||||
@@ -468,13 +448,35 @@ local function createOptions(parentData, data, index, subIndex)
|
||||
option.set = function(info, v)
|
||||
data["text_text_format_" .. key] = v
|
||||
WeakAuras.Add(parentData)
|
||||
WeakAuras.ReloadOptions2(parentData.id, parentData)
|
||||
WeakAuras.ClearAndUpdateOptions(parentData.id, true)
|
||||
end
|
||||
end
|
||||
options["text_text_format_" .. key] = option
|
||||
end
|
||||
|
||||
WeakAuras.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
|
||||
if parentData.controlledChildren then
|
||||
for _, childId in pairs(parentData.controlledChildren) do
|
||||
local parentChildData = WeakAuras.GetData(childId)
|
||||
|
||||
if parentChildData.subRegions then
|
||||
local childData = parentChildData.subRegions[index]
|
||||
if childData then
|
||||
local get = function(key)
|
||||
return childData["text_text_format_" .. key]
|
||||
end
|
||||
local input = childData["text_text"]
|
||||
WeakAuras.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local get = function(key)
|
||||
return data["text_text_format_" .. key]
|
||||
end
|
||||
local input = data["text_text"]
|
||||
WeakAuras.AddTextFormatOption(input, true, get, addOption, hidden, setHidden)
|
||||
end
|
||||
|
||||
addOption("footer", {
|
||||
type = "description",
|
||||
name = "",
|
||||
|
||||
Reference in New Issue
Block a user