Skip to content

Commit

Permalink
Phase 2, Wrath Classic 3.4.1 initial compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Road-block authored and Rottenbeer committed Jan 19, 2023
1 parent eea9a4a commit 8273a70
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 15 deletions.
20 changes: 20 additions & 0 deletions ItemRack/ItemRack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions ItemRack/ItemRack.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 19 additions & 0 deletions ItemRack/ItemRackEquip.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 19 additions & 9 deletions ItemRackOptions/ItemRackOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ItemRackOptions/ItemRackOptions.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion ItemRackOptions/ItemRackOptions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3302,7 +3302,11 @@
</Frames>
<Scripts>
<OnLoad>
self:SetMinResize(250,110)
if self.SetMinResize then
self:SetMinResize(250,110)
elseif self.SetResizeBounds then
self:SetResizeBounds(250,110)
end
</OnLoad>
<OnMouseDown>
self:StartMoving()
Expand Down

0 comments on commit 8273a70

Please sign in to comment.