orbit/data
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
..
research
…
actionbar.json
…
asteroids.json
…
builds.json Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
comms.json Add faction worldgen layer: territories, capitals, bridges, and arid pla 2026-09-10 21:45:33 -06:00
creditshud.json Add trade economy engine, credits currency, and goods catalog 2026-09-11 18:36:30 -06:00
economy.json Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
factions.json Add faction territory floor and ring all stars by ownership 2026-09-11 13:34:35 -06:00
galaxy.json
…
game.json Add front nebula layer with derived accent tint for two-tone gas 2026-09-10 22:48:40 -06:00
gates.json Add faction worldgen layer: territories, capitals, bridges, and arid pla 2026-09-10 21:45:33 -06:00
goods.json Add trade economy engine, credits currency, and goods catalog 2026-09-11 18:36:30 -06:00
landing.json Add balance quota to cap faction territory sizes 2026-09-10 22:18:07 -06:00
manifest.json Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
map.json Add faction territory floor and ring all stars by ownership 2026-09-11 13:34:35 -06:00
menu.json
…
mineralhud.json
…
music.json
…
naming.json
…
planets.json Add faction worldgen layer: territories, capitals, bridges, and arid pla 2026-09-10 21:45:33 -06:00
quests.json Add trade economy engine, credits currency, and goods catalog 2026-09-11 18:36:30 -06:00
reputation.json
…
research.json
…
save.json
…
scan.json
…
settlements.json Add faction worldgen layer: territories, capitals, bridges, and arid pla 2026-09-10 21:45:33 -06:00
sfx.json
…
ship.json Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
shopui.json Add shop buy/sell UI, cargo hold, and cargo bay upgrades 2026-09-11 20:11:34 -06:00
signalCompass.json
…
stations.json
…
systems.json Add far-sky lightning bolts to nebula systems 2026-09-10 23:11:21 -06:00
tether.json
…
theme.json
…