diff --git a/assets b/assets index 2dd4ab0eb..f3e9cd835 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 2dd4ab0eb9979422c1c4cb849ebe899b7bf1758a +Subproject commit f3e9cd8355f20445fcad7030fdb6363a2325adb3 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 1a0f94341..519d1a54a 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2085,10 +2085,34 @@ 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; + } }; + playbarBPM.onClick = _ -> { + if (FlxG.keys.pressed.CONTROL) + { + this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, true); + } + else + { + Conductor.currentTimeChange.bpm += 1; + refreshMetadataToolbox(); + } + } + + playbarBPM.onRightClick = _ -> { + Conductor.currentTimeChange.bpm -= 1; + refreshMetadataToolbox(); + } + // Add functionality to the menu items. // File @@ -2264,6 +2288,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); @@ -3979,6 +4007,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (playbarSongRemaining.value != songRemainingString) playbarSongRemaining.value = songRemainingString; playbarNoteSnap.text = '1/${noteSnapQuant}'; + playbarDifficulty.text = "Difficulty: " + selectedDifficulty.toTitleCase(); + playbarBPM.text = "BPM: " + Conductor.currentTimeChange.bpm; } function handlePlayhead():Void 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); 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);