if no stage is found in chart, default will be chosen by week

This commit is contained in:
Lucky56 2021-06-11 08:31:50 +02:00
parent a645d3a49e
commit 17db8031c5
No known key found for this signature in database
GPG Key ID: 19E3875EAD1F8B8F
2 changed files with 19 additions and 4 deletions

View File

@ -344,7 +344,22 @@ class PlayState extends MusicBeatState
dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue'));
}
switch(SONG.stage)
//defaults if no stage was found in chart
var stageCheck:String = 'stage';
//i should check if its stage (but this is when none is found in chart anyway)
if (SONG.stage == null) {
switch(storyWeek)
{
case 2: stageCheck = 'halloween';
case 3: stageCheck = 'philly';
case 4: stageCheck = 'limo';
case 5: if (songLowercase == 'winter-horrorland') {stageCheck = 'mallEvil';} else {stageCheck = 'mall';}
case 6: if (songLowercase == 'thorns') {stageCheck = 'schoolEvil';} else {stageCheck = 'school';}
}
} else {stageCheck = SONG.stage;}
switch(stageCheck)
{
case 'halloween':
{

View File

@ -35,7 +35,7 @@ class Song
public var player2:String = 'dad';
public var gfVersion:String = 'gf';
public var noteStyle:String = 'normal';
public var stage:String = 'stage';
public var stage:String = '';
public function new(song, notes, bpm)
{
@ -47,8 +47,8 @@ class Song
public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong
{
trace(jsonInput);
// pre lowercasing the song name (update)
// pre lowercasing the folder name
var folderLowercase = StringTools.replace(folder, " ", "-").toLowerCase();
switch (folderLowercase) {
case 'dad-battle': folderLowercase = 'dadbattle';