Skip to content

Commit

Permalink
fix: handle more 11.0 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Jun 22, 2024
1 parent 4dd80ed commit c182ba6
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 27 deletions.
10 changes: 7 additions & 3 deletions Components/Core/Common/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ local TMW = TMW
local L = TMW.L
local print = TMW.print

local IsEquippedItem, GetItemCount, GetItemInfo, GetItemIcon, IsItemInRange
= IsEquippedItem, GetItemCount, GetItemInfo, GetItemIcon, IsItemInRange
local GetInventoryItemTexture, GetInventoryItemCooldown, GetInventoryItemID, GetInventoryItemLink
= GetInventoryItemTexture, GetInventoryItemCooldown, GetInventoryItemID, GetInventoryItemLink
local tonumber, type, pairs, strfind, strmatch, ipairs, strtrim, error
= tonumber, type, pairs, strfind, strmatch, ipairs, strtrim, error

local GetItemCooldown = GetItemCooldown or (C_Container and C_Container.GetItemCooldown)
local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)
local IsEquippedItem = IsEquippedItem or (C_Item and C_Item.IsEquippedItem)
local GetItemCount = GetItemCount or (C_Item and C_Item.GetItemCount)
local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)
local IsItemInRange = IsItemInRange or (C_Item and C_Item.IsItemInRange)
local GetItemCooldown = GetItemCooldown or (C_Item and C_Item.GetItemCooldown) or (C_Container and C_Container.GetItemCooldown)
local GetItemSpell = GetItemSpell or (C_Item and C_Item.GetItemSpell)

local INVSLOT_LAST_EQUIPPED = INVSLOT_LAST_EQUIPPED

Expand Down
2 changes: 1 addition & 1 deletion Components/Core/Conditions/Categories/Spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Env.GetSpellCooldown = GetSpellCooldown
local GetSpellName = TMW.GetSpellName
local GetSpellInfo = TMW.GetSpellInfo

local GetItemCooldown = GetItemCooldown or (C_Container and C_Container.GetItemCooldown)
local GetItemCooldown = GetItemCooldown or (C_Item and C_Item.GetItemCooldown) or (C_Container and C_Container.GetItemCooldown)

function Env.CooldownDuration(spell, gcdAsUnusable)
if spell == "gcd" then
Expand Down
1 change: 1 addition & 0 deletions Components/Core/Spells/ItemCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local currentTimestamp = time()

local doUpdateCache = true

local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)
local GetContainerNumSlots = C_Container and C_Container.GetContainerNumSlots or GetContainerNumSlots
local GetContainerItemID = C_Container and C_Container.GetContainerItemID or GetContainerItemID
local GetContainerItemLink = C_Container and C_Container.GetContainerItemLink or GetContainerItemLink
Expand Down
5 changes: 3 additions & 2 deletions Components/Core/Suggester/Suggester.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,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 GetItemInfo, GetItemIcon =
GetItemInfo, GetItemIcon

local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)
local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)


-- GLOBALS: GameTooltip, GameTooltip_SetDefaultAnchor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ local TMW = TMW
local L = TMW.L
local print = TMW.print

local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)
local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)

local SUG = TMW.SUG

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
end)


local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)
local GetSpellBookItemInfo = TMW.GetSpellBookItemInfo
function self:DragReceived(icon, t, data, subType)
local ics = icon:GetSettings()
Expand Down
5 changes: 3 additions & 2 deletions Components/IconTypes/IconType_cleu/cleu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ local print = TMW.print
local _G = _G
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 UnitGUID, CombatLogGetCurrentEventInfo =
UnitGUID, CombatLogGetCurrentEventInfo

local GetSpellInfo = TMW.GetSpellInfo
local GetSpellTexture = TMW.GetSpellTexture
local GetSpellLink = C_Spell and C_Spell.GetSpellLink or GetSpellLink
local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)

local pGUID = nil -- This can't be defined at load.
local clientVersion = select(4, GetBuildInfo())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ if not TMW then return end
local L = TMW.L

