@@ -17,6 +17,7 @@ class FirstCheckState extends MusicBeatState
1717 var updateAlphabet : Alphabet ;
1818 var updateIcon : FlxSprite ;
1919 var updateRibbon : FlxSprite ;
20+ var allowProgression : Bool = true ; // For april fools
2021
2122 public static function checkInternetConnection (): Bool {
2223 var response : Dynamic = null ;
@@ -84,15 +85,114 @@ class FirstCheckState extends MusicBeatState
8485
8586 if (AprilFools .allowAF )
8687 {
88+ allowProgression = false ;
89+ var randoTimer : Int = FlxG .random .int (2 , 10 );
8790 var aprilFoolsText = new FlxText (0 , 0 , FlxG .width , " April Fools!" );
88- aprilFoolsText .setFormat (Paths .font (" vcr.ttf" ), 16 , FlxColor .WHITE , LEFT );
91+ aprilFoolsText .setFormat (Paths .font (" vcr.ttf" ), 128 , FlxColor .WHITE , CENTER );
92+ aprilFoolsText .screenCenter ();
93+ aprilFoolsText .alpha = 0 ;
8994 add (aprilFoolsText );
95+ FlxTween .num (0 , 1 , randoTimer , {ease : FlxEase .linear ,
96+ onComplete : function (twn : FlxTween ) {
97+ if (! relaunch )
98+ {
99+ remove (aprilFoolsText );
100+ updateRibbon = new FlxSprite (0 , FlxG .height - 75 ).makeGraphic (FlxG .width , 75 , 0x88FFFFFF , true );
101+ updateRibbon .visible = false ;
102+ updateRibbon .alpha = 0 ;
103+ add (updateRibbon );
104+
105+ updateIcon = new FlxSprite (FlxG .width - 75 , FlxG .height - 75 );
106+ updateIcon .frames = Paths .getSparrowAtlas (" pause/pauseAlt/bfLol" );
107+ updateIcon .animation .addByPrefix (" dance" , " funnyThing instance 1" , 20 , true );
108+ updateIcon .animation .play (" dance" );
109+ updateIcon .setGraphicSize (65 );
110+ updateIcon .updateHitbox ();
111+ updateIcon .antialiasing = true ;
112+ updateIcon .visible = false ;
113+ add (updateIcon );
114+
115+ updateAlphabet = new ColoredAlphabet (0 , 0 , " Checking Your Vibe..." , true , FlxColor .WHITE );
116+ for (c in updateAlphabet .members ) {
117+ c .scale .x / = 2 ;
118+ c .scale .y / = 2 ;
119+ c .updateHitbox ();
120+ c .x / = 2 ;
121+ c .y / = 2 ;
122+ }
123+ updateAlphabet .visible = false ;
124+ updateAlphabet .x = updateIcon .x - updateAlphabet .width - 10 ;
125+ updateAlphabet .y = updateIcon .y ;
126+ add (updateAlphabet );
127+ updateIcon .y + = 15 ;
128+
129+
130+ var tmr = new FlxTimer ().start (2 , function (tmr : FlxTimer )
131+ {
132+ trace (' checking for update' );
133+ if (! checkInternetConnection ())
134+ {
135+ updateAlphabet .text = ' Failed the vibe check! (No internet connection?)' ;
136+ updateAlphabet .color = FlxColor .RED ;
137+ updateIcon .visible = false ;
138+ FlxTween .tween (updateAlphabet , {alpha : 0 }, 2 , {ease :FlxEase .sineOut });
139+ FlxTween .tween (updateIcon , {alpha : 0 }, 2 , {ease :FlxEase .sineOut });
140+ new FlxTimer ().start (2 , function (tmr : FlxTimer ) {
141+ trace (" Ew, no internet!" );
142+ FlxG .switchState (new states. SplashScreen ());
143+ });
144+ return ;
145+ }
146+ var http = new haxe. Http (" https://raw.githubusercontent.com/Z11Coding/Mixtape-Engine-Rework/refs/heads/Archipelago/gitVersion.txt" );
147+
148+ http .onData = function (data : String )
149+ {
150+ updateVersion = data .split (' :' )[0 ].trim ();
151+ betaVersion = data .split (' :' )[1 ].trim ();
152+ var curVersion : String = MainMenuState .mixtapeEngineVersion .trim ();
153+ trace (' version online: ' + updateVersion + ' , your version: ' + curVersion );
154+ var updateVersionNum = Std .parseFloat (updateVersion .replace (" ." , " " ));
155+ var curVersionNum = Std .parseFloat (curVersion .replace (" ." , " " ));
156+ if (curVersionNum < updateVersionNum && ClientPrefs .data .checkForUpdates )
157+ {
158+ trace (' versions arent matching!' );
159+ MusicBeatState .switchState (new states. OutdatedState ());
160+ }
161+ else FlxG .switchState (new APCheckState ());
162+ }
163+
164+ http .onError = function (error )
165+ {
166+ trace (' error: $error ' );
167+ updateAlphabet .text = ' Failed the vibe check!' ;
168+ updateAlphabet .color = FlxColor .RED ;
169+ updateIcon .visible = false ;
170+ FlxTween .tween (updateAlphabet , {alpha : 0 }, 2 , {ease :FlxEase .sineOut });
171+ FlxTween .tween (updateIcon , {alpha : 0 }, 2 , {ease :FlxEase .sineOut });
172+ new FlxTimer ().start (2 , function (tmr : FlxTimer ) {
173+ FlxG .switchState (new states. SplashScreen ());
174+ });
175+ }
176+
177+ http .request ();
178+ updateIcon .visible = true ;
179+ updateAlphabet .visible = true ;
180+ updateRibbon .visible = true ;
181+ updateRibbon .alpha = 1 ;
182+ });
183+ }
184+ else
185+ {
186+ FlxG .switchState (new TitleState ());
187+ }
188+ }},
189+ function (num ){aprilFoolsText .alpha = num ;});
90190 }
91191 else {
92192 ClientPrefs .data .aprilFools = true ;
93193 }
94194
95- if (! relaunch )
195+ if (! relaunch && allowProgression )
96196 {
97197 updateRibbon = new FlxSprite (0 , FlxG .height - 75 ).makeGraphic (FlxG .width , 75 , 0x88FFFFFF , true );
98198 updateRibbon .visible = false ;
@@ -177,10 +277,8 @@ class FirstCheckState extends MusicBeatState
177277 updateRibbon .visible = true ;
178278 updateRibbon .alpha = 1 ;
179279 });
180-
181-
182- }
183- else
280+ }
281+ else if (allowProgression )
184282 {
185283 FlxG .switchState (new TitleState ());
186284 }
0 commit comments