From 818e80ed74233ef33224284c4238c30c71221fa1 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 22 Feb 2024 03:15:06 -0500 Subject: [PATCH] Add a screenshot sound provided by Isaac. --- assets | 2 +- source/funkin/util/plugins/ScreenshotPlugin.hx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets b/assets index c8f320e89..14abe753a 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit c8f320e89f65f9e6242354b25f04aac2c07cceeb +Subproject commit 14abe753a2af62879f7ebaf717331297ff7d7a81 diff --git a/source/funkin/util/plugins/ScreenshotPlugin.hx b/source/funkin/util/plugins/ScreenshotPlugin.hx index 16d0c7244..d7e8109b8 100644 --- a/source/funkin/util/plugins/ScreenshotPlugin.hx +++ b/source/funkin/util/plugins/ScreenshotPlugin.hx @@ -13,6 +13,7 @@ import flixel.util.FlxSignal; import flixel.util.FlxTimer; import funkin.graphics.FunkinSprite; import funkin.input.Cursor; +import funkin.audio.FunkinSound; import openfl.display.Bitmap; import openfl.display.Sprite; import openfl.display.BitmapData; @@ -162,7 +163,7 @@ class ScreenshotPlugin extends FlxBasic final CAMERA_FLASH_DURATION = 0.25; /** - * Visual (and audio?) feedback when a screenshot is taken. + * Visual and audio feedback when a screenshot is taken. */ function showCaptureFeedback():Void { @@ -171,6 +172,9 @@ class ScreenshotPlugin extends FlxBasic flashSpr.addChild(flashBitmap); FlxG.stage.addChild(flashSpr); FlxTween.tween(flashSpr, {alpha: 0}, 0.15, {ease: FlxEase.quadOut, onComplete: _ -> FlxG.stage.removeChild(flashSpr)}); + + // Play a sound (auto-play is true). + FunkinSound.load(Paths.sound('screenshot'), 1.0, false, true, true); } static final PREVIEW_INITIAL_DELAY = 0.25; // How long before the preview starts fading in.