local print = TMW.print
local GetItemIcon =
GetItemIcon

local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)
local GetSpellBookItemInfo = TMW.GetSpellBookItemInfo

local Type = TMW.Classes.IconType:New("conditionicon")
Expand Down
3 changes: 1 addition & 2 deletions Components/IconTypes/IconType_item/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ local L = TMW.L
local print = TMW.print
local pairs, ipairs =
pairs, ipairs
local GetItemInfo =
GetItemInfo

local OnGCD = TMW.OnGCD
local GetSpellTexture = TMW.GetSpellTexture
local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ if not TMW then return end
local L = TMW.L

local print = TMW.print
local GetItemIcon =
GetItemIcon

local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)
local GetSpellBookItemInfo = TMW.GetSpellBookItemInfo

local Type = TMW.Classes.IconType:New("unitcondition")
Expand Down
2 changes: 2 additions & 0 deletions Components/IconTypes/IconType_wpnenchant/Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ local print = TMW.print
local SUG = TMW.SUG
local strlowerCache = TMW.strlowerCache
local GetSpellTexture = TMW.GetSpellTexture
local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)
local GetItemIcon = GetItemIcon or (C_Item and C_Item.GetItemIcon)

local Type = rawget(TMW.Types, "wpnenchant")

Expand Down
6 changes: 4 additions & 2 deletions Components/IconTypes/IconType_wpnenchant/wpnenchant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ local L = TMW.L
local print = TMW.print
local _G, strmatch, strtrim, select, floor, ceil, pairs, wipe, type, max =
_G, strmatch, strtrim, select, floor, ceil, pairs, wipe, type, max
local GetInventoryItemTexture, GetInventorySlotInfo, GetInventoryItemID, GetItemInfo, GetWeaponEnchantInfo =
GetInventoryItemTexture, GetInventorySlotInfo, GetInventoryItemID, GetItemInfo, GetWeaponEnchantInfo
local GetInventoryItemTexture, GetInventorySlotInfo, GetInventoryItemID, GetWeaponEnchantInfo =
GetInventoryItemTexture, GetInventorySlotInfo, GetInventoryItemID, GetWeaponEnchantInfo

local GetItemInfo = GetItemInfo or (C_Item and C_Item.GetItemInfo)

local strlowerCache = TMW.strlowerCache

Expand Down
22 changes: 11 additions & 11 deletions TellMeWhen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1106,17 +1106,17 @@ function TMW:PLAYER_LOGIN()
TMW:UnregisterEvent("PLAYER_LOGIN")
TMW.PLAYER_LOGIN = nil

if not LibStub("DRList-1.0", true) then
StaticPopupDialogs["TMW_RESTARTNEEDED"] = {
text = L["ERROR_MISSINGFILE_NOREQ"],
button1 = OKAY,
timeout = 0,
showAlert = true,
whileDead = true,
preferredIndex = 3, -- http://forums.wowace.com/showthread.php?p=320956
}
StaticPopup_Show("TMW_RESTARTNEEDED", TELLMEWHEN_VERSION_FULL, "TellMeWhen/Lib/DRList-1.0/DRList-1.0.lua") -- arg3 could also be L["ERROR_MISSINGFILE_REQFILE"]
end
-- if not LibStub("DRList-1.0", true) then
-- StaticPopupDialogs["TMW_RESTARTNEEDED"] = {
-- text = L["ERROR_MISSINGFILE_NOREQ"],
-- button1 = OKAY,
-- timeout = 0,
-- showAlert = true,
-- whileDead = true,
-- preferredIndex = 3, -- http://forums.wowace.com/showthread.php?p=320956
-- }
-- StaticPopup_Show("TMW_RESTARTNEEDED", TELLMEWHEN_VERSION_FULL, "TellMeWhen/Lib/DRList-1.0/DRList-1.0.lua") -- arg3 could also be L["ERROR_MISSINGFILE_REQFILE"]
-- end



Expand Down

0 comments on commit c182ba6

Please sign in to comment.