diff --git a/source/funkin/input/Cursor.hx b/source/funkin/input/Cursor.hx index b4bf43808..39f399465 100644 --- a/source/funkin/input/Cursor.hx +++ b/source/funkin/input/Cursor.hx @@ -34,6 +34,18 @@ class Cursor Cursor.cursorMode = null; } + public static inline function toggle():Void + { + if (FlxG.mouse.visible) + { + hide(); + } + else + { + show(); + } + } + public static final CURSOR_DEFAULT_PARAMS:CursorParams = { graphic: "assets/images/cursor/cursor-default.png", diff --git a/source/funkin/play/stage/StageData.hx b/source/funkin/play/stage/StageData.hx index d89995ef3..2d87dec31 100644 --- a/source/funkin/play/stage/StageData.hx +++ b/source/funkin/play/stage/StageData.hx @@ -164,6 +164,7 @@ class StageDataParser try { var parser = new json2object.JsonParser(); + parser.ignoreUnknownVariables = false; parser.fromJson(rawJson, '$stageId.json'); if (parser.errors.length > 0) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index fa55750bf..afb0a114d 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1010,7 +1010,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState function get_availableDifficulties():Array { var m:Null = songMetadata.get(selectedVariation); - return m?.playData?.difficulties ?? []; + return m?.playData?.difficulties ?? [Constants.DEFAULT_DIFFICULTY]; } /** @@ -1069,7 +1069,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var result:Null = songChartData.get(selectedVariation); if (result == null) { - result = new SongChartData(["normal" => 1.0], [], ["normal" => []]); + result = new SongChartData([Constants.DEFAULT_DIFFICULTY => 1.0], [], [Constants.DEFAULT_DIFFICULTY => []]); songChartData.set(selectedVariation, result); } return result; @@ -1293,6 +1293,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState function set_selectedDifficulty(value:String):String { + if (value == null) value = availableDifficulties[0] ?? Constants.DEFAULT_DIFFICULTY; + selectedDifficulty = value; // Make sure view is updated when the difficulty changes. diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx index 666b3656c..a595b8195 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -687,6 +687,9 @@ class ChartEditorDialogHandler Conductor.instrumentalOffset = state.currentInstrumentalOffset; // Loads from the metadata. Conductor.mapTimeChanges(state.currentSongMetadata.timeChanges); + state.selectedVariation = Constants.DEFAULT_VARIATION; + state.selectedDifficulty = state.availableDifficulties[0]; + state.difficultySelectDirty = true; dialog.hideDialog(DialogButton.APPLY);