Add sfx for writing on paper (#25257)

* Initial commit

* Moved params to sound

* Removed type tag

* Removed null check

* Forced default
This commit is contained in:
Krunklehorn
2024-02-16 18:48:18 -05:00
committed by GitHub
parent b2e8c2e3aa
commit 1de3f24f16
9 changed files with 21 additions and 0 deletions

View File

@@ -160,6 +160,8 @@ namespace Content.Server.Paper
if (args.Session.AttachedEntity != null) if (args.Session.AttachedEntity != null)
_adminLogger.Add(LogType.Chat, LogImpact.Low, _adminLogger.Add(LogType.Chat, LogImpact.Low,
$"{ToPrettyString(args.Session.AttachedEntity.Value):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}"); $"{ToPrettyString(args.Session.AttachedEntity.Value):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}");
_audio.PlayPvs(paperComp.Sound, uid);
} }
paperComp.Mode = PaperAction.Read; paperComp.Mode = PaperAction.Read;

View File

@@ -1,9 +1,16 @@
using Robust.Shared.Audio;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.Paper; namespace Content.Shared.Paper;
public abstract partial class SharedPaperComponent : Component public abstract partial class SharedPaperComponent : Component
{ {
/// <summary>
/// Sound played after writing to the paper.
/// </summary>
[DataField("sound")]
public SoundSpecifier? Sound { get; private set; } = new SoundCollectionSpecifier("PaperScribbles", AudioParams.Default.WithVariation(0.1f));
[Serializable, NetSerializable] [Serializable, NetSerializable]
public sealed class PaperBoundUserInterfaceState : BoundUserInterfaceState public sealed class PaperBoundUserInterfaceState : BoundUserInterfaceState
{ {

View File

@@ -0,0 +1,4 @@
- files: ["paper_scribble1.ogg", "paper_scribble2.ogg", "paper_scribble3.ogg", "paper_scribble4.ogg", "paper_scribble5.ogg"]
license: "CC0-1.0"
copyright: "Originally 'Pen Clicks and Writing on Paper' created by PDaefaul. Cut, spliced and converted by Krunklehorn."
source: "https://freesound.org/people/PDaefaul/sounds/631971/"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,8 @@
- type: soundCollection
id: PaperScribbles
files:
- /Audio/Items/Paper/paper_scribble1.ogg
- /Audio/Items/Paper/paper_scribble2.ogg
- /Audio/Items/Paper/paper_scribble3.ogg
- /Audio/Items/Paper/paper_scribble4.ogg
- /Audio/Items/Paper/paper_scribble5.ogg