Skip to content

Commit

Permalink
Fixed missing reagent bank free space slot in retail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidan committed Mar 21, 2024
1 parent c4e8324 commit 975f2a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion data/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ function items:BankLoadFunction()
for bagid, bag in pairs(items.bankItemsByBagAndSlot) do
local name = ""
local freeSlots = C_Container.GetContainerNumFreeSlots(bagid)
if bagid == Enum.BagIndex.Bank then
if bagid == Enum.BagIndex.Bank or Enum.BagIndex.Reagentbank then
-- BugFix(https://github.com/Stanzilla/WoWUIBugs/issues/538):
-- There are 4 extra slots in the bank bag in Classic that should not
-- exist. This is a Blizzard bug.
Expand Down
23 changes: 16 additions & 7 deletions frames/section.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ local sectionProto = {}
---@param kind BagKind
---@param view BagView
---@param freeSpaceShown boolean
---@param nosort? boolean
---@return number width
---@return number height
function sectionProto:Draw(kind, view, freeSpaceShown)
return self:Grid(kind, view, freeSpaceShown)
function sectionProto:Draw(kind, view, freeSpaceShown, nosort)
return self:Grid(kind, view, freeSpaceShown, nosort)
end

-- SetTitle will set the title of the section.
Expand Down Expand Up @@ -139,6 +140,11 @@ function sectionProto:GetKeys()
return keys
end

---@return Cell[]|Item[]|Section[]
function sectionProto:GetRawCells()
return self.content.cells
end

function sectionProto:Release()
sectionFrame._pool:Release(self)
end
Expand All @@ -147,13 +153,16 @@ end
---@param kind BagKind
---@param view BagView
---@param freeSpaceShown boolean
---@param nosort? boolean
---@return number width
---@return number height
function sectionProto:Grid(kind, view, freeSpaceShown)
if freeSpaceShown then
self.content:Sort(sort.GetItemSortBySlot)
else
self.content:Sort(sort:GetItemSortFunction(kind, view))
function sectionProto:Grid(kind, view, freeSpaceShown, nosort)
if not nosort then
if freeSpaceShown then
self.content:Sort(sort.GetItemSortBySlot)
else
self.content:Sort(sort:GetItemSortFunction(kind, view))
end
end
local w, h = self.content:Draw()
self.content:GetContainer():SetPoint("TOPLEFT", self.title, "BOTTOMLEFT", 0, 0)
Expand Down

0 comments on commit 975f2a5

Please sign in to comment.