Skip to content

Commit

Permalink
fix: upgrade deprecated api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nulian committed Jun 6, 2024
1 parent 2771254 commit 6e02fde
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions Outfitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3661,7 +3661,7 @@ function Outfitter:GetBagType(pBagIndex)
return nil
end

return GetItemFamily(vItemLink)
return C_Item.GetItemFamily(vItemLink)
end

function Outfitter:GetEmptyBagSlot(pStartBagIndex, pStartBagSlotIndex, pIncludeBank)
Expand Down Expand Up @@ -4147,7 +4147,7 @@ function Outfitter:GetPlayerAuraStates()
end

while true do
local vName, _, vTexture, _, _, _, _, _, _, _, vSpellID = UnitBuff("player", vBuffIndex)
local vName, _, vTexture, _, _, _, _, _, _, _, vSpellID = C_UnitAuras.GetAuraDataByIndex("PLAYER", vBuffIndex)

if not vName then
return self.AuraStates
Expand Down Expand Up @@ -4465,7 +4465,7 @@ function Outfitter:GetCurrentZoneIDs(pRecycleTable)
vZoneSpecialIDMap = self.cZoneSpecialIDMap[GetRealZoneText()]
end

local vPVPType, vIsArena, vFactionName = GetZonePVPInfo()
local vPVPType, vIsArena, vFactionName = C_PvP.GetZonePVPInfo()

if vZoneSpecialIDMap then
for _, vZoneSpecialID in ipairs(vZoneSpecialIDMap) do
Expand Down Expand Up @@ -4656,7 +4656,7 @@ function Outfitter:Initialize()
end

-- Make sure they're not upgrading with a reloadui when there are new files
if tonumber(GetAddOnMetadata("Outfitter", "X-ReloadTag")) ~= 2 then
if tonumber(C_AddOns.GetAddOnMetadata("Outfitter", "X-ReloadTag")) ~= 2 then
OutfitterMinimapButton:Hide() -- Remove access to Outfitter so more errors don't start coming up
OutfitterButtonFrame:Hide()
StaticPopup_Show("OUTFITTER_CANT_RELOADUI")
Expand Down Expand Up @@ -7159,7 +7159,7 @@ function Outfitter:GenerateItemLink(pItem)
return
end

local _, _, vQuality = GetItemInfo(pItem.Code)
local _, _, vQuality = C_Item.GetItemInfo(pItem.Code)
if pItem.Quality then vQuality = pItem.Quality end
local _, _, _, vQualityColorCode = GetItemQualityColor(vQuality or 1)

Expand Down Expand Up @@ -7307,7 +7307,7 @@ function Outfitter._ExtendedCompareTooltip:ShowCompareItem()
vTooltipItemType,
vTooltipItemSubType,
vTooltipItemCount,
vTooltipItemInvType = GetItemInfo(vTooltipItemCodes[1])
vTooltipItemInvType = C_Item.GetItemInfo(vTooltipItemCodes[1])

if not vTooltipItemInvType or vTooltipItemType ~= "Armor" then
return
Expand Down
2 changes: 1 addition & 1 deletion Outfitter.toc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Interface: 100207
## Author: John Stephen
## Title: Outfitter
## Version: 10.2.7.0
## Version: 10.2.7.1
## Notes: Clothing and weapon management and automated equipment changes
## OptionalDeps:
## RequiredDeps:
Expand Down
2 changes: 1 addition & 1 deletion OutfitterBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function Outfitter.OutfitBar:GetOutfitTexture(pOutfit)
end

if vOutfitItem then
local vTexture = GetItemIcon(vOutfitItem.Code)
local vTexture = C_Item.GetItemIconByID(vOutfitItem.Code)

if vTexture then
return vTexture
Expand Down
12 changes: 6 additions & 6 deletions OutfitterInventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function Outfitter:FindNextCooldownItem(pItemCodes, pIgnoreSwapCooldown)

for _, vItemCode in ipairs(pItemCodes) do
if type(vItemCode) == "string" then
local vItemName, vItemLink = GetItemInfo(vItemCode)
local vItemName, vItemLink = C_Item.GetItemInfo(vItemCode)

