File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
source/funkin/ui/debug/charting Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -118,10 +118,16 @@ class ChartEditorImportExportHandler
118
118
state .songMetadata = newSongMetadata ;
119
119
state .songChartData = newSongChartData ;
120
120
121
- if (! state .songMetadata .exists (state .selectedVariation ))
121
+ var variationMetadata : Null <SongMetadata > = state .songMetadata .get (state .selectedVariation );
122
+ if (variationMetadata == null )
122
123
{
123
- state .selectedVariation = Constants .DEFAULT_VARIATION ;
124
+ // Use the default variation, or the first available variation if that doesn't exist for some reason.
125
+ if (state .availableDifficulties .indexOf (Constants .DEFAULT_VARIATION ) < 0 ) state .selectedVariation = state .availableVariations [0 ];
126
+ else state .selectedVariation = Constants .DEFAULT_VARIATION ;
127
+
128
+ variationMetadata = state .songMetadata .get (state .selectedVariation );
124
129
}
130
+
125
131
// Use the first available difficulty as a fallback if the currently selected one cannot be found.
126
132
if (state .availableDifficulties .indexOf (state .selectedDifficulty ) < 0 ) state .selectedDifficulty = state .availableDifficulties [0 ];
127
133
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import haxe.ui.components.Button;
4
4
import haxe .ui .containers .dialogs .Dialogs ;
5
5
import haxe .ui .containers .dialogs .Dialog .DialogButton ;
6
6
import funkin .data .song .SongData .SongMetadata ;
7
+ import funkin .data .song .SongData .SongChartData ;
7
8
import funkin .util .FileUtil ;
8
9
import haxe .ui .containers .dialogs .MessageBox .MessageBoxType ;
9
10
import funkin .play .song .SongSerializer ;
@@ -133,6 +134,16 @@ class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox
133
134
134
135
var difficultyList : Array <String > = variationMetadata .playData .difficulties ;
135
136
137
+ var variationChartdata : Null <SongChartData > = chartEditorState .songChartData .get (curVariation );
138
+ if (variationChartdata != null )
139
+ {
140
+ var keys : Array <String > = [for (x in variationChartdata .notes .keys ()) x ];
141
+ for (key in keys )
142
+ {
143
+ difficultyList .pushUnique (key );
144
+ }
145
+ }
146
+
136
147
for (difficulty in difficultyList )
137
148
{
138
149
var _treeDifficulty : TreeViewNode = treeVariation .addNode (
You can’t perform that action at this time.
0 commit comments