From 741c70cbb5479aa39ed5deaa8025843cc7401ccf Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sat, 18 Jul 2020 00:02:27 +0300 Subject: [PATCH] from retail fix #36 --- WeakAurasOptions/BuffTrigger2.lua | 2 +- WeakAurasOptions/CommonOptions.lua | 16 ++++++---------- WeakAurasOptions/GenericTrigger.lua | 6 +++++- WeakAurasOptions/OptionsFrames/OptionsFrame.lua | 7 +++++++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/WeakAurasOptions/BuffTrigger2.lua b/WeakAurasOptions/BuffTrigger2.lua index 19e7bf5..56cba5c 100644 --- a/WeakAurasOptions/BuffTrigger2.lua +++ b/WeakAurasOptions/BuffTrigger2.lua @@ -683,7 +683,7 @@ local function GetBuffTriggerOptions(data, triggernum) useUnitName = { type = "toggle", - width = "WeakAuras.normalWidth", + width = WeakAuras.normalWidth, name = L["UnitName Filter"], order = 69.1, hidden = function() return diff --git a/WeakAurasOptions/CommonOptions.lua b/WeakAurasOptions/CommonOptions.lua index d31dc43..b640953 100644 --- a/WeakAurasOptions/CommonOptions.lua +++ b/WeakAurasOptions/CommonOptions.lua @@ -1322,7 +1322,7 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p end local function AddCommonTriggerOptions(options, data, triggernum) - local trigger= data.triggers[triggernum].trigger + local trigger = data.triggers[triggernum].trigger local trigger_types = {}; for type, triggerSystem in pairs(WeakAuras.triggerTypes) do @@ -1349,15 +1349,11 @@ local function AddCommonTriggerOptions(options, data, triggernum) end, set = function(info, v) trigger.type = v; - if(trigger.event) then - local prototype = WeakAuras.event_prototypes[trigger.event]; - if(prototype) then - if(v == "status" and prototype.type == "event") then - trigger.event = "Cooldown Progress (Spell)" - elseif(v == "event" and prototype.type == "status") then - trigger.event = "Combat Log" - end - end + local prototype = trigger.event and WeakAuras.event_prototypes[trigger.event]; + if v == "status" and (not prototype or prototype.type == "event") then + trigger.event = "Cooldown Progress (Spell)" + elseif v == "event" and (not prototype or prototype.type == "status") then + trigger.event = "Combat Log" end WeakAuras.Add(data); WeakAuras.UpdateThumbnail(data); diff --git a/WeakAurasOptions/GenericTrigger.lua b/WeakAurasOptions/GenericTrigger.lua index 51f03d9..22aa52e 100644 --- a/WeakAurasOptions/GenericTrigger.lua +++ b/WeakAurasOptions/GenericTrigger.lua @@ -408,7 +408,11 @@ local function GetGenericTriggerOptions(data, triggernum) control = "WeakAurasSortedDropdown", hidden = function() return not (trigger.type == "event" and trigger.event == "Combat Log" and subevent_actual_prefix_types[trigger.subeventPrefix]); end, get = function(info) - return trigger.subevent + return trigger.subeventSuffix + end, + set = function(info, v) + trigger.subeventSuffix = v + WeakAuras.Add(data) end }, spacer_suffix = { diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 94ad565..50038e3 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -767,6 +767,9 @@ function WeakAuras.CreateFrame() end frame.UpdateOptions = function(self) + if not self.pickedDisplay then + return + end self.selectedTab = self.selectedTab or "region" local data if type(self.pickedDisplay) == "string" then @@ -820,6 +823,10 @@ function WeakAuras.CreateFrame() -- Any changes to the options that go around that, e.g. drag/drop, group, -- texture pick, etc should call this frame.FillOptions = function(self) + if not self.pickedDisplay then + return + end + frame:UpdateOptions() local data