forked from Eliote/SimpleAddonManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoreCompat.lua
More file actions
27 lines (24 loc) · 1.02 KB
/
Copy pathCoreCompat.lua
File metadata and controls
27 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
local _, T = ...
--- @type SimpleAddonManager
local frame = T.AddonFrame
local function getFunction(fun)
return (C_AddOns and C_AddOns[fun]) or _G[fun]
end
frame.compat = {
EnableAddOn = getFunction("EnableAddOn"),
DisableAddOn = getFunction("DisableAddOn"),
IsAddOnLoaded = getFunction("IsAddOnLoaded"),
EnableAllAddOns = getFunction("EnableAllAddOns"),
DisableAllAddOns = getFunction("DisableAllAddOns"),
GetAddOnInfo = getFunction("GetAddOnInfo"),
GetAddOnDependencies = getFunction("GetAddOnDependencies"),
GetNumAddOns = getFunction("GetNumAddOns"),
SaveAddOns = getFunction("SaveAddOns"),
ResetAddOns = getFunction("ResetAddOns"),
IsAddonVersionCheckEnabled = getFunction("IsAddonVersionCheckEnabled"),
SetAddonVersionCheck = getFunction("SetAddonVersionCheck"),
IsAddOnLoadOnDemand = getFunction("IsAddOnLoadOnDemand"),
GetAddOnEnableState = (C_AddOns and C_AddOns.GetAddOnEnableState) or function(nameOrIndex, character)
return GetAddOnEnableState(character, nameOrIndex) -- the old API has inverted parameters
end
}