Word replacement accent system (#15086)
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
namespace Content.Server.Speech.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Used for replacing words for dwarves (pseudo-scottish)
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DwarfAccentComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -10,12 +10,22 @@ namespace Content.Server.Speech.Components
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("words")]
|
||||
public string[] Words = default!;
|
||||
/// <summary>
|
||||
/// If this array is non-null, the full text of anything said will be randomly replaced with one of these words.
|
||||
/// </summary>
|
||||
[DataField("fullReplacements")]
|
||||
public string[]? FullReplacements;
|
||||
|
||||
/// <summary>
|
||||
/// If this dictionary is non-null and <see cref="FullReplacements"/> is null, any keys surrounded by spaces
|
||||
/// (words) will be replaced by the value, attempting to intelligently keep capitalization.
|
||||
/// </summary>
|
||||
[DataField("wordReplacements")]
|
||||
public Dictionary<string, string>? WordReplacements;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces any spoken sentences with a random word.
|
||||
/// Replaces full sentences or words within sentences with new strings.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ReplacementAccentComponent : Component
|
||||
|
||||
Reference in New Issue
Block a user