Implement Cargo Console (#413)

* Implement Cargo Console

Add to CargoConsoleComponent GalacticBank information for syncing Bank Account Balance.

Implement CargoOrderDatabase on the server side and a list of orders in the CargoOrderDatabaseComponent on the client side. This makes it easier to change data on the server side but also utilize the state syncing between components.

Implement GalacticMarketComponent.
Only productIds get sent. Both client and server create their lists from YAML.

Implement basic spawning of items from approved orders in CargoOrderDatabase.

* Finish Cargo Console

Add validation to make sure Order Amount is one or more.

Implement approve and cancel buttons to CargoConsoleMenu orders list row.

Add price to CargoConsoleMenu product list row.

Implement CargoOrderDataManager to consolidate CargoOrder lists.

Refactor CargoOrderDatabaseComponent to use CargoOrderDataManager instead of storing duplicate lists.

Implement canceling orders.
Implement approving orders.

Fix sprite links.

Implement Cargo Request Console.
This commit is contained in:
ShadowCommander
2019-11-21 16:37:15 -08:00
committed by Pieter-Jan Briers
parent 58709d2d26
commit 1580750606
29 changed files with 1867 additions and 12 deletions

View File

@@ -0,0 +1,33 @@
- type: cargoProduct
name: "Dice"
id: cargo.dice
description: Some dice
icon:
sprite: Objects/Fun/dice.rsi
state: d2020
product: d20
cost: 20
category: Other
group: market
- type: cargoProduct
name: "Medkit"
id: cargo.Medkit
description: Everything you need to patch someone up.
icon: Objects/Medical/medkit_r.png
product: Medkit
cost: 200
category: Medical
group: market
- type: cargoProduct
name: "Flashlight"
id: cargo.flashlight
description: Shine a light in the dark
icon:
sprite: Objects/Tools/flashlight.rsi
state: lantern_off
product: FlashlightLantern
cost: 3000
category: Engineering
group: market

View File

@@ -69,14 +69,38 @@
- type: entity
id: computerSupplyOrdering
parent: computerBase
name: Supply Ordering Computer
name: Cargo Ordering Computer
components:
- type: Appearance
visuals:
- type: ComputerVisualizer2D
key: tech_key
screen: supply
- type: CargoConsole
- type: CargoOrderDatabase
- type: GalacticMarket
static: true
products:
- cargo.dice
- cargo.flashlight
- cargo.Medkit
- type: UserInterface
interfaces:
- key: enum.CargoConsoleUiKey.Key
type: CargoConsoleBoundUserInterface
- type: entity
id: computerSupplyRequest
parent: computerSupplyOrdering
name: Cargo Request Computer
components:
- type: Appearance
visuals:
- type: ComputerVisualizer2D
key: tech_key
screen: request
- type: CargoConsole
requestOnly: true
- type: entity
id: computerMedicalRecords