from retail

This commit is contained in:
Bunny67
2020-07-11 00:19:17 +03:00
parent bbb4ac1c37
commit 6a7003b535
27 changed files with 2317 additions and 647 deletions
+124 -13
View File
@@ -51,6 +51,9 @@ function WeakAuras.AddActionOption(id, data)
pcall(PlaySound, v, "Master");
end
WeakAuras.Add(data);
if(value == "message") then
WeakAuras.ReloadOptions(data.id)
end
end,
args = {
init_header = {
@@ -112,7 +115,7 @@ function WeakAuras.AddActionOption(id, data)
type = "input",
width = WeakAuras.normalWidth,
name = L["Send To"],
order = 4,
order = 3.1,
disabled = function() return not data.actions.start.do_message end,
hidden = function() return data.actions.start.message_type ~= "WHISPER" end
},
@@ -120,7 +123,7 @@ function WeakAuras.AddActionOption(id, data)
type = "input",
width = WeakAuras.doubleWidth,
name = L["Message"],
order = 5,
order = 4,
disabled = function() return not data.actions.start.do_message end,
desc = function()
return L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(data)
@@ -131,27 +134,27 @@ function WeakAuras.AddActionOption(id, data)
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Play Sound"],
order = 7
order = 8
},
start_do_loop = {
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Loop"],
order = 7.1,
order = 8.1,
disabled = function() return not data.actions.start.do_sound end,
},
start_sound_repeat = {
type = "range",
width = WeakAuras.normalWidth,
name = L["Repeat After"],
order = 7.2,
order = 8.2,
hidden = function() return not data.actions.start.do_loop end,
disabled = function() return not data.actions.start.do_sound end,
},
start_sound_repeat_space = {
type = "description",
width = WeakAuras.normalWidth,
order = 7.3,
order = 8.3,
name = "",
hidden = function() return not data.actions.start.do_loop end,
},
@@ -159,7 +162,7 @@ function WeakAuras.AddActionOption(id, data)
type = "select",
width = WeakAuras.normalWidth,
name = L["Sound"],
order = 8,
order = 8.4,
values = sound_types,
disabled = function() return not data.actions.start.do_sound end,
control = "WeakAurasSortedDropdown"
@@ -484,7 +487,7 @@ function WeakAuras.AddActionOption(id, data)
type = "input",
width = WeakAuras.normalWidth,
name = L["Send To"],
order = 24,
order = 23.1,
disabled = function() return not data.actions.finish.do_message end,
hidden = function() return data.actions.finish.message_type ~= "WHISPER" end
},
@@ -492,7 +495,7 @@ function WeakAuras.AddActionOption(id, data)
type = "input",
width = WeakAuras.doubleWidth,
name = L["Message"],
order = 25,
order = 24,
disabled = function() return not data.actions.finish.do_message end,
desc = function()
return L["Dynamic text tooltip"] .. WeakAuras.GetAdditionalProperties(data)
@@ -503,13 +506,13 @@ function WeakAuras.AddActionOption(id, data)
type = "toggle",
width = WeakAuras.normalWidth,
name = L["Play Sound"],
order = 27
order = 28
},
finish_sound = {
type = "select",
width = WeakAuras.normalWidth,
name = L["Sound"],
order = 28,
order = 28.1,
values = sound_types,
disabled = function() return not data.actions.finish.do_sound end,
control = "WeakAurasSortedDropdown"
@@ -796,17 +799,125 @@ function WeakAuras.AddActionOption(id, data)
},
}
-- Text format option helpers
WeakAuras.AddCodeOption(action.args, data, L["Custom Code"], "init", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-init",
0.011, function() return not data.actions.init.do_custom end, {"actions", "init", "custom"}, true);
WeakAuras.AddCodeOption(action.args, data, L["Custom Code"], "start_message", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code",
5.1, function() return not (data.actions.start.do_message and WeakAuras.ContainsCustomPlaceHolder(data.actions.start.message)) end, {"actions", "start", "message_custom"}, false);
5, function() return not (data.actions.start.do_message and WeakAuras.ContainsCustomPlaceHolder(data.actions.start.message)) end, {"actions", "start", "message_custom"}, false);
local startHidden = function()
return WeakAuras.IsCollapsed("format_option", "actions", "start_message", true)
end
local startSetHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "actions", "start_message", hidden)
end
local startGet = function(key)
return data.actions.start["message_format_" .. key]
end
local order = 6
local usedKeys = {}
local function startAddOption(key, option)
if usedKeys[key] then
return
end
usedKeys[key] = true
option.order = order
order = order + 0.01
local reload = option.reloadOptions
option.reloadOptions = nil
option.set = function(info, v)
data.actions.start["message_format_" .. key] = v
WeakAuras.Add(data)
if reload then
WeakAuras.ReloadOptions2(data.id, data)
end
end
if option.hidden then
local hidden = option.hidden
option.hidden = function() return not data.actions.start.do_message or hidden() end
else
option.hidden = function() return not data.actions.start.do_message end
end
action.args["start_message_format_" .. key] = option
end
if data.controlledChildren then
for _, childId in pairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local startGet = function(key)
return childData.actions.start["message_format_" .. key]
end
WeakAuras.AddTextFormatOption(childData.actions and childData.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
end
else
WeakAuras.AddTextFormatOption(data.actions and data.actions.start.message, true, startGet, startAddOption, startHidden, startSetHidden)
end
WeakAuras.AddCodeOption(action.args, data, L["Custom Code"], "start", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-show",
13, function() return not data.actions.start.do_custom end, {"actions", "start", "custom"}, true);
WeakAuras.AddCodeOption(action.args, data, L["Custom Code"], "finish_message", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#chat-message---custom-code",
26, function() return not (data.actions.finish.do_message and WeakAuras.ContainsCustomPlaceHolder(data.actions.finish.message)) end, {"actions", "finish", "message_custom"}, false);
25, function() return not (data.actions.finish.do_message and WeakAuras.ContainsCustomPlaceHolder(data.actions.finish.message)) end, {"actions", "finish", "message_custom"}, false);
local finishHidden = function()
return WeakAuras.IsCollapsed("format_option", "actions", "finish_message", true)
end
local finishSetHidden = function(hidden)
WeakAuras.SetCollapsed("format_option", "actions", "finish_message", hidden)
end
local finishGet = function(key)
return data.actions.finish["message_format_" .. key]
end
order = 25
usedKeys = {}
local function finishAddOption(key, option)
if usedKeys[key] then
return
end
option.order = order
order = order + 0.01
local reload = option.reloadOptions
option.reloadOptions = nil
option.set = function(info, v)
data.actions.finish["message_format_" .. key] = v
WeakAuras.Add(data)
if reload then
WeakAuras.ReloadOptions2(data.id, data)
end
end
if option.hidden then
local hidden = option.hidden
option.hidden = function() return not data.actions.finish.do_message or hidden() end
else
option.hidden = function() return not data.actions.finish.do_message end
end
action.args["finish_message_format_" .. key] = option
end
if data.controlledChildren then
for _, childId in pairs(data.controlledChildren) do
local childData = WeakAuras.GetData(childId)
local finishGet = function(key)
return childData.actions.finish["message_format_" .. key]
end
WeakAuras.AddTextFormatOption(childData.actions and childData.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
end
else
WeakAuras.AddTextFormatOption(data.actions and data.actions.finish.message, true, finishGet, finishAddOption, finishHidden, finishSetHidden)
end
WeakAuras.AddCodeOption(action.args, data, L["Custom Code"], "finish", "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#on-hide",
32, function() return not data.actions.finish.do_custom end, {"actions", "finish", "custom"}, true);