diff --git a/source/funkin/play/character/BaseCharacter.hx b/source/funkin/play/character/BaseCharacter.hx index 30b549fd3..71022c5df 100644 --- a/source/funkin/play/character/BaseCharacter.hx +++ b/source/funkin/play/character/BaseCharacter.hx @@ -580,8 +580,7 @@ class BaseCharacter extends Bopper public override function playAnimation(name:String, restart:Bool = false, ignoreOther:Bool = false, reversed:Bool = false):Void { - FlxG.watch.addQuick('playAnim(${characterName})', name); - // trace('playAnim(${characterName}): ${name}'); + // FlxG.watch.addQuick('playAnim(${characterName})', name); super.playAnimation(name, restart, ignoreOther, reversed); } } diff --git a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx index 30f0381c6..91576f2ee 100644 --- a/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorDialogHandler.hx @@ -667,8 +667,6 @@ class ChartEditorDialogHandler timeChanges[0].bpm = event.value; } - Conductor.forceBPM(event.value); - newSongMetadata.timeChanges = timeChanges; }; @@ -677,6 +675,8 @@ class ChartEditorDialogHandler dialogContinue.onClick = (_event) -> { state.songMetadata.set(targetVariation, newSongMetadata); + Conductor.mapTimeChanges(state.currentSongMetadata.timeChanges); + dialog.hideDialog(DialogButton.APPLY); } @@ -696,6 +696,8 @@ class ChartEditorDialogHandler var charData:SongCharacterData = state.currentSongMetadata.playData.characters; + var hasClearedVocals:Bool = false; + charIdsForVocals.push(charData.player); charIdsForVocals.push(charData.opponent); @@ -715,6 +717,7 @@ class ChartEditorDialogHandler if (dialogNoVocals == null) throw 'Could not locate dialogNoVocals button in Upload Vocals dialog'; dialogNoVocals.onClick = function(_event) { // Dismiss + ChartEditorAudioHandler.stopExistingVocals(state); dialog.hideDialog(DialogButton.APPLY); }; @@ -738,6 +741,12 @@ class ChartEditorDialogHandler trace('Selected file: $pathStr'); var path:Path = new Path(pathStr); + if (!hasClearedVocals) + { + hasClearedVocals = true; + ChartEditorAudioHandler.stopExistingVocals(state); + } + if (ChartEditorAudioHandler.loadVocalsFromPath(state, path, charKey, instId)) { // Tell the user the load was successful. @@ -788,6 +797,11 @@ class ChartEditorDialogHandler if (selectedFile != null && selectedFile.bytes != null) { trace('Selected file: ' + selectedFile.name); + if (!hasClearedVocals) + { + hasClearedVocals = true; + ChartEditorAudioHandler.stopExistingVocals(state); + } if (ChartEditorAudioHandler.loadVocalsFromBytes(state, selectedFile.bytes, charKey, instId)) { // Tell the user the load was successful. diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index b4c8c3483..4e561d040 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1897,6 +1897,16 @@ class ChartEditorState extends HaxeUIState handleViewKeybinds(); handleTestKeybinds(); handleHelpKeybinds(); + + #if debug + handleQuickWatch(); + #end + } + + function handleQuickWatch():Void + { + FlxG.watch.addQuick('scrollPosInPixels', scrollPositionInPixels); + FlxG.watch.addQuick('playheadPosInPixels', playheadPositionInPixels); } /** @@ -3342,6 +3352,7 @@ class ChartEditorState extends HaxeUIState if (!isHaxeUIDialogOpen && !isCursorOverHaxeUI && FlxG.keys.justPressed.ENTER) { var minimal = FlxG.keys.pressed.SHIFT; + ChartEditorToolboxHandler.hideAllToolboxes(this); testSongInPlayState(minimal); } } @@ -4153,14 +4164,13 @@ class ChartEditorState extends HaxeUIState */ function moveSongToScrollPosition():Void { - // Update the songPosition in the Conductor. - var targetPos = scrollPositionInMs; - Conductor.update(targetPos); - // Update the songPosition in the audio tracks. if (audioInstTrack != null) audioInstTrack.time = scrollPositionInMs + playheadPositionInMs; if (audioVocalTrackGroup != null) audioVocalTrackGroup.time = scrollPositionInMs + playheadPositionInMs; + // Update the songPosition in the Conductor. + Conductor.update(audioInstTrack.time); + // We need to update the note sprites because we changed the scroll position. noteDisplayDirty = true; } diff --git a/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx b/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx index 6f89b6b63..d92e43cf2 100644 --- a/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx +++ b/source/funkin/ui/debug/charting/ChartEditorToolboxHandler.hx @@ -136,6 +136,18 @@ class ChartEditorToolboxHandler } } + public static function rememberOpenToolboxes(state:ChartEditorState):Void {} + + public static function openRememberedToolboxes(state:ChartEditorState):Void {} + + public static function hideAllToolboxes(state:ChartEditorState):Void + { + for (toolbox in state.activeToolboxes.values()) + { + toolbox.hideDialog(DialogButton.CANCEL); + } + } + public static function minimizeToolbox(state:ChartEditorState, id:String):Void { var toolbox:Null = state.activeToolboxes.get(id); @@ -634,9 +646,9 @@ class ChartEditorToolboxHandler timeChanges[0].bpm = event.value; } - Conductor.forceBPM(event.value); - state.currentSongMetadata.timeChanges = timeChanges; + + Conductor.mapTimeChanges(state.currentSongMetadata.timeChanges); }; inputBPM.value = state.currentSongMetadata.timeChanges[0].bpm;