Skip to content

Commit

Permalink
Update C_Item deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
raethkcj committed May 7, 2024
1 parent 12ff558 commit 3384e66
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion RatingBuster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3337,7 +3337,7 @@ end

function RatingBuster:StatSummary(tooltip, link)
-- Hide stat summary for equipped items
if db.global.sumIgnoreEquipped and IsEquippedItem(link) then return end
if db.global.sumIgnoreEquipped and C_Item.IsEquippedItem(link) then return end

-- Show stat summary only for highest level armor type and items you can use with uncommon quality and up
if db.global.sumIgnoreUnused then
Expand Down
8 changes: 4 additions & 4 deletions libs/StatLogic/StatLogic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ do
local function update_armor_slot(slot)
-- Set slot's bit to 0 if correct, else 1
local item = GetInventoryItemID("player", slot)
if item and select(7, GetItemInfoInstant(item)) == class_armor_specs[addon.class] then
if item and select(7, C_Item.GetItemInfoInstant(item)) == class_armor_specs[addon.class] then
armor_bits = bit.band(armor_bits, bit.bnot(bit.lshift(1, slot - 1)))
else
armor_bits = bit.bor(armor_bits, bit.lshift(1, slot - 1))
Expand Down Expand Up @@ -973,7 +973,7 @@ addon.StatModValidators = {
validate = function(case)
local weapon = GetInventoryItemID("player", 16)
if weapon then
local subclassID = select(7, GetItemInfoInstant(weapon))
local subclassID = select(7, C_Item.GetItemInfoInstant(weapon))
return subclassID and case.weapon[subclassID]
end
end,
Expand Down Expand Up @@ -1396,7 +1396,7 @@ do

function StatLogic:RemoveExtraSockets(link)
-- Only check belt, bracer and gloves
local itemEquipLoc = select(4, GetItemInfoInstant(link))
local itemEquipLoc = select(4, C_Item.GetItemInfoInstant(link))
if not extraSocketInvTypes[itemEquipLoc] then return link end

-- Count item's actual sockets
Expand Down Expand Up @@ -1515,7 +1515,7 @@ function StatLogic:GetGemID(item)
-- Scan tooltip for gem text
local gemScanLink = "item:6948:0:%d:0:0:0:0:0"
local itemLink = gemScanLink:format(itemID)
local _, gem1Link = GetItemGem(itemLink, 1)
local _, gem1Link = C_Item.GetItemGem(itemLink, 1)
if gem1Link then
tip:ClearLines() -- this is required or SetX won't work the second time its called
tip:SetHyperlink(itemLink);
Expand Down
8 changes: 4 additions & 4 deletions libs/StatLogic/locales/GlobalPatterns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ local exclusions = {
ITEM_DISENCHANT_NOT_DISENCHANTABLE,
ITEM_REQ_HORDE,
ITEM_REQ_ALLIANCE,
GetItemClassInfo(Enum.ItemClass.Projectile),
C_Item.GetItemClassInfo(Enum.ItemClass.Projectile),
INVTYPE_AMMO,
INVTYPE_HEAD,
INVTYPE_NECK,
Expand Down Expand Up @@ -84,16 +84,16 @@ local exclusions = {
ITEM_QUALITY5_DESC,
ITEM_QUALITY6_DESC,
ITEM_QUALITY7_DESC,
GetItemSubClassInfo(Enum.ItemClass.Weapon, Enum.ItemWeaponSubclass.Thrown),
GetItemSubClassInfo(Enum.ItemClass.Miscellaneous, Enum.ItemMiscellaneousSubclass.Mount)
C_Item.GetItemSubClassInfo(Enum.ItemClass.Weapon, Enum.ItemWeaponSubclass.Thrown),
C_Item.GetItemSubClassInfo(Enum.ItemClass.Miscellaneous, Enum.ItemMiscellaneousSubclass.Mount)
}

for _, exclusion in pairs(exclusions) do
W[exclusion] = false
end

for _, subclass in pairs(Enum.ItemArmorSubclass) do
local subclassName = GetItemSubClassInfo(Enum.ItemClass.Armor, subclass)
local subclassName = C_Item.GetItemSubClassInfo(Enum.ItemClass.Armor, subclass)
if subclassName then
W[subclassName] = false
end
Expand Down

0 comments on commit 3384e66

Please sign in to comment.