From 9ff4885173e42dacf35097a6df52891a72aaeefa Mon Sep 17 00:00:00 2001 From: Cameron Taylor <cameron.taylor.ninja@gmail.com> Date: Wed, 11 Oct 2023 19:39:52 -0400 Subject: [PATCH 1/3] charting sound effects in progress! --- assets | 2 +- .../ui/debug/charting/ChartEditorCommand.hx | 16 ++++++++++------ .../ui/debug/charting/ChartEditorState.hx | 18 +++++++++++++++++- .../charting/ChartEditorToolboxHandler.hx | 4 ++++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/assets b/assets index 6e5ed4602..b767f2d43 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 6e5ed46026a2eb1e575c5accf9192b90c13ff857 +Subproject commit b767f2d43bf357e0d092fdf255a28963fe42cdff diff --git a/source/funkin/ui/debug/charting/ChartEditorCommand.hx b/source/funkin/ui/debug/charting/ChartEditorCommand.hx index c358c1d3d..ccefea67d 100644 --- a/source/funkin/ui/debug/charting/ChartEditorCommand.hx +++ b/source/funkin/ui/debug/charting/ChartEditorCommand.hx @@ -64,7 +64,7 @@ class AddNotesCommand implements ChartEditorCommand state.currentEventSelection = []; } - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-08')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/noteLay')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -78,7 +78,7 @@ class AddNotesCommand implements ChartEditorCommand state.currentSongChartNoteData = SongDataUtils.subtractNotes(state.currentSongChartNoteData, notes); state.currentNoteSelection = []; state.currentEventSelection = []; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-01')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/undo')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -131,7 +131,7 @@ class RemoveNotesCommand implements ChartEditorCommand } state.currentNoteSelection = notes; state.currentEventSelection = []; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-08')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/undo')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -252,7 +252,7 @@ class AddEventsCommand implements ChartEditorCommand state.currentEventSelection = events; } - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-08')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/noteLay')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -312,7 +312,7 @@ class RemoveEventsCommand implements ChartEditorCommand state.currentSongChartEventData.push(event); } state.currentEventSelection = events; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-08')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/undo')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -376,7 +376,7 @@ class RemoveItemsCommand implements ChartEditorCommand state.currentNoteSelection = notes; state.currentEventSelection = events; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-08')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/undo')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -777,6 +777,8 @@ class PasteItemsCommand implements ChartEditorCommand public function undo(state:ChartEditorState):Void { + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/undo')); + state.currentSongChartNoteData = SongDataUtils.subtractNotes(state.currentSongChartNoteData, addedNotes); state.currentSongChartEventData = SongDataUtils.subtractEvents(state.currentSongChartEventData, addedEvents); state.currentNoteSelection = []; @@ -829,6 +831,8 @@ class ExtendNoteLengthCommand implements ChartEditorCommand public function undo(state:ChartEditorState):Void { + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/undo')); + note.length = oldLength; state.saveDataDirty = true; diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 67e3c1dc8..277079e31 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2096,11 +2096,18 @@ class ChartEditorState extends HaxeUIState } } + var dragLengthCurrent:Float = 0; + var stretchySounds:Bool = false; + /** * Handle display of the mouse cursor. */ function handleCursor():Void { + // Mouse sounds + if (FlxG.mouse.justPressed) FlxG.sound.play(Paths.sound("chartingSounds/ClickDown")); + if (FlxG.mouse.justReleased) FlxG.sound.play(Paths.sound("chartingSounds/ClickUp")); + // Note: If a menu is open in HaxeUI, don't handle cursor behavior. var shouldHandleCursor:Bool = !isCursorOverHaxeUI || (selectionBoxStartPos != null); var eventColumn:Int = (STRUMLINE_SIZE * 2 + 1) - 1; @@ -2449,6 +2456,14 @@ class ChartEditorState extends HaxeUIState if (dragLengthSteps > 0) { + if (dragLengthCurrent != dragLengthSteps) + { + stretchySounds = !stretchySounds; + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/stretch' + (stretchySounds ? '1' : '2') + '_UI')); + + dragLengthCurrent = dragLengthSteps; + } + gridGhostHoldNote.visible = true; gridGhostHoldNote.noteData = gridGhostNote.noteData; gridGhostHoldNote.noteDirection = gridGhostNote.noteData.getDirection(); @@ -2466,6 +2481,7 @@ class ChartEditorState extends HaxeUIState { if (dragLengthSteps > 0) { + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/stretchSNAP_UI')); // Apply the new length. performCommand(new ExtendNoteLengthCommand(currentPlaceNoteData, dragLengthMs)); } @@ -4206,7 +4222,7 @@ class ChartEditorState extends HaxeUIState function playMetronomeTick(high:Bool = false):Void { - ChartEditorAudioHandler.playSound(Paths.sound('pianoStuff/piano-${high ? '001' : '008'}')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/metronome${high ? '1' : '2'}')); } function isNoteSelected(note:Null<SongNoteData>):Bool diff --git a/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx b/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx index 6f89b6b63..25418a74e 100644 --- a/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx @@ -72,6 +72,8 @@ class ChartEditorToolboxHandler { toolbox.showDialog(false); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/openWindow')); + switch (id) { case ChartEditorState.CHART_EDITOR_TOOLBOX_TOOLS_LAYOUT: @@ -109,6 +111,8 @@ class ChartEditorToolboxHandler { toolbox.hideDialog(DialogButton.CANCEL); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/exitWindow')); + switch (id) { case ChartEditorState.CHART_EDITOR_TOOLBOX_TOOLS_LAYOUT: From 0f08b1133e67c1f7bcc7d5a905e218b7ba595dad Mon Sep 17 00:00:00 2001 From: EliteMasterEric <ericmyllyoja@gmail.com> Date: Sat, 14 Oct 2023 22:49:24 -0400 Subject: [PATCH 2/3] Rename some sounds used by the chart editor --- assets | 2 +- source/funkin/ui/debug/charting/ChartEditorCommand.hx | 8 +++++--- source/funkin/ui/debug/charting/ChartEditorState.hx | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets b/assets index b767f2d43..05973b6bb 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit b767f2d43bf357e0d092fdf255a28963fe42cdff +Subproject commit 05973b6bb816464b5cb46631285f17477d05cf08 diff --git a/source/funkin/ui/debug/charting/ChartEditorCommand.hx b/source/funkin/ui/debug/charting/ChartEditorCommand.hx index ccefea67d..e6caf61e7 100644 --- a/source/funkin/ui/debug/charting/ChartEditorCommand.hx +++ b/source/funkin/ui/debug/charting/ChartEditorCommand.hx @@ -114,7 +114,8 @@ class RemoveNotesCommand implements ChartEditorCommand state.currentSongChartNoteData = SongDataUtils.subtractNotes(state.currentSongChartNoteData, notes); state.currentNoteSelection = []; state.currentEventSelection = []; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-01')); + + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/noteErase')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -296,7 +297,8 @@ class RemoveEventsCommand implements ChartEditorCommand { state.currentSongChartEventData = SongDataUtils.subtractEvents(state.currentSongChartEventData, events); state.currentEventSelection = []; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-01')); + + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/noteErase')); state.saveDataDirty = true; state.noteDisplayDirty = true; @@ -352,7 +354,7 @@ class RemoveItemsCommand implements ChartEditorCommand state.currentNoteSelection = []; state.currentEventSelection = []; - ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-01')); + ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/noteErase')); state.saveDataDirty = true; state.noteDisplayDirty = true; diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 277079e31..b23df1d3a 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -3849,9 +3849,9 @@ class ChartEditorState extends HaxeUIState switch (noteData.getStrumlineIndex()) { case 0: // Player - if (hitsoundsEnabledPlayer) ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-09')); + if (hitsoundsEnabledPlayer) ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/hitNotePlayer')); case 1: // Opponent - if (hitsoundsEnabledOpponent) ChartEditorAudioHandler.playSound(Paths.sound('funnyNoise/funnyNoise-010')); + if (hitsoundsEnabledOpponent) ChartEditorAudioHandler.playSound(Paths.sound('chartingSounds/hitNoteOpponent')); } } } From 73022207fa6bc1bc063db5d82f1d0639dd32c140 Mon Sep 17 00:00:00 2001 From: EliteMasterEric <ericmyllyoja@gmail.com> Date: Wed, 18 Oct 2023 15:52:44 -0400 Subject: [PATCH 3/3] Merge hitsound audios --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index a66eb8353..f66c8559d 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit a66eb835318b7b4cf639d5add1de98a1a155d209 +Subproject commit f66c8559db05df42a8503abc7b59166c35ba0b2e