From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
Date: Thu, 8 May 2025 19:53:19 +0000 (-0400)
Subject: Validate Cargo Markets (#37271)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7bec14863440fbf51fd286fbb899ad33c0119057;p=space-station-14.git
Validate Cargo Markets (#37271)
* Validate cargo markets
* readonly market ID
---
diff --git a/Content.Shared/Cargo/Components/CargoOrderConsoleComponent.cs b/Content.Shared/Cargo/Components/CargoOrderConsoleComponent.cs
index 8b189313ae..44790d8881 100644
--- a/Content.Shared/Cargo/Components/CargoOrderConsoleComponent.cs
+++ b/Content.Shared/Cargo/Components/CargoOrderConsoleComponent.cs
@@ -78,7 +78,7 @@ public sealed partial class CargoOrderConsoleComponent : Component
/// All of the s that are supported.
///
[DataField, AutoNetworkedField]
- public List AllowedGroups = new() { "market" };
+ public List> AllowedGroups = new() { "market" };
///
/// Access needed to toggle the limit on this console.
diff --git a/Content.Shared/Cargo/Prototypes/CargoMarketPrototype.cs b/Content.Shared/Cargo/Prototypes/CargoMarketPrototype.cs
new file mode 100644
index 0000000000..32fe3a4dac
--- /dev/null
+++ b/Content.Shared/Cargo/Prototypes/CargoMarketPrototype.cs
@@ -0,0 +1,14 @@
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Cargo.Prototypes;
+
+///
+/// Defines a "market" that a cargo computer can access and make orders from.
+///
+[Prototype]
+public sealed partial class CargoMarketPrototype : IPrototype
+{
+ ///
+ [IdDataField]
+ public string ID { get; private set; } = default!;
+}
diff --git a/Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs b/Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
index 5a18b6becc..d98c9bd8f7 100644
--- a/Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
+++ b/Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
@@ -93,6 +93,6 @@ namespace Content.Shared.Cargo.Prototypes
/// The prototype group of the product. (e.g. Contraband)
///
[DataField]
- public string Group { get; private set; } = "market";
+ public ProtoId Group { get; private set; } = "market";
}
}
diff --git a/Resources/Prototypes/Catalog/Cargo/markets.yml b/Resources/Prototypes/Catalog/Cargo/markets.yml
new file mode 100644
index 0000000000..b6d8790a8f
--- /dev/null
+++ b/Resources/Prototypes/Catalog/Cargo/markets.yml
@@ -0,0 +1,2 @@
+- type: cargoMarket
+ id: market