From 367cb8b1cce1281e75d72356cc97931f8c377e1a Mon Sep 17 00:00:00 2001
From: MtH <mth@mth.moe>
Date: Sat, 13 Mar 2021 22:31:34 +0100
Subject: [PATCH] make main menu bg not go offscreen when selecting options,
 add offsets for menu items

---
 source/MainMenuState.hx | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx
index 4b3a8f110..369af2e87 100644
--- a/source/MainMenuState.hx
+++ b/source/MainMenuState.hx
@@ -45,7 +45,7 @@ class MainMenuState extends MusicBeatState
 
 		var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
 		bg.scrollFactor.x = 0;
-		bg.scrollFactor.y = 0.18;
+		bg.scrollFactor.y = 0.17;
 		bg.setGraphicSize(Std.int(bg.width * 1.1));
 		bg.updateHitbox();
 		bg.screenCenter();
@@ -57,7 +57,7 @@ class MainMenuState extends MusicBeatState
 
 		magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
 		magenta.scrollFactor.x = 0;
-		magenta.scrollFactor.y = 0.18;
+		magenta.scrollFactor.y = 0.17;
 		magenta.setGraphicSize(Std.int(magenta.width * 1.1));
 		magenta.updateHitbox();
 		magenta.screenCenter();
@@ -208,11 +208,25 @@ class MainMenuState extends MusicBeatState
 
 			if (spr.ID == curSelected)
 			{
-				spr.animation.play('selected');
 				camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
+				spr.animation.play('selected');
 			}
 
 			spr.updateHitbox();
+			if(spr.animation.curAnim.name == 'selected')
+			{
+				switch(optionShit[curSelected])
+				{
+					case 'story mode':
+						spr.offset.y += 26;
+					case 'freeplay':
+						spr.offset.y += 28;
+					case 'donate':
+						spr.offset.y += 21;
+					case 'options':
+						spr.offset.y += 26;
+				}
+			}
 		});
 	}
 }