Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
make categorys less jank
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDrawingCoder-Gamer committed Mar 8, 2021
1 parent 14dcef2 commit 3536527
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
11 changes: 9 additions & 2 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,15 @@ class FreeplayState extends MusicBeatState
FlxG.autoPause = true;
if (soundTest)
FlxG.switchState(new SaveDataState());
else
FlxG.switchState(new MainMenuState());
else {
var epicCategoryJs:Array<Dynamic> = CoolUtil.parseJson(Assets.getText('assets/data/freeplaySongJson.jsonc'));
if (epicCategoryJs.length > 1)
{
FlxG.switchState(new CategoryState());
} else
FlxG.switchState(new MainMenuState());
}

}

if (accepted)
Expand Down
11 changes: 9 additions & 2 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,16 @@ class MainMenuState extends MusicBeatState
trace("Story Menu Selected");
case 'freeplay':
CategoryState.choosingFor = "freeplay";
FlxG.switchState(new CategoryState());
var epicCategoryJs:Array<Dynamic> = CoolUtil.parseJson(Assets.getText('assets/data/freeplaySongJson.jsonc'));
FreeplayState.soundTest = false;
trace("Freeplay Menu Selected");
if (epicCategoryJs.length > 1)
{
FlxG.switchState(new CategoryState());
} else {
FreeplayState.currentSongList = epicCategoryJs[0].songs;
FlxG.switchState(new FreeplayState());
}


case 'options':
FlxG.switchState(new SaveDataState());
Expand Down
3 changes: 0 additions & 3 deletions source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class PauseSubState extends MusicBeatSubstate
pauseMusic = new FlxSound().loadEmbedded('assets/music/breakfast' + TitleState.soundExt, true, true);
pauseMusic.volume = 0;
pauseMusic.play(false, FlxG.random.int(0, Std.int(pauseMusic.length / 2)));
if (PlayState.isStoryMode) {
menuItems = ['Resume', 'Restart Song', "Exit to menu"];
}
FlxG.sound.list.add(pauseMusic);

var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
Expand Down

0 comments on commit 3536527

Please sign in to comment.