From 77c9422088219089d67577a2b06661f6ac13116d Mon Sep 17 00:00:00 2001
From: Brandon <brandy@scarecrowarts.com>
Date: Sat, 7 Nov 2020 15:52:21 -0500
Subject: [PATCH] haha , also highscore.hx breaks switch

---
 Preloader.hx             |  2 +-
 source/FreeplayState.hx  |  6 ++++++
 source/MainMenuState.hx  |  2 ++
 source/PlayState.hx      |  5 +++--
 source/StoryMenuState.hx | 17 +++++++++++++++++
 5 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/Preloader.hx b/Preloader.hx
index 234205867..6f12b403a 100644
--- a/Preloader.hx
+++ b/Preloader.hx
@@ -43,7 +43,7 @@ class Preloader extends FlxBasePreloader
      
     override function update(Percent:Float):Void 
     {
-        if(Percent < 75)
+        if(Percent < 69)
         {
             logo.scaleX += Percent / 1280;
             logo.scaleY += Percent / 1280;
diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx
index 213c91c3d..59839368f 100644
--- a/source/FreeplayState.hx
+++ b/source/FreeplayState.hx
@@ -119,6 +119,8 @@ class FreeplayState extends MusicBeatState
 	{
 		super.update(elapsed);
 
+		trace("Freeplay Menu Updating");
+
 		lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
 		scoreText.text = "PERSONAL BEST:" + lerpScore;
 
@@ -169,7 +171,9 @@ class FreeplayState extends MusicBeatState
 		if (curDifficulty > 2)
 			curDifficulty = 0;
 
+		#if !switch
 		intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
+		#end
 
 		switch (curDifficulty)
 		{
@@ -197,7 +201,9 @@ class FreeplayState extends MusicBeatState
 
 		// selector.y = (70 * curSelected) + 30;
 
+		#if !switch
 		intendedScore = Highscore.getScore(songs[curSelected], curDifficulty);
+		#end
 		// lerpScore = 0;
 
 		var bullShit:Int = 0;
diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx
index 6f2ff630d..d92735e51 100644
--- a/source/MainMenuState.hx
+++ b/source/MainMenuState.hx
@@ -144,8 +144,10 @@ class MainMenuState extends MusicBeatState
 								{
 									case 'story mode':
 										FlxG.switchState(new StoryMenuState());
+										trace("Story Menu Selected");
 									case 'freeplay':
 										FlxG.switchState(new FreeplayState());
+										trace("Freeplay Menu Selected");
 									case 'options':
 										FlxG.switchState(new OptionsMenu());
 								}
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 51cc7874d..f4e4fd579 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -844,7 +844,9 @@ class PlayState extends MusicBeatState
 
 	function endSong():Void
 	{
+		#if !switch
 		Highscore.saveScore(SONG.song, songScore, storyDifficulty);
+		#end
 
 		if (isStoryMode)
 		{
@@ -862,9 +864,8 @@ class PlayState extends MusicBeatState
 
 				#if !switch
 				NGio.unlockMedal(60961);
-				#end
-
 				Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
+				#end
 				
 				FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked;
 				FlxG.save.flush();
diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx
index 0f4b5c018..9c49dce25 100644
--- a/source/StoryMenuState.hx
+++ b/source/StoryMenuState.hx
@@ -67,6 +67,8 @@ class StoryMenuState extends MusicBeatState
 		grpLocks = new FlxTypedGroup<FlxSprite>();
 		add(grpLocks);
 
+		trace("Line 70");
+
 		for (i in 0...weekData.length)
 		{
 			var weekThing:MenuItem = new MenuItem(0, yellowBG.y + yellowBG.height + 10, i);
@@ -91,6 +93,8 @@ class StoryMenuState extends MusicBeatState
 			}
 		}
 
+		trace("Line 96");
+
 		for (char in 0...3)
 		{
 			var weekCharacterThing:MenuCharacter = new MenuCharacter((FlxG.width * 0.25) * (1 + char) - 150, weekCharacters[curWeek][char]);
@@ -117,6 +121,8 @@ class StoryMenuState extends MusicBeatState
 		difficultySelectors = new FlxGroup();
 		add(difficultySelectors);
 
+		trace("Line 124");
+
 		leftArrow = new FlxSprite(grpWeekText.members[0].x + grpWeekText.members[0].width + 10, grpWeekText.members[0].y + 10);
 		leftArrow.frames = ui_tex;
 		leftArrow.animation.addByPrefix('idle', "arrow left");
@@ -141,6 +147,8 @@ class StoryMenuState extends MusicBeatState
 		rightArrow.animation.play('idle');
 		difficultySelectors.add(rightArrow);
 
+		trace("Line 150");
+
 		add(yellowBG);
 		add(grpWeekCharacters);
 
@@ -154,11 +162,15 @@ class StoryMenuState extends MusicBeatState
 
 		updateText();
 
+		trace("Line 165");
+
 		super.create();
 	}
 
 	override function update(elapsed:Float)
 	{
+		trace("Story Menu Updating");
+
 		// scoreText.setFormat('VCR OSD Mono', 32);
 		lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.5));
 
@@ -286,7 +298,10 @@ class StoryMenuState extends MusicBeatState
 
 		// USING THESE WEIRD VALUES SO THAT IT DOESNT FLOAT UP
 		sprDifficulty.y = leftArrow.y - 15;
+
+		#if !switch
 		intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
+		#end
 
 		FlxTween.tween(sprDifficulty, {y: leftArrow.y + 15, alpha: 1}, 0.07);
 	}
@@ -339,6 +354,8 @@ class StoryMenuState extends MusicBeatState
 		txtTracklist.screenCenter(X);
 		txtTracklist.x -= FlxG.width * 0.35;
 
+		#if !switch
 		intendedScore = Highscore.getWeekScore(curWeek, curDifficulty);
+		#end
 	}
 }