orbit/js/ui
Brian Fertig 1b4cba9f4f Add shop buy/sell UI, cargo hold, and cargo bay upgrades
- Introduce CargoHold (pure class) as the ship's trade-goods carrier: fixed bays, one good each, capacity = unlocked bays, save/restore round-trip. Ship.cargo + setCargoHold/cargoRoom wired into stats.
- Add three credit-costed cargo builds (cargo-bay-8/12/16) that expand the hold 4→8→12→16 (MAX wins). BuildWindow affordability now covers both minerals and credits; GameScene.beginBuild debits credit lines and _applyCargoUpgrade expands the hold on completion.
- Add tradePreview/resultingCargo to Economy.js as the shop's pure calculator: sell/buy pricing, net credits, the two caps (can't go negative, end hold fits capacity), and atomic sell-to-free-room-for-buy.
- New ShopView + TradeGrid compose the buy/sell screen over the shop clip: SELL grid of cargo bays (tap to check), BUY grid with quantity steppers, live NET preview, Confirm/Clear, and a session-local Buyback tab (neutral undo at the sale price, locked until a sale). Wired into SurfaceScene's SHOP button.
- data/shopui.json drives the shop layout/animation knobs; economy.json gains cargo.maxSlots (16-slot grid); ship.json base cargoHold drops to 4 unlocked bays.
- Headless tests: dev/cargo.test.mjs (hold rules + trade preview caps), dev/shop-ui.test.mjs (construct, sell, buy, caps, buyback, clear), plus updated builds/ship-behavior suites; phaser-stub gains Geom.Rectangle for the hitArea path.
2026-09-11 20:11:34 -06:00
..
shop Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
ActionBar.js
…
BuildWindow.js Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
CommsBox.js
…
CommsPanel.js
…
ConfirmOverlay.js
…
CreditsHud.js Add trade economy engine, credits currency, and goods catalog 2026-09-11 18:36:30 -06:00
CyberShape.js
…
DiscoveryCompass.js
…
GalaxyView.js Add faction territory floor and ring all stars by ownership 2026-09-11 13:34:35 -06:00
GlitchText.js
…
MapWindow.js
…
MenuButton.js
…
MenuSubBar.js
…
MineralHud.js Add trade economy engine, credits currency, and goods catalog 2026-09-11 18:36:30 -06:00
MiningPopup.js
…
QuestTrackerHud.js
…
QuestWindow.js
…
ResearchWindow.js
…
SavePanel.js
…
SignalCompass.js
…
SlotCard.js
…
Toast.js
…