2025-04-05 16:56:22 +01:00
|
|
|
using Content.Shared.Dataset;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
2025-04-06 14:12:39 -04:00
|
|
|
namespace Content.Server.RandomMetadata;
|
2022-05-02 13:51:03 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2022-09-14 03:13:22 -04:00
|
|
|
/// Randomizes the description and/or the name for an entity by creating it from list of dataset prototypes or strings.
|
2022-05-02 13:51:03 -07:00
|
|
|
/// </summary>
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class RandomMetadataComponent : Component
|
2022-05-02 13:51:03 -07:00
|
|
|
{
|
2025-04-05 16:56:22 +01:00
|
|
|
[DataField]
|
|
|
|
|
public List<ProtoId<LocalizedDatasetPrototype>>? DescriptionSegments;
|
2022-09-14 03:13:22 -04:00
|
|
|
|
2025-04-05 16:56:22 +01:00
|
|
|
[DataField]
|
|
|
|
|
public List<ProtoId<LocalizedDatasetPrototype>>? NameSegments;
|
2022-09-14 03:13:22 -04:00
|
|
|
|
2025-04-06 14:12:39 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// LocId of the formatting string to use to assemble the <see cref="NameSegments"/> into the entity's name.
|
|
|
|
|
/// Segments will be passed to the localization system with this string as variables named $part0, $part1, $part2, etc.
|
|
|
|
|
/// </summary>
|
2025-04-05 16:56:22 +01:00
|
|
|
[DataField]
|
2025-04-06 14:12:39 -04:00
|
|
|
public LocId NameFormat = "random-metadata-name-format-default";
|
2022-05-02 13:51:03 -07:00
|
|
|
|
2025-04-06 14:12:39 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// LocId of the formatting string to use to assemble the <see cref="DescriptionSegments"/> into the entity's description.
|
|
|
|
|
/// Segments will be passed to the localization system with this string as variables named $part0, $part1, $part2, etc.
|
|
|
|
|
/// </summary>
|
2025-04-05 16:56:22 +01:00
|
|
|
[DataField]
|
2025-04-06 14:12:39 -04:00
|
|
|
public LocId DescriptionFormat = "random-metadata-description-format-default";
|
2022-05-02 13:51:03 -07:00
|
|
|
}
|