diff --git a/Content.Server/_CD/TapeRecorder/TapeRecorderSystem.cs b/Content.Server/_CD/TapeRecorder/TapeRecorderSystem.cs index d900fc4c55b..616de8369ef 100644 --- a/Content.Server/_CD/TapeRecorder/TapeRecorderSystem.cs +++ b/Content.Server/_CD/TapeRecorder/TapeRecorderSystem.cs @@ -46,7 +46,7 @@ protected override void ReplayMessagesInSegment(Entity en voice.NameOverride = message.Name ?? ent.Comp.DefaultName; // TODO: mimic the exact string chosen when the message was recorded var verb = message.Verb ?? SharedChatSystem.DefaultSpeechVerb; - speech.SpeechVerb = _proto.Index; + speech.SpeechVerb = _proto.Index(verb); // Play the message _chat.TrySendInGameICMessage(ent, message.Message, InGameICChatType.Speak, false); } diff --git a/Content.Shared/_CD/TapeRecorder/Events/TapeRecorderEvents.cs b/Content.Shared/_CD/TapeRecorder/Events/TapeRecorderEvents.cs index 845125cbaf1..3b245ca653e 100644 --- a/Content.Shared/_CD/TapeRecorder/Events/TapeRecorderEvents.cs +++ b/Content.Shared/_CD/TapeRecorder/Events/TapeRecorderEvents.cs @@ -17,27 +17,17 @@ public sealed class ChangeModeTapeRecorderMessage(TapeRecorderMode mode) : Bound public sealed class PrintTapeRecorderMessage : BoundUserInterfaceMessage; [Serializable, NetSerializable] -public sealed class TapeRecorderState : BoundUserInterfaceState +public sealed class TapeRecorderState( + bool hasCassette, + float currentTime, + float maxTime, + string cassetteName, + TimeSpan printCooldown): BoundUserInterfaceState { // TODO: check the itemslot on client instead of putting easy cassette stuff in the state - public bool HasCassette; - public float CurrentTime; - public float MaxTime; - public string CassetteName; - public TimeSpan PrintCooldown; - - public TapeRecorderState( - bool hasCassette, - bool hasData, - float currentTime, - float maxTime, - string cassetteName, - TimeSpan printCooldown) - { - HasCassette = hasCassette; - CurrentTime = currentTime; - MaxTime = maxTime; - CassetteName = cassetteName; - PrintCooldown = printCooldown; - } + public bool HasCassette = hasCassette; + public float CurrentTime = currentTime; + public float MaxTime = maxTime; + public string CassetteName = cassetteName; + public TimeSpan PrintCooldown = printCooldown; } diff --git a/Content.Shared/_CD/TapeRecorder/SharedTapeRecorderSystem.cs b/Content.Shared/_CD/TapeRecorder/SharedTapeRecorderSystem.cs index 972162ac3ee..ee346aed370 100644 --- a/Content.Shared/_CD/TapeRecorder/SharedTapeRecorderSystem.cs +++ b/Content.Shared/_CD/TapeRecorder/SharedTapeRecorderSystem.cs @@ -29,7 +29,7 @@ public abstract class SharedTapeRecorderSystem : EntitySystem [Dependency] protected readonly IGameTiming Timing = default!; [Dependency] protected readonly SharedAudioSystem Audio = default!; - private protected const string SlotName = "cassette_tape"; + private const string SlotName = "cassette_tape"; public override void Initialize() { @@ -177,7 +177,7 @@ protected virtual void ReplayMessagesInSegment(Entity ent /// /// Start repairing a damaged tape when using a screwdriver or pen on it /// - private protected void OnInteractingWithCassette(Entity ent, ref InteractUsingEvent args) + private void OnInteractingWithCassette(Entity ent, ref InteractUsingEvent args) { // Is the tape damaged? if (HasComp(ent)) @@ -197,7 +197,7 @@ private protected void OnInteractingWithCassette(Entity e /// /// Repair a damaged tape /// - private protected void OnTapeCassetteRepair(Entity ent, ref TapeCassetteRepairDoAfterEvent args) + private void OnTapeCassetteRepair(Entity ent, ref TapeCassetteRepairDoAfterEvent args) { if (args.Handled || args.Cancelled || args.Args.Target == null) return; @@ -214,7 +214,7 @@ private protected void OnTapeCassetteRepair(Entity ent, r /// /// When the cassette has been damaged, corrupt and entry and unspool it /// - private protected void OnDamagedChanged(Entity ent, ref DamageChangedEvent args) + private void OnDamagedChanged(Entity ent, ref DamageChangedEvent args) { if (args.DamageDelta == null || args.DamageDelta.GetTotal() < 5) return; @@ -225,7 +225,7 @@ private protected void OnDamagedChanged(Entity ent, ref D CorruptRandomEntry(ent); } - private protected void OnTapeExamined(Entity ent, ref ExaminedEvent args) + private void OnTapeExamined(Entity ent, ref ExaminedEvent args) { if (!args.IsInDetailsRange) return; @@ -241,7 +241,7 @@ private protected void OnTapeExamined(Entity ent, ref Exa args.PushMarkup(tapePosMsg); } - private protected void OnRecorderExamined(Entity ent, ref ExaminedEvent args) + private void OnRecorderExamined(Entity ent, ref ExaminedEvent args) { if (!args.IsInDetailsRange) return; @@ -268,7 +268,7 @@ private protected void OnRecorderExamined(Entity ent, ref /// /// Prevent removing the tape cassette while the recorder is active /// - private protected void OnCassetteRemoveAttempt(Entity ent, ref ItemSlotEjectAttemptEvent args) + private void OnCassetteRemoveAttempt(Entity ent, ref ItemSlotEjectAttemptEvent args) { if (!HasComp(ent)) return; @@ -276,14 +276,14 @@ private protected void OnCassetteRemoveAttempt(Entity ent args.Cancelled = true; } - private protected void OnCassetteRemoved(Entity ent, ref EntRemovedFromContainerMessage args) + private void OnCassetteRemoved(Entity ent, ref EntRemovedFromContainerMessage args) { SetMode(ent, TapeRecorderMode.Stopped); UpdateAppearance(ent); UpdateUI(ent); } - private protected void OnCassetteInserted(Entity ent, ref EntInsertedIntoContainerMessage args) + private void OnCassetteInserted(Entity ent, ref EntInsertedIntoContainerMessage args) { UpdateAppearance(ent); UpdateUI(ent); @@ -293,7 +293,7 @@ private protected void OnCassetteInserted(Entity ent, ref /// Update the appearance of the tape recorder. /// /// The tape recorder to update - private protected void UpdateAppearance(Entity ent) + private void UpdateAppearance(Entity ent) { var hasCassette = TryGetTapeCassette(ent, out _); _appearance.SetData(ent, TapeRecorderVisuals.Mode, ent.Comp.Mode); @@ -303,7 +303,7 @@ private protected void UpdateAppearance(Entity ent) /// /// Choose a random recorded entry on the cassette and replace some of the text with hashes /// - private protected void CorruptRandomEntry(TapeCassetteComponent tape) + private void CorruptRandomEntry(TapeCassetteComponent tape) { if (tape.RecordedData.Count == 0) return; @@ -362,7 +362,7 @@ private void SetMode(Entity ent, TapeRecorderMode mode) UpdateUI(ent); } - private protected bool TryGetTapeCassette(EntityUid ent, out Entity tape) + protected bool TryGetTapeCassette(EntityUid ent, out Entity tape) { if (_slots.GetItemOrNull(ent, SlotName) is not {} cassette) { @@ -408,7 +408,6 @@ private void UpdateUI(Entity ent) var state = new TapeRecorderState( hasCassette, - hasData, currentTime, maxTime, cassetteName,