From 0e3999b8fdfd53fba957032ba4cfc290fabaa569 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sat, 18 Jul 2020 22:48:08 +0300 Subject: [PATCH] from retail --- WeakAurasOptions/GenericTrigger.lua | 10 ++++++++++ WeakAurasOptions/LoadOptions.lua | 16 ++++++++++++++-- WeakAurasOptions/OptionsFrames/TextEditor.lua | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/WeakAurasOptions/GenericTrigger.lua b/WeakAurasOptions/GenericTrigger.lua index 22aa52e..5247f86 100644 --- a/WeakAurasOptions/GenericTrigger.lua +++ b/WeakAurasOptions/GenericTrigger.lua @@ -204,6 +204,9 @@ local function GetCustomTriggerOptions(data, triggernum) name = L["Dynamic Duration"], order = 12.5, hidden = function() return not (trigger.type == "custom" and trigger.custom_type == "event" and trigger.custom_hide ~= "custom") end, + get = function() + return trigger.dynamicDuration + end, set = function(info, v) trigger.dynamicDuration = v; WeakAuras.Add(data); @@ -217,6 +220,12 @@ local function GetCustomTriggerOptions(data, triggernum) name = L["Duration (s)"], order = 13, hidden = function() return not (trigger.type == "custom" and trigger.custom_type == "event" and trigger.custom_hide ~= "custom" and not trigger.dynamicDuration) end, + get = function() + return trigger.duration + end, + set = function(info, v) + trigger.duration = v + end }, addOverlayFunction = { type = "execute", @@ -247,6 +256,7 @@ local function GetCustomTriggerOptions(data, triggernum) end WeakAuras.Add(data); WeakAuras.ClearAndUpdateOptions(data.id) + WeakAuras.FillOptions() end } }; diff --git a/WeakAurasOptions/LoadOptions.lua b/WeakAurasOptions/LoadOptions.lua index 0fa97b2..f8a3222 100644 --- a/WeakAurasOptions/LoadOptions.lua +++ b/WeakAurasOptions/LoadOptions.lua @@ -809,7 +809,13 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri type = "select", width = WeakAuras.doubleWidth, name = L["Hide"], - order = order + order = order, + get = function() + return trigger.unevent + end, + set = function(info, v) + trigger.unevent = v + end }; order = order + 1; if(unevent == "timed") then @@ -818,7 +824,13 @@ function WeakAuras.ConstructOptions(prototype, data, startorder, triggernum, tri type = "input", width = WeakAuras.normalWidth, name = L["Duration (s)"], - order = order + order = order, + get = function() + return trigger.duration + end, + set = function(info, v) + trigger.duration = v + end } order = order + 1; else diff --git a/WeakAurasOptions/OptionsFrames/TextEditor.lua b/WeakAurasOptions/OptionsFrames/TextEditor.lua index b8d90ec..a895e5a 100644 --- a/WeakAurasOptions/OptionsFrames/TextEditor.lua +++ b/WeakAurasOptions/OptionsFrames/TextEditor.lua @@ -741,6 +741,7 @@ local function ConstructTextEditor(frame) editor:ClearFocus() frame.window = "default" frame:UpdateFrameVisible() + WeakAuras.FillOptions() end WeakAuras.editor = editor