Files
tbd-station-14/Content.Server/RandomMetadata/RandomMetadataComponent.cs
Tayrtahn 8d8c1e4dae Make RandomMetadata properly support localization (#36343)
* Make _outputSegments readonly

* Remove mystery character

* Use Fluent instead of string concatenation

* Adjust format

* Convert existing content

* Don't need these anymore

* Docs
2025-04-06 11:12:39 -07:00

32 lines
1.2 KiB
C#

using Content.Shared.Dataset;
using Robust.Shared.Prototypes;
namespace Content.Server.RandomMetadata;
/// <summary>
/// Randomizes the description and/or the name for an entity by creating it from list of dataset prototypes or strings.
/// </summary>
[RegisterComponent]
public sealed partial class RandomMetadataComponent : Component
{
[DataField]
public List<ProtoId<LocalizedDatasetPrototype>>? DescriptionSegments;
[DataField]
public List<ProtoId<LocalizedDatasetPrototype>>? NameSegments;
/// <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>
[DataField]
public LocId NameFormat = "random-metadata-name-format-default";
/// <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>
[DataField]
public LocId DescriptionFormat = "random-metadata-description-format-default";
}