Quantcast

- Updates for API changes - C_Container

urnati [08-19-23 - 20:31]
- Updates for API changes - C_Container
Filename
TitanClassicBag/TitanClassicBag.lua
TitanClassicLootType/TitanClassicLootType.lua
TitanClassicRepair/TitanClassicRepair.lua
diff --git a/TitanClassicBag/TitanClassicBag.lua b/TitanClassicBag/TitanClassicBag.lua
index 0d7e2c9..b24013d 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,8 +399,8 @@ 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))
 				or TitanUtils_GetHighlightText(L["TITAN_BAG_BACKPACK"]).. FONT_COLOR_CODE_CLOSE;
diff --git a/TitanClassicLootType/TitanClassicLootType.lua b/TitanClassicLootType/TitanClassicLootType.lua
index 2c2ae08..593023e 100644
--- a/TitanClassicLootType/TitanClassicLootType.lua
+++ b/TitanClassicLootType/TitanClassicLootType.lua
@@ -775,7 +775,7 @@ function Track.Init()
 	Track.allRolled = false

 --	TitanPanelLootTypeMainWindow:SetMinResize(194,170)
-	TitanPanelLootTypeMainWindow:SetMinResize(225,250)
+--	TitanPanelLootTypeMainWindow:SetMinResize(225,250)
 	local x, y, w, h = Track.DB.X, Track.DB.Y, Track.DB.Width, Track.DB.Height
 	if not x or not y or not w or not h then
 		Track.SaveAnchors()
diff --git a/TitanClassicRepair/TitanClassicRepair.lua b/TitanClassicRepair/TitanClassicRepair.lua
index b6aeb9d..77eedd5 100644
--- a/TitanClassicRepair/TitanClassicRepair.lua
+++ b/TitanClassicRepair/TitanClassicRepair.lua
@@ -108,7 +108,6 @@ function TitanPanelRepairButton_OnLoad(self)
 			DiscountHonored = false,
 			DiscountPVP = false,
 			DiscountCombined = false,
-			DiscountExalted = false,
 			ShowPercentage = false,
 			ShowColoredText = false,
 			ShowInventory = false,
@@ -474,7 +473,7 @@ function TitanRepair_GetInventoryInformation(bag)
 	TPR.INVENTORY_STATUS[bag].values.val = 0
 	TPR.INVENTORY_STATUS[bag].values.max = 0
 	TPR.INVENTORY_STATUS[bag].values.cost = 0
-	for slot = 1, GetContainerNumSlots(bag) do
+	for slot = 1, C_Container.GetContainerNumSlots(bag) do
 		-- retrieve item repair status of this slot in the bag
 		local act_status, act_val, act_max, act_cost = TitanRepair_GetStatus(slot, bag);
 		if act_max ~= 0 then
@@ -610,7 +609,7 @@ function TitanRepair_GetStatus(index, bag)

 	if (bag) then
 		_, repairCost = TitanRepairTooltip:SetBagItem(bag, index)
-		curDurability, maxDurability = GetContainerItemDurability(bag, index)
+		curDurability, maxDurability = C_Container.GetContainerItemDurability(bag, index)
 	else
 --		local slotName = TPR.ITEM_STATUS[index].slot.."Slot"
 		--tit_debug_bis("_GetStatus index="..index..", slotName="..(slotName or "NIL"))
@@ -1454,7 +1453,7 @@ function TitanRepair_GetRepairInvCost()
 	TitanRepairTooltip:SetOwner(UIParent, "ANCHOR_NONE");

 	for bag = 0, 4 do
-		for slot = 1, GetContainerNumSlots(bag) do
+		for slot = 1, C_Container.GetContainerNumSlots(bag) do
 			local _, repairCost = TitanRepairTooltip:SetBagItem(bag, slot);
 			if (repairCost and (repairCost > 0)) then
 				result = result + repairCost;