Use Segments for RandomMetadata (#11190)
* use segments for randomized names now * separator datafields * public api
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
using Content.Shared.Dataset;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.RandomMetadata;
|
||||
namespace Content.Server.RandomMetadata;
|
||||
|
||||
/// <summary>
|
||||
/// Randomizes the description and/or the name for an entity by pulling from a dataset prototype.
|
||||
/// Randomizes the description and/or the name for an entity by creating it from list of dataset prototypes or strings.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class RandomMetadataComponent : Component
|
||||
{
|
||||
[DataField("descriptionSet", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
||||
public string? DescriptionSet;
|
||||
[DataField("descriptionSegments")]
|
||||
public List<string>? DescriptionSegments;
|
||||
|
||||
[DataField("nameSet", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
|
||||
public string? NameSet;
|
||||
[DataField("nameSegments")]
|
||||
public List<string>? NameSegments;
|
||||
|
||||
[DataField("nameSeparator")]
|
||||
public string NameSeparator = " ";
|
||||
|
||||
[DataField("descriptionSeparator")]
|
||||
public string DescriptionSeparator = " ";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user