From cdc6cb9d1c65f8788cf6ab551c426ebc638687d0 Mon Sep 17 00:00:00 2001 From: Ilya Danilkin Date: Sat, 23 Sep 2023 12:44:53 +0400 Subject: [PATCH] Fix addon for latest Era patch --- .gitignore | 1 + Libraries/MC2ItemStatsLib/MC2ItemStatsLib.lua | 2 +- Libraries/Vanilla-C_Container.lua | 24 ------------------- Libraries/Vanilla-C_Minimap.lua | 8 ------- OutfitterBar.lua | 2 +- OutfitterInventory.lua | 3 ++- OutfitterOutfits.lua | 2 +- 7 files changed, 6 insertions(+), 36 deletions(-) create mode 100644 .gitignore delete mode 100644 Libraries/Vanilla-C_Container.lua delete mode 100644 Libraries/Vanilla-C_Minimap.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..722d5e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode diff --git a/Libraries/MC2ItemStatsLib/MC2ItemStatsLib.lua b/Libraries/MC2ItemStatsLib/MC2ItemStatsLib.lua index f814b9f..e03e965 100644 --- a/Libraries/MC2ItemStatsLib/MC2ItemStatsLib.lua +++ b/Libraries/MC2ItemStatsLib/MC2ItemStatsLib.lua @@ -92,7 +92,7 @@ function Addon.ItemStatsLib._Stats:setToBagItem(bag, slot) local stats = Addon.TooltipLib:StatsForBagItem(bag, slot) self:setTooltipStats(stats) - local link = GetContainerItemLink(bag, slot) + local link = C_Container.GetContainerItemLink(bag, slot) self:setInfoFromLink(link) end diff --git a/Libraries/Vanilla-C_Container.lua b/Libraries/Vanilla-C_Container.lua deleted file mode 100644 index 0ab45bf..0000000 --- a/Libraries/Vanilla-C_Container.lua +++ /dev/null @@ -1,24 +0,0 @@ -if C_Container == nil then - C_Container = {} - ----[[ - -- Create an autoload function that will try to call the global namespace - setmetatable(C_Container, {__index = function (t, funcname, args) return _G[funcname] end } ) - --]] - function C_Container.GetContainerItemInfo(bagIndex, slotIndex) - icon, itemCount, locked, quality, readable, lootable, itemLink, isFiltered, noValue, itemID, isBound = GetContainerItemInfo(bagIndex, slotIndex) - containerItemInfo = { - ["iconFileID"] = icon, - ["stackCount"] = itemCount, - ["isLocked"] = locked, - ["quality"] = quality, - ["isReadable"] = readable, - ["hasLoot"] = lootable, - ["hyperlink"] = itemLink, - ["isFiltered"] = isFiltered, - ["hasNoValue"] = noValue, - ["itemID"] = itemID, - ["isBound"] = isBound - }; - return containerItemInfo - end -end \ No newline at end of file diff --git a/Libraries/Vanilla-C_Minimap.lua b/Libraries/Vanilla-C_Minimap.lua deleted file mode 100644 index 3b8ef3a..0000000 --- a/Libraries/Vanilla-C_Minimap.lua +++ /dev/null @@ -1,8 +0,0 @@ -if C_Minimap == nil then - C_Minimap = {} - setmetatable(C_Minimap, {__index = function (t, funcname, args) return _G[funcname] end } ) - function C_Minimap.SetTracking(vIndex, pEnabled) - -- pEnabled was sometimes set to 1 instead of true. This forces true/false - return SetTracking(vIndex, pEnabled == true or pEnabled == 1) - end -end \ No newline at end of file diff --git a/OutfitterBar.lua b/OutfitterBar.lua index 119543a..0206771 100644 --- a/OutfitterBar.lua +++ b/OutfitterBar.lua @@ -440,7 +440,7 @@ function Outfitter.OutfitBar:GetCursorTexture() local vItemLink = C_Container.GetContainerItemLink(vBagIndex, vBagSlotIndex) if vItemLink == vParam2 then - local itemInfo = C_Containeer.GetContainerItemInfo(vBagIndex, vBagSlotIndex) + local itemInfo = C_Container.GetContainerItemInfo(vBagIndex, vBagSlotIndex) local vTexture = itemInfo.iconFileID return vTexture diff --git a/OutfitterInventory.lua b/OutfitterInventory.lua index 8c81bff..96612d0 100644 --- a/OutfitterInventory.lua +++ b/OutfitterInventory.lua @@ -21,7 +21,8 @@ function Outfitter:FindNextCooldownItem(pItemCodes, pIgnoreSwapCooldown) local vStart, vDuration, vEnabled if vItemInfo.Location.BagIndex then - vStart, vDuration, vEnabled = GetContainerItemCooldown(vItemInfo.Location.BagIndex, vItemInfo.Location.BagSlotIndex) + vStart, vDuration, vEnabled = C_Container.GetContainerItemCooldown(vItemInfo.Location.BagIndex, + vItemInfo.Location.BagSlotIndex) elseif vItemInfo.Location.SlotID then vStart, vDuration, vEnabled = GetInventoryItemCooldown("player", vItemInfo.Location.SlotID) end diff --git a/OutfitterOutfits.lua b/OutfitterOutfits.lua index 2fa77a3..464b329 100644 --- a/OutfitterOutfits.lua +++ b/OutfitterOutfits.lua @@ -747,7 +747,7 @@ end function Outfitter:DumpEMOutfitLocations(pName) local equipmentSetID = C_EquipmentSet.GetEquipmentSetID(pName) local vLocations = C_EquipmentSet.GetItemLocations(equipmentSetID) - local vIgnoreSlots = GetEquipmentSetIgnoreSlots(pName) + local vIgnoreSlots = C_EquipmentSet.GetIgnoredSlots(pName) self:DebugTable(vLocations, "Locations") self:DebugTable(vIgnoreSlots, "IgnoreSlots")