if vItemLink then
vItemCode = self:ParseItemLink2(vItemLink)[1]
Expand Down Expand Up @@ -101,7 +101,7 @@ function Outfitter:GetBagItemInvType(bagIndex, slotIndex)
return
end

local _, _, _, _, _, _, _, _, itemInvType = GetItemInfo(itemLink)
local _, _, _, _, _, _, _, _, itemInvType = C_Item.GetItemInfo(itemLink)

return itemInvType
end
Expand Down Expand Up @@ -144,7 +144,7 @@ function Outfitter:GetBagItemBagType(pBagIndex, pSlotIndex)
return
end

return GetItemFamily(vItemCodes[1])
return C_Item.GetItemFamily(vItemCodes[1])
end

function Outfitter:GetSlotIDLinkInfo(pSlotID)
Expand All @@ -158,7 +158,7 @@ function Outfitter:GetSlotIDItemBagType(pSlotID)
return
end

return GetItemFamily(vItemCodes[1])
return C_Item.GetItemFamily(vItemCodes[1])
end

function Outfitter:ParseItemLink2(pItemLink)
Expand Down Expand Up @@ -248,7 +248,7 @@ function Outfitter._ItemInfo:GetItemInfoFromCode(itemCode)
itemType,
itemSubType,
itemCount,
itemInvType = GetItemInfo(itemCode)
itemInvType = C_Item.GetItemInfo(itemCode)

--

Expand Down Expand Up @@ -328,7 +328,7 @@ function Outfitter._ItemInfo:GetItemInfoFromLink(itemLink)
local _, _,
itemQuality,
itemLevel,
itemMinLevel = GetItemInfo(itemLink)
itemMinLevel = C_Item.GetItemInfo(itemLink)

self.Name = itemName
self.Link = itemLink
Expand Down
6 changes: 3 additions & 3 deletions OutfitterItemStats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ Outfitter._PawnScaleStatMetaTable = {__index = Outfitter._PawnScaleStat}
-- Install Pawn scales
----------------------------------------

if IsAddOnLoaded("Pawn") then
if C_AddOns.IsAddOnLoaded("Pawn") then
table.insert(Outfitter.StatCategories, Outfitter.PawnScalesCategory)
else
Outfitter.EventLib:RegisterEvent("ADDON_LOADED", function (pEventID, pAddOnName)
Expand Down Expand Up @@ -505,7 +505,7 @@ Outfitter._WeightsWatcherStatMetaTable = {__index = Outfitter._WeightsWatcherSta
-- Install WeightsWatcher
----------------------------------------

if IsAddOnLoaded("WeightsWatcher") then
if C_AddOns.IsAddOnLoaded("WeightsWatcher") then
table.insert(Outfitter.StatCategories, Outfitter.WeightsWatcherCategory)
else
Outfitter.EventLib:RegisterEvent("ADDON_LOADED", function (pEventID, pAddOnName)
Expand Down Expand Up @@ -595,7 +595,7 @@ end
-- Install TankPoints
----------------------------------------
--[[
if IsAddOnLoaded("TankPoints") then
if C_AddOns.IsAddOnLoaded("TankPoints") then
table.insert(Outfitter.StatCategories, Outfitter.TankPointsCategory)
else
Outfitter.EventLib:RegisterEvent("ADDON_LOADED", function (pEventID, pAddOnName)
Expand Down
2 changes: 1 addition & 1 deletion OutfitterScripting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ end
if select(1, ...) ~= "player" then return end
if UnitBuff("player", setting.buffName) then
if C_UnitAuras.GetAuraDataByIndex("PLAYER", setting.buffName) then
equip = true
end
Expand Down
2 changes: 1 addition & 1 deletion OutfitterStrings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Outfitter.cVersion = GetAddOnMetadata("Outfitter", "Version")
Outfitter.cVersion = C_AddOns.GetAddOnMetadata("Outfitter", "Version")

Outfitter.cTitle = "Outfitter"
Outfitter.cTitleVersion = Outfitter.cTitle.." "..Outfitter.cVersion
Expand Down

0 comments on commit 6e02fde

Please sign in to comment.