File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
source/funkin/ui/debug/charting Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,16 @@ class ChartEditorImportExportHandler
131
131
state .songMetadata = newSongMetadata ;
132
132
state .songChartData = newSongChartData ;
133
133
134
- if (! state .songMetadata .exists (state .selectedVariation ))
134
+ var variationMetadata : Null <SongMetadata > = state .songMetadata .get (state .selectedVariation );
135
+ if (variationMetadata == null )
135
136
{
136
- state .selectedVariation = Constants .DEFAULT_VARIATION ;
137
+ // Use the default variation, or the first available variation if that doesn't exist for some reason.
138
+ if (state .availableDifficulties .indexOf (Constants .DEFAULT_VARIATION ) < 0 ) state .selectedVariation = state .availableVariations [0 ];
139
+ else state .selectedVariation = Constants .DEFAULT_VARIATION ;
140
+
141
+ variationMetadata = state .songMetadata .get (state .selectedVariation );
137
142
}
143
+
138
144
// Use the first available difficulty as a fallback if the currently selected one cannot be found.
139
145
if (state .availableDifficulties .indexOf (state .selectedDifficulty ) < 0 ) state .selectedDifficulty = state .availableDifficulties [0 ];
140
146
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import funkin.data.song.SongRegistry;
6
6
import haxe .ui .components .Button ;
7
7
import haxe .ui .containers .dialogs .Dialogs ;
8
8
import haxe .ui .containers .dialogs .Dialog .DialogButton ;
9
- import funkin .data .song .SongData .SongMetadata ;
10
9
import haxe .ui .components .DropDown ;
11
10
import haxe .ui .components .HorizontalSlider ;
12
11
import funkin .util .VersionUtil ;
@@ -215,6 +214,16 @@ class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox
215
214
216
215
var difficultyList : Array <String > = variationMetadata .playData .difficulties ;
217
216
217
+ var variationChartdata : Null <SongChartData > = chartEditorState .songChartData .get (curVariation );
218
+ if (variationChartdata != null )
219
+ {
220
+ var keys : Array <String > = [for (x in variationChartdata .notes .keys ()) x ];
221
+ for (key in keys )
222
+ {
223
+ difficultyList .pushUnique (key );
224
+ }
225
+ }
226
+
218
227
for (difficulty in difficultyList )
219
228
{
220
229
var _treeDifficulty : TreeViewNode = treeVariation .addNode (
You can’t perform that action at this time.
0 commit comments