From d612676a297ba51f4ac7cc956c045493c8220c25 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:59:56 -0700 Subject: [PATCH] fix difficulty adding in tree menu --- source/funkin/editors/charter/CharterSelection.hx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/funkin/editors/charter/CharterSelection.hx b/source/funkin/editors/charter/CharterSelection.hx index e55fa2f8..8c9e0d71 100644 --- a/source/funkin/editors/charter/CharterSelection.hx +++ b/source/funkin/editors/charter/CharterSelection.hx @@ -31,13 +31,14 @@ class CharterSelection extends EditorTreeMenu { for(s in freeplayList.songs) new EditorIconOption(s.name, "Press ACCEPT to choose a difficulty to edit.", s.icon, function() { curSong = s; var list:Array = [ - for(d in s.difficulties) if (d != "") new TextOption(d, "Press ACCEPT to edit the chart for the selected difficulty", function() { - FlxG.switchState(new Charter(s.name, d)); + new NewOption("New Difficulty", "New Difficulty", function() { + FlxG.state.openSubState(new ChartCreationScreen(saveChart)); }) ]; - list.push(new NewOption("New Difficulty", "New Difficulty", function() { - FlxG.state.openSubState(new ChartCreationScreen(saveChart)); - })); + for(d in s.difficulties) if (d != "") + list.push(new TextOption(d, "Press ACCEPT to edit the chart for the selected difficulty", function() { + FlxG.switchState(new Charter(s.name, d)); + })); optionsTree.add(new OptionsScreen(s.name, "Select a difficulty to continue.", list)); }, s.parsedColor.getDefault(0xFFFFFFFF)) ]; @@ -156,7 +157,7 @@ class CharterSelection extends EditorTreeMenu { var option = new TextOption(name, "Press ACCEPT to edit the chart for the selected difficulty", function() { FlxG.switchState(new Charter(curSong.name, name)); }); - main.insert(main.length - 2, option); + optionsTree.members[optionsTree.members.length-1].insert(1, option); // Add to Meta var meta = Json.parse(sys.io.File.getContent('$songFolder/meta.json'));