From ad8b2ed964cc6703748fbacbce63a03eed5d67f2 Mon Sep 17 00:00:00 2001 From: Lars Norberg Date: Sun, 18 Aug 2024 00:11:32 +0200 Subject: [PATCH] 2.0.59-Release --- CHANGELOG.md | 3 +++ ChatCleaner/Components/Windows.lua | 5 +++++ ChatCleaner/Core/API/Addons.lua | 15 ++++++++++----- ChatCleaner/Core/Options.lua | 5 +++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 744ec4f..1bd37c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. Be aware th The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.0.59-Release] 2024-07-18 +- Updated for WoW Retail Client Patch 11.0.2. + ## [2.0.58-Release] 2024-07-10 - Updated for WoW Retail Client Patch 10.2.7. - Updated for WoW Classic Era Client Patch 1.15.3. diff --git a/ChatCleaner/Components/Windows.lua b/ChatCleaner/Components/Windows.lua index 79953c4..597186b 100644 --- a/ChatCleaner/Components/Windows.lua +++ b/ChatCleaner/Components/Windows.lua @@ -28,6 +28,11 @@ local Addon, ns = ... -- NOT YET IMPLEMENTED! do return end +-- WoW 11.0.x +local GetAddOnEnableState = GetAddOnEnableState or function(character, name) return C_AddOns.GetAddOnEnableState(name, character) end +local GetAddOnInfo = GetAddOnInfo or C_AddOns.GetAddOnInfo +local GetNumAddOns = GetNumAddOns or C_AddOns.GetNumAddOns + -- Just bail out completely if this module isn't supported. if ((function(...) for i = 1,GetNumAddOns() do diff --git a/ChatCleaner/Core/API/Addons.lua b/ChatCleaner/Core/API/Addons.lua index 6bb3dd7..c19abfe 100644 --- a/ChatCleaner/Core/API/Addons.lua +++ b/ChatCleaner/Core/API/Addons.lua @@ -30,21 +30,26 @@ ns.API = API -- Lua API local string_lower = string.lower +-- WoW 11.0.x +local GetAddOnEnableState = GetAddOnEnableState or function(character, name) return C_AddOns.GetAddOnEnableState(name, character) end +local GetAddOnInfo = GetAddOnInfo or C_AddOns.GetAddOnInfo +local GetNumAddOns = GetNumAddOns or C_AddOns.GetNumAddOns + -- GLOBALS: UnitName, GetAddOnEnableState, GetAddOnInfo, GetNumAddOns local PLAYER_NAME = UnitName("player") -- Proxy for the Blizzard method, which also includes the 'enabled' flag. local GetAddOnInfo = function(index) - local name, title, notes, loadable, reason, security = _G.GetAddOnInfo(index) - local enabled = not(_G.GetAddOnEnableState(PLAYER_NAME, index) == 0) + local name, title, notes, loadable, reason, security = GetAddOnInfo(index) + local enabled = not(GetAddOnEnableState(PLAYER_NAME, index) == 0) return name, title, notes, enabled, loadable, reason, security end -- Check if an addon exists in the addon listing local IsAddOnAvailable = function(target) local target = string_lower(target) - for i = 1,_G.GetNumAddOns() do + for i = 1,GetNumAddOns() do local name = GetAddOnInfo(i) if (string_lower(name) == target) then return true @@ -56,7 +61,7 @@ end -- *Making this available as a generic library method. local IsAddOnEnabled = function(target) local target = string_lower(target) - for i = 1,_G.GetNumAddOns() do + for i = 1,GetNumAddOns() do local name, _, _, enabled, loadable = GetAddOnInfo(i) if (string_lower(name) == target) then if (enabled and loadable) then @@ -69,7 +74,7 @@ end -- Check if an addon exists in the addon listing and loadable on demand local IsAddOnLoadable = function(target, ignoreLoD) local target = string_lower(target) - for i = 1,_G.GetNumAddOns() do + for i = 1,GetNumAddOns() do local name, _, _, _, loadable = GetAddOnInfo(i) if (string_lower(name) == target) then if (loadable or ignoreLoD) then diff --git a/ChatCleaner/Core/Options.lua b/ChatCleaner/Core/Options.lua index 5064306..fbfd6e7 100644 --- a/ChatCleaner/Core/Options.lua +++ b/ChatCleaner/Core/Options.lua @@ -46,6 +46,11 @@ local string_upper = string.upper local table_sort = table.sort local type = type +-- WoW 11.0.x +local GetAddOnEnableState = GetAddOnEnableState or function(character, name) return C_AddOns.GetAddOnEnableState(name, character) end +local GetAddOnInfo = GetAddOnInfo or C_AddOns.GetAddOnInfo +local GetNumAddOns = GetNumAddOns or C_AddOns.GetNumAddOns + -- Utility ------------------------------------------------------- local hasaddons = function(...)