diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..2f93975 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,75 @@ +name: release + +on: + push: + tags: + - '*-coa.*' # Asc-1.1.6-coa.2, 9.1.40-coa.3, etc. + - 'v*' # v0.3.0 for repos without an upstream version + +jobs: + release: + runs-on: linux-amd64 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # build_zip uses git archive HEAD; full history is fine + + - name: Build per-addon zip(s) + run: bash tools/build_zip.sh + + - name: Publish release (Gitea API direct; no action dependency) + env: + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + TAG: ${{ github.ref_name }} + API: ${{ github.server_url }}/api/v1 + # Gitea attachment ceiling is 200 MiB (see roles/gitea config). + # Skip anything larger so one oversized asset doesn't fail the job. + MAX_BYTES: 209715200 + run: | + set -euo pipefail + # Create the release (or reuse if it already exists for this tag). + RID=$(curl -s -H "Authorization: token $GITEA_TOKEN" \ + "$API/repos/$REPO/releases/tags/$TAG" 2>/dev/null \ + | jq -r '.id // empty') + if [ -z "$RID" ]; then + RID=$(curl -sf -X POST -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + "$API/repos/$REPO/releases" \ + -d "$(jq -nc --arg t "$TAG" '{tag_name:$t,name:$t,draft:false,prerelease:false,hide_archive_links:true}')" \ + | jq -r '.id') + fi + echo "release id: $RID" + # Gitea honors hide_archive_links only on edit, not create — PATCH it + # so the auto-generated Source Code (zip/tar.gz) links stay hidden. + curl -sf -X PATCH -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/json" \ + "$API/repos/$REPO/releases/$RID" -d '{"hide_archive_links":true}' >/dev/null || true + # Upload every dist/*.zip. Per-asset failures don't fail the job — + # we want partial releases to still publish rather than block the + # whole pipeline on one big file. + failed=0 + uploaded=0 + for f in dist/*.zip; do + name=$(basename "$f") + size=$(stat -c '%s' "$f") + if [ "$size" -gt "$MAX_BYTES" ]; then + echo "::warning::skip $name (${size} B > ${MAX_BYTES} B Gitea limit; host on CDN instead)" + failed=$((failed+1)) + continue + fi + echo "uploading $name ($(numfmt --to=iec "$size"))" + if curl -sf -X POST -H "Authorization: token $GITEA_TOKEN" \ + -F "attachment=@$f" \ + "$API/repos/$REPO/releases/$RID/assets?name=$name" \ + | jq -r '" -> " + .browser_download_url'; then + uploaded=$((uploaded+1)) + else + echo "::warning::upload failed for $name" + failed=$((failed+1)) + fi + done + echo "release published: $uploaded uploaded, $failed skipped/failed" + # Only fail the job if NO assets uploaded — a release with zero + # attachments isn't useful to anyone. + [ "$uploaded" -gt 0 ] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index cb7b432..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: "Bug Report" -description: Create a report to help us improve this addon -labels: '🐛 Bug' -body: -- type: markdown - attributes: - value: | - Please search for existing issues before creating a new one. - -- type: textarea - attributes: - label: Description - description: What did you expect to happen and what happened instead? - validations: - required: true - -- type: dropdown - id: flavor - attributes: - label: Realm - description: What realm did this occur on? - options: - - Area 52 (Default) - - Seasonal - - Grizzly Hills - - Rexxar - - Other - validations: - required: true - -- type: checkboxes - id: testing - attributes: - label: Tested with only this addon - description: Did you try having just this addon as the only enabled addon and everything else disabled? - options: - - label: "Yes" - - label: "No" - validations: - required: true - -- type: textarea - attributes: - label: Lua Error - description: | - Do you have an error log of what happened? If you don't see any errors, make sure that error reporting is enabled (`/console scriptErrors 1`) - validations: - required: false - -- type: textarea - attributes: - label: Reproduction Steps - description: Please list out the steps to reproduce your bug. - placeholder: | - 1. Go to '...' - 2. Click on '....' - 3. Scroll down to '....' - 4. See error - validations: - required: true - -- type: input - attributes: - label: Last Good Version - description: | - Was it working in a previous version? If yes, which update did it stop working? If you don't know, when was the last date you were aware it was working - placeholder: "MM/DD/YYYY" - validations: - required: false - -- type: textarea - attributes: - label: Screenshots - description: If applicable, add screenshots to help explain your problem. - placeholder: Click here to attach your screenshots via the editor button in the top right. - validations: - required: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index ec4bb38..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1 +0,0 @@ -blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEPMLATE.md b/.github/PULL_REQUEST_TEPMLATE.md deleted file mode 100644 index 30d2afa..0000000 --- a/.github/PULL_REQUEST_TEPMLATE.md +++ /dev/null @@ -1,28 +0,0 @@ -# Description - -Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. - -Fixes #(issue) - -## Type of change - -Please delete options that are not relevant. - -- [ ] Bug fix (non-breaking change which fixes an issue) -- [ ] New feature (non-breaking change which adds functionality) -- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - -## How Has This Been Tested - -Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration - -- [ ] Test A -- [ ] Test B - -## Checklist - - -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas - - \ No newline at end of file diff --git a/.gitignore b/.gitignore index 44356e3..ec92999 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ .install .lua/* .vscode -.idea \ No newline at end of file +.idea +dist/ diff --git a/ShadowedUF_Options/config.lua b/ShadowedUF_Options/config.lua index f895b76..b66b6d3 100644 --- a/ShadowedUF_Options/config.lua +++ b/ShadowedUF_Options/config.lua @@ -2029,14 +2029,14 @@ local function loadUnitOptions() }, sep2 = {order = 1.75, type = "description", name = "", hidden = function(info) local moduleKey = info[#(info) - 1] - return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" ) or not ShadowUF.db.profile.advanced + return ( moduleKey ~= "healthBar" and moduleKey ~= "powerBar" and moduleKey ~= "druidBar" and moduleKey ~= "necromancerBar" ) or not ShadowUF.db.profile.advanced end}, invert = { order = 2, type = "toggle", name = L["Invert colors"], desc = L["Flips coloring so the bar color is shown as the background color and the background as the bar"], - hidden = function(info) return ( info[#(info) - 1] ~= "healthBar" and info[#(info) - 1] ~= "powerBar" and info[#(info) - 1] ~= "druidBar" ) or not ShadowUF.db.profile.advanced end, + hidden = function(info) return ( info[#(info) - 1] ~= "healthBar" and info[#(info) - 1] ~= "powerBar" and info[#(info) - 1] ~= "druidBar" and info[#(info) - 1] ~= "necromancerBar" ) or not ShadowUF.db.profile.advanced end, arg = "$parent.invert", }, order = { @@ -2997,6 +2997,14 @@ local function loadUnitOptions() hidden = hideRestrictedOption, arg = "druidBar.enabled", }, + necromancerBar = { + order = 1.5, + type = "toggle", + name = string.format(L["Enable %s"], L["Necromancer mana bar"]), + desc = L["Adds a second power bar to the player frame showing your mana and runic power at the same time."], + hidden = hideRestrictedOption, + arg = "necromancerBar.enabled", + }, xpBar = { order = 2, type = "toggle", @@ -3760,14 +3768,17 @@ local function loadFilterOptions() add = { order = 0, type = "input", - name = L["Aura name"], + name = L["Aura name or spell ID"], + desc = L["Enter an exact aura name, or a numeric spell ID for precise matching (CoA's client exposes aura spell IDs)."], --dialogControl = "Aura_EditBox", hidden = false, set = function(info, value) local filterType = info[#(info) - 3] local filter = filterMap[info[#(info) - 2]] - ShadowUF.db.profile.filters[filterType][filter][value] = true + -- A purely-numeric entry is stored as a number so it matches the + -- spellId returned by UnitAura; anything else stays a name string. + ShadowUF.db.profile.filters[filterType][filter][tonumber(value) or value] = true reloadUnitAuras() rebuildFilters() @@ -3844,9 +3855,17 @@ local function loadFilterOptions() type = "description", -- Odd I know, AceConfigDialog-3.0 expands descriptions to full width if width is nil -- on the other hand we can't set width to "normal" so tricking it - width = "", + width = "", fontSize = "medium", - name = function(info) return spellMap[info[#(info)]] end, + name = function(info) + local entry = spellMap[info[#(info)]] + -- Numeric entries are spell IDs; show "Name (ID)" when the client can resolve it. + if( type(entry) == "number" ) then + local spellName = GetSpellInfo(entry) + return spellName and string.format("%s (%d)", spellName, entry) or tostring(entry) + end + return entry + end, } local spellRow = { diff --git a/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.lua b/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.lua index b66022d..1c9454a 100644 --- a/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.lua +++ b/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.lua @@ -1,57 +1,58 @@ ---- AceConfig-3.0 wrapper library. --- Provides an API to register an options table with the config registry, --- as well as associate it with a slash command. --- @class file --- @name AceConfig-3.0 --- @release $Id: AceConfig-3.0.lua 877 2009-11-02 15:56:50Z nevcairiel $ - ---[[ -AceConfig-3.0 - -Very light wrapper library that combines all the AceConfig subcomponents into one more easily used whole. - -]] - -local MAJOR, MINOR = "AceConfig-3.0", 2 -local AceConfig = LibStub:NewLibrary(MAJOR, MINOR) - -if not AceConfig then return end - -local cfgreg = LibStub("AceConfigRegistry-3.0") -local cfgcmd = LibStub("AceConfigCmd-3.0") -local cfgdlg = LibStub("AceConfigDialog-3.0") ---TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0") - --- Lua APIs -local pcall, error, type, pairs = pcall, error, type, pairs - --- ------------------------------------------------------------------- --- :RegisterOptionsTable(appName, options, slashcmd, persist) --- --- - appName - (string) application name --- - options - table or function ref, see AceConfigRegistry --- - slashcmd - slash command (string) or table with commands, or nil to NOT create a slash command - ---- Register a option table with the AceConfig registry. --- You can supply a slash command (or a table of slash commands) to register with AceConfigCmd directly. --- @paramsig appName, options [, slashcmd] --- @param appName The application name for the config table. --- @param options The option table (or a function to generate one on demand) --- @param slashcmd A slash command to register for the option table, or a table of slash commands. --- @usage --- local AceConfig = LibStub("AceConfig-3.0") --- AceConfig:RegisterOptionsTable("MyAddon", myOptions, {"/myslash", "/my"}) -function AceConfig:RegisterOptionsTable(appName, options, slashcmd) - local ok,msg = pcall(cfgreg.RegisterOptionsTable, self, appName, options) - if not ok then error(msg, 2) end - - if slashcmd then - if type(slashcmd) == "table" then - for _,cmd in pairs(slashcmd) do - cfgcmd:CreateChatCommand(cmd, appName) - end - else - cfgcmd:CreateChatCommand(slashcmd, appName) - end - end -end +--- AceConfig-3.0 wrapper library. +-- Provides an API to register an options table with the config registry, +-- as well as associate it with a slash command. +-- @class file +-- @name AceConfig-3.0 +-- @release $Id$ + +--[[ +AceConfig-3.0 + +Very light wrapper library that combines all the AceConfig subcomponents into one more easily used whole. + +]] + +local cfgreg = LibStub("AceConfigRegistry-3.0") +local cfgcmd = LibStub("AceConfigCmd-3.0") + +local MAJOR, MINOR = "AceConfig-3.0", 3 +local AceConfig = LibStub:NewLibrary(MAJOR, MINOR) + +if not AceConfig then return end + +--TODO: local cfgdlg = LibStub("AceConfigDialog-3.0", true) +--TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0", true) + +-- Lua APIs +local pcall, error, type, pairs = pcall, error, type, pairs + +-- ------------------------------------------------------------------- +-- :RegisterOptionsTable(appName, options, slashcmd) +-- +-- - appName - (string) application name +-- - options - table or function ref, see AceConfigRegistry +-- - slashcmd - slash command (string) or table with commands, or nil to NOT create a slash command + +--- Register a option table with the AceConfig registry. +-- You can supply a slash command (or a table of slash commands) to register with AceConfigCmd directly. +-- @paramsig appName, options [, slashcmd] +-- @param appName The application name for the config table. +-- @param options The option table (or a function to generate one on demand). http://www.wowace.com/addons/ace3/pages/ace-config-3-0-options-tables/ +-- @param slashcmd A slash command to register for the option table, or a table of slash commands. +-- @usage +-- local AceConfig = LibStub("AceConfig-3.0") +-- AceConfig:RegisterOptionsTable("MyAddon", myOptions, {"/myslash", "/my"}) +function AceConfig:RegisterOptionsTable(appName, options, slashcmd) + local ok,msg = pcall(cfgreg.RegisterOptionsTable, self, appName, options) + if not ok then error(msg, 2) end + + if slashcmd then + if type(slashcmd) == "table" then + for _,cmd in pairs(slashcmd) do + cfgcmd:CreateChatCommand(cmd, appName) + end + else + cfgcmd:CreateChatCommand(slashcmd, appName) + end + end +end diff --git a/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.xml b/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.xml index d9eb96a..87972ad 100644 --- a/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.xml +++ b/ShadowedUF_Options/libs/AceConfig-3.0/AceConfig-3.0.xml @@ -1,8 +1,8 @@ - - - - - -