diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 4d41eff..5053578 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -903,6 +903,9 @@ function Private.ScanEvents(event, arg1, arg2, ...) end function WeakAuras.ScanEvents(event, arg1, arg2, ...) + if type(event) ~= "string" then + return + end scannerFrame:Queue(Private.ScanEvents, event, arg1, arg2, ...) end diff --git a/WeakAuras/Modernize.lua b/WeakAuras/Modernize.lua index cdb19f9..a3a24e5 100644 --- a/WeakAuras/Modernize.lua +++ b/WeakAuras/Modernize.lua @@ -1827,9 +1827,11 @@ function Private.Modernize(data, oldSnapshot) -- noMerge for separator custom option doesn't make sense, -- and groups achieve the desired effect better, -- so drop the feature - for _, optionData in ipairs(data.authorOptions) do - if optionData.type == "header" then - optionData.noMerge = nil + if data.authorOptions then + for _, optionData in ipairs(data.authorOptions) do + if optionData.type == "header" then + optionData.noMerge = nil + end end end end diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 207bf58..f604110 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -487,8 +487,7 @@ function OptionsPrivate.CreateFrame() if OptionsPrivate.changelog then local changelog if OptionsPrivate.changelog.highlightText then - changelog = L["Highlights"] .. "\n" .. OptionsPrivate.changelog.highlightText .. "\n" - .. L["Commits"] .. "\n" ..OptionsPrivate.changelog.commitText + changelog = L["Highlights"] .. "\n" .. OptionsPrivate.changelog.highlightText else changelog = OptionsPrivate.changelog.commitText end diff --git a/WeakAurasOptions/RegionOptions/Empty.lua b/WeakAurasOptions/RegionOptions/Empty.lua index 71508af..1f17157 100644 --- a/WeakAurasOptions/RegionOptions/Empty.lua +++ b/WeakAurasOptions/RegionOptions/Empty.lua @@ -19,6 +19,34 @@ local function createOptions(id, data) bigStep = 0.01, isPercent = true }, + + thumbnailIcon = { + type = "input", + width = WeakAuras.doubleWidth - 0.15, + name = L["Thumbnail Icon"], + order = 2, + get = function() + return data.thumbnailIcon and tostring(data.thumbnailIcon) or "" + end, + set = function(info, v) + data.thumbnailIcon = v + WeakAuras.Add(data) + WeakAuras.UpdateThumbnail(data) + end + }, + chooseIcon = { + type = "execute", + width = 0.15, + name = L["Choose"], + order = 3, + func = function() + OptionsPrivate.OpenIconPicker(data, { [data.id] = {"thumbnailIcon"} }) + end, + imageWidth = 24, + imageHeight = 24, + control = "WeakAurasIcon", + image = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\browse", + }, } return { @@ -38,11 +66,20 @@ local function createThumbnail() border:SetTexture("Interface\\BUTTONS\\UI-Quickslot2.blp") border:SetTexCoord(0.2, 0.8, 0.2, 0.8) + local icon = frame:CreateTexture(nil, "OVERLAY") + icon:SetAllPoints(frame) + frame.icon = icon + return frame end local function modifyThumbnail(parent, frame, data) - + frame.icon:SetTexture(data.thumbnailIcon) + if frame.icon:GetTexture() then + frame.icon:Show() + else + frame.icon:Hide() + end end -- Register new region type options with WeakAuras