Log inGet started
Package

Character.component

Newest version

README.md

game.rpg.Character

V's menu in Banana 2077, in the style of Cyberpunk 2077 2.0. The scene entrypoint attaches it to the mount_shops entity when play starts, next to game.shops.Shops. It needs no sibling components: it reads and changes the game only through game.rules, and draws through game.rpg.menu.

What it does

  • Opens and closes the menu. It activates game.rpg.character.inputMap while a run is playing. I, gamepad select or touch BAG toggles the menu (refused unless R.canControl()), which opens on the INVENTORY tab.
  • Owns the screen. Screen rpg_menu sits on layer 156, built by Menu.tree(m) from the view model this component owns. It is rebuilt only on input or a rules event (eddies, items, equip, attributes, XP, perks, skills, cred, disassembly, upgrades), never per frame.
  • Takes the modal. While open, it holds focus "inventory", unlocks the pointer (and re-locks it on close if it was locked), claims the platform Back, and activates game.shops.shopnav and game.rpg.charnav. Those suppress the HUD, combat, walking, quest-HUD and story groups. If another system takes focus, the menu closes itself.
  • Inventory tab. A 6-wide item grid with category filters and the seven equipment slots. Enter equips, unequips or uses the item. X disassembles it into components. U upgrades it a tier for components and eddies. F cycles the filter. Left from the first grid column moves to the slot column, and Enter on a slot filters the grid to that slot. Back clears a slot filter before it closes the menu.
  • Character tab. Left and right pick an attribute, and Enter spends an attribute point on it.
  • Perks tab. Left and right switch tree, and up and down pick a perk. Enter buys a rank. X arms a respec, and a second X within 3 s confirms it (R.respec, costs eddies).
  • Skills tab. A read-only view of street cred and the five skills.
  • Every result (equipped, not enough components, perk locked, and so on) shows in the footer.

Controls

keyboard / mousegamepadtouch
open / closeIselectBAG / ✕
switch tabQ / E, TabLB / RBtap a tab
movearrows / WASDd-padtap a tile, slot, card or perk
primary (equip, use, raise, buy)Enter / Space, or click the selected tilesouthtap the button
disassemble / respecXwestDISASSEMBLE / RESPEC button
upgradeUnorthUPGRADE button
cycle filterFright triggertap a filter chip
backEsc / Backspaceeast✕

Click ids

onCallback handles menu:close, menu:act, menu:dis, menu:up, menu:buy, menu:respec, menu:tab:<tab>, menu:filter:<filter>, menu:item:<n>, menu:slot:<n>, menu:scroll:<±n>, menu:attr:<n>, menu:spend:<attribute>, menu:tree:<attribute> and menu:perk:<n>.

Cost

Per frame it only checks a dirty flag. The input maps are activated once and released in onDestroy, along with the screen and every rules listener.