Skip to content

Commit

Permalink
C_Item scope depreciations
Browse files Browse the repository at this point in the history
Wutname1 committed Jun 1, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent dd5c5b3 commit 1a53bbb
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Core/Framework.lua
Original file line number Diff line number Diff line change
@@ -1709,7 +1709,7 @@ function SUI:GetiLVL(itemLink)

local scanningTooltip = CreateFrame('GameTooltip', 'AutoTurnInTooltip', nil, 'GameTooltipTemplate')
local itemLevelPattern = ITEM_LEVEL:gsub('%%d', '(%%d+)')
local itemQuality = select(3, GetItemInfo(itemLink))
local itemQuality = select(3, C_Item.GetItemInfo(itemLink))

-- if a heirloom return a huge number so we dont replace it.
if itemQuality == 7 then return math.huge end
12 changes: 6 additions & 6 deletions Modules/AutoSell.lua
Original file line number Diff line number Diff line change
@@ -221,7 +221,7 @@ local function BuildOptions()
eventFrame:RegisterEvent('GET_ITEM_INFO_RECEIVED')
eventFrame:SetScript('OnEvent', function(_, event, itemID, success)
if event == 'GET_ITEM_INFO_RECEIVED' and success then
local itemName, itemLink = GetItemInfo(itemID)
local itemName, itemLink = C_Item.GetItemInfo(itemID)
if itemLink then
itemCache[itemID] = itemLink
-- Call buildItemList with the current mode to refresh the list
@@ -246,7 +246,7 @@ local function BuildOptions()
label = itemLink .. ' (' .. entry .. ')'
else
-- Request item info which may return nil initially
local itemName, itemLink = GetItemInfo(entry)
local itemName, itemLink = C_Item.GetItemInfo(entry)
if itemLink then
-- If the item link is available, use it
label = itemLink .. ' (' .. entry .. ')'
@@ -381,7 +381,7 @@ local function BuildOptions()
return
end
--Check that the inputted nmumber is a valid item
local itemLink = GetItemInfo(itemID)
local itemLink = C_Item.GetItemInfo(itemID)
if not itemLink then
SUI:Print('Could not load item ID: ' .. input .. ' this can happen if the item is not in your cache, please try again in a few seconds.')
return
@@ -457,7 +457,7 @@ end

function module:IsSellable(item, ilink, bag, slot)
if not item then return false end
local name, _, quality, _, _, itemType, itemSubType, _, equipSlot, _, vendorPrice, _, _, _, expacID, _, isCraftingReagent = GetItemInfo(ilink)
local name, _, quality, _, _, itemType, itemSubType, _, equipSlot, _, vendorPrice, _, _, _, expacID, _, isCraftingReagent = C_Item.GetItemInfo(ilink)
if vendorPrice == 0 or name == nil then return false end
-- 0. Poor (gray): Broken I.W.I.N. Button
-- 1. Common (white): Archmage Vargoth's Staff
@@ -534,10 +534,10 @@ function module:SellTrash()
local itemInfo, _, _, _, _, _, link, _, _, itemID = C_Container.GetContainerItemInfo(bag, slot)
if SUI.IsRetail and itemInfo and module:IsSellable(itemInfo.itemID, itemInfo.hyperlink, bag, slot) then
ItemToSell[#ItemToSell + 1] = { bag, slot }
totalValue = totalValue + (select(11, GetItemInfo(itemInfo.itemID)) * itemInfo.stackCount)
totalValue = totalValue + (select(11, C_Item.GetItemInfo(itemInfo.itemID)) * itemInfo.stackCount)
elseif not SUI.IsRetail and module:IsSellable(itemID, link, bag, slot) then
ItemToSell[#ItemToSell + 1] = { bag, slot }
totalValue = totalValue + (select(11, GetItemInfo(itemID)) * select(2, C_Container.GetContainerItemInfo(bag, slot)))
totalValue = totalValue + (select(11, C_Item.GetItemInfo(itemID)) * select(2, C_Container.GetContainerItemInfo(bag, slot)))
end
end
end
6 changes: 3 additions & 3 deletions Modules/AutoTurnIn.lua
Original file line number Diff line number Diff line change
@@ -329,7 +329,7 @@ end
function module:EquipItem(ItemToEquip)
if InCombatLockdown() then return end

local EquipItemName = GetItemInfo(ItemToEquip)
local EquipItemName = C_Item.GetItemInfo(ItemToEquip)
local EquipILvl = GetDetailedItemLevelInfo(ItemToEquip)
local ItemFound = false

@@ -339,7 +339,7 @@ function module:EquipItem(ItemToEquip)
for slot = 1, GetContainerNumSlots(bag), 1 do
local link = GetContainerItemLink(bag, slot)
if link then
local slotItemName = GetItemInfo(link)
local slotItemName = C_Item.GetItemInfo(link)
local SlotILvl = GetDetailedItemLevelInfo(link)
if (slotItemName == EquipItemName) and (SlotILvl == EquipILvl) then
if IsMerchantOpen then
@@ -403,7 +403,7 @@ function module.QUEST_COMPLETE()
local link = GetQuestItemLink('choice', i)
debug(link)
if link == nil then return end
local itemName, _, _, _, _, _, _, _, itemEquipLoc, _, itemSellPrice = GetItemInfo(link)
local itemName, _, _, _, _, _, _, _, itemEquipLoc, _, itemSellPrice = C_Item.GetItemInfo(link)
local QuestItemTrueiLVL = SUI:GetiLVL(link) or 0

-- Check the items value
2 changes: 1 addition & 1 deletion Modules/ImprovedCharacterScreen.lua
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ local function UpdateSpellFlyout(button)
if not item or item:IsItemEmpty() then return end

item:ContinueOnItemLoad(function()
local _, _, _, _, _, itemClass, itemSubClass = GetItemInfoInstant(item:GetItemID())
local _, _, _, _, _, itemClass, itemSubClass = C_Item.GetItemInfoInstant(item:GetItemID())
if not (itemClass == Enum.ItemClass.Weapon or itemClass == Enum.ItemClass.Armor or (itemClass == Enum.ItemClass.Gem and itemSubClass == Enum.ItemGemSubclass.Artifactrelic)) then return end
local quality = item:GetItemQuality()
addiLvlDisplay(button, item:GetCurrentItemLevel(), quality)
4 changes: 2 additions & 2 deletions Modules/Tooltips.lua
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ local TooltipSetItem = function(tooltip, tooltipData)
end

if itemLink then
local quality = select(3, GetItemInfo(itemLink))
local quality = select(3, C_Item.GetItemInfo(itemLink))
local style = {
bgFile = 'Interface/Tooltips/UI-Tooltip-Background',
}
@@ -238,7 +238,7 @@ local TooltipSetItem = function(tooltip, tooltipData)
end

if SUI.IsClassic and module.DB.VendorPrices then
local _, _, _, _, _, _, _, itemStackCount, _, _, itemSellPrice = GetItemInfo(itemLink)
local _, _, _, _, _, _, _, itemStackCount, _, _, itemSellPrice = C_Item.GetItemInfo(itemLink)
if itemSellPrice then
SetTooltipMoney(tooltip, itemSellPrice, 'STATIC', L['Vendors for:'])
local itemUnderMouse = GetMouseFocus()
6 changes: 3 additions & 3 deletions libs/StdUi/widgets/Autocomplete.lua
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ StdUi.Util.autocompleteItemTransformer = function(_, value)
return value;
end

local itemName = GetItemInfo(value);
local itemName = C_Item.GetItemInfo(value);
return itemName;
end

@@ -34,12 +34,12 @@ StdUi.Util.autocompleteItemValidator = function(ac)

if tonumber(t) ~= nil then
-- it's a number
itemName = GetItemInfo(tonumber(t));
itemName = C_Item.GetItemInfo(tonumber(t));
if itemName then
itemId = tonumber(t);
end
elseif v then
itemName = GetItemInfo(v);
itemName = C_Item.GetItemInfo(v);
if itemName == t then
itemId = v;
end

0 comments on commit 1a53bbb

Please sign in to comment.