Skip to content

Commit

Permalink
Merge branch 'release/0.22.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
evil-morfar committed Jun 21, 2024
2 parents 1270a87 + 6c97e26 commit e8ff8f5
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ echo "Executing $0" >&2
usage() {
echo "Usage: test.sh [-cbp]" >&2
echo " -c Pack to _classic_era_ WoW edition. (Classic)" >&2
echo " -b Pack to _classic_ WoW edition. (WotLK)" >&2
echo " -b Pack to _classic_ WoW edition. (Cataclysm)" >&2
echo " -bp Pack to _classic_ptr_ WoW edition. (Cataclysm PTR)" >&2
echo " -p Pack to _ptr_ WoW edition." >&2
}

Expand All @@ -28,6 +29,8 @@ while getopts ":cbp" opt; do
WOWEDITION="_classic_era_";;
b)
WOWEDITION="_classic_";;
bp)
WOWEDITION="_classic_ptr_";;
p)
WOWEDITION="_ptr_";;
/?)
Expand Down
12 changes: 10 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"label": "Deploy both",
"dependsOn": [
"Deploy Classic",
"Deploy TBC"
"Deploy Cataclysm"
],
"dependsOrder": "parallel",
"problemMatcher": []
Expand All @@ -22,13 +22,21 @@
]
},
{
"label": "Deploy TBC",
"label": "Deploy Cataclysm",
"type": "shell",
"command": "sh",
"args": [
".scripts/deploy.sh",
"-b"
]
}, {
"label": "Deploy Cata PTR",
"type": "shell",
"command": "sh",
"args": [
".scripts/deploy.sh",
"-bp"
]
},
{
"label": "Build and Release",
Expand Down
6 changes: 5 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changes

### TradeUI

Addons can no longer check whether people are in trade range during combat, so now the labels are yellow in combat. Clicking the yellow label will attempt to open trade.

### Bugfixes

- *Fixed issue introduced in v0.22.2 causing voting frame to break when reloading with access to the voting frame.*
- *Added fix for histories containing broken colors.*
13 changes: 13 additions & 0 deletions Changelog_Complete.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.22.4

## Changes

### TradeUI

Addons can no longer check whether people are in trade range during combat, so now the labels are yellow in combat. Clicking the yellow label will attempt to open trade.

### Bugfixes

- *Added fix for histories containing broken colors.*


# 0.22.3

## Changes
Expand Down
59 changes: 59 additions & 0 deletions Core/BackwardsCompatibility.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
--- BackwardsCompatibility.lua See RCLootCouncil/Utils/BackwardsCompat.lua

--- @type RCLootCouncil
local addon = select(2, ...)
local Classic = addon:GetModule("RCClassic")
local Compat = {}
Classic.Compat = Compat

--- Runs all compability changes registered.
--- Initially called in `Classic:OnEnable()`
--- Note: Nothing is run on first installs.
--- Each compat can only be run once per login, so feel free to call it again.
function Compat:Run()
for k, v in ipairs(self.list) do
addon:Debug("CompatRun", v.name)
if v.version == "always"
or (addon:VersionCompare(addon.db.global.Classic_version, v.version) or not addon.db.global.Classic_version)
and not v.executed then
addon:Debug("<ClassicCompat>", "Executing:", k, v.name or "no_name")
local check, err = pcall(v.func, addon, Classic.version, addon.db.global.Classic_version,
addon.db.global.Classic_oldVersion)
v.executed = true
if not check then
addon:Debug("<ClassicCompat>", "<ERROR>", err)
end
end
end
end

-- List of backwards compatibility. Each entry is executed numerically, if allowed.
-- Fields:
-- name: Optional - name that gets logged if the function is run.
-- version: If the user's last version is older than this, then the function is run.
-- `always` will always run the function.
-- Directly compared in `addon:VersionCompare(db.global.version, version_field)`
-- func: The function to execute if the version predicate is met. Called with the following parameters:
-- (addon, addon.version, addon.db.global.version, addon.db.global.oldVersion)
Compat.list = {
{
name = "History Color fix",
version = "0.22.4",
func = function()
local count = 0
for _, a in pairs(_G.RCLootCouncilLootDB["factionrealm"]) do
for _, b in pairs(a) do
for _, c in pairs(b) do
if #c.color < 3 then
for i = #c.color + 1, 3 do
c.color[i] = 1
end
count = count + 1
end
end
end
end
addon:Debug("Fixed", count, "history colors")
end
}
}
5 changes: 5 additions & 0 deletions Core/Module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ function ClassicModule:OnEnable ()
addon.debug = self.debug
addon.nnp = self.nnp

if addon.db.global.Classic_version then
addon:Debug("Running compat")
self.Compat:Run()
end

addon.db.global.Classic_oldVersion = addon.db.global.Classic_version
addon.db.global.Classic_version = self.version
addon.db.global.Classic_game = WOW_PROJECT_ID
Expand Down
2 changes: 1 addition & 1 deletion RCLootCouncil
5 changes: 3 additions & 2 deletions RCLootCouncil_Classic.toc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Author: Potdisc
## Interface: 11502
## Interface-Cata: 40400
## Notes: RCLootCouncil for WoW Classic and Cataclysm Classic v0.22.3
## Notes: RCLootCouncil for WoW Classic and Cataclysm Classic v0.22.4
## Title: RCLootCouncil Classic
## Version: 0.22.3
## Version: 0.22.4
## X-Curse-Project-ID: 332955
## SavedVariables: RCLootCouncilDB, RCLootCouncilLootDB
## OptionalDeps: LibStub, CallbackHandler-1.0, Ace3, lib-st, LibWindow-1.1, LibDialog-1.0
Expand Down Expand Up @@ -48,6 +48,7 @@ Core\Lists.lua
Core\Comms.lua
Core\Classes\Queue.lua
Core\Classes\QueuedComms.lua
Core\BackwardsCompatibility.lua

## Overrides
API\RCLootCouncilUpdates.lua
Expand Down

0 comments on commit e8ff8f5

Please sign in to comment.