Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions EllesmereUIBags/EllesmereUIBags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ local function CreateHeader()
SetBagFont(header.itemCount, 11)
header.itemCount:SetPoint("LEFT", header.title, "RIGHT", 8, 0)
header.itemCount:SetTextColor(0.6, 0.6, 0.6)
header.itemCount:SetJustifyH("LEFT")

local search = CreateFrame("EditBox", "EUI_BagSearchBox", header)
search:SetSize(160, 22)
Expand Down Expand Up @@ -5548,12 +5549,24 @@ function EUI_Bags:RefreshInventory()
ReleaseAllSlotTables()
local tempItems = {}
local emptySlots = {}
local regularUsed, regularTotal = 0, 0
local reagentUsed, reagentTotal = 0, 0

for bag = 0, 5 do
local numSlots = C_Container.GetContainerNumSlots(bag)
if bag == 5 then
reagentTotal = numSlots
else
regularTotal = regularTotal + numSlots
end
for slot = 1, numSlots do
local info = C_Container.GetContainerItemInfo(bag, slot)
if info then
if bag == 5 then
reagentUsed = reagentUsed + 1
else
regularUsed = regularUsed + 1
end
local itemLink = C_Container.GetContainerItemLink(bag, slot)
local d = AcquireSlotTable()
d.bag = bag; d.slot = slot; d.info = info; d.itemLink = itemLink
Expand Down Expand Up @@ -7102,12 +7115,27 @@ function EUI_Bags:RefreshInventory()
end

if EUI_Bags.Header and EUI_Bags.Header.itemCount then
if selectedCategoryIndex == 0 or selectedCategoryIndex == -1 or selectedCategoryIndex == -2 then
local totalSlots = totalCount + #emptySlots
EUI_Bags.Header.itemCount:SetText(EllesmereUI.Lf("%d / %d Items", totalCount, totalSlots))
-- Capacity describes physical slots, independent of categories and merged stacks.
local format = BP().bagSlotCountFormat
local separate = BP().bagSeparateReagentSlots ~= false
local function FormatSlots(used, total, reagent)
if format == "free" then
return EllesmereUI.Lf(reagent and "%d Reagent slots free" or "%d Bag slots free", total - used)
elseif format == "free_total" then
return EllesmereUI.Lf(reagent and "%d / %d Reagent slots free" or "%d / %d Bag slots free", total - used, total)
end
return EllesmereUI.Lf(reagent and "%d / %d Reagent slots" or "%d / %d Bag slots", used, total)
end
local countText
if separate then
countText = FormatSlots(regularUsed, regularTotal, false)
if reagentTotal > 0 then
countText = countText .. "\n" .. FormatSlots(reagentUsed, reagentTotal, true)
end
else
EUI_Bags.Header.itemCount:SetText(EllesmereUI.Lf("%d Items", totalCount))
countText = FormatSlots(regularUsed + reagentUsed, regularTotal + reagentTotal, false)
end
EUI_Bags.Header.itemCount:SetText(countText)
end

-- Dice button: OneBag only (unless hidden by setting), parented to the scroll child and anchored to the first category header.
Expand Down
2 changes: 2 additions & 0 deletions EllesmereUIBags/EllesmereUIBags_DB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ local BAGS_DEFAULTS = {
bagAutoSize = false,
bagCatTitleSize = 11,
bagCountFontSize = 11,
bagSlotCountFormat = "used_total",
bagSeparateReagentSlots = true,
itemlevelFontSize = 12,
showItemlevelInBags = true,
showUpgradeIndicator = true,
Expand Down
3 changes: 1 addition & 2 deletions EllesmereUILocales/_keys.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Auto-generated by .tools/extract-locale-keys.sh -- do not edit by hand.
# Canonical list of translatable English keys passed as string literals
# (789 unique). Regenerate after wrapping new strings. Keys passed as
# (788 unique). Regenerate after wrapping new strings. Keys passed as
# variables are not listed here -- use the in-game /euiloc harvester for
# the complete runtime set.
(Raid)
Expand All @@ -24,7 +24,6 @@
%1$s's %2$s Breakdown
%1$s's Death Recap
%d / %d Items
%d Items
%d junk item(s) could not be sold.
%s is also assigned to:
(Applies on Window Close)
Expand Down
20 changes: 20 additions & 0 deletions EllesmereUIOptions/EUI_Bags_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,26 @@ initFrame:SetScript("OnEvent", function(self)
end
end

-- Slot count format | Separate reagent slots
_, h = W:DualRow(parent, y,
{ type="dropdown", text="Slot count format",
tooltip="Choose how the inventory header shows occupied or free bag slots. Each item stack occupies one slot.",
values={ used_total="Used/total", free_total="Free/total", free="Free only" },
order={ "used_total", "free_total", "free" },
getValue=function() return db.profile.bagSlotCountFormat or "used_total" end,
setValue=function(v)
db.profile.bagSlotCountFormat = v
if _G.EUI_Bags and _G.EUI_Bags.RefreshInventory then _G.EUI_Bags:RefreshInventory() end
end },
{ type="toggle", text="Separate reagent slots",
tooltip="Show regular bag and reagent bag capacity separately in the inventory header. Turn this off to combine them; reagent slots still only accept reagents.",
getValue=function() return db.profile.bagSeparateReagentSlots ~= false end,
setValue=function(v)
db.profile.bagSeparateReagentSlots = v
if _G.EUI_Bags and _G.EUI_Bags.RefreshInventory then _G.EUI_Bags:RefreshInventory() end
end }
); y = y - h

-- Item Count Text Size | Item Level Text Size
_, h = W:DualRow(parent, y,
{ type="slider", text="Item Count Text Size", min=8, max=16, step=1,
Expand Down