Validate Cargo Markets (#37271)
* Validate cargo markets * readonly market ID
This commit is contained in:
@@ -78,7 +78,7 @@ public sealed partial class CargoOrderConsoleComponent : Component
|
||||
/// All of the <see cref="CargoProductPrototype.Group"/>s that are supported.
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public List<string> AllowedGroups = new() { "market" };
|
||||
public List<ProtoId<CargoMarketPrototype>> AllowedGroups = new() { "market" };
|
||||
|
||||
/// <summary>
|
||||
/// Access needed to toggle the limit on this console.
|
||||
|
||||
14
Content.Shared/Cargo/Prototypes/CargoMarketPrototype.cs
Normal file
14
Content.Shared/Cargo/Prototypes/CargoMarketPrototype.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Cargo.Prototypes;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a "market" that a cargo computer can access and make orders from.
|
||||
/// </summary>
|
||||
[Prototype]
|
||||
public sealed partial class CargoMarketPrototype : IPrototype
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
[IdDataField]
|
||||
public string ID { get; private set; } = default!;
|
||||
}
|
||||
@@ -93,6 +93,6 @@ namespace Content.Shared.Cargo.Prototypes
|
||||
/// The prototype group of the product. (e.g. Contraband)
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string Group { get; private set; } = "market";
|
||||
public ProtoId<CargoMarketPrototype> Group { get; private set; } = "market";
|
||||
}
|
||||
}
|
||||
|
||||
2
Resources/Prototypes/Catalog/Cargo/markets.yml
Normal file
2
Resources/Prototypes/Catalog/Cargo/markets.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
- type: cargoMarket
|
||||
id: market
|
||||
Reference in New Issue
Block a user