menu.module
README.md
game.rpg.menu
The widget trees for V's menu in Banana 2077, Cyberpunk 2077 2.0 style. It draws one full-screen panel with four tabs:
- INVENTORY: the seven equipment slots (katana, baton and five cyberware slots), a tier-framed
item grid (
M.COLS×M.ROWSvisible, scrolling) with category filters, and a detail card. The card shows the item's effects, a comparison against what is equipped, the salvage yield and the upgrade cost, with EQUIP / USE, DISASSEMBLE and UPGRADE buttons. - CHARACTER: the five attributes, the perk-tier gates at 4 / 9 / 15 / 20, unspent points, and the derived stats.
- PERKS: the five attribute trees (SOLO, BLADES, ENGINEER, NETRUNNER, HEADHUNTER). Each has four tiers, requirement links and ranks, plus BUY and RESPEC.
- SKILLS: street cred with its title track, and the five level-by-doing skills with their milestones.
It is a pure builder over game.rules state plus a view model. It owns no state and registers no
screen. The game.rpg.Character component owns the view model, puts M.tree(m) on screen
rpg_menu (layer 156), and routes the clicks back in through its onCallback.
API
M.tree(m)returns the whole frame: header (level, eddies, points), tab bar, the active tab's body, and a footer with that tab's keycaps.M.itemRows(filter)returns the sorted{id, count, def}rows for an inventory filter.M.perkOrder(tree)returns a tree's perks in tier/column order (this is whatperkSelindexes).M.perkState(perk)returns"maxed" | "owned" | "ready" | "open" | "locked".M.primaryLabel(row)returnsEQUIP | UNEQUIP | USE | INSPECT.M.tier(id),M.icon(def, color),M.iconKind(def),M.effects(id, def),M.compare(id, def),M.filterLabel(f), andM.currentItem(m).- Constants:
M.TABS,M.ACCENT,M.FILTERS,M.COLS,M.ROWS.
View model m
| field | meaning |
|---|---|
tab | "inventory" | "character" | "perks" | "skills" |
msg, msgColor | footer feedback line |
filter | a key from M.FILTERS, or "slot:<slot>" |
items | M.itemRows(filter) |
sel, top | selected item (1-based) and first visible grid row (0-based) |
focus, slotSel | "grid" | "slots" and the highlighted slot index |
attrSel | highlighted attribute index (CHARACTER) |
tree, perkSel | attribute id of the open tree and index into M.perkOrder(tree) |
respecArmed | the respec button asks for confirmation |
Click ids
menu:close, menu:tab:<t>, menu:filter:<f>, menu:item:<i>, menu:slot:<i>,
menu:scroll:-1|1, menu:act, menu:dis, menu:up, menu:attr:<i>, menu:spend:<attr>,
menu:tree:<attr>, menu:perk:<i>, menu:buy, menu:respec.