fix difficulty adding in tree menu

This commit is contained in:
lunarcleint
2024-02-01 17:59:56 -07:00
parent 4a98aef5cb
commit d612676a29
@@ -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<OptionType> = [
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'));