]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove legacy cargo shuttle code/prototypes (#36967)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sun, 27 Apr 2025 02:06:45 +0000 (22:06 -0400)
committerGitHub <noreply@github.com>
Sun, 27 Apr 2025 02:06:45 +0000 (12:06 +1000)
Content.Server/Cargo/Components/CargoShuttleConsoleComponent.cs [deleted file]
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs
Resources/Prototypes/Catalog/Fills/Lockers/heads.yml
Resources/Prototypes/Entities/Objects/Devices/Circuitboards/computer.yml
Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml
Resources/ServerInfo/Guidebook/Cargo/Cargo.xml
Resources/ServerInfo/Guidebook/Engineering/VoltageNetworks.xml
Resources/migration.yml

diff --git a/Content.Server/Cargo/Components/CargoShuttleConsoleComponent.cs b/Content.Server/Cargo/Components/CargoShuttleConsoleComponent.cs
deleted file mode 100644 (file)
index 2f61726..0000000
+++ /dev/null
@@ -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");
-}
index f89f1b0e8f5969914fc23749c5d6fffffe0dad0e..fe37f56e02f8395efdacf5e026e3458cf1a795e0 100644 (file)
@@ -378,16 +378,6 @@ namespace Content.Server.Cargo.Systems
 
                 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(
index 2516965b6deb59fe8d398b82390240f599a3c0d9..4fc2c088139d8bef58ea9613e29daf31eb0a2420 100644 (file)
@@ -6,7 +6,6 @@ using Content.Shared.Cargo.Components;
 using Content.Shared.Cargo.Events;
 using Content.Shared.Cargo.Prototypes;
 using Content.Shared.CCVar;
-using JetBrains.Annotations;
 using Robust.Shared.Audio;
 using Robust.Shared.Prototypes;
 
@@ -25,8 +24,6 @@ public sealed partial class CargoSystem
     {
         SubscribeLocalEvent<TradeStationComponent, GridSplitEvent>(OnTradeSplit);
 
-        SubscribeLocalEvent<CargoShuttleConsoleComponent, ComponentStartup>(OnCargoShuttleConsoleStartup);
-
         SubscribeLocalEvent<CargoPalletConsoleComponent, CargoPalletSellMessage>(OnPalletSale);
         SubscribeLocalEvent<CargoPalletConsoleComponent, CargoPalletAppraiseMessage>(OnPalletAppraise);
         SubscribeLocalEvent<CargoPalletConsoleComponent, BoundUIOpenedEvent>(OnPalletUIOpen);
@@ -35,26 +32,6 @@ public sealed partial class CargoSystem
     }
 
     #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)
     {
         if (Transform(uid).GridUid is not { } gridUid)
@@ -89,32 +66,6 @@ public sealed partial class CargoSystem
         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
 
     private void OnTradeSplit(EntityUid uid, TradeStationComponent component, ref GridSplitEvent args)
@@ -127,62 +78,6 @@ public sealed partial class CargoSystem
     }
 
     #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.Buy) to return only Buy pads
     private List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent PalletXform)> GetCargoPallets(EntityUid gridUid, BuySellType requestType = BuySellType.All)
index bf49e30923f8235e5b7fb2ec8904d0b7b51614f2..6770680b6372ed3e7cd5e97366e75e5436d571ec 100644 (file)
@@ -7,7 +7,6 @@
     - id: CargoBountyComputerCircuitboard
     - id: CargoRequestComputerCircuitboard
     - id: CargoSaleComputerCircuitboard
-    - id: CargoShuttleComputerCircuitboard
     - id: CargoShuttleConsoleCircuitboard
     - id: SalvageMagnetMachineCircuitboard
     - id: CigPackGreen
index 89cf314e95df62b880ab2f0903adc53e6caef5c9..6af8b9639efca0b69fd7f9b557ace68589b924f2 100644 (file)
     prototype: ComputerCargoBounty
   - 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
   parent: BaseComputerCircuitboard
   id: SalvageExpeditionsComputerCircuitboard
index 93125455bc2429fc95f67f3a6755cfecbf2d7230..a05c88aadb7972a8c7492c302315cb7df77362b3 100644 (file)
     energy: 1.6
     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
   id: ComputerCargoOrders
   parent: BaseComputerAiAccess
index 526dd35ffed4bf75b4be7a0eb446aebc63bf10e2..c4147f5e476062315795fda6a4d946dee326a7e7 100644 (file)
@@ -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.
 
   <Box>
-    <GuideEntityEmbed Entity="ComputerCargoShuttle"/>
+    <GuideEntityEmbed Entity="ComputerShuttleCargo"/>
   </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.
index 9d7ed300965b0728d5b8033ba5cf1925fb9a2662..3f635715ce99c9fc335d829b2a1151447ba8f5a8 100644 (file)
@@ -16,7 +16,7 @@
 
   <Box>
     <GuideEntityEmbed Entity="PoweredSmallLight" Caption=""/>
-    <GuideEntityEmbed Entity="ComputerCargoShuttle" Caption=""/>
+    <GuideEntityEmbed Entity="ComputerShuttleCargo" Caption=""/>
     <GuideEntityEmbed Entity="ComputerComms" Caption=""/>
     <GuideEntityEmbed Entity="Autolathe" Caption=""/>
     <GuideEntityEmbed Entity="VendingMachineEngivend" Caption=""/>
index 742429bbecab0eac6b20c2197774d3f55b06bdde..667a6c090bbde18a8017677b6f41a9c9d7f99fef 100644 (file)
@@ -610,3 +610,7 @@ MediumXenoArtifact: ComplexXenoArtifact
 SimpleXenoArtifactItem: ComplexXenoArtifactItem
 MediumXenoArtifactItem: ComplexXenoArtifactItem
 VariedXenoArtifactItem: ComplexXenoArtifactItem
+
+# 2025-04-26
+ComputerCargoShuttle: ComputerShuttleCargo
+CargoShuttleComputerCircuitboard: CargoShuttleConsoleCircuitboard