Remove legacy cargo shuttle code/prototypes (#36967)
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
using Robust.Shared.Audio;
|
|
||||||
|
|
||||||
namespace Content.Server.Cargo.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
public sealed partial class CargoShuttleConsoleComponent : Component
|
|
||||||
{
|
|
||||||
[ViewVariables(VVAccess.ReadWrite), DataField("soundDeny")]
|
|
||||||
public SoundSpecifier DenySound = new SoundPathSpecifier("/Audio/Effects/Cargo/buzz_two.ogg");
|
|
||||||
}
|
|
||||||
@@ -378,16 +378,6 @@ namespace Content.Server.Cargo.Systems
|
|||||||
|
|
||||||
UpdateOrderState(uid, station);
|
UpdateOrderState(uid, station);
|
||||||
}
|
}
|
||||||
|
|
||||||
var consoleQuery = AllEntityQuery<CargoShuttleConsoleComponent>();
|
|
||||||
while (consoleQuery.MoveNext(out var uid, out var _))
|
|
||||||
{
|
|
||||||
var station = _station.GetOwningStation(uid);
|
|
||||||
if (station != dbUid)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
UpdateShuttleState(uid, station);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AddAndApproveOrder(
|
public bool AddAndApproveOrder(
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using Content.Shared.Cargo.Components;
|
|||||||
using Content.Shared.Cargo.Events;
|
using Content.Shared.Cargo.Events;
|
||||||
using Content.Shared.Cargo.Prototypes;
|
using Content.Shared.Cargo.Prototypes;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
@@ -25,8 +24,6 @@ public sealed partial class CargoSystem
|
|||||||
{
|
{
|
||||||
SubscribeLocalEvent<TradeStationComponent, GridSplitEvent>(OnTradeSplit);
|
SubscribeLocalEvent<TradeStationComponent, GridSplitEvent>(OnTradeSplit);
|
||||||
|
|
||||||
SubscribeLocalEvent<CargoShuttleConsoleComponent, ComponentStartup>(OnCargoShuttleConsoleStartup);
|
|
||||||
|
|
||||||
SubscribeLocalEvent<CargoPalletConsoleComponent, CargoPalletSellMessage>(OnPalletSale);
|
SubscribeLocalEvent<CargoPalletConsoleComponent, CargoPalletSellMessage>(OnPalletSale);
|
||||||
SubscribeLocalEvent<CargoPalletConsoleComponent, CargoPalletAppraiseMessage>(OnPalletAppraise);
|
SubscribeLocalEvent<CargoPalletConsoleComponent, CargoPalletAppraiseMessage>(OnPalletAppraise);
|
||||||
SubscribeLocalEvent<CargoPalletConsoleComponent, BoundUIOpenedEvent>(OnPalletUIOpen);
|
SubscribeLocalEvent<CargoPalletConsoleComponent, BoundUIOpenedEvent>(OnPalletUIOpen);
|
||||||
@@ -35,26 +32,6 @@ public sealed partial class CargoSystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Console
|
#region Console
|
||||||
|
|
||||||
[PublicAPI]
|
|
||||||
private void UpdateCargoShuttleConsoles(EntityUid shuttleUid, CargoShuttleComponent _)
|
|
||||||
{
|
|
||||||
// Update pilot consoles that are already open.
|
|
||||||
_console.RefreshDroneConsoles();
|
|
||||||
|
|
||||||
// Update order consoles.
|
|
||||||
var shuttleConsoleQuery = AllEntityQuery<CargoShuttleConsoleComponent>();
|
|
||||||
|
|
||||||
while (shuttleConsoleQuery.MoveNext(out var uid, out var _))
|
|
||||||
{
|
|
||||||
var stationUid = _station.GetOwningStation(uid);
|
|
||||||
if (stationUid != shuttleUid)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
UpdateShuttleState(uid, stationUid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdatePalletConsoleInterface(EntityUid uid)
|
private void UpdatePalletConsoleInterface(EntityUid uid)
|
||||||
{
|
{
|
||||||
if (Transform(uid).GridUid is not { } gridUid)
|
if (Transform(uid).GridUid is not { } gridUid)
|
||||||
@@ -89,32 +66,6 @@ public sealed partial class CargoSystem
|
|||||||
UpdatePalletConsoleInterface(uid);
|
UpdatePalletConsoleInterface(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCargoShuttleConsoleStartup(EntityUid uid, CargoShuttleConsoleComponent component, ComponentStartup args)
|
|
||||||
{
|
|
||||||
var station = _station.GetOwningStation(uid);
|
|
||||||
UpdateShuttleState(uid, station);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateShuttleState(EntityUid uid, EntityUid? station = null)
|
|
||||||
{
|
|
||||||
TryComp<StationCargoOrderDatabaseComponent>(station, out var orderDatabase);
|
|
||||||
TryComp<CargoShuttleComponent>(orderDatabase?.Shuttle, out var shuttle);
|
|
||||||
|
|
||||||
var orders = GetProjectedOrders(station ?? EntityUid.Invalid, orderDatabase, shuttle);
|
|
||||||
var shuttleName = orderDatabase?.Shuttle != null ? MetaData(orderDatabase.Shuttle.Value).EntityName : string.Empty;
|
|
||||||
|
|
||||||
if (_uiSystem.HasUi(uid, CargoConsoleUiKey.Shuttle))
|
|
||||||
{
|
|
||||||
_uiSystem.SetUiState(uid,
|
|
||||||
CargoConsoleUiKey.Shuttle,
|
|
||||||
new CargoShuttleConsoleBoundUserInterfaceState(
|
|
||||||
station != null ? MetaData(station.Value).EntityName : Loc.GetString("cargo-shuttle-console-station-unknown"),
|
|
||||||
string.IsNullOrEmpty(shuttleName) ? Loc.GetString("cargo-shuttle-console-shuttle-not-found") : shuttleName,
|
|
||||||
orders
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void OnTradeSplit(EntityUid uid, TradeStationComponent component, ref GridSplitEvent args)
|
private void OnTradeSplit(EntityUid uid, TradeStationComponent component, ref GridSplitEvent args)
|
||||||
@@ -127,62 +78,6 @@ public sealed partial class CargoSystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Shuttle
|
#region Shuttle
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the orders that can fit on the cargo shuttle.
|
|
||||||
/// </summary>
|
|
||||||
private List<CargoOrderData> GetProjectedOrders(
|
|
||||||
EntityUid shuttleUid,
|
|
||||||
StationCargoOrderDatabaseComponent? component = null,
|
|
||||||
CargoShuttleComponent? shuttle = null)
|
|
||||||
{
|
|
||||||
var orders = new List<CargoOrderData>();
|
|
||||||
|
|
||||||
if (component == null || shuttle == null || component.Orders.Count == 0)
|
|
||||||
return orders;
|
|
||||||
|
|
||||||
var spaceRemaining = GetCargoSpace(shuttleUid);
|
|
||||||
var allOrders = component.AllOrders.ToList();
|
|
||||||
for (var i = 0; i < allOrders.Count && spaceRemaining > 0; i++)
|
|
||||||
{
|
|
||||||
var order = allOrders[i];
|
|
||||||
if (order.Approved)
|
|
||||||
{
|
|
||||||
var numToShip = order.OrderQuantity - order.NumDispatched;
|
|
||||||
if (numToShip > spaceRemaining)
|
|
||||||
{
|
|
||||||
// We won't be able to fit the whole order on, so make one
|
|
||||||
// which represents the space we do have left:
|
|
||||||
var reducedOrder = new CargoOrderData(
|
|
||||||
order.OrderId,
|
|
||||||
order.ProductId,
|
|
||||||
order.ProductName,
|
|
||||||
order.Price,
|
|
||||||
spaceRemaining,
|
|
||||||
order.Requester,
|
|
||||||
order.Reason);
|
|
||||||
orders.Add(reducedOrder);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
orders.Add(order);
|
|
||||||
}
|
|
||||||
spaceRemaining -= numToShip;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return orders;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the amount of space the cargo shuttle can fit for orders.
|
|
||||||
/// </summary>
|
|
||||||
private int GetCargoSpace(EntityUid gridUid)
|
|
||||||
{
|
|
||||||
var space = GetCargoPallets(gridUid, BuySellType.Buy).Count;
|
|
||||||
return space;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// GetCargoPallets(gridUid, BuySellType.Sell) to return only Sell pads
|
/// GetCargoPallets(gridUid, BuySellType.Sell) to return only Sell pads
|
||||||
/// GetCargoPallets(gridUid, BuySellType.Buy) to return only Buy pads
|
/// GetCargoPallets(gridUid, BuySellType.Buy) to return only Buy pads
|
||||||
private List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent PalletXform)> GetCargoPallets(EntityUid gridUid, BuySellType requestType = BuySellType.All)
|
private List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent PalletXform)> GetCargoPallets(EntityUid gridUid, BuySellType requestType = BuySellType.All)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
- id: CargoBountyComputerCircuitboard
|
- id: CargoBountyComputerCircuitboard
|
||||||
- id: CargoRequestComputerCircuitboard
|
- id: CargoRequestComputerCircuitboard
|
||||||
- id: CargoSaleComputerCircuitboard
|
- id: CargoSaleComputerCircuitboard
|
||||||
- id: CargoShuttleComputerCircuitboard
|
|
||||||
- id: CargoShuttleConsoleCircuitboard
|
- id: CargoShuttleConsoleCircuitboard
|
||||||
- id: SalvageMagnetMachineCircuitboard
|
- id: SalvageMagnetMachineCircuitboard
|
||||||
- id: CigPackGreen
|
- id: CigPackGreen
|
||||||
|
|||||||
@@ -198,17 +198,6 @@
|
|||||||
prototype: ComputerCargoBounty
|
prototype: ComputerCargoBounty
|
||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
|
|
||||||
- type: entity
|
|
||||||
parent: BaseComputerCircuitboard
|
|
||||||
id: CargoShuttleComputerCircuitboard
|
|
||||||
name: cargo shuttle computer board
|
|
||||||
description: A computer printed circuit board for a cargo shuttle computer.
|
|
||||||
components:
|
|
||||||
- type: Sprite
|
|
||||||
state: cpu_supply
|
|
||||||
- type: ComputerBoard
|
|
||||||
prototype: ComputerCargoShuttle
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
parent: BaseComputerCircuitboard
|
parent: BaseComputerCircuitboard
|
||||||
id: SalvageExpeditionsComputerCircuitboard
|
id: SalvageExpeditionsComputerCircuitboard
|
||||||
|
|||||||
@@ -854,45 +854,6 @@
|
|||||||
energy: 1.6
|
energy: 1.6
|
||||||
color: "#e6e227"
|
color: "#e6e227"
|
||||||
|
|
||||||
- type: entity
|
|
||||||
id: ComputerCargoShuttle
|
|
||||||
parent: BaseComputerAiAccess
|
|
||||||
name: cargo shuttle computer
|
|
||||||
description: Used to order the shuttle.
|
|
||||||
components:
|
|
||||||
- type: Sprite
|
|
||||||
layers:
|
|
||||||
- map: ["computerLayerBody"]
|
|
||||||
state: computer
|
|
||||||
- map: ["computerLayerKeyboard"]
|
|
||||||
state: generic_keyboard
|
|
||||||
- map: ["computerLayerScreen"]
|
|
||||||
state: supply
|
|
||||||
- map: ["computerLayerKeys"]
|
|
||||||
state: tech_key
|
|
||||||
- map: [ "enum.WiresVisualLayers.MaintenancePanel" ]
|
|
||||||
state: generic_panel_open
|
|
||||||
- type: CargoShuttleConsole
|
|
||||||
- type: ActivatableUI
|
|
||||||
key: enum.CargoConsoleUiKey.Shuttle
|
|
||||||
- type: UserInterface
|
|
||||||
interfaces:
|
|
||||||
enum.CargoConsoleUiKey.Shuttle:
|
|
||||||
type: CargoShuttleConsoleBoundUserInterface
|
|
||||||
enum.WiresUiKey.Key:
|
|
||||||
type: WiresBoundUserInterface
|
|
||||||
- type: Computer
|
|
||||||
board: CargoShuttleComputerCircuitboard
|
|
||||||
- type: PointLight
|
|
||||||
radius: 1.5
|
|
||||||
energy: 1.6
|
|
||||||
color: "#b89f25"
|
|
||||||
- type: AccessReader
|
|
||||||
access: [["Cargo"]]
|
|
||||||
- type: GuideHelp
|
|
||||||
guides:
|
|
||||||
- Cargo
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: ComputerCargoOrders
|
id: ComputerCargoOrders
|
||||||
parent: BaseComputerAiAccess
|
parent: BaseComputerAiAccess
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
Orders are delivered to the station via the orbiting [color=cyan]Trade Station[/color] and are transported to the main station by the [color=cyan]Cargo Shuttle[color]. The shuttle does not fly itself, so it must either be piloted in the shuttle or remotely.
|
Orders are delivered to the station via the orbiting [color=cyan]Trade Station[/color] and are transported to the main station by the [color=cyan]Cargo Shuttle[color]. The shuttle does not fly itself, so it must either be piloted in the shuttle or remotely.
|
||||||
|
|
||||||
<Box>
|
<Box>
|
||||||
<GuideEntityEmbed Entity="ComputerCargoShuttle"/>
|
<GuideEntityEmbed Entity="ComputerShuttleCargo"/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
To fly the shuttle, you must first find the [color=cyan]Cargo Shuttle Console[/color]. One is inside the Cargo Bay, and the other is inside the Cargo Shuttle.
|
To fly the shuttle, you must first find the [color=cyan]Cargo Shuttle Console[/color]. One is inside the Cargo Bay, and the other is inside the Cargo Shuttle.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<Box>
|
<Box>
|
||||||
<GuideEntityEmbed Entity="PoweredSmallLight" Caption=""/>
|
<GuideEntityEmbed Entity="PoweredSmallLight" Caption=""/>
|
||||||
<GuideEntityEmbed Entity="ComputerCargoShuttle" Caption=""/>
|
<GuideEntityEmbed Entity="ComputerShuttleCargo" Caption=""/>
|
||||||
<GuideEntityEmbed Entity="ComputerComms" Caption=""/>
|
<GuideEntityEmbed Entity="ComputerComms" Caption=""/>
|
||||||
<GuideEntityEmbed Entity="Autolathe" Caption=""/>
|
<GuideEntityEmbed Entity="Autolathe" Caption=""/>
|
||||||
<GuideEntityEmbed Entity="VendingMachineEngivend" Caption=""/>
|
<GuideEntityEmbed Entity="VendingMachineEngivend" Caption=""/>
|
||||||
|
|||||||
@@ -610,3 +610,7 @@ MediumXenoArtifact: ComplexXenoArtifact
|
|||||||
SimpleXenoArtifactItem: ComplexXenoArtifactItem
|
SimpleXenoArtifactItem: ComplexXenoArtifactItem
|
||||||
MediumXenoArtifactItem: ComplexXenoArtifactItem
|
MediumXenoArtifactItem: ComplexXenoArtifactItem
|
||||||
VariedXenoArtifactItem: ComplexXenoArtifactItem
|
VariedXenoArtifactItem: ComplexXenoArtifactItem
|
||||||
|
|
||||||
|
# 2025-04-26
|
||||||
|
ComputerCargoShuttle: ComputerShuttleCargo
|
||||||
|
CargoShuttleComputerCircuitboard: CargoShuttleConsoleCircuitboard
|
||||||
|
|||||||
Reference in New Issue
Block a user