From 64114e934954d50c5b4b07d5f18d9be4be006dbd Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Tue, 22 Jul 2025 20:19:16 +0700 Subject: [PATCH] frakits help mee --- assets/sounds/editors/charter/hitsound.mp3 | Bin 5012 -> 0 bytes assets/sounds/editors/charter/metronome.mp3 | Bin 2041 -> 0 bytes source/flixel/sound/FlxSound.hx | 5 ++-- source/funkin/backend/utils/CoolUtil.hx | 22 +++++++----------- source/funkin/editors/charter/Charter.hx | 6 ++++- .../editors/charter/CharterAutoSaveUI.hx | 2 ++ .../editors/charter/CharterStrumline.hx | 12 ++++++++-- 7 files changed, 28 insertions(+), 19 deletions(-) delete mode 100644 assets/sounds/editors/charter/hitsound.mp3 delete mode 100644 assets/sounds/editors/charter/metronome.mp3 diff --git a/assets/sounds/editors/charter/hitsound.mp3 b/assets/sounds/editors/charter/hitsound.mp3 deleted file mode 100644 index 67cbc2513dcf4aee8b7007462a629d1fa47f4728..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5012 zcmds5cT`i)mw%!6Dv%&Zr~)D+^bVnh5(p3!1in(GBfSfu8u-$CQ4|3MrK&*`mEJ>9 z5fKFiL8Xcy2u70MbN77RJ-_{(-G9F4?AiUCcjwNXnRoAfGk50AjG2)VEdT-{fHT7> zf*B5wtivMUKEC1bu!|8vo;a*A5-ei|$u7du(l^pA2Q3ySn0DIye=a7MO<|5-#? z8i3+|Rpj8{0G11ZWF6}3?HlA40Cx)w_YDh|4wLy0-GBgMCwfnHAMBW2ZM)XEmTH?@5(y5Sa#X#2vu`y@?;5y7s&!o@PCOLY3h6BId;n5Hv z=QBX>PRp2ud;!;fmWWUo7^!vo@$71{?Rar!t#99nk>RYIR4n(mqy3HXF@S9-&@cjcCxzsL8`QQ}X(-F0sn>d|*HwT0T0qmn3hcXZP)fOw7S zw^s3mqSZ9-LTN`v%Fkad<{|(99Sxk-ZTUmRb;vzu9nDnN=i%;5SfAlwAR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?a65!JZQbzZT3}vY!8l&iy|hk${-=x(!sc(+d z^IvOi|1Yk3{+EvicfrBuElWfGZ@29&YBgXIcv7&`^?218F{T~^=FCewrDx@=JFsEp zXW{5`)vwi8NU)Z7H81QG=RY>@Ft@3vfYYHxg6bNz$_mn*DocaslpQ^+=z29aV{(4X z?bD7*g;~k{la9-4D(zbD{f9^6)jG*ccOLnVxm;SgW&O4FruCvndMZ6;mlRT$OafR7S1Idkv;+iJ@!f_nUjhEa1 z|4umav4PL!W%}P11|?&IjLIo}Gg>^FF1f0xCvtW#)$b`-!(H%FNIB@!B%{FUPbI0I z6Bn6uDQiu-=$i3=!sBOd$68kI^8B|Y@c*)mnXTMvDSLI}|G(UN?xvX)*ZefD|6kPD z%KvA8 VE|FniP+(v%X#m!w)U*I<7689&x_AHp 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; } }