Merge pull request from FunkinCrew/feature/screenshot-sound

Add a screenshot sound provided by Isaac.
This commit is contained in:
Cameron Taylor 2024-02-22 19:05:28 -05:00 committed by GitHub
commit b6a21044ea
2 changed files with 6 additions and 2 deletions
assets
source/funkin/util/plugins

2
assets

@ -1 +1 @@
Subproject commit cb122820d4f533a542fe27875202d57294600bbc
Subproject commit cb0fbb56b9667f68a9776a216c16a4e2b29f7096

View file

@ -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.