Replace string data fields with LocId where relevant (#20883)

This commit is contained in:
DrSmugleaf
2023-10-10 20:06:24 -07:00
committed by GitHub
parent ef233cf0fe
commit 9bcf67753a
69 changed files with 265 additions and 286 deletions

View File

@@ -12,37 +12,37 @@ public sealed partial class WarDeclaratorComponent : Component
/// Custom war declaration message. If empty, use default.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("message")]
[DataField]
public string Message;
/// <summary>
/// Permission to customize message text
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("allowEditingMessage")]
[DataField]
public bool AllowEditingMessage = true;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxMessageLength")]
[DataField]
public int MaxMessageLength = 512;
/// <summary>
/// War declarement text color
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("color")]
public Color DeclarementColor = Color.Red;
[DataField]
public Color Color = Color.Red;
/// <summary>
/// War declarement sound file path
/// </summary>
[DataField("sound")]
public SoundSpecifier DeclarementSound = new SoundPathSpecifier("/Audio/Announcements/war.ogg");
[DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Announcements/war.ogg");
/// <summary>
/// Fluent ID for the declarement title
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("title")]
public string DeclarementTitle = "comms-console-announcement-title-nukie";
[DataField]
public LocId Title = "comms-console-announcement-title-nukie";
}

View File

@@ -76,9 +76,9 @@ public sealed class WarDeclaratorSystem : EntitySystem
{
message = Loc.GetString("war-declarator-default-message");
}
var title = Loc.GetString(component.DeclarementTitle);
var title = Loc.GetString(component.Title);
_nukeopsRuleSystem.DeclareWar(args.Session.AttachedEntity.Value, message, title, component.DeclarementSound, component.DeclarementColor);
_nukeopsRuleSystem.DeclareWar(args.Session.AttachedEntity.Value, message, title, component.Sound, component.Color);
if (args.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"{ToPrettyString(args.Session.AttachedEntity.Value):player} has declared war with this text: {message}");