From e44559d056bc321a0ac5aea443a69b135b9c0180 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 27 Nov 2023 20:37:10 -0500 Subject: [PATCH 1/7] 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/7] 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/7] 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/7] 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 9a2f235bed085e95a2aa14942ee857882ac15064 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 28 Nov 2023 20:52:45 -0500 Subject: [PATCH 5/7] Platform-specific fixes for HTML5 and MacOS --- docs/troubleshooting.md | 6 +++ hmm.json | 4 +- source/funkin/ui/freeplay/CapsuleText.hx | 9 ++++- source/funkin/ui/freeplay/FreeplayState.hx | 5 +++ source/funkin/ui/transition/LoadingState.hx | 41 +++++++++++---------- 5 files changed, 43 insertions(+), 22 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 26958a467..27208689b 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -1,6 +1,12 @@ # Troubleshooting Common Issues - Weird macro error with a very tall call stack: Restart Visual Studio Code + - NOTE: This is caused by Polymod somewhere, and seems to only occur when there is another compile error somewhere in the program. There is a bounty up for it. + - `Get Thread Context Failed`: Turn off other expensive applications while building + - `Type not found: T1`: This is thrown by `json2object`, make sure the data type of `@:default` is correct. - NOTE: `flixel.util.typeLimit.OneOfTwo` isn't supported. + +- `Class lists not properly generated. Try cleaning out your export folder, restarting your IDE, and rebuilding your project.` + - This is a bug specific to HTML5. Simply perform the steps listed (don't forget to restart the IDE too). diff --git a/hmm.json b/hmm.json index 593011448..64a05b16f 100644 --- a/hmm.json +++ b/hmm.json @@ -11,7 +11,7 @@ "name": "flixel", "type": "git", "dir": null, - "ref": "8437a86aa5dafdb3f5dcb91d212cb10a4ee6e53b", + "ref": "da04cbda49a4c5eebe93fb61296dbaf4f0f1b556", "url": "https://github.com/EliteMasterEric/flixel" }, { @@ -144,7 +144,7 @@ "name": "polymod", "type": "git", "dir": null, - "ref": "e8a07b81e3bc535238ad8649e38f5d43c46f1b65", + "ref": "41aea83dbc267234b301434553ce8c17742b8ab7", "url": "https://github.com/larsiusprime/polymod" }, { diff --git a/source/funkin/ui/freeplay/CapsuleText.hx b/source/funkin/ui/freeplay/CapsuleText.hx index 1a5a0a335..3a520e015 100644 --- a/source/funkin/ui/freeplay/CapsuleText.hx +++ b/source/funkin/ui/freeplay/CapsuleText.hx @@ -38,12 +38,19 @@ class CapsuleText extends FlxSpriteGroup function set_text(value:String):String { + if (value == null) return value; + if (blurredText == null || whiteText == null) + { + trace('WARN: Capsule not initialized properly'); + return text = value; + } + blurredText.text = value; whiteText.text = value; whiteText.textField.filters = [ new openfl.filters.GlowFilter(0x00ccff, 1, 5, 5, 210, BitmapFilterQuality.MEDIUM), // new openfl.filters.BlurFilter(5, 5, BitmapFilterQuality.LOW) ]; - return value; + return text = value; } } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 37e1260c0..371021114 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -998,6 +998,11 @@ class FreeplayState extends MusicBeatSubState PlayStatePlaylist.isStoryMode = false; var targetSong:Song = SongRegistry.instance.fetchEntry(cap.songData.songId); + if (targetSong == null) + { + FlxG.log.warn('WARN: could not find song with id (${cap.songData.songId})'); + return; + } var targetDifficulty:String = currentDifficulty; // TODO: Implement Pico into the interface properly. diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index 69590bfe3..a223a4123 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -1,24 +1,25 @@ package funkin.ui.transition; -import funkin.play.PlayStatePlaylist; import flixel.FlxSprite; import flixel.FlxState; -import funkin.graphics.shaders.ScreenWipeShader; import flixel.math.FlxMath; +import flixel.tweens.FlxEase; +import flixel.tweens.FlxTween; import flixel.util.FlxTimer; +import funkin.graphics.shaders.ScreenWipeShader; import funkin.play.PlayState; +import funkin.play.PlayStatePlaylist; +import funkin.play.song.Song.SongDifficulty; +import funkin.ui.mainmenu.MainMenuState; +import funkin.ui.MusicBeatState; import haxe.io.Path; import lime.app.Future; -import flixel.tweens.FlxTween; -import funkin.ui.MusicBeatState; import lime.app.Promise; import lime.utils.AssetLibrary; -import flixel.tweens.FlxEase; import lime.utils.AssetManifest; import lime.utils.Assets as LimeAssets; -import openfl.utils.Assets; -import funkin.ui.mainmenu.MainMenuState; import openfl.filters.ShaderFilter; +import openfl.utils.Assets; class LoadingState extends MusicBeatState { @@ -59,18 +60,20 @@ class LoadingState extends MusicBeatState initSongsManifest().onComplete(function(lib) { callbacks = new MultiCallback(onLoad); var introComplete = callbacks.add('introComplete'); - // checkLoadSong(getSongPath()); - // if (PlayState.currentSong.needsVoices) - // { - // var files = PlayState.currentSong.voiceList; - // - // if (files == null) files = ['']; // loads with no file name assumption, to load 'Voices.ogg' or whatev normally - // - // for (sndFile in files) - // { - // checkLoadSong(getVocalPath(sndFile)); - // } - // } + + if (Std.isOfType(target, PlayState)) + { + var targetPlayState:PlayState = cast target; + var targetChart:SongDifficulty = targetPlayState.currentChart; + var instPath:String = Paths.inst(targetChart.song.id); + var voicesPaths:Array = targetChart.buildVoiceList(); + + checkLoadSong(instPath); + for (voicePath in voicesPaths) + { + checkLoadSong(voicePath); + } + } checkLibrary('shared'); checkLibrary(PlayStatePlaylist.campaignId); From 90fc00f9bb16e598338573bc4b6d9aa888563008 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 28 Nov 2023 21:19:07 -0500 Subject: [PATCH 6/7] Additional web fixes, Github CI should be happy now. --- hmm.json | 4 ++-- source/funkin/ui/debug/charting/ChartEditorState.hx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hmm.json b/hmm.json index 64a05b16f..57c9378aa 100644 --- a/hmm.json +++ b/hmm.json @@ -49,7 +49,7 @@ "name": "haxeui-core", "type": "git", "dir": null, - "ref": "bfdb49886f256a8c37edfc4f46586727d68e2756", + "ref": "91ed8d7867c52af5ea2a9513204057d69ab33c8e", "url": "https://github.com/haxeui/haxeui-core" }, { @@ -144,7 +144,7 @@ "name": "polymod", "type": "git", "dir": null, - "ref": "41aea83dbc267234b301434553ce8c17742b8ab7", + "ref": "80d1d309803c1b111866524f9769325e3b8b0b1b", "url": "https://github.com/larsiusprime/polymod" }, { diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 983840b75..1f8713d4f 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2137,8 +2137,6 @@ class ChartEditorState extends HaxeUIState // Disable the menu item if we're not on a desktop platform. var menubarItemGoToBackupsFolder = findComponent('menubarItemGoToBackupsFolder', MenuItem); if (menubarItemGoToBackupsFolder != null) menubarItemGoToBackupsFolder.disabled = true; - - menubarItemGoToBackupsFolder.disabled = true; #end addUIClickListener('menubarItemUserGuide', _ -> this.openUserGuideDialog()); @@ -2291,9 +2289,13 @@ class ChartEditorState extends HaxeUIState */ function openBackupsFolder():Void { + #if sys // TODO: Is there a way to open a folder and highlight a file in it? var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]); WindowUtil.openFolder(absoluteBackupsPath); + #else + trace('No file system access, cannot open backups folder.'); + #end } /** From 99ed8b94d79c95c0b27c8eb50150e0ee3244861c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 28 Nov 2023 21:44:09 -0500 Subject: [PATCH 7/7] 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);