diff --git a/ItemRack/ItemRack.lua b/ItemRack/ItemRack.lua index 1b76100..76d0929 100644 --- a/ItemRack/ItemRack.lua +++ b/ItemRack/ItemRack.lua @@ -17,6 +17,26 @@ function ItemRack.IsWrath() return WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC end +local GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem +if C_Container then + GetContainerNumSlots = C_Container.GetContainerNumSlots + GetContainerItemLink = C_Container.GetContainerItemLink + GetContainerItemCooldown = C_Container.GetContainerItemCooldown + GetItemCooldown = C_Container.GetItemCooldown + PickupContainerItem = C_Container.PickupContainerItem + GetContainerItemInfo = function(bag, slot) + local info = C_Container.GetContainerItemInfo(bag, slot) + if info then + return info.iconFileID, info.stackCount, info.isLocked, info.quality, info.isReadable, info.hasLoot, info.hyperlink, info.isFiltered, info.hasNoValue, info.itemID, info.isBound + else + return + end + end +else + GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem = + GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem +end + local LDB = LibStub("LibDataBroker-1.1") local LDBIcon = LibStub("LibDBIcon-1.0") diff --git a/ItemRack/ItemRack.toc b/ItemRack/ItemRack.toc index 70e892f..5cbc4f2 100644 --- a/ItemRack/ItemRack.toc +++ b/ItemRack/ItemRack.toc @@ -1,9 +1,9 @@ -## Interface: 30400 +## Interface: 30401 ## Interface-Classic: 11403 ## Interface-BCC: 20504 -## Interface-WOTLKC: 30400 +## Interface-WOTLKC: 30401 ## Title: ItemRack - Classic -## Version: 2.74 +## Version: 2.75 ## Author: Gello - Updated for Classic by Rottenbeer,Roadblock ## SavedVariables: ItemRackSettings, ItemRackItems, ItemRackEvents ## SavedVariablesPerCharacter: ItemRackUser diff --git a/ItemRack/ItemRackEquip.lua b/ItemRack/ItemRackEquip.lua index 3602c7c..027243d 100644 --- a/ItemRack/ItemRackEquip.lua +++ b/ItemRack/ItemRackEquip.lua @@ -1,4 +1,23 @@ -- ItemRackEquip.lua : ItemRack.EquipSet and its supporting functions. +local GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem +if C_Container then + GetContainerNumSlots = C_Container.GetContainerNumSlots + GetContainerItemLink = C_Container.GetContainerItemLink + GetContainerItemCooldown = C_Container.GetContainerItemCooldown + GetItemCooldown = C_Container.GetItemCooldown + PickupContainerItem = C_Container.PickupContainerItem + GetContainerItemInfo = function(bag, slot) + local info = C_Container.GetContainerItemInfo(bag, slot) + if info then + return info.iconFileID, info.stackCount, info.isLocked, info.quality, info.isReadable, info.hasLoot, info.hyperlink, info.isFiltered, info.hasNoValue, info.itemID, info.isBound + else + return + end + end +else + GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem = + GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem +end ItemRack.SwapList = {} -- table of item ids that want to swap in, indexed by slot ItemRack.AbortSwap = nil -- reasons: 1=not enough room, 2=item on cursor, 3=in spell targeting mode, 4=item lock diff --git a/ItemRackOptions/ItemRackOptions.lua b/ItemRackOptions/ItemRackOptions.lua index 8bbdba8..f823ec8 100644 --- a/ItemRackOptions/ItemRackOptions.lua +++ b/ItemRackOptions/ItemRackOptions.lua @@ -362,15 +362,25 @@ function ItemRackOpt.PopulateInitialIcons() ItemRackOpt.PopulateInvIcons() table.insert(ItemRackOpt.Icons,"Interface\\Icons\\INV_Banner_02") table.insert(ItemRackOpt.Icons,"Interface\\Icons\\INV_Banner_03") - RefreshPlayerSpellIconInfo() - local numMacros = #GetMacroIcons(MACRO_ICON_FILENAMES) - local texture - for i=1,numMacros do - texture = GetSpellorMacroIconInfo(i) - if(type(texture) == "number") then - table.insert(ItemRackOpt.Icons,texture) - else - table.insert(ItemRackOpt.Icons,"Interface\\Icons\\"..texture) + if RefreshPlayerSpellIconInfo then + RefreshPlayerSpellIconInfo() + local numMacros = #GetMacroIcons(MACRO_ICON_FILENAMES) + local texture + for i=1,numMacros do + texture = GetSpellorMacroIconInfo(i) + if(type(texture) == "number") then + table.insert(ItemRackOpt.Icons,texture) + else + table.insert(ItemRackOpt.Icons,"Interface\\Icons\\"..texture) + end + end + elseif IconDataProviderMixin then + local iconProvider = CreateAndInitFromMixin(IconDataProviderMixin, IconDataProviderExtraType.Spell) + if iconProvider then + for i=1, iconProvider:GetNumIcons() do + table.insert(ItemRackOpt.Icons, iconProvider:GetIconByIndex(i)) + end + iconProvider:Release() end end end diff --git a/ItemRackOptions/ItemRackOptions.toc b/ItemRackOptions/ItemRackOptions.toc index 111eb24..a74e0f6 100644 --- a/ItemRackOptions/ItemRackOptions.toc +++ b/ItemRackOptions/ItemRackOptions.toc @@ -1,7 +1,7 @@ -## Interface: 30400 +## Interface: 30401 ## Interface-Classic: 11403 ## Interface-BCC: 20504 -## Interface-WOTLKC: 30400 +## Interface-WOTLKC: 30401 ## Title: ItemRackOptions ## Notes: Load-On-Demand modules for ItemRack ## Dependencies: ItemRack, Blizzard_MacroUI diff --git a/ItemRackOptions/ItemRackOptions.xml b/ItemRackOptions/ItemRackOptions.xml index 672bafc..3575fd9 100644 --- a/ItemRackOptions/ItemRackOptions.xml +++ b/ItemRackOptions/ItemRackOptions.xml @@ -3302,7 +3302,11 @@ - self:SetMinResize(250,110) + if self.SetMinResize then + self:SetMinResize(250,110) + elseif self.SetResizeBounds then + self:SetResizeBounds(250,110) + end self:StartMoving()