-
Notifications
You must be signed in to change notification settings - Fork 15
/
Deprecated.lua
120 lines (108 loc) · 5.53 KB
/
Deprecated.lua
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
if (not LIB_OPEN_RAID_CAN_LOAD) then
return
end
local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0")
--comm prefix deprecated
openRaidLib.commPrefixDeprecated = {
}
local spamLimit = {}
local showDeprecatedMessage = function(deprecatedCall, newCall)
local debugTrace = debugstack(3, 1, 1)
if (debugTrace:find("AddOns\\WeakAuras")) then
local auraName = debugTrace:gsub("%[string \"Error in: ", ""):gsub("':'.*", "")
openRaidLib.DeprecatedMessage("|cFFEEEEEE" .. deprecatedCall .. "|r is deprecated|cFFEEEEEE, please use " .. newCall .. "\nFrom a weakaura named: " .. auraName .. "")
else
debugTrace = debugTrace:gsub("%[.-%]", "")
debugTrace = debugTrace:gsub("\n", "")
openRaidLib.DeprecatedMessage("|cFFEEEEEE" .. deprecatedCall .. "|r is deprecated|cFFEEEEEE, please use " .. newCall .. "\nFrom line" .. debugTrace .. "")
end
end
--deprecated: 'RequestAllPlayersInfo' has been replaced by 'RequestAllData'
function openRaidLib.RequestAllPlayersInfo()
if (not spamLimit["openRaidLib.RequestAllData"]) then
spamLimit["openRaidLib.RequestAllData"] = true
showDeprecatedMessage("openRaidLib.RequestAllPlayersInfo()", "openRaidLib.RequestAllData()")
end
end
--deprecated: 'playerInfoManager' has been replaced by 'UnitInfoManager'
openRaidLib.playerInfoManager = {}
local deprecatedMetatable = {
__newindex = function()
if (not spamLimit["openRaidLib.UnitInfoManager"]) then
openRaidLib.DeprecatedMessage("openRaidLib.playerInfoManager table is deprecated, please use openRaidLib.UnitInfoManager.")
showDeprecatedMessage("", "")
spamLimit["openRaidLib.UnitInfoManager"] = true
end
return
end,
__index = function(t, key)
return rawget(t, key) or showDeprecatedMessage("openRaidLib.playerInfoManager", "openRaidLib.UnitInfoManager")
end,
}
function openRaidLib.playerInfoManager.GetPlayerInfo()
if (not spamLimit["openRaidLib.playerInfoManager.GetPlayerInfo"]) then
showDeprecatedMessage("openRaidLib.playerInfoManager.GetPlayerInfo(unitName)", "openRaidLib.GetUnitInfo(unitId)")
spamLimit["openRaidLib.playerInfoManager.GetPlayerInfo"] = true
end
end
function openRaidLib.playerInfoManager.GetAllPlayersInfo()
if (not spamLimit["openRaidLib.playerInfoManager.GetAllPlayersInfo"]) then
showDeprecatedMessage("openRaidLib.playerInfoManager.GetAllPlayersInfo()", "openRaidLib.GetAllUnitsInfo()")
spamLimit["openRaidLib.playerInfoManager.GetAllPlayersInfo"] = true
end
end
setmetatable(openRaidLib.playerInfoManager, deprecatedMetatable)
--deprecated: 'gearManager' has been replaced by 'GearManager'
openRaidLib.gearManager = {}
local deprecatedMetatable = {
__newindex = function()
if (not spamLimit["openRaidLib.gearManager__newindex"]) then
showDeprecatedMessage("openRaidLib.gearManager", "openRaidLib.GearManager")
spamLimit["openRaidLib.gearManager__newindex"] = true
end
return
end,
__index = function(t, key)
return rawget(t, key) or showDeprecatedMessage("openRaidLib.gearManager", "openRaidLib.GearManager")
end,
}
function openRaidLib.gearManager.GetAllPlayersGear()
if (not spamLimit["openRaidLib.gearManager.GetAllPlayersGear"]) then
showDeprecatedMessage("openRaidLib.gearManager.GetAllPlayersGear()", "openRaidLib.GetAllUnitsGear()")
spamLimit["openRaidLib.gearManager.GetAllPlayersGear"] = true
end
end
function openRaidLib.gearManager.GetPlayerGear()
if (not spamLimit["openRaidLib.gearManager.GetPlayerGear"]) then
showDeprecatedMessage("openRaidLib.gearManager.GetPlayerGear()", "openRaidLib.GetUnitGear(unitId)")
spamLimit["openRaidLib.gearManager.GetPlayerGear"] = true
end
end
setmetatable(openRaidLib.gearManager, deprecatedMetatable)
--deprecated: 'cooldownManager' has been replaced by 'CooldownManager'
openRaidLib.cooldownManager = {}
local deprecatedMetatable = {
__newindex = function()
if (not spamLimit["openRaidLib.cooldownManager__newindex"]) then
showDeprecatedMessage("openRaidLib.cooldownManager", "openRaidLib.CooldownManager")
spamLimit["openRaidLib.cooldownManager__newindex"] = true
end
return
end,
__index = function(t, key)
return rawget(t, key) or showDeprecatedMessage("openRaidLib.cooldownManager", "openRaidLib.CooldownManager")
end,
}
function openRaidLib.cooldownManager.GetAllPlayersCooldown()
if (not spamLimit["openRaidLib.cooldownManager.GetAllPlayersCooldown"]) then
showDeprecatedMessage("openRaidLib.cooldownManager.GetAllPlayersCooldown()", "openRaidLib.GetAllUnitsCooldown()")
spamLimit["openRaidLib.cooldownManager.GetAllPlayersCooldown"] = true
end
end
function openRaidLib.cooldownManager.GetPlayerCooldowns()
if (not spamLimit["openRaidLib.cooldownManager.GetPlayerCooldowns"]) then
showDeprecatedMessage("openRaidLib.cooldownManager.GetPlayerCooldowns()", "openRaidLib.GetUnitCooldowns(unitId)")
spamLimit["openRaidLib.cooldownManager.GetPlayerCooldowns"] = true
end
end
setmetatable(openRaidLib.cooldownManager, deprecatedMetatable)