diff --git a/assets/sounds/editors/charter/hitsound.mp3 b/assets/sounds/editors/charter/hitsound.mp3 deleted file mode 100644 index 67cbc251..00000000 Binary files a/assets/sounds/editors/charter/hitsound.mp3 and /dev/null differ diff --git a/assets/sounds/editors/charter/metronome.mp3 b/assets/sounds/editors/charter/metronome.mp3 deleted file mode 100644 index 4a823020..00000000 Binary files a/assets/sounds/editors/charter/metronome.mp3 and /dev/null differ diff --git a/source/flixel/sound/FlxSound.hx b/source/flixel/sound/FlxSound.hx index e52b8cc7..6e83609e 100644 --- a/source/flixel/sound/FlxSound.hx +++ b/source/flixel/sound/FlxSound.hx @@ -263,8 +263,9 @@ class FlxSound extends FlxBasic { */ public function reset():Void { if (_source != null) stop(); - x = y = 0; + onFinish.removeAll(); + x = y = 0; muted = false; looped = false; loopTime = 0; @@ -297,8 +298,6 @@ class FlxSound extends FlxBasic { _lastTime = null; if (destroySound) { - onFinish.removeAll(); - if (group != null) group.remove(this); if (_channel != null) { diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index aaea5e06..64b428ca 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -479,14 +479,14 @@ final class CoolUtil * @param volume At which volume it should play */ @:noUsing public static inline function playMenuSFX(menuSFX:CoolSfx = SCROLL, volume:Float = 1) { - FlxG.sound.play(Paths.sound(switch(menuSFX) { - case CONFIRM: 'menu/confirm'; - case CANCEL: 'menu/cancel'; - case SCROLL: 'menu/scroll'; - case CHECKED: 'menu/checkboxChecked'; - case UNCHECKED: 'menu/checkboxUnchecked'; - case WARNING: 'menu/warningMenu'; - default: 'menu/scroll'; + FlxG.sound.play(Paths.sound('menu/' + switch(menuSFX) { + case CONFIRM: 'confirm'; + case CANCEL: 'cancel'; + case SCROLL: 'scroll'; + case CHECKED: 'checkboxChecked'; + case UNCHECKED: 'checkboxUnchecked'; + case WARNING: 'warningMenu'; + default: 'scroll'; }), volume); } @@ -850,11 +850,7 @@ final class CoolUtil * Stops a sound, set its time to 0 then play it again. * @param sound Sound to replay. */ - public static inline function replay(sound:FlxSound) { - sound.stop(); - sound.time = 0; - sound.play(); - } + public static inline function replay(sound:FlxSound) sound.play(true, 0); /** * Equivalent of `Math.max`, except doesn't require a Int -> Float -> Int conversion. diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index e238a92a..e701e02e 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -950,6 +950,7 @@ class Charter extends UIState { notesGroup.add(note); selection = [note]; undos.addToUndo(CCreateSelection([note])); + FlxG.sound.play(Paths.sound('editors/charter/notePlace')); } isSelecting = false; } @@ -1014,7 +1015,10 @@ class Charter extends UIState { }); if (FlxG.mouse.justReleasedRight) { - if (deletedNotes.length > 0) undos.addToUndo(CDeleteSelection(deletedNotes.copy())); + if (deletedNotes.length > 0) { + undos.addToUndo(CDeleteSelection(deletedNotes.copy())); + FlxG.sound.play(Paths.sound('editors/charter/noteDelete')); + } else if (noteDeleteAnims.garbageIcon.alpha <= .5) { var mousePos = FlxG.mouse.getScreenPosition(uiCamera); closeCurrentContextMenu(); diff --git a/source/funkin/editors/charter/CharterAutoSaveUI.hx b/source/funkin/editors/charter/CharterAutoSaveUI.hx index 37391f1a..b814a12a 100644 --- a/source/funkin/editors/charter/CharterAutoSaveUI.hx +++ b/source/funkin/editors/charter/CharterAutoSaveUI.hx @@ -79,6 +79,8 @@ class CharterAutoSaveUI extends UISliceSprite { icon.animation.curAnim.curFrame = 1; for (member in [this, progressBar, progressBarBack, autosavingText]) member.color = 0xFFA3EC95; + FlxG.sound.play(Paths.sound("editors/autosave")); + (new FlxTimer()).start(1, (_) -> {disappearAnimation();}); }); } diff --git a/source/funkin/editors/charter/CharterStrumline.hx b/source/funkin/editors/charter/CharterStrumline.hx index 2d4a4d78..41aa082f 100644 --- a/source/funkin/editors/charter/CharterStrumline.hx +++ b/source/funkin/editors/charter/CharterStrumline.hx @@ -135,8 +135,16 @@ class CharterStrumline extends UISprite { healthIcons.add(healthIcon); } - vocals = null; - vocals = strumLine.vocalsSuffix.length > 0 ? FlxG.sound.load(Paths.voices(PlayState.SONG.meta.name, PlayState.difficulty, strumLine.vocalsSuffix)) : new FlxSound(); + var asset = strumLine.vocalsSuffix.length > 0 ? Assets.getSound(Paths.voices(PlayState.SONG.meta.name, PlayState.difficulty, strumLine.vocalsSuffix)) : null; + + if (vocals == null) FlxG.sound.list.add(vocals = new FlxSound()); + if (asset != null) { + vocals.reset(); + vocals.loadEmbedded(asset); + } + else { + vocals.destroy(); + } vocals.group = FlxG.sound.defaultMusicGroup; } }