diff --git a/mod/Jailbreak.Logs/Listeners/LogEntityListeners.cs b/mod/Jailbreak.Logs/Listeners/LogEntityListeners.cs index 0bfc2c70..87991aaf 100644 --- a/mod/Jailbreak.Logs/Listeners/LogEntityListeners.cs +++ b/mod/Jailbreak.Logs/Listeners/LogEntityListeners.cs @@ -27,8 +27,7 @@ public HookResult OnButtonPressed(CEntityIOOutput output, string name, CEntityIn CBaseEntity? ent = Utilities.GetEntityFromIndex((int)caller.Index); - _logs.Append( - $"{_logs.Player(player)} pressed a button: {ent.Entity?.Name ?? "Unlabeled"} -> {output?.Connections?.TargetDesc ?? "None"}"); + _logs.Append(_logs.Player(player) $"pressed a button: {ent.Entity?.Name ?? "Unlabeled"} -> {output?.Connections?.TargetDesc ?? "None"}"); return HookResult.Continue; } @@ -42,8 +41,7 @@ public HookResult OnBreakableBroken(CEntityIOOutput output, string name, CEntity CBaseEntity? ent = Utilities.GetEntityFromIndex((int)caller.Index); - _logs.Append( - $"{_logs.Player(player)} broke an entity: {ent.Entity?.Name ?? "Unlabeled"} -> {output?.Connections?.TargetDesc ?? "None"}"); + _logs.Append(_logs.Player(player), $"broke an entity: {ent.Entity?.Name ?? "Unlabeled"} -> {output?.Connections?.TargetDesc ?? "None"}"); return HookResult.Continue; } } diff --git a/public/Jailbreak.Formatting/Core/FormatObject.cs b/public/Jailbreak.Formatting/Core/FormatObject.cs index daef6232..9bbddc1b 100644 --- a/public/Jailbreak.Formatting/Core/FormatObject.cs +++ b/public/Jailbreak.Formatting/Core/FormatObject.cs @@ -45,4 +45,7 @@ public static FormatObject FromObject(object value) { return new StringFormatObject(value.ToString() ?? "null"); } -} \ No newline at end of file + + public override string ToString() + => ToPlain(); +} diff --git a/public/Jailbreak.Formatting/Objects/PlayerFormatObject.cs b/public/Jailbreak.Formatting/Objects/PlayerFormatObject.cs index 08b04f0e..3143fecf 100644 --- a/public/Jailbreak.Formatting/Objects/PlayerFormatObject.cs +++ b/public/Jailbreak.Formatting/Objects/PlayerFormatObject.cs @@ -7,25 +7,25 @@ namespace Jailbreak.Formatting.Objects; public class PlayerFormatObject : FormatObject { - private readonly CCSPlayerController _player; + private readonly string _name; public PlayerFormatObject(CCSPlayerController player) { - _player = player; + _name = player.PlayerName; } public override string ToChat() { - return $"{ChatColors.Yellow}{_player.PlayerName}"; + return $"{ChatColors.Yellow}{_name}"; } public override string ToPanorama() { - return _player.PlayerName.Sanitize(); + return _name.Sanitize(); } public override string ToPlain() { - return _player.PlayerName; + return _name; } -} \ No newline at end of file +}