Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit 64114e9

Browse files
committed
frakits help mee
1 parent cb5e29d commit 64114e9

File tree

7 files changed

+28
-19
lines changed

7 files changed

+28
-19
lines changed
-4.89 KB
Binary file not shown.
-1.99 KB
Binary file not shown.

source/flixel/sound/FlxSound.hx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ class FlxSound extends FlxBasic {
263263
*/
264264
public function reset():Void {
265265
if (_source != null) stop();
266-
x = y = 0;
266+
onFinish.removeAll();
267267

268+
x = y = 0;
268269
muted = false;
269270
looped = false;
270271
loopTime = 0;
@@ -297,8 +298,6 @@ class FlxSound extends FlxBasic {
297298
_lastTime = null;
298299

299300
if (destroySound) {
300-
onFinish.removeAll();
301-
302301
if (group != null) group.remove(this);
303302

304303
if (_channel != null) {

source/funkin/backend/utils/CoolUtil.hx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,14 @@ final class CoolUtil
479479
* @param volume At which volume it should play
480480
*/
481481
@:noUsing public static inline function playMenuSFX(menuSFX:CoolSfx = SCROLL, volume:Float = 1) {
482-
FlxG.sound.play(Paths.sound(switch(menuSFX) {
483-
case CONFIRM: 'menu/confirm';
484-
case CANCEL: 'menu/cancel';
485-
case SCROLL: 'menu/scroll';
486-
case CHECKED: 'menu/checkboxChecked';
487-
case UNCHECKED: 'menu/checkboxUnchecked';
488-
case WARNING: 'menu/warningMenu';
489-
default: 'menu/scroll';
482+
FlxG.sound.play(Paths.sound('menu/' + switch(menuSFX) {
483+
case CONFIRM: 'confirm';
484+
case CANCEL: 'cancel';
485+
case SCROLL: 'scroll';
486+
case CHECKED: 'checkboxChecked';
487+
case UNCHECKED: 'checkboxUnchecked';
488+
case WARNING: 'warningMenu';
489+
default: 'scroll';
490490
}), volume);
491491
}
492492

@@ -850,11 +850,7 @@ final class CoolUtil
850850
* Stops a sound, set its time to 0 then play it again.
851851
* @param sound Sound to replay.
852852
*/
853-
public static inline function replay(sound:FlxSound) {
854-
sound.stop();
855-
sound.time = 0;
856-
sound.play();
857-
}
853+
public static inline function replay(sound:FlxSound) sound.play(true, 0);
858854

859855
/**
860856
* Equivalent of `Math.max`, except doesn't require a Int -> Float -> Int conversion.

source/funkin/editors/charter/Charter.hx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,7 @@ class Charter extends UIState {
950950
notesGroup.add(note);
951951
selection = [note];
952952
undos.addToUndo(CCreateSelection([note]));
953+
FlxG.sound.play(Paths.sound('editors/charter/notePlace'));
953954
}
954955
isSelecting = false;
955956
}
@@ -1014,7 +1015,10 @@ class Charter extends UIState {
10141015
});
10151016

10161017
if (FlxG.mouse.justReleasedRight) {
1017-
if (deletedNotes.length > 0) undos.addToUndo(CDeleteSelection(deletedNotes.copy()));
1018+
if (deletedNotes.length > 0) {
1019+
undos.addToUndo(CDeleteSelection(deletedNotes.copy()));
1020+
FlxG.sound.play(Paths.sound('editors/charter/noteDelete'));
1021+
}
10181022
else if (noteDeleteAnims.garbageIcon.alpha <= .5) {
10191023
var mousePos = FlxG.mouse.getScreenPosition(uiCamera);
10201024
closeCurrentContextMenu();

source/funkin/editors/charter/CharterAutoSaveUI.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ class CharterAutoSaveUI extends UISliceSprite {
7979
icon.animation.curAnim.curFrame = 1;
8080
for (member in [this, progressBar, progressBarBack, autosavingText]) member.color = 0xFFA3EC95;
8181

82+
FlxG.sound.play(Paths.sound("editors/autosave"));
83+
8284
(new FlxTimer()).start(1, (_) -> {disappearAnimation();});
8385
});
8486
}

source/funkin/editors/charter/CharterStrumline.hx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,16 @@ class CharterStrumline extends UISprite {
135135
healthIcons.add(healthIcon);
136136
}
137137

138-
vocals = null;
139-
vocals = strumLine.vocalsSuffix.length > 0 ? FlxG.sound.load(Paths.voices(PlayState.SONG.meta.name, PlayState.difficulty, strumLine.vocalsSuffix)) : new FlxSound();
138+
var asset = strumLine.vocalsSuffix.length > 0 ? Assets.getSound(Paths.voices(PlayState.SONG.meta.name, PlayState.difficulty, strumLine.vocalsSuffix)) : null;
139+
140+
if (vocals == null) FlxG.sound.list.add(vocals = new FlxSound());
141+
if (asset != null) {
142+
vocals.reset();
143+
vocals.loadEmbedded(asset);
144+
}
145+
else {
146+
vocals.destroy();
147+
}
140148
vocals.group = FlxG.sound.defaultMusicGroup;
141149
}
142150
}

0 commit comments

Comments
 (0)