From fc546901739d4e8d1d9c24460be0975876cc04cd Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:15:36 +0200 Subject: [PATCH 1/5] Ensure cache is instantiated --- RCLootCouncil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RCLootCouncil b/RCLootCouncil index ac16754..5e964b5 160000 --- a/RCLootCouncil +++ b/RCLootCouncil @@ -1 +1 @@ -Subproject commit ac1675453af2f1ebefb66d9dbb9c751f776dceee +Subproject commit 5e964b5195e15e7e6ca7d3af73f5a2798ef9e9b5 From ec7c7617840956ec456630de5b44ea748e24d183 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:27:05 +0200 Subject: [PATCH 2/5] Changelog for `CheckInteractDistance` change --- Changelog.md | 6 ++++-- RCLootCouncil | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 6223839..c59797c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,7 @@ ## Changes -### Bugfixes +### 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. -- *Fixed issue introduced in v0.22.2 causing voting frame to break when reloading with access to the voting frame.* \ No newline at end of file +### Bugfixes diff --git a/RCLootCouncil b/RCLootCouncil index 5e964b5..53d2199 160000 --- a/RCLootCouncil +++ b/RCLootCouncil @@ -1 +1 @@ -Subproject commit 5e964b5195e15e7e6ca7d3af73f5a2798ef9e9b5 +Subproject commit 53d2199befd410bcb978705bf1aeafb768ead44d From 47b10eb7a442dca48d139216fa888a7c0475c468 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:27:14 +0200 Subject: [PATCH 3/5] Updated deploy tasks --- .scripts/deploy.sh | 5 ++++- .vscode/tasks.json | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.scripts/deploy.sh b/.scripts/deploy.sh index d4fcf44..18911e9 100644 --- a/.scripts/deploy.sh +++ b/.scripts/deploy.sh @@ -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 } @@ -28,6 +29,8 @@ while getopts ":cbp" opt; do WOWEDITION="_classic_era_";; b) WOWEDITION="_classic_";; + bp) + WOWEDITION="_classic_ptr_";; p) WOWEDITION="_ptr_";; /?) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c32c9c1..b95daa7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -7,7 +7,7 @@ "label": "Deploy both", "dependsOn": [ "Deploy Classic", - "Deploy TBC" + "Deploy Cataclysm" ], "dependsOrder": "parallel", "problemMatcher": [] @@ -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", From b05ea55382bb031195b2be1ce880eb696627661c Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:42:50 +0200 Subject: [PATCH 4/5] Added BackwardCompatibilty for Classic. Added fix for histories with entries with broken color table. --- Changelog.md | 2 ++ Core/BackwardsCompatibility.lua | 59 +++++++++++++++++++++++++++++++++ Core/Module.lua | 5 +++ RCLootCouncil | 2 +- RCLootCouncil_Classic.toc | 1 + 5 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 Core/BackwardsCompatibility.lua diff --git a/Changelog.md b/Changelog.md index c59797c..77341a6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,3 +5,5 @@ 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.* diff --git a/Core/BackwardsCompatibility.lua b/Core/BackwardsCompatibility.lua new file mode 100644 index 0000000..f37b4d3 --- /dev/null +++ b/Core/BackwardsCompatibility.lua @@ -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("", "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("", "", 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 + } +} diff --git a/Core/Module.lua b/Core/Module.lua index 3f6a830..d7cdd1a 100644 --- a/Core/Module.lua +++ b/Core/Module.lua @@ -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 diff --git a/RCLootCouncil b/RCLootCouncil index 53d2199..c15e816 160000 --- a/RCLootCouncil +++ b/RCLootCouncil @@ -1 +1 @@ -Subproject commit 53d2199befd410bcb978705bf1aeafb768ead44d +Subproject commit c15e81614ec75721a365f25b2c78bbbb0246a7f1 diff --git a/RCLootCouncil_Classic.toc b/RCLootCouncil_Classic.toc index 3be71fc..63f6809 100644 --- a/RCLootCouncil_Classic.toc +++ b/RCLootCouncil_Classic.toc @@ -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 From 6c97e26e39d21127caadbe82d39cdd2215324422 Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Fri, 21 Jun 2024 21:00:17 +0200 Subject: [PATCH 5/5] v0.22.4 --- Changelog_Complete.md | 13 +++++++++++++ RCLootCouncil_Classic.toc | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Changelog_Complete.md b/Changelog_Complete.md index 6975554..293409b 100644 --- a/Changelog_Complete.md +++ b/Changelog_Complete.md @@ -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 diff --git a/RCLootCouncil_Classic.toc b/RCLootCouncil_Classic.toc index 63f6809..a374757 100644 --- a/RCLootCouncil_Classic.toc +++ b/RCLootCouncil_Classic.toc @@ -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