]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add sfx for writing on paper (#25257)
authorKrunklehorn <42424291+Krunklehorn@users.noreply.github.com>
Fri, 16 Feb 2024 23:48:18 +0000 (18:48 -0500)
committerGitHub <noreply@github.com>
Fri, 16 Feb 2024 23:48:18 +0000 (16:48 -0700)
* Initial commit

* Moved params to sound

* Removed type tag

* Removed null check

* Forced default

Content.Server/Paper/PaperSystem.cs
Content.Shared/Paper/SharedPaperComponent.cs
Resources/Audio/Items/Paper/attributions.yml [new file with mode: 0644]
Resources/Audio/Items/Paper/paper_scribble1.ogg [new file with mode: 0644]
Resources/Audio/Items/Paper/paper_scribble2.ogg [new file with mode: 0644]
Resources/Audio/Items/Paper/paper_scribble3.ogg [new file with mode: 0644]
Resources/Audio/Items/Paper/paper_scribble4.ogg [new file with mode: 0644]
Resources/Audio/Items/Paper/paper_scribble5.ogg [new file with mode: 0644]
Resources/Prototypes/SoundCollections/bureaucracy.yml [new file with mode: 0644]

index f599bbdb6a5b7d17bf503558ca339a96ef70a87b..c582b82e2c07d34f47a04701254e774388ef1572 100644 (file)
@@ -160,6 +160,8 @@ namespace Content.Server.Paper
                 if (args.Session.AttachedEntity != null)
                     _adminLogger.Add(LogType.Chat, LogImpact.Low,
                         $"{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;
index 1e654cc68aec6ccc894644dc52b4608e443021da..dd87f9f907ab689958cd5f9007b4bd6f7dc3af5d 100644 (file)
@@ -1,9 +1,16 @@
+using Robust.Shared.Audio;
 using Robust.Shared.Serialization;
 
 namespace Content.Shared.Paper;
 
 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]
     public sealed class PaperBoundUserInterfaceState : BoundUserInterfaceState
     {
diff --git a/Resources/Audio/Items/Paper/attributions.yml b/Resources/Audio/Items/Paper/attributions.yml
new file mode 100644 (file)
index 0000000..42c973c
--- /dev/null
@@ -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/"
diff --git a/Resources/Audio/Items/Paper/paper_scribble1.ogg b/Resources/Audio/Items/Paper/paper_scribble1.ogg
new file mode 100644 (file)
index 0000000..982bad9
Binary files /dev/null and b/Resources/Audio/Items/Paper/paper_scribble1.ogg differ
diff --git a/Resources/Audio/Items/Paper/paper_scribble2.ogg b/Resources/Audio/Items/Paper/paper_scribble2.ogg
new file mode 100644 (file)
index 0000000..fd2d907
Binary files /dev/null and b/Resources/Audio/Items/Paper/paper_scribble2.ogg differ
diff --git a/Resources/Audio/Items/Paper/paper_scribble3.ogg b/Resources/Audio/Items/Paper/paper_scribble3.ogg
new file mode 100644 (file)
index 0000000..7e44117
Binary files /dev/null and b/Resources/Audio/Items/Paper/paper_scribble3.ogg differ
diff --git a/Resources/Audio/Items/Paper/paper_scribble4.ogg b/Resources/Audio/Items/Paper/paper_scribble4.ogg
new file mode 100644 (file)
index 0000000..1d99801
Binary files /dev/null and b/Resources/Audio/Items/Paper/paper_scribble4.ogg differ
diff --git a/Resources/Audio/Items/Paper/paper_scribble5.ogg b/Resources/Audio/Items/Paper/paper_scribble5.ogg
new file mode 100644 (file)
index 0000000..8e155e5
Binary files /dev/null and b/Resources/Audio/Items/Paper/paper_scribble5.ogg differ
diff --git a/Resources/Prototypes/SoundCollections/bureaucracy.yml b/Resources/Prototypes/SoundCollections/bureaucracy.yml
new file mode 100644 (file)
index 0000000..052b102
--- /dev/null
@@ -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