- TitanClassicBag : Replaced GetContainer, ContainerIDToInventoryID and GetBagName calls with C_Container.GetContainer calls.
HonorGoG [01-18-23 - 03:01]
- TitanClassicBag : Replaced GetContainer, ContainerIDToInventoryID and GetBagName calls with C_Container.GetContainer calls.
diff --git a/TitanClassicBag/TitanClassicBag.lua b/TitanClassicBag/TitanClassicBag.lua
index 0d7e2c9..6540133 100644
--- a/TitanClassicBag/TitanClassicBag.lua
+++ b/TitanClassicBag/TitanClassicBag.lua
@@ -170,8 +170,8 @@ end
--]]
local function CountMe(bag)
-- defaults as if bag does not exist
- local name = (GetBagName(bag) or "")
- local size = (GetContainerNumSlots(bag) or 0)
+ local name = (C_Container.GetBagName(bag) or "")
+ local size = (C_Container.GetContainerNumSlots(bag) or 0)
local bagType = ""
local color = {r=1,g=1,b=1} -- WHITE
local used = 0
@@ -219,7 +219,7 @@ local function CountMe(bag)
-- Collect the slots IF we should count it
if (countme) then
for slot = 1, size do
- if (GetContainerItemInfo(bag, slot)) then
+ if (C_Container.GetContainerItemInfo(bag, slot)) then
used = used + 1;
end
end
@@ -399,10 +399,10 @@ function TitanPanelBagButton_GetTooltipText()
end
for bag = 0, 4 do
- totalSlots = GetContainerNumSlots(bag) or 0;
- availableSlots = GetContainerNumFreeSlots(bag) or 0;
+ totalSlots = C_Container.GetContainerNumSlots(bag) or 0;
+ availableSlots = C_Container.GetContainerNumFreeSlots(bag) or 0;
usedSlots = totalSlots - availableSlots;
- local itemlink = bag > 0 and GetInventoryItemLink("player", ContainerIDToInventoryID(bag))
+ local itemlink = bag > 0 and GetInventoryItemLink("player", C_Container.ContainerIDToInventoryID(bag))
or TitanUtils_GetHighlightText(L["TITAN_BAG_BACKPACK"]).. FONT_COLOR_CODE_CLOSE;
if itemlink then
@@ -410,7 +410,7 @@ function TitanPanelBagButton_GetTooltipText()
itemlink = string.gsub( itemlink, "%]", "" );
end
- if bag > 0 and not GetInventoryItemLink("player", ContainerIDToInventoryID(bag)) then
+ if bag > 0 and not GetInventoryItemLink("player", C_Container.ContainerIDToInventoryID(bag)) then
itemlink = nil;
end