Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smallpatches #5606

Merged
merged 6 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/scripts/discordupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
52 changes: 52 additions & 0 deletions WeakAuras/RegionTypes/Empty.lua
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion WeakAuras/RegionTypes/StopMotion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/Border.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/CircularProgressTexture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion WeakAuras/SubRegionTypes/Glow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/LinearProgressTexture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/Model.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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);
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/StopMotion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/SubText.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/SubRegionTypes/Texture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions WeakAuras/WeakAuras.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/WeakAuras_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions WeakAuras/WeakAuras_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions WeakAurasOptions/Changelog.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if not WeakAuras.IsLibsOK() then return end
---@type string
local AddonName = ...
---@class OptionsPrivate
local OptionsPrivate = select(2, ...)

15 changes: 15 additions & 0 deletions WeakAurasOptions/OptionsFrames/OptionsFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
57 changes: 57 additions & 0 deletions WeakAurasOptions/RegionOptions/Empty.lua
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion WeakAurasOptions/SubRegionOptions/StopMotion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"]);
2 changes: 1 addition & 1 deletion WeakAurasOptions/SubRegionOptions/Texture.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
3 changes: 3 additions & 0 deletions WeakAurasOptions/WeakAurasOptions.toc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ locales.xml
VersionCheck.lua
ForAllIndentsAndPurposes.lua

RegionOptions\Empty.lua
RegionOptions\AuraBar.lua
RegionOptions\Texture.lua
RegionOptions\Icon.lua
Expand Down Expand Up @@ -61,6 +62,8 @@ WeakAurasOptions.lua
ConditionOptions.lua
AuthorOptions.lua

Changelog.lua

OptionsFrames\OptionsFrame.lua

# Groups
Expand Down
3 changes: 3 additions & 0 deletions WeakAurasOptions/WeakAurasOptions_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ locales.xml

ForAllIndentsAndPurposes.lua

RegionOptions\Empty.lua
RegionOptions\AuraBar.lua
RegionOptions\Texture.lua
RegionOptions\Icon.lua
Expand Down Expand Up @@ -60,6 +61,8 @@ WeakAurasOptions.lua
ConditionOptions.lua
AuthorOptions.lua

Changelog.lua

OptionsFrames\OptionsFrame.lua

# Groups
Expand Down
3 changes: 3 additions & 0 deletions WeakAurasOptions/WeakAurasOptions_Vanilla.toc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ locales.xml

ForAllIndentsAndPurposes.lua

RegionOptions\Empty.lua
RegionOptions\AuraBar.lua
RegionOptions\Texture.lua
RegionOptions\Icon.lua
Expand Down Expand Up @@ -59,6 +60,8 @@ WeakAurasOptions.lua
ConditionOptions.lua
AuthorOptions.lua

Changelog.lua

OptionsFrames\OptionsFrame.lua

# Groups
Expand Down
16 changes: 16 additions & 0 deletions generate_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Loading