Fix issue where difficulty names wouldn't show up properly sometimes.
This commit is contained in:
@@ -349,6 +349,7 @@ class FreeplayState extends MusicBeatSubState
|
||||
var displayedVariations = song.getVariationsByCharacter(currentCharacter);
|
||||
trace('Displayed Variations (${songId}): $displayedVariations');
|
||||
var availableDifficultiesForSong:Array<String> = song.listSuffixedDifficulties(displayedVariations, false, false);
|
||||
var unsuffixedDifficulties = song.listDifficulties(displayedVariations, false, false);
|
||||
trace('Available Difficulties: $availableDifficultiesForSong');
|
||||
if (availableDifficultiesForSong.length == 0) continue;
|
||||
|
||||
@@ -357,6 +358,10 @@ class FreeplayState extends MusicBeatSubState
|
||||
{
|
||||
diffIdsTotal.pushUnique(difficulty);
|
||||
}
|
||||
for (difficulty in unsuffixedDifficulties)
|
||||
{
|
||||
diffIdsTotal.pushUnique(difficulty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2414,10 +2419,13 @@ class DifficultySprite extends FlxSprite
|
||||
// Remove the last suffix of the difficulty id until we find an asset or there are no more suffixes.
|
||||
var assetDiffIdParts:Array<String> = assetDiffId.split('-');
|
||||
assetDiffIdParts.pop();
|
||||
if (assetDiffIdParts.length == 0) break;
|
||||
if (assetDiffIdParts.length == 0)
|
||||
{
|
||||
trace('Could not find difficulty asset: freeplay/freeplay${diffId} (from ${diffId})');
|
||||
return;
|
||||
};
|
||||
assetDiffId = assetDiffIdParts.join('-');
|
||||
}
|
||||
trace('Found difficulty asset: freeplay/freeplay${assetDiffId}');
|
||||
|
||||
// Check for an XML to use an animation instead of an image.
|
||||
if (Assets.exists(Paths.file('images/freeplay/freeplay${assetDiffId}.xml')))
|
||||
@@ -2429,6 +2437,7 @@ class DifficultySprite extends FlxSprite
|
||||
else
|
||||
{
|
||||
this.loadGraphic(Paths.image('freeplay/freeplay' + assetDiffId));
|
||||
trace('Loaded difficulty asset: freeplay/freeplay${assetDiffId} (from ${diffId})');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user