diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c952c15..cf0407a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## v10.2.7 +* Initial support for WoW 11.0 * Fix GetTalentTabInfo call for SOD Phase 4 ## v10.2.6 diff --git a/Components/Core/Common/SwingTimerMonitor.lua b/Components/Core/Common/SwingTimerMonitor.lua index 4a3fe5b6..77970e09 100644 --- a/Components/Core/Common/SwingTimerMonitor.lua +++ b/Components/Core/Common/SwingTimerMonitor.lua @@ -33,6 +33,8 @@ local strsub, pairs local UnitGUID, GetNetStats, GetInventorySlotInfo, IsDualWielding, UnitAttackSpeed = UnitGUID, GetNetStats, GetInventorySlotInfo, IsDualWielding, UnitAttackSpeed +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local strlowerCache = TMW.strlowerCache -- Module creation @@ -58,15 +60,15 @@ end) local swingSpells = not TMW.isRetail and { - [strlowerCache[GetSpellInfo(78)]] = 1, -- Heroic Strike - [strlowerCache[GetSpellInfo(845)]] = 1, -- Cleave - [strlowerCache[GetSpellInfo(6807)]] = 1, -- Maul - [strlowerCache[GetSpellInfo(2973)]] = 1, -- Raptor Strike + [strlowerCache[GetSpellName(78)]] = 1, -- Heroic Strike + [strlowerCache[GetSpellName(845)]] = 1, -- Cleave + [strlowerCache[GetSpellName(6807)]] = 1, -- Maul + [strlowerCache[GetSpellName(2973)]] = 1, -- Raptor Strike } or {} -if GetSpellInfo(56815) then - swingSpells[strlowerCache[GetSpellInfo(56815)]] = 1 -- Rune Strike +if GetSpellName(56815) then + swingSpells[strlowerCache[GetSpellName(56815)]] = 1 -- Rune Strike end -- --------------------------------- diff --git a/Components/Core/Conditions/Categories/PlayerAttributes.lua b/Components/Core/Conditions/Categories/PlayerAttributes.lua index b2ed8709..c5f3ab28 100644 --- a/Components/Core/Conditions/Categories/PlayerAttributes.lua +++ b/Components/Core/Conditions/Categories/PlayerAttributes.lua @@ -23,7 +23,9 @@ local strlowerCache = TMW.strlowerCache local _, pclass = UnitClass("Player") +local GetSpellName = TMW.GetSpellName local GetSpellTexture = C_Spell and C_Spell.GetSpellTexture or GetSpellTexture + local IsInInstance, GetInstanceDifficulty, GetNumShapeshiftForms, GetShapeshiftFormInfo = IsInInstance, GetInstanceDifficulty, GetNumShapeshiftForms, GetShapeshiftFormInfo local GetPetActionInfo = GetPetActionInfo @@ -193,7 +195,7 @@ ConditionCategory:RegisterCondition(6, "STANCE", { return strlowerCache[NONE] else local icons, active, catable, spellID = GetShapeshiftFormInfo(i) - return spellID and strlowerCache[GetSpellInfo(spellID)] or "" + return spellID and strlowerCache[GetSpellName(spellID)] or "" end end }, diff --git a/Components/Core/Conditions/Categories/PlayerAttributes_config.lua b/Components/Core/Conditions/Categories/PlayerAttributes_config.lua index be65ab31..45e4af36 100644 --- a/Components/Core/Conditions/Categories/PlayerAttributes_config.lua +++ b/Components/Core/Conditions/Categories/PlayerAttributes_config.lua @@ -19,6 +19,8 @@ local print = TMW.print local SUG = TMW.SUG local strlowerCache = TMW.strlowerCache +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetNumTrackingTypes = GetNumTrackingTypes or C_Minimap.GetNumTrackingTypes local GetTrackingInfo = GetTrackingInfo or C_Minimap.GetTrackingInfo @@ -34,70 +36,70 @@ Module.helpText = L["SUG_TOOLTIPTITLE_GENERIC"] Module.stances = (TMW.isWrath or TMW.isCata) and { WARRIOR = { - [2457] = GetSpellInfo(2457), -- Battle Stance - [71] = GetSpellInfo(71), -- Defensive Stance - [2458] = GetSpellInfo(2458), -- Berserker Stance + [2457] = GetSpellName(2457), -- Battle Stance + [71] = GetSpellName(71), -- Defensive Stance + [2458] = GetSpellName(2458), -- Berserker Stance }, DRUID = { - [5487] = GetSpellInfo(5487), -- Bear Form - [9634] = GetSpellInfo(9634), -- Dire Bear Form - [768] = GetSpellInfo(768), -- Cat Form - [783] = GetSpellInfo(783), -- Travel Form - [1066] = GetSpellInfo(1066), -- Aquatic Form - [24858] = GetSpellInfo(24858), -- Moonkin Form - [33891] = GetSpellInfo(33891), -- Tree of Life - [33943] = GetSpellInfo(33943), -- Flight Form - [40120] = GetSpellInfo(40120), -- Swift Flight Form + [5487] = GetSpellName(5487), -- Bear Form + [9634] = GetSpellName(9634), -- Dire Bear Form + [768] = GetSpellName(768), -- Cat Form + [783] = GetSpellName(783), -- Travel Form + [1066] = GetSpellName(1066), -- Aquatic Form + [24858] = GetSpellName(24858), -- Moonkin Form + [33891] = GetSpellName(33891), -- Tree of Life + [33943] = GetSpellName(33943), -- Flight Form + [40120] = GetSpellName(40120), -- Swift Flight Form }, PRIEST = { - [15473] = GetSpellInfo(15473), -- Shadowform + [15473] = GetSpellName(15473), -- Shadowform }, ROGUE = { - [1784] = GetSpellInfo(1784), -- Stealth + [1784] = GetSpellName(1784), -- Stealth }, PALADIN = { - [19746] = GetSpellInfo(19746), -- Concentration Aura - [32223] = GetSpellInfo(32223), -- Crusader Aura - [465] = GetSpellInfo(465), -- Devotion Aura - [19900] = GetSpellInfo(19891), -- Fire Resistance Aura - [19898] = GetSpellInfo(19891), -- Frost Resistance Aura - [19896] = GetSpellInfo(19891), -- Shadow Resistance Aura - [7294] = GetSpellInfo(7294), -- Retribution Aura + [19746] = GetSpellName(19746), -- Concentration Aura + [32223] = GetSpellName(32223), -- Crusader Aura + [465] = GetSpellName(465), -- Devotion Aura + [19900] = GetSpellName(19891), -- Fire Resistance Aura + [19898] = GetSpellName(19891), -- Frost Resistance Aura + [19896] = GetSpellName(19891), -- Shadow Resistance Aura + [7294] = GetSpellName(7294), -- Retribution Aura }, DEATHKNIGHT = { - [48266] = GetSpellInfo(48266), -- Blood - [48263] = GetSpellInfo(48263), -- Frost - [48265] = GetSpellInfo(48265), -- Unholy + [48266] = GetSpellName(48266), -- Blood + [48263] = GetSpellName(48263), -- Frost + [48265] = GetSpellName(48265), -- Unholy }, } or TMW.isClassic and { WARRIOR = { - [2457] = GetSpellInfo(2457), -- Battle Stance - [71] = GetSpellInfo(71), -- Defensive Stance - [2458] = GetSpellInfo(2458), -- Berserker Stance + [2457] = GetSpellName(2457), -- Battle Stance + [71] = GetSpellName(71), -- Defensive Stance + [2458] = GetSpellName(2458), -- Berserker Stance }, DRUID = { - [5487] = GetSpellInfo(5487), -- Bear Form - [768] = GetSpellInfo(768), -- Cat Form - [783] = GetSpellInfo(783), -- Travel Form - [24858] = GetSpellInfo(24858), -- Moonkin Form + [5487] = GetSpellName(5487), -- Bear Form + [768] = GetSpellName(768), -- Cat Form + [783] = GetSpellName(783), -- Travel Form + [24858] = GetSpellName(24858), -- Moonkin Form }, PRIEST = { - [15473] = GetSpellInfo(15473), -- Shadowform + [15473] = GetSpellName(15473), -- Shadowform }, ROGUE = { - [1784] = GetSpellInfo(1784), -- Stealth + [1784] = GetSpellName(1784), -- Stealth }, } or { DRUID = { - [5487] = GetSpellInfo(5487), -- Bear Form - [768] = GetSpellInfo(768), -- Cat Form - [783] = GetSpellInfo(783), -- Travel Form - [24858] = GetSpellInfo(24858), -- Moonkin Form - [33891] = GetSpellInfo(33891), -- Incarnation: Tree of Life - [171745] = GetSpellInfo(171745), -- Claws of Shirvallah + [5487] = GetSpellName(5487), -- Bear Form + [768] = GetSpellName(768), -- Cat Form + [783] = GetSpellName(783), -- Travel Form + [24858] = GetSpellName(24858), -- Moonkin Form + [33891] = GetSpellName(33891), -- Incarnation: Tree of Life + [171745] = GetSpellName(171745), -- Claws of Shirvallah }, ROGUE = { - [1784] = GetSpellInfo(1784), -- Stealth + [1784] = GetSpellName(1784), -- Stealth }, } function Module:Table_Get() @@ -188,7 +190,7 @@ else 19883, -- Track Humanoids 19884, -- Track Undead } do - local name = GetSpellInfo(id) + local name = GetSpellName(id) TrackingCache[id] = strlower(name) end diff --git a/Components/Core/Conditions/Categories/Spells.lua b/Components/Core/Conditions/Categories/Spells.lua index 12ee4fd3..913968a4 100644 --- a/Components/Core/Conditions/Categories/Spells.lua +++ b/Components/Core/Conditions/Categories/Spells.lua @@ -34,8 +34,10 @@ local bit_band = bit.band local COMBATLOG_OBJECT_TYPE_PLAYER = COMBATLOG_OBJECT_TYPE_PLAYER +local GetSpellCooldown = TMW.GetSpellCooldown Env.GetSpellCooldown = GetSpellCooldown -local GetSpellCooldown = GetSpellCooldown +local GetSpellName = TMW.GetSpellName +local GetSpellInfo = TMW.GetSpellInfo local GetItemCooldown = GetItemCooldown or (C_Container and C_Container.GetItemCooldown) @@ -277,7 +279,7 @@ ConditionCategory:RegisterCondition(2.8, "LASTCAST", { module:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", function(_, unit, _, spellID) if unit == "player" and ussSpells[spellID] and not blacklist[spellID] then - Env.LastPlayerCastName = strlower(GetSpellInfo(spellID)) + Env.LastPlayerCastName = strlower(GetSpellName(spellID)) Env.LastPlayerCastID = spellID TMW:Fire("TMW_CNDT_LASTCAST_UPDATED") end @@ -326,11 +328,11 @@ ConditionCategory:RegisterCondition(2.95, "SPELL_LEARNED", { icon = 237558, tcoords = CNDT.COMMON.standardtcoords, Env = { - GetSpellInfo = GetSpellInfo, + GetSpellName = TMW.GetSpellName }, -- In Classic SoD, IsPlayerSpell doesn't work for rune abilities (always returns false). -- However, GetSpellInfo with a name input only returns the player's spells. - funcstr = [[BOOLCHECK( GetSpellInfo(c.Spells.FirstString) )]], + funcstr = [[BOOLCHECK( GetSpellName(c.Spells.FirstString) )]], events = function(ConditionObject, c) return ConditionObject:GenerateNormalEventString("SPELLS_CHANGED") @@ -436,7 +438,7 @@ ConditionCategory:RegisterCondition(3.5, "OVERLAYED", { module = CNDT:NewModule("OVERLAYED", "AceEvent-3.0") local function handleEvent(event, arg1) - Env.OverlayedNameMap[strlowerCache[GetSpellInfo(arg1)]] = arg1 + Env.OverlayedNameMap[strlowerCache[GetSpellName(arg1)]] = arg1 end module:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW", handleEvent) diff --git a/Components/Core/Conditions/Categories/Spells_config.lua b/Components/Core/Conditions/Categories/Spells_config.lua index 49291ad0..92b55849 100644 --- a/Components/Core/Conditions/Categories/Spells_config.lua +++ b/Components/Core/Conditions/Categories/Spells_config.lua @@ -18,6 +18,8 @@ local L = TMW.L local print = TMW.print local SUG = TMW.SUG +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local Module_spell = SUG:GetModule("spell") local Module = SUG:NewModule("spellWithGCD", Module_spell) @@ -34,7 +36,7 @@ function Module:Entry_AddToList_2(f, id) if id == "GCD" then local spellID = TMW.GCDSpell - local name = GetSpellInfo(spellID) + local name = GetSpellName(spellID) f.Name:SetText(L["GCD"]) f.ID:SetText(nil) diff --git a/Components/Core/Conditions/Categories/Talents.lua b/Components/Core/Conditions/Categories/Talents.lua index 895309ce..69bf452a 100644 --- a/Components/Core/Conditions/Categories/Talents.lua +++ b/Components/Core/Conditions/Categories/Talents.lua @@ -25,8 +25,8 @@ local _, pclass = UnitClass("Player") local wipe = wipe -local GetTalentInfo, GetNumTalents, GetGlyphLink, GetSpellInfo = - GetTalentInfo, GetNumTalents, GetGlyphLink, GetSpellInfo +local GetTalentInfo, GetNumTalents, GetGlyphLink = + GetTalentInfo, GetNumTalents, GetGlyphLink local GetSpecializationInfo, GetNumClasses = GetSpecializationInfo, GetNumClasses local GetNumBattlefieldScores, RequestBattlefieldScoreData, GetBattlefieldScore, GetNumArenaOpponents, GetArenaOpponentSpec = @@ -34,6 +34,8 @@ local GetNumBattlefieldScores, RequestBattlefieldScoreData, GetBattlefieldScore, local UnitAura, IsInJailersTower, C_SpecializationInfo, GetPvpTalentInfoByID = UnitAura, IsInJailersTower, C_SpecializationInfo, GetPvpTalentInfoByID +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetClassInfo = TMW.GetClassInfo local GetMaxClassID = TMW.GetMaxClassID @@ -690,7 +692,7 @@ if GetGlyphSocketInfo then if spellID then GlyphLookup[spellID] = 1 - local name = GetSpellInfo(spellID) + local name = GetSpellName(spellID) name = strlowerCache[name] GlyphLookup[name] = 1 end @@ -702,7 +704,7 @@ if GetGlyphSocketInfo then if spellID then GlyphLookup[spellID] = 1 - local name = GetSpellInfo(spellID) + local name = GetSpellName(spellID) name = strlowerCache[name] GlyphLookup[name] = 1 end diff --git a/Components/Core/Conditions/Categories/Talents_config.lua b/Components/Core/Conditions/Categories/Talents_config.lua index 21942f0a..ea379dbd 100644 --- a/Components/Core/Conditions/Categories/Talents_config.lua +++ b/Components/Core/Conditions/Categories/Talents_config.lua @@ -19,6 +19,7 @@ local print = TMW.print local SUG = TMW.SUG local strlowerCache = TMW.strlowerCache +local GetSpellInfo = TMW.GetSpellInfo local _, pclass = UnitClass("Player") diff --git a/Components/Core/Conditions/Conditions.lua b/Components/Core/Conditions/Conditions.lua index 3bdcf3bc..7f1f4d78 100644 --- a/Components/Core/Conditions/Conditions.lua +++ b/Components/Core/Conditions/Conditions.lua @@ -181,7 +181,7 @@ TMW:RegisterUpgrade(60026, { for _, stanceData in ipairs(self.stances) do if stanceData.class == pclass then - local stanceName = GetSpellInfo(stanceData.id) + local stanceName = TMW.GetSpellInfo(stanceData.id) tinsert(self.CSN, stanceName) end end diff --git a/Components/Core/IconDataProcessors.lua b/Components/Core/IconDataProcessors.lua index 12ee151c..7ff16d7c 100755 --- a/Components/Core/IconDataProcessors.lua +++ b/Components/Core/IconDataProcessors.lua @@ -19,6 +19,8 @@ local print = TMW.print local format = format local isNumber = TMW.isNumber + +local GetSpellInfo = TMW.GetSpellInfo local GetSpellLink = C_Spell and C_Spell.GetSpellLink or GetSpellLink diff --git a/Components/Core/IconType.lua b/Components/Core/IconType.lua index 10ab3a02..8a1fa183 100644 --- a/Components/Core/IconType.lua +++ b/Components/Core/IconType.lua @@ -17,13 +17,13 @@ local TMW = TMW local L = TMW.L local print = TMW.print -local GetSpellInfo - = GetSpellInfo + local pairs, ipairs, setmetatable, rawget, date, tinsert, type - = pairs, ipairs, setmetatable, rawget, date, tinsert, type - -local GetSpellBookItemInfo = TMW.GetSpellBookItemInfo += pairs, ipairs, setmetatable, rawget, date, tinsert, type +local GetSpellBookItemInfo = TMW.GetSpellBookItemInfo +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetSpellLink = C_Spell and C_Spell.GetSpellLink or GetSpellLink local GetSpellTexture = TMW.GetSpellTexture local tContains = TMW.tContains @@ -121,7 +121,7 @@ function IconType:FormatSpellForOutput(icon, data, doInsertLink) if doInsertLink then name = GetSpellLink(data) else - name = GetSpellInfo(data) + name = GetSpellName(data) end if name then return name @@ -215,14 +215,14 @@ function IconType:DragReceived(icon, t, data, subType, param4) if data == 0 and type(param4) == "number" then -- I don't remember the purpose of this anymore. -- It handles some special sort of spell, though, and is required. - input = GetSpellInfo(param4) + input = GetSpellName(param4) else local spellData = GetSpellBookItemInfo(data, subType) if not spellData or spellData.typeName ~= "SPELL" then return end - local baseSpellName = GetSpellInfo(spellData.actionId) + local baseSpellName = GetSpellName(spellData.actionId) input = baseSpellName or spellData.name end diff --git a/Components/Core/Spells/ClassSpellCache.lua b/Components/Core/Spells/ClassSpellCache.lua index cbc6b5c3..1d1b74f4 100644 --- a/Components/Core/Spells/ClassSpellCache.lua +++ b/Components/Core/Spells/ClassSpellCache.lua @@ -20,6 +20,8 @@ local print = TMW.print local pairs, type, ipairs, bit, select = pairs, type, ipairs, bit, select +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetClassInfo = TMW.GetClassInfo local GetMaxClassID = TMW.GetMaxClassID @@ -144,7 +146,7 @@ function ClassSpellCache:GetNameCache() local c = {} NameCache[class] = c for spellID, value in pairs(spells) do - local name = GetSpellInfo(spellID) + local name = GetSpellName(spellID) if name then c[name:lower()] = true end diff --git a/Components/Core/Spells/SpellCache.lua b/Components/Core/Spells/SpellCache.lua index ac7eaea7..a13af5b7 100644 --- a/Components/Core/Spells/SpellCache.lua +++ b/Components/Core/Spells/SpellCache.lua @@ -19,8 +19,12 @@ local print = TMW.print local strfind, strlower, pairs = strfind, strlower, pairs -local GetSpellInfo, InCombatLockdown, C_TradeSkillUI - = GetSpellInfo, InCombatLockdown, C_TradeSkillUI +local InCombatLockdown, C_TradeSkillUI + = InCombatLockdown, C_TradeSkillUI + +local GetSpellTexturePlain = C_Spell and C_Spell.GetSpellTexture or GetSpellTexture +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local debugprofilestop = debugprofilestop_SAFE @@ -265,9 +269,10 @@ TMW:RegisterCallback("TMW_OPTIONS_LOADED", function() spellID = spellID + skip end - local name, _, icon = GetSpellInfo(spellID) + local name = GetSpellName(spellID) local fail = false if name then + local icon = GetSpellTexturePlain(spellID) spellsFailed = 0 -- This is our best filter by far - about 70k spells are filtered out by this. @@ -404,7 +409,7 @@ TMW:RegisterCallback("TMW_OPTIONS_LOADED", function() Cache[spellID] = nil end for spellID in pairs(CONST.WHITELIST) do - local name = GetSpellInfo(spellID) + local name = GetSpellName(spellID) if name then Cache[spellID] = strlower(name) end diff --git a/Components/Core/Spells/Spells.lua b/Components/Core/Spells/Spells.lua index 0bf1e5ae..6f94bf51 100644 --- a/Components/Core/Spells/Spells.lua +++ b/Components/Core/Spells/Spells.lua @@ -20,7 +20,8 @@ local print = TMW.print local type, pairs, gsub, strfind, strmatch, strsplit, strtrim, tonumber, tremove, ipairs, tinsert, CopyTable, setmetatable = type, pairs, gsub, strfind, strmatch, strsplit, strtrim, tonumber, tremove, ipairs, tinsert, CopyTable, setmetatable local tconcat = table.concat -local GetSpellInfo = GetSpellInfo +local GetSpellName = TMW.GetSpellName +local GetSpellInfo = TMW.GetSpellInfo local GetSpellTexture = TMW.GetSpellTexture local strlowerCache = TMW.strlowerCache @@ -231,7 +232,7 @@ local function getSpellNames(setting, doLower, firstOnly, convert, hash, allowRe local hash = {} for k, v in ipairs(spells) do if convert == "name" and (allowRenaming or tonumber(v)) then - v = GetSpellInfo(v or "") or v -- Turn the value into a name if needed + v = GetSpellName(v or "") or v -- Turn the value into a name if needed end if doLower then @@ -250,7 +251,7 @@ local function getSpellNames(setting, doLower, firstOnly, convert, hash, allowRe -- Turn the first value into a name and return it local ret = spells[1] or "" if (allowRenaming or tonumber(ret)) then - ret = GetSpellInfo(ret) or ret + ret = GetSpellName(ret) or ret end if doLower then @@ -262,7 +263,7 @@ local function getSpellNames(setting, doLower, firstOnly, convert, hash, allowRe -- Convert everything to a name for k, v in ipairs(spells) do if (allowRenaming or tonumber(v)) then - spells[k] = GetSpellInfo(v or "") or v + spells[k] = GetSpellName(v or "") or v end end @@ -579,13 +580,13 @@ TMW:MakeSingleArgFunctionCached(TMW, "EquivToTable") --------------------------------- if TMW.isCata then if pclass == "PALADIN" then - local name = GetSpellInfo(26573) + local name = GetSpellName(26573) TMW.COMMON.CurrentClassTotems = { name = name, desc = L["ICONMENU_TOTEM_GENERIC_DESC"]:format(name), { hasVariableNames = false, - name = GetSpellInfo(26573), --consecration + name = GetSpellName(26573), --consecration texture = GetSpellTexture(26573) } } @@ -598,7 +599,7 @@ if TMW.isCata then return cachedName end end - local name = GetSpellInfo(46584) + local name = GetSpellName(46584) TMW.COMMON.CurrentClassTotems = { name = name, desc = function() return L["ICONMENU_TOTEM_GENERIC_DESC"]:format(name) end, @@ -719,7 +720,7 @@ elseif not TMW.isRetail then rankRoman = numerals[rank] } - data.spellName = GetSpellInfo(spellID) + data.spellName = GetSpellName(spellID) if not data.spellName then if not TMW.isClassic then -- don't debug on classic - we use wrath's data and filter out totems that don't exist @@ -907,18 +908,18 @@ else } if pclass == "PALADIN" then - local name = GetSpellInfo(26573) .. " & " .. GetSpellInfo(114158) + local name = GetSpellName(26573) .. " & " .. GetSpellName(114158) TMW.COMMON.CurrentClassTotems = { name = name, desc = L["ICONMENU_TOTEM_GENERIC_DESC"]:format(name), { hasVariableNames = false, - name = GetSpellInfo(26573), --consecration + name = GetSpellName(26573), --consecration texture = GetSpellTexture(26573) }, { hasVariableNames = false, - name = GetSpellInfo(114158), --light's hammer + name = GetSpellName(114158), --light's hammer texture = GetSpellTexture(114158) } } @@ -931,7 +932,7 @@ else return cachedName end end - local name = GetSpellInfo(49206) + local name = GetSpellName(49206) TMW.COMMON.CurrentClassTotems = { name = name, desc = function() return L["ICONMENU_TOTEM_GENERIC_DESC"]:format(name) end, @@ -1018,7 +1019,7 @@ local function ProcessEquivalencies() end for _, spell in pairs(tbl) do - if type(spell) == "number" and not GetSpellInfo(spell) then + if type(spell) == "number" and not GetSpellName(spell) then TMW:Debug("Invalid spellID found: %s (%s - %s)!", spell, category, equiv) end diff --git a/Components/Core/Suggester/Suggester.lua b/Components/Core/Suggester/Suggester.lua index 9da48f6f..f9af42a6 100644 --- a/Components/Core/Suggester/Suggester.lua +++ b/Components/Core/Suggester/Suggester.lua @@ -19,6 +19,8 @@ local print = TMW.print local strlowerCache = TMW.strlowerCache local GetSpellTexture = TMW.GetSpellTexture +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local _, pclass = UnitClass("Player") local LSM = LibStub("LibSharedMedia-3.0") @@ -27,8 +29,9 @@ local tonumber, tostring, type, pairs, ipairs, tinsert, tremove, sort, wipe, nex tonumber, tostring, type, pairs, ipairs, tinsert, tremove, sort, wipe, next, getmetatable, setmetatable, assert, rawget, rawset, unpack, select local strfind, strmatch, strbyte, format, gsub, strsub, strtrim, strlen, strsplit, strlower, max, min, floor, ceil, log10 = strfind, strmatch, strbyte, format, gsub, strsub, strtrim, strlen, strsplit, strlower, max, min, floor, ceil, log10 -local GetSpellInfo, GetItemInfo, GetItemIcon = - GetSpellInfo, GetItemInfo, GetItemIcon +local GetItemInfo, GetItemIcon = + GetItemInfo, GetItemIcon + -- GLOBALS: GameTooltip, GameTooltip_SetDefaultAnchor @@ -1291,7 +1294,7 @@ function Module:Table_GetSorter() end function Module:Entry_AddToList_1(f, id) if tonumber(id) then --sanity check - local name = GetSpellInfo(id) + local name = GetSpellName(id) f.Name:SetText(name) f.ID:SetText(id) @@ -1336,7 +1339,7 @@ end local Module = SUG:NewModule("texture", SUG:GetModule("spell")) function Module:Entry_AddToList_1(f, id) if tonumber(id) then --sanity check - local name = GetSpellInfo(id) + local name = GetSpellName(id) f.Name:SetText(name) f.ID:SetText(id) diff --git a/Components/IconModules/IconModule_PowerBar/PowerBar.lua b/Components/IconModules/IconModule_PowerBar/PowerBar.lua index 4bfbc7d5..b3657894 100644 --- a/Components/IconModules/IconModule_PowerBar/PowerBar.lua +++ b/Components/IconModules/IconModule_PowerBar/PowerBar.lua @@ -18,8 +18,9 @@ local print = TMW.print local L = TMW.L local LSM = LibStub("LibSharedMedia-3.0") local _, pclass = UnitClass("Player") -local GetSpellInfo, UnitPower = - GetSpellInfo, UnitPower +local UnitPower = + UnitPower +local GetSpellInfo = TMW.GetSpellInfo local GetSpellLink = C_Spell and C_Spell.GetSpellLink or GetSpellLink local pairs, wipe, _G = pairs, wipe, _G diff --git a/Components/IconTypes/IconType_buff/buff.lua b/Components/IconTypes/IconType_buff/buff.lua index e2da132e..42edc655 100644 --- a/Components/IconTypes/IconType_buff/buff.lua +++ b/Components/IconTypes/IconType_buff/buff.lua @@ -19,6 +19,8 @@ local tonumber, pairs, type, format, select = tonumber, pairs, type, format, select local UnitAura = UnitAura +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetSpellTexture = TMW.GetSpellTexture local strlowerCache = TMW.strlowerCache local isNumber = TMW.isNumber @@ -668,24 +670,24 @@ end local aurasWithNoSourceReported = { -- Mists: - GetSpellInfo(104993), -- Jade Spirit - GetSpellInfo(116660), -- River's Song - GetSpellInfo(120032), -- Dancing Steel - GetSpellInfo(116631), -- Colossus - GetSpellInfo(104423), -- Windsong - GetSpellInfo(109085), -- Blastington's + GetSpellName(104993), -- Jade Spirit + GetSpellName(116660), -- River's Song + GetSpellName(120032), -- Dancing Steel + GetSpellName(116631), -- Colossus + GetSpellName(104423), -- Windsong + GetSpellName(109085), -- Blastington's -- Warlords: - GetSpellInfo(156060), -- Megawatt Filament - GetSpellInfo(156055), -- Oglethorpe's Missile Splitter - GetSpellInfo(173288), -- Hemet's Heartseeker (maybe unused?) - GetSpellInfo(159679), -- Mark of Blackrock - GetSpellInfo(159678), -- Mark of Shadowmoon - GetSpellInfo(159676), -- Mark of the Frostwolf - GetSpellInfo(159239), -- Mark of the Shattered Hand - GetSpellInfo(159234), -- Mark of the Thunderlord - GetSpellInfo(173322), -- Mark of Bleeding Hollow - GetSpellInfo(159675), -- Mark of Warsong + GetSpellName(156060), -- Megawatt Filament + GetSpellName(156055), -- Oglethorpe's Missile Splitter + GetSpellName(173288), -- Hemet's Heartseeker (maybe unused?) + GetSpellName(159679), -- Mark of Blackrock + GetSpellName(159678), -- Mark of Shadowmoon + GetSpellName(159676), -- Mark of the Frostwolf + GetSpellName(159239), -- Mark of the Shattered Hand + GetSpellName(159234), -- Mark of the Thunderlord + GetSpellName(173322), -- Mark of Bleeding Hollow + GetSpellName(159675), -- Mark of Warsong nil, -- Terminate with nil to prevent all Warsong's return values from filling the table } diff --git a/Components/IconTypes/IconType_cast/cast.lua b/Components/IconTypes/IconType_cast/cast.lua index fcbb0c3c..4174f233 100644 --- a/Components/IconTypes/IconType_cast/cast.lua +++ b/Components/IconTypes/IconType_cast/cast.lua @@ -17,8 +17,8 @@ local L = TMW.L local print = TMW.print local pairs, ipairs = pairs, ipairs -local GetSpellInfo, UnitCastingInfo, UnitChannelInfo = - GetSpellInfo, UnitCastingInfo, UnitChannelInfo +local UnitCastingInfo, UnitChannelInfo = + UnitCastingInfo, UnitChannelInfo local strlowerCache = TMW.strlowerCache diff --git a/Components/IconTypes/IconType_cleu/cleu.lua b/Components/IconTypes/IconType_cleu/cleu.lua index 17e9793a..0aee8cce 100644 --- a/Components/IconTypes/IconType_cleu/cleu.lua +++ b/Components/IconTypes/IconType_cleu/cleu.lua @@ -20,6 +20,8 @@ local bit_band, bit_bor, tinsert, tremove, unpack, wipe = bit.band, bit.bor, tinsert, tremove, unpack, wipe local UnitGUID, GetItemIcon, CombatLogGetCurrentEventInfo = UnitGUID, GetItemIcon, CombatLogGetCurrentEventInfo + +local GetSpellInfo = TMW.GetSpellInfo local GetSpellTexture = TMW.GetSpellTexture local GetSpellLink = C_Spell and C_Spell.GetSpellLink or GetSpellLink diff --git a/Components/IconTypes/IconType_cooldown/cooldown.lua b/Components/IconTypes/IconType_cooldown/cooldown.lua index 6cacd03f..9e1b4e2b 100644 --- a/Components/IconTypes/IconType_cooldown/cooldown.lua +++ b/Components/IconTypes/IconType_cooldown/cooldown.lua @@ -15,8 +15,6 @@ if not TMW then return end local L = TMW.L local print = TMW.print -local GetSpellInfo, GetSpellCooldown = - GetSpellInfo, GetSpellCooldown local UnitRangedDamage = UnitRangedDamage local pairs, wipe, strlower = @@ -24,8 +22,11 @@ local pairs, wipe, strlower = local OnGCD = TMW.OnGCD local SpellHasNoMana = TMW.SpellHasNoMana +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetSpellTexture = TMW.GetSpellTexture local GetSpellCharges = TMW.GetSpellCharges +local GetSpellCooldown = TMW.GetSpellCooldown local IsUsableSpell = C_Spell.IsSpellUsable or _G.IsUsableSpell local GetSpellCount = C_Spell.GetSpellCastCount or _G.GetSpellCount local GetRuneCooldownDuration = TMW.GetRuneCooldownDuration @@ -176,7 +177,7 @@ end local usableData = {} local unusableData = {} -local mindfreeze = GetSpellInfo(47528) and strlower(GetSpellInfo(47528)) +local mindfreeze = GetSpellName(47528) and strlower(GetSpellName(47528)) local function SpellCooldown_OnUpdate(icon, time) -- Upvalue things that will be referenced a lot in our loops. local IgnoreRunes, RangeCheck, ManaCheck, GCDAsUnusable, NameArray = @@ -308,7 +309,7 @@ function Type:Setup(icon) icon.IgnoreRunes = nil end - if icon.Spells.FirstString == strlower(GetSpellInfo(75)) and not icon.Spells.Array[2] then + if icon.Spells.FirstString == strlower(GetSpellName(75)) and not icon.Spells.Array[2] then -- Auto shot needs special handling - it isn't a regular cooldown, so it gets its own update function. icon:SetInfo("texture", GetSpellTexture(75)) icon.asStart = icon.asStart or 0 diff --git a/Components/IconTypes/IconType_default/default.lua b/Components/IconTypes/IconType_default/default.lua index b1863e44..553216a2 100644 --- a/Components/IconTypes/IconType_default/default.lua +++ b/Components/IconTypes/IconType_default/default.lua @@ -17,9 +17,9 @@ local L = TMW.L local print = TMW.print local type = type -local GetSpellInfo = - GetSpellInfo +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetSpellBookItemInfo = TMW.GetSpellBookItemInfo local Type = TMW.Classes.IconType:New("") @@ -64,7 +64,7 @@ function Type:DragReceived(icon, t, data, subType, param4) -- I don't remember the purpose of this anymore. -- It handles some special sort of spell, though, and is required. -- param4 here is a spellID, obviously. - input = GetSpellInfo(param4) + input = GetSpellName(param4) else local spellData = GetSpellBookItemInfo(data, subType) @@ -72,7 +72,7 @@ function Type:DragReceived(icon, t, data, subType, param4) return end - local baseSpellName = GetSpellInfo(spellData.actionId) + local baseSpellName = GetSpellName(spellData.actionId) input = baseSpellName or spellData.name end diff --git a/Components/IconTypes/IconType_dotwatch/dotwatch.lua b/Components/IconTypes/IconType_dotwatch/dotwatch.lua index 08c9d664..dc68f5e1 100644 --- a/Components/IconTypes/IconType_dotwatch/dotwatch.lua +++ b/Components/IconTypes/IconType_dotwatch/dotwatch.lua @@ -17,8 +17,8 @@ local L = TMW.L local print = TMW.print local type, wipe, pairs, rawget, abs, min, next, GetTime = type, wipe, pairs, rawget, abs, min, next, GetTime -local UnitGUID, UnitAura, UnitName, GetSpellInfo = - UnitGUID, UnitAura, UnitName, GetSpellInfo +local UnitGUID, UnitAura, UnitName = + UnitGUID, UnitAura, UnitName local C_Timer = C_Timer local huge = math.huge @@ -28,6 +28,8 @@ local pGUID = nil -- UnitGUID() returns nil at load time, so we set this later. local isNumber = TMW.isNumber local strlowerCache = TMW.strlowerCache local GetSpellTexture = TMW.GetSpellTexture +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local Aura @@ -338,7 +340,7 @@ Aura = TMW:NewClass("Aura"){ self.unitName = destName self.spellID = spellID - self.spellName = GetSpellInfo(spellID) + self.spellName = GetSpellName(spellID) self.start = TMW.time self.lastSeen = TMW.time local duration = BaseDurations[spellID] diff --git a/Components/IconTypes/IconType_guardian/Config.lua b/Components/IconTypes/IconType_guardian/Config.lua index a4e82e88..b55b8ad2 100644 --- a/Components/IconTypes/IconType_guardian/Config.lua +++ b/Components/IconTypes/IconType_guardian/Config.lua @@ -50,7 +50,7 @@ end function Module:Entry_AddToList_1(f, id) local data = Type.GuardianInfo[id] local name = data.name - local triggerSpellName = GetSpellInfo(data.triggerSpell) + local triggerSpellName = TMW.GetSpellName(data.triggerSpell) if data.nameKnown then f.insert = SUG.inputType == "number" and id or name diff --git a/Components/IconTypes/IconType_icd/icd.lua b/Components/IconTypes/IconType_icd/icd.lua index 901d0ac6..294ce023 100644 --- a/Components/IconTypes/IconType_icd/icd.lua +++ b/Components/IconTypes/IconType_icd/icd.lua @@ -18,7 +18,9 @@ local print = TMW.print local UnitGUID = UnitGUID +local GetSpellInfo = TMW.GetSpellInfo local GetSpellTexture = TMW.GetSpellTexture +local GetSpellName = TMW.GetSpellName local strlowerCache = TMW.strlowerCache local pGUID = nil -- UnitGUID() returns nil at load time, so we set this later. @@ -132,7 +134,7 @@ local function ICD_OnEvent(icon, event, ...) then local unit unit, _, spellID = ... - spellName = GetSpellInfo(spellID) + spellName = GetSpellName(spellID) valid = unit == "player" end diff --git a/Components/IconTypes/IconType_losecontrol/losecontrol.lua b/Components/IconTypes/IconType_losecontrol/losecontrol.lua index f6399caf..4a944a53 100644 --- a/Components/IconTypes/IconType_losecontrol/losecontrol.lua +++ b/Components/IconTypes/IconType_losecontrol/losecontrol.lua @@ -19,8 +19,6 @@ if not _G.C_LossOfControl then end local print = TMW.print -local GetSpellInfo = - GetSpellInfo local GetEventInfo = C_LossOfControl.GetEventInfo or C_LossOfControl.GetActiveLossOfControlData local GetNumEvents = C_LossOfControl.GetNumEvents or C_LossOfControl.GetActiveLossOfControlDataCount diff --git a/Components/IconTypes/IconType_reactive/reactive.lua b/Components/IconTypes/IconType_reactive/reactive.lua index be57bf9e..dee0a178 100644 --- a/Components/IconTypes/IconType_reactive/reactive.lua +++ b/Components/IconTypes/IconType_reactive/reactive.lua @@ -17,11 +17,12 @@ local L = TMW.L local _, pclass = UnitClass("player") local print = TMW.print -local GetSpellCooldown, GetSpellInfo = - GetSpellCooldown, GetSpellInfo +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local GetSpellTexture = TMW.GetSpellTexture local GetSpellCharges = TMW.GetSpellCharges +local GetSpellCooldown = TMW.GetSpellCooldown local IsUsableSpell = C_Spell.IsSpellUsable or _G.IsUsableSpell local GetSpellCount = C_Spell.GetSpellCastCount or _G.GetSpellCount @@ -139,13 +140,13 @@ end) local function Reactive_OnEvent(icon, event, arg1) -- If icon.UseActvtnOverlay == true, treat the icon as usable if the spell has an activation overlay glow. - if icon.Spells.First == arg1 or strlowerCache[GetSpellInfo(arg1)] == icon.Spells.FirstString then + if icon.Spells.First == arg1 or strlowerCache[GetSpellName(arg1)] == icon.Spells.FirstString then icon.activationOverlayActive = event == "SPELL_ACTIVATION_OVERLAY_GLOW_SHOW" icon.NextUpdateTime = 0 end end -local mindfreeze = GetSpellInfo(47528) and strlower(GetSpellInfo(47528)) +local mindfreeze = GetSpellName(47528) and strlower(GetSpellName(47528)) local function Reactive_OnUpdate(icon, time) -- Upvalue things that will be referenced a lot in our loops. diff --git a/Components/IconTypes/IconType_swingtimer/Config.xml b/Components/IconTypes/IconType_swingtimer/Config.xml index c99125a0..0f8a6338 100644 --- a/Components/IconTypes/IconType_swingtimer/Config.xml +++ b/Components/IconTypes/IconType_swingtimer/Config.xml @@ -41,13 +41,13 @@ TMW:CInit(self) - self:SetTitle(GetSpellInfo(75)) + self:SetTitle(TMW.GetSpellName(75)) self.Text:SetText(TMW.L["ICONTYPE_SWINGTIMER_TIP"]) self:CScriptAdd("PanelSetup", function(self, panel, panelInfo) local settings = self:GetSettingTable() local supplementalData = panelInfo.supplementalData local spellID = supplementalData.spellID - local name = GetSpellInfo(spellID) + local name = TMW.GetSpellName(spellID) local descriptiveName = supplementalData.descriptiveName or name self.spellIdToApply = spellID diff --git a/Components/IconTypes/IconType_swingtimer/swingtimer.lua b/Components/IconTypes/IconType_swingtimer/swingtimer.lua index 738542b0..181d3c54 100644 --- a/Components/IconTypes/IconType_swingtimer/swingtimer.lua +++ b/Components/IconTypes/IconType_swingtimer/swingtimer.lua @@ -64,7 +64,7 @@ if pclass == "HUNTER" then elseif not TMW.isRetail and (pclass == "MAGE" or pclass == "PRIEST" or pclass == "WARLOCK") then Type:RegisterConfigPanel_XMLTemplate(130, "TellMeWhen_AutoshootSwingTimerTip", { spellID = 5019, - descriptiveName = GetSpellInfo(5009) -- "Wands" (best i could do - couldnt find "Wand") + descriptiveName = TMW.GetSpellName(5009) -- "Wands" (best i could do - couldnt find "Wand") }) end diff --git a/Components/IconTypes/IconType_totem/totem.lua b/Components/IconTypes/IconType_totem/totem.lua index f3cef7c8..6c87fc82 100644 --- a/Components/IconTypes/IconType_totem/totem.lua +++ b/Components/IconTypes/IconType_totem/totem.lua @@ -19,8 +19,8 @@ local print = TMW.print local format, type, tonumber, wipe, bit = format, type, tonumber, wipe, bit -local GetTotemInfo, GetSpellInfo = - GetTotemInfo, GetSpellInfo +local GetTotemInfo = + GetTotemInfo local GetSpellTexture = TMW.GetSpellTexture local strlowerCache = TMW.strlowerCache diff --git a/Components/IconTypes/IconType_unitcooldown/unitcooldown-Classic.lua b/Components/IconTypes/IconType_unitcooldown/unitcooldown-Classic.lua index 2030396e..9d100c85 100644 --- a/Components/IconTypes/IconType_unitcooldown/unitcooldown-Classic.lua +++ b/Components/IconTypes/IconType_unitcooldown/unitcooldown-Classic.lua @@ -27,9 +27,8 @@ local huge = math.huge local isNumber = TMW.isNumber local strlowerCache = TMW.strlowerCache local GetSpellTexture = TMW.GetSpellTexture - -local GetSpellInfo - = GetSpellInfo +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local classSpellNameCache @@ -228,8 +227,8 @@ local resetsOnCast = { -- Map to names, since classic doesn't provide spellIDs to CLEU resetsOnCast = TMW.map(resetsOnCast, function(v, k) return TMW.map(v, function(v, k) - return v, strlowerCache[GetSpellInfo(k)] - end), strlowerCache[GetSpellInfo(k)] + return v, strlowerCache[GetSpellName(k)] + end), strlowerCache[GetSpellName(k)] end) -- local resetsOnAura = { @@ -319,7 +318,7 @@ function Type:UNIT_SPELLCAST_SUCCEEDED(event, unit, _, spellID) -- so remove all errors and just ignore things without GUIDs. local c = Cooldowns[sourceGUID] - local spellName = GetSpellInfo(spellID) + local spellName = GetSpellName(spellID) spellName = strlowerCache[spellName] c[spellName] = TMW.time diff --git a/Components/IconTypes/IconType_unitcooldown/unitcooldown.lua b/Components/IconTypes/IconType_unitcooldown/unitcooldown.lua index e4321221..1780b307 100644 --- a/Components/IconTypes/IconType_unitcooldown/unitcooldown.lua +++ b/Components/IconTypes/IconType_unitcooldown/unitcooldown.lua @@ -31,9 +31,8 @@ local huge = math.huge local isNumber = TMW.isNumber local strlowerCache = TMW.strlowerCache local GetSpellTexture = TMW.GetSpellTexture - -local GetSpellInfo - = GetSpellInfo +local GetSpellInfo = TMW.GetSpellInfo +local GetSpellName = TMW.GetSpellName local classSpellNameCache @@ -401,7 +400,7 @@ function Type:UNIT_SPELLCAST_SUCCEEDED(event, unit, _, spellID) -- so remove all errors and just ignore things without GUIDs. local c = Cooldowns[sourceGUID] - local spellName = GetSpellInfo(spellID) + local spellName = GetSpellName(spellID) spellName = strlowerCache[spellName] c[spellName] = spellID diff --git a/Components/IconTypes/IconType_wpnenchant/Config.lua b/Components/IconTypes/IconType_wpnenchant/Config.lua index d71e14f3..5dd3e658 100644 --- a/Components/IconTypes/IconType_wpnenchant/Config.lua +++ b/Components/IconTypes/IconType_wpnenchant/Config.lua @@ -127,7 +127,7 @@ function Module:OnInitialize() self:Etc_DoItemLookups() for _, id in pairs(self.SpellIDs) do - local name = GetSpellInfo(id) + local name = TMW.GetSpellName(id) for _, enchant in TMW:Vararg(strsplit("|", L["SUG_MATCH_WPNENCH_ENCH"])) do local dobreak enchant = name:match(enchant) diff --git a/Localization/StaticFormats.lua b/Localization/StaticFormats.lua index c89378d6..a0c9ca5b 100644 --- a/Localization/StaticFormats.lua +++ b/Localization/StaticFormats.lua @@ -3,6 +3,23 @@ local pname = UnitName("player") local locale = GetLocale() +local GetSpellInfo +if C_Spell.GetSpellInfo then + GetSpellInfo = function(spellID) + if not spellID then + return nil; + end + + local spellInfo = C_Spell.GetSpellInfo(spellID); + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID; + end + end +else + GetSpellInfo = _G.GetSpellInfo +end + + local spellFmt = "|T%s:0|t%s" local function Spell(id, noTex) local name, _, tex = GetSpellInfo(id) diff --git a/Options/CHANGELOG.lua b/Options/CHANGELOG.lua index 0274035c..88395555 100644 --- a/Options/CHANGELOG.lua +++ b/Options/CHANGELOG.lua @@ -4,6 +4,7 @@ TMW.CHANGELOG_LASTVER="7.4.0" TMW.CHANGELOG = [==[ ## v10.2.7 +* Initial support for WoW 11.0 * Fix GetTalentTabInfo call for SOD Phase 4 ## v10.2.6 diff --git a/Options/IconConfig.lua b/Options/IconConfig.lua index 1ca7f02c..3ab336d9 100644 --- a/Options/IconConfig.lua +++ b/Options/IconConfig.lua @@ -19,6 +19,7 @@ local print = TMW.print local IE = TMW.IE local CI = TMW.CI +local GetSpellInfo = TMW.GetSpellInfo diff --git a/Options/TellMeWhen_Options.lua b/Options/TellMeWhen_Options.lua index 65c39b28..4f0c6f0e 100644 --- a/Options/TellMeWhen_Options.lua +++ b/Options/TellMeWhen_Options.lua @@ -31,8 +31,6 @@ local AceDB = LibStub("AceDB-3.0") ---------- Upvalues ---------- local TMW = TMW local L = TMW.L -local GetSpellInfo = - GetSpellInfo local tonumber, tostring, type, pairs, ipairs, tinsert, tremove, sort, wipe, next, getmetatable, setmetatable, pcall, assert, rawget, rawset, unpack, select = tonumber, tostring, type, pairs, ipairs, tinsert, tremove, sort, wipe, next, getmetatable, setmetatable, pcall, assert, rawget, rawset, unpack, select local format, gsub, strlenutf8, strsplit, strlower, max, min, floor, ceil, log10 = @@ -830,7 +828,7 @@ function IE:Equiv_GenerateTips(equiv) local original = TMW.EquivOriginalLookup[equiv] for k, v in pairs(IDs) do - local name, _, texture = GetSpellInfo(v) + local name, _, texture = TMW.GetSpellInfo(v) if not name then if TMW.debug then TMW:Error("INVALID ID FOUND: %s:%s", equiv, v) diff --git a/TellMeWhen.lua b/TellMeWhen.lua index 23c5a733..f9291afd 100644 --- a/TellMeWhen.lua +++ b/TellMeWhen.lua @@ -161,8 +161,6 @@ end) ---------- Upvalues ---------- local GetSpellTexture = C_Spell and C_Spell.GetSpellTexture or GetSpellTexture -local GetSpellCooldown, GetSpellInfo = - GetSpellCooldown, GetSpellInfo local InCombatLockdown, GetTalentInfo = InCombatLockdown, GetTalentInfo local IsInGuild, IsInGroup, IsInInstance = @@ -393,10 +391,43 @@ end +if _G.GetSpellInfo then + TMW.GetSpellInfo = _G.GetSpellInfo +else + local C_Spell_GetSpellInfo = C_Spell.GetSpellInfo + TMW.GetSpellInfo = function(spellID) + if not spellID then + return nil; + end + local spellInfo = C_Spell_GetSpellInfo(spellID); + if spellInfo then + return spellInfo.name, nil, spellInfo.iconID, spellInfo.castTime, spellInfo.minRange, spellInfo.maxRange, spellInfo.spellID, spellInfo.originalIconID; + end + end +end +if C_Spell.GetSpellName then + TMW.GetSpellName = C_Spell.GetSpellName +else + TMW.GetSpellName = GetSpellInfo +end +local GetSpellName = TMW.GetSpellName +if _G.GetSpellCooldown then + TMW.GetSpellCooldown = _G.GetSpellCooldown +else + local C_Spell_GetSpellCooldown = C_Spell.GetSpellCooldown + TMW.GetSpellCooldown = function(spellID) + local spellCooldownInfo = C_Spell_GetSpellCooldown(spellID); + if spellCooldownInfo then + return spellCooldownInfo.startTime, spellCooldownInfo.duration, spellCooldownInfo.isEnabled, spellCooldownInfo.modRate; + end + end +end +local GetSpellCooldown = TMW.GetSpellCooldown + --------------------------------- -- Caches --------------------------------- @@ -433,19 +464,19 @@ end}) TMW.SpellTexturesMetaIndex = {} -if GetSpellInfo(336126) then +if GetSpellName(336126) then --hack for pvp tinkets TMW.SpellTexturesMetaIndex[336126] = GetSpellTexture(336126) - TMW.SpellTexturesMetaIndex[strlowerCache[GetSpellInfo(336126)]] = GetSpellTexture(336126) + TMW.SpellTexturesMetaIndex[strlowerCache[GetSpellName(336126)]] = GetSpellTexture(336126) end local SpellTexturesMetaIndex = TMW.SpellTexturesMetaIndex -local avengingWrathName = GetSpellInfo(31884) +local avengingWrathName = GetSpellName(31884) function TMW.GetSpellTexture(spell) if not spell then return end local spellTex = GetSpellTexture(spell) - if spellTex and (spellTex ~= 135875 or GetSpellInfo(spell) == avengingWrathName) then + if spellTex and (spellTex ~= 135875 or GetSpellName(spell) == avengingWrathName) then -- Workaround https://github.com/ascott18/TellMeWhen/issues/2114 - -- don't return avenging wrath texture if the input wasn't the avenging wrath spell. return spellTex