From e44559d056bc321a0ac5aea443a69b135b9c0180 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 27 Nov 2023 20:37:10 -0500 Subject: [PATCH 1/5] last modified --- .../ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx index 3c8fbb15b..744bf4ac4 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx @@ -83,10 +83,18 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog public function addRecentFilePath(state:ChartEditorState, chartPath:String):Void { var linkRecentChart:Link = new Link(); + var fileNamePattern:EReg = new EReg("([^/\\\\]+)$", ""); var fileName:String = fileNamePattern.match(chartPath) ? fileNamePattern.matched(1) : chartPath; linkRecentChart.text = fileName; + linkRecentChart.tooltip = chartPath; + + #if sys + var lastModified:String = "Last Modified: " + sys.FileSystem.stat(chartPath).mtime.toString(); + linkRecentChart.tooltip += "\n" + lastModified; + #end + linkRecentChart.onClick = function(_event) { this.hideDialog(DialogButton.CANCEL); From aee8df4fcb3062919eb7179b2d92da26eb014898 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 27 Nov 2023 23:29:48 -0500 Subject: [PATCH 2/5] default note snapps --- assets | 2 +- source/funkin/ui/debug/charting/ChartEditorState.hx | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/assets b/assets index 2dd4ab0eb..33ee5181c 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 2dd4ab0eb9979422c1c4cb849ebe899b7bf1758a +Subproject commit 33ee5181c09e954beaf3629e34375eceb832bfd2 diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 1794a3b7e..da3a3b0b6 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2085,8 +2085,15 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (noteSnapQuantIndex < 0) noteSnapQuantIndex = SNAP_QUANTS.length - 1; }; playbarNoteSnap.onClick = _ -> { - noteSnapQuantIndex++; - if (noteSnapQuantIndex >= SNAP_QUANTS.length) noteSnapQuantIndex = 0; + if (FlxG.keys.pressed.SHIFT) + { + noteSnapQuantIndex = BASE_QUANT_INDEX; + } + else + { + noteSnapQuantIndex++; + if (noteSnapQuantIndex >= SNAP_QUANTS.length) noteSnapQuantIndex = 0; + } }; // Add functionality to the menu items. From d9d5744f1eff2b75a4ac1e19962a096662a3009e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 28 Nov 2023 04:05:17 -0500 Subject: [PATCH 3/5] difficulty playbar --- assets | 2 +- source/funkin/ui/debug/charting/ChartEditorState.hx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets b/assets index 33ee5181c..082a5df5b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 33ee5181c09e954beaf3629e34375eceb832bfd2 +Subproject commit 082a5df5bab669132f3b8f532b48be39c8f4fd43 diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index da3a3b0b6..4a8f22982 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -3979,6 +3979,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (playbarSongRemaining.value != songRemainingString) playbarSongRemaining.value = songRemainingString; playbarNoteSnap.text = '1/${noteSnapQuant}'; + playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase(); } function handlePlayhead():Void From 21b79c0b837a2f37f3ce82df3cd8ac6f4a2b7ab6 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 28 Nov 2023 04:30:29 -0500 Subject: [PATCH 4/5] bpm in playbar --- assets | 2 +- .../ui/debug/charting/ChartEditorState.hx | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/assets b/assets index 082a5df5b..f3e9cd835 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 082a5df5bab669132f3b8f532b48be39c8f4fd43 +Subproject commit f3e9cd8355f20445fcad7030fdb6363a2325adb3 diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 4a8f22982..6f0e55fb7 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2096,6 +2096,23 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } }; + playbarBPM.onClick = _ -> { + if (FlxG.keys.pressed.CONTROL) + { + this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, true); + } + else + { + currentSongMetadata.timeChanges[0].bpm += 1; + refreshMetadataToolbox(); + } + } + + playbarBPM.onRightClick = _ -> { + currentSongMetadata.timeChanges[0].bpm -= 1; + refreshMetadataToolbox(); + } + // Add functionality to the menu items. // File @@ -2268,6 +2285,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarLabelPlaybackSpeed.text = 'Playback Speed - ${pitchDisplay}x'; } + playbarDifficulty.onClick = _ -> { + this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, true); + } + menubarItemToggleToolboxDifficulty.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, event.value); menubarItemToggleToolboxMetadata.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, event.value); menubarItemToggleToolboxNotes.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_NOTEDATA_LAYOUT, event.value); @@ -3980,6 +4001,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState playbarNoteSnap.text = '1/${noteSnapQuant}'; playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase(); + playbarBPM.text = "BPM: " + currentSongMetadata.timeChanges[0].bpm; } function handlePlayhead():Void From 99ed8b94d79c95c0b27c8eb50150e0ee3244861c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 28 Nov 2023 21:44:09 -0500 Subject: [PATCH 5/5] Target the current time change rather than the first one. --- source/funkin/Conductor.hx | 8 ++++---- source/funkin/ui/debug/charting/ChartEditorState.hx | 6 +++--- source/funkin/ui/debug/latency/LatencyState.hx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 10bf505f0..b8ded63da 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -35,15 +35,15 @@ class Conductor static var timeChanges:Array = []; /** - * The current time change. + * The most recent time change for the current song position. */ - static var currentTimeChange:SongTimeChange; + public static var currentTimeChange(default, null):SongTimeChange; /** * The current position in the song in milliseconds. - * Updated every frame based on the audio position. + * Update this every frame based on the audio position using `Conductor.update()`. */ - public static var songPosition:Float = 0; + public static var songPosition(default, null):Float = 0; /** * Beats per minute of the current song at the current time. diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 6f0e55fb7..798631414 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2103,13 +2103,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } else { - currentSongMetadata.timeChanges[0].bpm += 1; + Conductor.currentTimeChange.bpm += 1; refreshMetadataToolbox(); } } playbarBPM.onRightClick = _ -> { - currentSongMetadata.timeChanges[0].bpm -= 1; + Conductor.currentTimeChange.bpm -= 1; refreshMetadataToolbox(); } @@ -4001,7 +4001,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState playbarNoteSnap.text = '1/${noteSnapQuant}'; playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase(); - playbarBPM.text = "BPM: " + currentSongMetadata.timeChanges[0].bpm; + playbarBPM.text = "BPM: " + Conductor.currentTimeChange.bpm; } function handlePlayhead():Void diff --git a/source/funkin/ui/debug/latency/LatencyState.hx b/source/funkin/ui/debug/latency/LatencyState.hx index 7cb18a3de..673b866f8 100644 --- a/source/funkin/ui/debug/latency/LatencyState.hx +++ b/source/funkin/ui/debug/latency/LatencyState.hx @@ -267,7 +267,7 @@ class LatencyState extends MusicBeatSubState function generateBeatStuff() { - Conductor.songPosition = swagSong.getTimeWithDiff(); + Conductor.update(swagSong.getTimeWithDiff()); var closestBeat:Int = Math.round(Conductor.songPosition / Conductor.beatLengthMs) % diffGrp.members.length; var getDiff:Float = Conductor.songPosition - (closestBeat * Conductor.beatLengthMs);