Skip to content

[Feature Request] Make bank column count configurable (currently a hardcoded local) #1175

Description

@LiQiuDGG

What

A bankColumns profile key with a slider in the Bags options panel, so the bank grid width can be changed like the other settings that already apply to both windows.

Bags are covered separately by #321 (part 2), which asks for a column option for the player bag. This is only about the bank, which #321 does not mention. The two are different problems: the bag value at least exists in the profile, the bank value does not exist at all.

Why

The bank grid is fixed by a file-level constant with no profile backing, at EllesmereUIBags/EllesmereUIBags_Bank.lua:31:

local COLUMNS = 14

It is consumed throughout the layout code (gridW at :1626 and :2380, col/row math at :1677, :1735 and :1808, rows at :1685, :1743 and :1816). Because it is a local rather than a profile key, changing it means editing the addon, and the edit is lost on the next update.

At the default slot size this leaves the bank much narrower than a full Warband bank needs, forcing vertical scrolling on tabs that would fit fine at a wider grid.

Precedent

The bag half of the same module already reads its count from the profile, at EllesmereUIBags.lua:132:

return BP().bagColumns or 12

So the two halves of one module are inconsistent today. Outside EUI, other bag replacements derive the count from window width rather than fixing it, and land near 27 columns for a combined bank against about 13 for bags, so a single hardcoded 14 is a poor fit for the bank specifically.

Notes

Passing along what turned up while tracking this down, in case any of it saves time. This looks like it fits existing patterns rather than needing new machinery:

  • BAGS_DEFAULTS in EUI_Bags_Options.lua already holds bank-side keys (bankSidebarCollapsed at :26), so there is a home for it.
  • The panel already drives the bank live through _G.EUI_BankFrame and its refresh entry points (RefreshBank, RefreshIconZoom, RefreshTextSizes at :181-182, :245-246, :261-262, :504-505, :513-514), so a slider could reuse RefreshBank() to reflow the grid without a reload.
  • Replacing the local with a GetBankColumns() reader mirrors GetColumns() on the bag side.

Defaulting bankColumns to 14 would preserve current behavior exactly for anyone who never touches it, and this adds no events, hooks, frames, or OnUpdate work: it is a read of an existing profile value inside layout code that already runs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions