Skip to content

Commit

Permalink
2.0.59-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldpaw committed Aug 17, 2024
1 parent dc69c89 commit ad8b2ed
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions ChatCleaner/Components/Windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions ChatCleaner/Core/API/Addons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ChatCleaner/Core/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)
Expand Down

0 comments on commit ad8b2ed

Please sign in to comment.