-
Notifications
You must be signed in to change notification settings - Fork 10
/
Blizzard_Compat.lua
109 lines (78 loc) · 2.85 KB
/
Blizzard_Compat.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
--[[----------------------------------------------------------------------------
LiteMount/Blizzard_Compat.lua
Copyright 2024 Mike Battersby
For better or worse, try to back-port a functioning amount of compatibility
for the 11.0 deprecations into classic, on the assumption that it will
eventually go in there properly and this is the right approach rather than
making the new way look like the old.
----------------------------------------------------------------------------]]--
local _, LM = ...
--[[ C_Spell ]]-----------------------------------------------------------------
LM.C_Spell = CopyTable(C_Spell or {})
if not LM.C_Spell.GetSpellInfo then
local GetSpellInfo = _G.GetSpellInfo
function LM.C_Spell.GetSpellInfo(spellIdentifier)
local name, _, iconID, castTime, minRange, maxRange, spellID, originalIconID = GetSpellInfo(spellIdentifier)
if name then
return {
name = name,
iconID = iconID,
originalIconID = originalIconID,
castTime = castTime,
minRange = minRange,
maxRange = maxRange,
spellID = spellID,
}
end
end
end
if not LM.C_Spell.GetSpellName then
local GetSpellInfo = _G.GetSpellInfo
function LM.C_Spell.GetSpellName(spellIdentifier)
local name = GetSpellInfo(spellIdentifier)
return name
end
end
if not LM.C_Spell.GetSpellTexture then
local GetSpellInfo = _G.GetSpellInfo
function LM.C_Spell.GetSpellTexture(spellIdentifier)
local _, _, iconID = GetSpellInfo(spellIdentifier)
return iconID
end
end
if not LM.C_Spell.GetSpellCooldown then
local GetSpellCooldown = _G.GetSpellCooldown
function LM.C_Spell.GetSpellCooldown(spellIdentifier)
local startTime, duration, isEnabled, modRate = GetSpellCooldown(spellIdentifier)
if startTime then
return {
startTime = startTime,
duration = duration,
isEnabled = isEnabled,
modRate = modRate,
}
end
end
end
if not LM.C_Spell.IsSpellUsable then
LM.C_Spell.IsSpellUsable = _G.IsUsableSpell
end
if not LM.C_Spell.PickupSpell then
LM.C_Spell.PickupSpell = _G.PickupSpell
end
if not LM.C_Spell.GetSpellSubtext then
LM.C_Spell.GetSpellSubtext = _G.GetSpellSubtext
end
--[[ C_MountJournal ]]----------------------------------------------------------
LM.C_MountJournal = CopyTable(C_MountJournal or {})
if not LM.C_MountJournal.IsDragonridingUnlocked then
local IsPlayerSpell = _G.IsPlayerSpell
function LM.C_MountJournal.IsDragonridingUnlocked()
return IsPlayerSpell(376777)
end
end
if not LM.C_MountJournal.GetDynamicFlightModeSpellID then
function LM.C_MountJournal.GetDynamicFlightModeSpellID()
return 436854
end
end