From 0ee89002425f81f02f9b3a9796bd2fcd3de58ce3 Mon Sep 17 00:00:00 2001 From: Infus Date: Sun, 13 Oct 2024 18:01:58 +0200 Subject: [PATCH 1/6] Add an Empty RegionType Which literally is empty and shows nothing --- WeakAuras/RegionTypes/Empty.lua | 52 +++++++++++++++++ WeakAuras/SubRegionTypes/Border.lua | 1 + .../CircularProgressTexture.lua | 1 + WeakAuras/SubRegionTypes/Glow.lua | 3 +- .../SubRegionTypes/LinearProgressTexture.lua | 1 + WeakAuras/SubRegionTypes/Model.lua | 1 + WeakAuras/SubRegionTypes/StopMotion.lua | 1 + WeakAuras/SubRegionTypes/SubText.lua | 1 + WeakAuras/SubRegionTypes/Texture.lua | 1 + WeakAuras/WeakAuras.toc | 1 + WeakAuras/WeakAuras_Cata.toc | 1 + WeakAuras/WeakAuras_Vanilla.toc | 1 + WeakAurasOptions/RegionOptions/Empty.lua | 57 +++++++++++++++++++ WeakAurasOptions/WeakAurasOptions.toc | 1 + WeakAurasOptions/WeakAurasOptions_Cata.toc | 1 + WeakAurasOptions/WeakAurasOptions_Vanilla.toc | 1 + 16 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 WeakAuras/RegionTypes/Empty.lua create mode 100644 WeakAurasOptions/RegionOptions/Empty.lua diff --git a/WeakAuras/RegionTypes/Empty.lua b/WeakAuras/RegionTypes/Empty.lua new file mode 100644 index 0000000000..5443a43009 --- /dev/null +++ b/WeakAuras/RegionTypes/Empty.lua @@ -0,0 +1,52 @@ +if not WeakAuras.IsLibsOK() then return end +---@type string +local AddonName = ... +---@class Private +local Private = select(2, ...) + +local L = WeakAuras.L + +local default = { + width = 200, + height = 200, + selfPoint = "CENTER", + anchorPoint = "CENTER", + anchorFrameType = "SCREEN", + xOffset = 0, + yOffset = 0, + frameStrata = 1 +} + +Private.regionPrototype.AddAlphaToDefault(default) + +local properties = { +} + + +Private.regionPrototype.AddProperties(properties, default); + +local function create(parent) + local region = CreateFrame("Frame", nil, UIParent) + region.regionType = "empty" + region:SetMovable(true) + region:SetResizable(true) + region:SetResizeBounds(1, 1) + + region.Update = function() end + + Private.regionPrototype.create(region) + return region +end + +local function modify(parent, region, data) + Private.regionPrototype.modify(parent, region, data) + region:SetWidth(data.width) + region:SetHeight(data.height) + region.width = data.width + region.height = data.height + region.scalex = 1 + region.scaley = 1 + Private.regionPrototype.modifyFinish(parent, region, data) +end + +Private.RegisterRegionType("empty", create, modify, default, properties) diff --git a/WeakAuras/SubRegionTypes/Border.lua b/WeakAuras/SubRegionTypes/Border.lua index 318cbef7e3..ef847e74eb 100644 --- a/WeakAuras/SubRegionTypes/Border.lua +++ b/WeakAuras/SubRegionTypes/Border.lua @@ -91,6 +91,7 @@ local function supports(regionType) or regionType == "progresstexture" or regionType == "icon" or regionType == "aurabar" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("subborder", L["Border"], supports, create, modify, onAcquire, onRelease, diff --git a/WeakAuras/SubRegionTypes/CircularProgressTexture.lua b/WeakAuras/SubRegionTypes/CircularProgressTexture.lua index 9361706408..3a041a5984 100644 --- a/WeakAuras/SubRegionTypes/CircularProgressTexture.lua +++ b/WeakAuras/SubRegionTypes/CircularProgressTexture.lua @@ -298,6 +298,7 @@ local function supports(regionType) or regionType == "icon" or regionType == "aurabar" or regionType == "text" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("subcirculartexture", L["Circular Texture"], supports, create, modify, onAcquire, onRelease, diff --git a/WeakAuras/SubRegionTypes/Glow.lua b/WeakAuras/SubRegionTypes/Glow.lua index e2d1587f07..e04edd1070 100644 --- a/WeakAuras/SubRegionTypes/Glow.lua +++ b/WeakAuras/SubRegionTypes/Glow.lua @@ -447,7 +447,8 @@ local supportedRegion = { icon = true, aurabar = true, texture = true, - progresstexture = true + progresstexture = true, + empty = true, } local function supports(regionType) return supportedRegion[regionType] diff --git a/WeakAuras/SubRegionTypes/LinearProgressTexture.lua b/WeakAuras/SubRegionTypes/LinearProgressTexture.lua index 4dc9eb8392..ed1174972e 100644 --- a/WeakAuras/SubRegionTypes/LinearProgressTexture.lua +++ b/WeakAuras/SubRegionTypes/LinearProgressTexture.lua @@ -267,6 +267,7 @@ local function supports(regionType) or regionType == "icon" or regionType == "aurabar" or regionType == "text" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("sublineartexture", L["Linear Texture"], supports, create, modify, onAcquire, onRelease, diff --git a/WeakAuras/SubRegionTypes/Model.lua b/WeakAuras/SubRegionTypes/Model.lua index 68990cfb56..22662a4f72 100644 --- a/WeakAuras/SubRegionTypes/Model.lua +++ b/WeakAuras/SubRegionTypes/Model.lua @@ -261,6 +261,7 @@ local function supports(regionType) or regionType == "icon" or regionType == "aurabar" or regionType == "text" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("submodel", L["Model"], supports, create, modify, onAcquire, onRelease, default, nil, properties); diff --git a/WeakAuras/SubRegionTypes/StopMotion.lua b/WeakAuras/SubRegionTypes/StopMotion.lua index af223533d7..dc5014da3b 100644 --- a/WeakAuras/SubRegionTypes/StopMotion.lua +++ b/WeakAuras/SubRegionTypes/StopMotion.lua @@ -276,6 +276,7 @@ local function supports(regionType) or regionType == "icon" or regionType == "aurabar" or regionType == "text" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("substopmotion", L["Stop Motion"], supports, create, modify, onAcquire, onRelease, default, nil, properties) diff --git a/WeakAuras/SubRegionTypes/SubText.lua b/WeakAuras/SubRegionTypes/SubText.lua index 246593e4e1..6331b8ba45 100644 --- a/WeakAuras/SubRegionTypes/SubText.lua +++ b/WeakAuras/SubRegionTypes/SubText.lua @@ -567,6 +567,7 @@ local function supports(regionType) or regionType == "progresstexture" or regionType == "icon" or regionType == "aurabar" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("subtext", L["Text"], supports, create, modify, onAcquire, onRelease, diff --git a/WeakAuras/SubRegionTypes/Texture.lua b/WeakAuras/SubRegionTypes/Texture.lua index 36c015787f..28e48c14c5 100644 --- a/WeakAuras/SubRegionTypes/Texture.lua +++ b/WeakAuras/SubRegionTypes/Texture.lua @@ -154,6 +154,7 @@ local function supports(regionType) or regionType == "icon" or regionType == "aurabar" or regionType == "text" + or regionType == "empty" end WeakAuras.RegisterSubRegionType("subtexture", L["Texture"], supports, create, modify, onAcquire, onRelease, default, nil, properties) diff --git a/WeakAuras/WeakAuras.toc b/WeakAuras/WeakAuras.toc index 41f3213afb..1431972560 100644 --- a/WeakAuras/WeakAuras.toc +++ b/WeakAuras/WeakAuras.toc @@ -69,6 +69,7 @@ Dragonriding.lua # Region support RegionTypes\SmoothStatusBarMixin.lua RegionTypes\RegionPrototype.lua +RegionTypes\Empty.lua BaseRegions\TextureCoords.lua BaseRegions\CircularProgressTexture.lua BaseRegions\LinearProgressTexture.lua diff --git a/WeakAuras/WeakAuras_Cata.toc b/WeakAuras/WeakAuras_Cata.toc index 09b8dec687..db0720b932 100644 --- a/WeakAuras/WeakAuras_Cata.toc +++ b/WeakAuras/WeakAuras_Cata.toc @@ -67,6 +67,7 @@ DebugLog.lua # Region support RegionTypes\SmoothStatusBarMixin.lua RegionTypes\RegionPrototype.lua +RegionTypes\Empty.lua BaseRegions\TextureCoords.lua BaseRegions\CircularProgressTexture.lua BaseRegions\LinearProgressTexture.lua diff --git a/WeakAuras/WeakAuras_Vanilla.toc b/WeakAuras/WeakAuras_Vanilla.toc index 2872a1b593..234c8e4cf5 100644 --- a/WeakAuras/WeakAuras_Vanilla.toc +++ b/WeakAuras/WeakAuras_Vanilla.toc @@ -59,6 +59,7 @@ DebugLog.lua # Region support RegionTypes\SmoothStatusBarMixin.lua RegionTypes\RegionPrototype.lua +RegionTypes\Empty.lua BaseRegions\TextureCoords.lua BaseRegions\CircularProgressTexture.lua BaseRegions\LinearProgressTexture.lua diff --git a/WeakAurasOptions/RegionOptions/Empty.lua b/WeakAurasOptions/RegionOptions/Empty.lua new file mode 100644 index 0000000000..fa98a8d6fa --- /dev/null +++ b/WeakAurasOptions/RegionOptions/Empty.lua @@ -0,0 +1,57 @@ +if not WeakAuras.IsLibsOK() then return end +---@type string +local AddonName = ... +---@class OptionsPrivate +local OptionsPrivate = select(2, ...) + +local L = WeakAuras.L + +local function createOptions(id, data) + local options = { + __title = L["Settings"], + __order = 1, + alpha = { + type = "range", + control = "WeakAurasSpinBox", + width = WeakAuras.normalWidth, + name = L["Alpha"], + order = 1, + min = 0, + max = 1, + bigStep = 0.01, + isPercent = true + }, + } + + return { + empty = options, + position = OptionsPrivate.commonOptions.PositionOptions(id, data), + } + +end + +local function createThumbnail() + ---@class frame: FrameScriptObject + local frame = CreateFrame("Frame", nil, UIParent) + frame:SetWidth(32) + frame:SetHeight(32) + + local border = frame:CreateTexture(nil, "OVERLAY") + border:SetAllPoints(frame) + border:SetTexture("Interface\\BUTTONS\\UI-Quickslot2.blp") + border:SetTexCoord(0.2, 0.8, 0.2, 0.8) + + return frame +end + +local function modifyThumbnail(parent, frame, data) + +end + +-- Register new region type options with WeakAuras +OptionsPrivate.registerRegions = OptionsPrivate.registerRegions or {} +table.insert(OptionsPrivate.registerRegions, function() + OptionsPrivate.Private.RegisterRegionOptions("empty", createOptions, createThumbnail, L["Empty Base Region"], + createThumbnail, modifyThumbnail, + L["Shows nothing, except sub elements"]); +end) diff --git a/WeakAurasOptions/WeakAurasOptions.toc b/WeakAurasOptions/WeakAurasOptions.toc index dc49f024f6..d401eee21a 100644 --- a/WeakAurasOptions/WeakAurasOptions.toc +++ b/WeakAurasOptions/WeakAurasOptions.toc @@ -21,6 +21,7 @@ locales.xml VersionCheck.lua ForAllIndentsAndPurposes.lua +RegionOptions\Empty.lua RegionOptions\AuraBar.lua RegionOptions\Texture.lua RegionOptions\Icon.lua diff --git a/WeakAurasOptions/WeakAurasOptions_Cata.toc b/WeakAurasOptions/WeakAurasOptions_Cata.toc index 15121f8cee..01e449a3e6 100644 --- a/WeakAurasOptions/WeakAurasOptions_Cata.toc +++ b/WeakAurasOptions/WeakAurasOptions_Cata.toc @@ -20,6 +20,7 @@ locales.xml ForAllIndentsAndPurposes.lua +RegionOptions\Empty.lua RegionOptions\AuraBar.lua RegionOptions\Texture.lua RegionOptions\Icon.lua diff --git a/WeakAurasOptions/WeakAurasOptions_Vanilla.toc b/WeakAurasOptions/WeakAurasOptions_Vanilla.toc index 7159dd7275..b0b6c87a7f 100644 --- a/WeakAurasOptions/WeakAurasOptions_Vanilla.toc +++ b/WeakAurasOptions/WeakAurasOptions_Vanilla.toc @@ -19,6 +19,7 @@ locales.xml ForAllIndentsAndPurposes.lua +RegionOptions\Empty.lua RegionOptions\AuraBar.lua RegionOptions\Texture.lua RegionOptions\Icon.lua From bd2d5018ce50a92da08ad4aaeb9dc11b78a48fcf Mon Sep 17 00:00:00 2001 From: InfusOnWoW Date: Thu, 26 Dec 2024 15:17:28 +0100 Subject: [PATCH 2/6] Add a Changelog button --- WeakAurasOptions/Changelog.lua | 6 ++++++ WeakAurasOptions/OptionsFrames/OptionsFrame.lua | 15 +++++++++++++++ WeakAurasOptions/WeakAurasOptions.toc | 2 ++ WeakAurasOptions/WeakAurasOptions_Cata.toc | 2 ++ WeakAurasOptions/WeakAurasOptions_Vanilla.toc | 2 ++ generate_changelog.sh | 16 ++++++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 WeakAurasOptions/Changelog.lua diff --git a/WeakAurasOptions/Changelog.lua b/WeakAurasOptions/Changelog.lua new file mode 100644 index 0000000000..75b6bf14ed --- /dev/null +++ b/WeakAurasOptions/Changelog.lua @@ -0,0 +1,6 @@ +if not WeakAuras.IsLibsOK() then return end +---@type string +local AddonName = ... +---@class OptionsPrivate +local OptionsPrivate = select(2, ...) + diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 73bd5dccd2..9b122ddfab 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -515,6 +515,21 @@ function OptionsPrivate.CreateFrame() thanksButton:SetParent(tipFrame) thanksButton:SetPoint("LEFT", documentationButton, "RIGHT", 10, 0) + 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 + else + changelog = OptionsPrivate.changelog.commitText + end + + local changelogButton = addFooter(L["Changelog"], "", OptionsPrivate.changelog.fullChangeLogUrl, + changelog, nil, nil, false, 800) + changelogButton:SetParent(tipFrame) + changelogButton:SetPoint("LEFT", thanksButton, "RIGHT", 10, 0) + end + local reportbugButton = addFooter(L["Found a Bug?"], [[Interface\AddOns\WeakAuras\Media\Textures\bug_report.tga]], "https://github.com/WeakAuras/WeakAuras2/issues/new?assignees=&labels=%F0%9F%90%9B+Bug&template=bug_report.md&title=", L["Report bugs on our issue tracker."], nil, nil, true) reportbugButton:SetParent(tipFrame) diff --git a/WeakAurasOptions/WeakAurasOptions.toc b/WeakAurasOptions/WeakAurasOptions.toc index d401eee21a..e7fd1f154d 100644 --- a/WeakAurasOptions/WeakAurasOptions.toc +++ b/WeakAurasOptions/WeakAurasOptions.toc @@ -62,6 +62,8 @@ WeakAurasOptions.lua ConditionOptions.lua AuthorOptions.lua +Changelog.lua + OptionsFrames\OptionsFrame.lua # Groups diff --git a/WeakAurasOptions/WeakAurasOptions_Cata.toc b/WeakAurasOptions/WeakAurasOptions_Cata.toc index 01e449a3e6..c7a2a53845 100644 --- a/WeakAurasOptions/WeakAurasOptions_Cata.toc +++ b/WeakAurasOptions/WeakAurasOptions_Cata.toc @@ -61,6 +61,8 @@ WeakAurasOptions.lua ConditionOptions.lua AuthorOptions.lua +Changelog.lua + OptionsFrames\OptionsFrame.lua # Groups diff --git a/WeakAurasOptions/WeakAurasOptions_Vanilla.toc b/WeakAurasOptions/WeakAurasOptions_Vanilla.toc index b0b6c87a7f..b629ba3d40 100644 --- a/WeakAurasOptions/WeakAurasOptions_Vanilla.toc +++ b/WeakAurasOptions/WeakAurasOptions_Vanilla.toc @@ -60,6 +60,8 @@ WeakAurasOptions.lua ConditionOptions.lua AuthorOptions.lua +Changelog.lua + OptionsFrames\OptionsFrame.lua # Groups diff --git a/generate_changelog.sh b/generate_changelog.sh index 7f9a0f560e..25e823b968 100755 --- a/generate_changelog.sh +++ b/generate_changelog.sh @@ -23,6 +23,7 @@ fi date=$( git log -1 --date=short --format="%ad" ) url=$( git remote get-url origin | sed -e 's/^git@\(.*\):/https:\/\/\1\//' -e 's/\.git$//' ) +# Changlog.md echo -ne "# [${version}](${url}/tree/${current}) ($date)\n\n[Full Changelog](${url}/compare/${previous}...${current})\n\n" > "CHANGELOG.md" if [ "$version" = "$tag" ]; then # on a tag @@ -31,3 +32,18 @@ if [ "$version" = "$tag" ]; then # on a tag fi git shortlog --no-merges --reverse "$previous..$current" | sed -e '/^\w/G' -e 's/^ /- /' >> "CHANGELOG.md" + +# Changelog.lua +echo -ne "if not WeakAuras.IsLibsOK() then return end\n---@type string\nlocal AddonName = ...\n---@class OptionsPrivate\nlocal OptionsPrivate = select(2, ...)\n" >> "WeakAurasOptions/Changelog.lua" +echo -ne "OptionsPrivate.changelog = {\n" >> "WeakAurasOptions/Changelog.lua" +echo -ne " versionString = '$version',\n" >> "WeakAurasOptions/Changelog.lua" +echo -ne " dateString = '$date',\n" >> "WeakAurasOptions/Changelog.lua" +echo -ne " fullChangeLogUrl = '${url}/compare/${previous}...${current}',\n" >> "WeakAurasOptions/Changelog.lua" +if [ "$version" = "$tag" ]; then # on a tag + echo -ne " highlightText = [==[\n" >> "WeakAurasOptions/Changelog.lua" + echo -ne "$highlights" >> "WeakAurasOptions/Changelog.lua" + echo -ne "]==]," >> "WeakAurasOptions/Changelog.lua" +fi +echo -ne " commitText = [==[" >> "WeakAurasOptions/Changelog.lua" +git shortlog --no-merges --reverse "$previous..$current" | sed -e '/^\w/G' -e 's/^ /- /' >> "WeakAurasOptions/Changelog.lua" +echo -ne "]==]\n}" >> "WeakAurasOptions/Changelog.lua" From 8d31904ff13d44e4caacb61c934af26a3a826565 Mon Sep 17 00:00:00 2001 From: Infus Date: Wed, 1 Jan 2025 03:12:38 +0100 Subject: [PATCH 3/6] Add Thank you Role to allowed roles --- .github/scripts/discordupdate.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/discordupdate.py b/.github/scripts/discordupdate.py index 73b4105ca6..a258720854 100644 --- a/.github/scripts/discordupdate.py +++ b/.github/scripts/discordupdate.py @@ -26,6 +26,7 @@ 402021459440173056, # Regular 172440752045948928, # Moderator, 294497613565263872, # Super Moderator + 1323828198479233054, # thankyou } MSG = """React to this message to have your name included in the Thanks list inside the WeakAuras GUI. From 530fb24a1710509c065b660823a8b7a54e51b0f3 Mon Sep 17 00:00:00 2001 From: Infus Date: Wed, 1 Jan 2025 03:12:56 +0100 Subject: [PATCH 4/6] Fix description of Stop Motion sub element --- WeakAurasOptions/SubRegionOptions/StopMotion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeakAurasOptions/SubRegionOptions/StopMotion.lua b/WeakAurasOptions/SubRegionOptions/StopMotion.lua index 36cb6239ec..017339eb7d 100644 --- a/WeakAurasOptions/SubRegionOptions/StopMotion.lua +++ b/WeakAurasOptions/SubRegionOptions/StopMotion.lua @@ -318,4 +318,4 @@ local function createOptions(parentData, data, index, subIndex) return options end - WeakAuras.RegisterSubRegionOptions("substopmotion", createOptions, L["Shows a Stop Moption"]); + WeakAuras.RegisterSubRegionOptions("substopmotion", createOptions, L["Shows a Stop Motion"]); From d4dad81337669178fc2fc8249c63c2a38ef3b1ee Mon Sep 17 00:00:00 2001 From: Infus Date: Sat, 4 Jan 2025 19:09:42 +0100 Subject: [PATCH 5/6] Stop Motion: Properly fix GetColor function We need to return the unanimated values Fixes: #5602 --- WeakAuras/RegionTypes/StopMotion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeakAuras/RegionTypes/StopMotion.lua b/WeakAuras/RegionTypes/StopMotion.lua index e004ca5007..2ee19b128f 100644 --- a/WeakAuras/RegionTypes/StopMotion.lua +++ b/WeakAuras/RegionTypes/StopMotion.lua @@ -262,7 +262,7 @@ local function modify(parent, region, data) --- @class StopMotionRegion --- @field GetColor fun(self: StopMotionRegion): number, number, number, number function region:GetColor() - return self.foreground:GetColor() + return region.color_r, region.color_g, region.color_b, region.color_a end --- @class StopMotionRegion From 312de126409f3126530b0e6b7d731c7868982c7a Mon Sep 17 00:00:00 2001 From: Infus Date: Sat, 4 Jan 2025 19:10:24 +0100 Subject: [PATCH 6/6] Texture Sub Element: Fix ordering of input and browse button --- WeakAurasOptions/SubRegionOptions/Texture.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WeakAurasOptions/SubRegionOptions/Texture.lua b/WeakAurasOptions/SubRegionOptions/Texture.lua index 85f421d436..9c89e174fb 100644 --- a/WeakAurasOptions/SubRegionOptions/Texture.lua +++ b/WeakAurasOptions/SubRegionOptions/Texture.lua @@ -33,7 +33,7 @@ local function createOptions(parentData, data, index, subIndex) type = "execute", width = 0.15, name = L["Choose"], - order = 2, + order = 2.1, func = function() local path = { "subRegions", index } local paths = {}