From b08191b226aa2463ab805abf9f3014d262339299 Mon Sep 17 00:00:00 2001 From: Azilroka Date: Sun, 11 Aug 2024 19:29:02 -0500 Subject: [PATCH] Cleanup --- AddOnSkins/Core/Core.lua | 14 -------------- AddOnSkins/Init.lua | 14 +++++++------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/AddOnSkins/Core/Core.lua b/AddOnSkins/Core/Core.lua index 712a05d7..5e1d0796 100644 --- a/AddOnSkins/Core/Core.lua +++ b/AddOnSkins/Core/Core.lua @@ -62,20 +62,6 @@ function AS:GetClassColor(class) return color end -function AS:OrderedPairs(t, f) - local a = {} - for n in pairs(t) do tinsert(a, n) end - sort(a, f) - local i = 0 - local iter = function() - i = i + 1 - if a[i] == nil then return nil - else return a[i], t[a[i]] - end - end - return iter -end - function AS:Delay(delay, func) C_Timer.After(delay, func) end diff --git a/AddOnSkins/Init.lua b/AddOnSkins/Init.lua index 2faed74d..e408719c 100644 --- a/AddOnSkins/Init.lua +++ b/AddOnSkins/Init.lua @@ -1,12 +1,11 @@ local _G = _G -local select = select local format = format local strlower = strlower local CreateFrame = CreateFrame -local GetAddOnEnableState = GetAddOnEnableState -local GetAddOnInfo = GetAddOnInfo -local GetAddOnMetadata = C_AddOns and C_AddOns.GetAddOnMetadata or GetAddOnMetadata -local GetNumAddOns = GetNumAddOns +local GetAddOnEnableState = C_AddOns.GetAddOnEnableState +local GetAddOnInfo = C_AddOns.GetAddOnInfo +local GetAddOnMetadata = C_AddOns.GetAddOnMetadata +local GetNumAddOns = C_AddOns.GetNumAddOns local GetRealmName = GetRealmName local UIParent = UIParent local UnitClass = UnitClass @@ -15,6 +14,7 @@ local UnitFactionGroup = UnitFactionGroup local AddOnName, Engine = ... local AS = _G.LibStub('AceAddon-3.0'):NewAddon('AddOnSkins', 'AceConsole-3.0', 'AceEvent-3.0', 'AceHook-3.0', 'AceTimer-3.0') +local _ AS.EmbedSystem = AS:NewModule('EmbedSystem', 'AceEvent-3.0', 'AceHook-3.0') AS.Skins = AS:NewModule('Skins', 'AceTimer-3.0', 'AceHook-3.0', 'AceEvent-3.0') @@ -51,8 +51,8 @@ AS.Version = tonumber(GetAddOnMetadata(AddOnName, 'Version')) AS.Authors = GetAddOnMetadata(AddOnName, 'Author'):gsub(", ", " ") AS.ProperVersion = format('%.2f', AS.Version) AS.TicketTracker = 'https://github.com/Azilroka/AddOnSkins/issues' -AS.MyClass = select(2, UnitClass('player')) -AS.MyName = UnitName('player') +AS.MyClass = UnitClass('player') +_, AS.MyName = UnitName('player') AS.MyRealm = GetRealmName() AS.Noop = function() end AS.TexCoords = { .075, .925, .075, .925 }