@@ -6,6 +6,8 @@ import flixel.effects.FlxFlicker;
66import lime .app .Application ;
77import states .editors .MasterEditorMenu ;
88import options .OptionsState ;
9+ import flixel .addons .display .FlxBackdrop ;
10+ import flixel .util .FlxGradient ;
911
1012enum MainMenuColumn {
1113 LEFT ;
@@ -16,14 +18,14 @@ enum MainMenuColumn {
1618
1719class MainMenuState extends MusicBeatState
1820{
19- public static var psychEngineVersion : String = ' 1.0.3 ' ; // This is also used for Discord RPC
21+ public static var psychEngineVersion : String = ' 1.0.4 ' ; // This is also used for Discord RPC
2022 public static var mixtapeEngineVersion : String = ' 4.8.2' ; // this is used for Discord RPC
2123 public static var curSelected : Int = 0 ;
2224 public static var curColumn : MainMenuColumn = CENTER ;
2325 private var archButton : PsychUIButton ;
2426 var allowMouse : Bool = true ; // Turn this off to block mouse movement in menus
2527
26- public var ticker : yutautil. StateTick = new yutautil. StateTick (function () {
28+ public var ticker : yutautil. StateTick = new yutautil. StateTick (function () {
2729 // trace('[DEBUG] Tick in state: ${Type.getClassName(Type.getClass(FlxG.state))}');
2830 }, 30 );
2931
@@ -32,7 +34,8 @@ class MainMenuState extends MusicBeatState
3234 var rightItem : FlxSprite ;
3335 var archipelagoItem : FlxSprite ;
3436
35- var checker : flixel.addons.display. FlxBackdrop ;
37+ var checker : FlxBackdrop ;
38+ var gradientBar : FlxSprite ;
3639
3740 // Centered/Text options
3841 var optionShit : Array <String > = [
@@ -46,15 +49,17 @@ class MainMenuState extends MusicBeatState
4649 var rightOption : String = ' options' ;
4750 var archipelagoOption : String = #if ARCHIPELAGO_ALLOWED ' archipelago' #else null #end;
4851
52+ var logoBl : FlxSprite ;
4953 var magenta : FlxSprite ;
5054 var camFollow : FlxObject ;
5155
5256 static var showOutdatedWarning : Bool = true ;
57+ var usingDefaultLogo : Bool = false ;
5358 override function create ()
5459 {
5560
5661 Cursor .cursorMode = Default ;
57- checker = new flixel.addons.display. FlxBackdrop (Paths .image (' mainmenu/Main_Checker' ), XY , Std .int (0.2 ), Std .int (0.2 ));
62+ checker = new FlxBackdrop (Paths .image (' mainmenu/Main_Checker' ), XY , Std .int (0.2 ), Std .int (0.2 ));
5863
5964 super .create ();
6065
@@ -110,6 +115,17 @@ class MainMenuState extends MusicBeatState
110115 camFollow = new FlxObject (0 , 0 , 1 , 1 );
111116 add (camFollow );
112117
118+ if (! ClientPrefs .data .lowQuality )
119+ {
120+ gradientBar = FlxGradient .createGradientFlxSprite (Math .round (FlxG .width ), 512 , [0x00ff0000 , 0x55AE59E4 , 0xAAFFA319 ], 1 , 90 , true );
121+ gradientBar .y = FlxG .height - gradientBar .height ;
122+ add (gradientBar );
123+ gradientBar .scrollFactor .set (0 , 0 );
124+
125+ add (checker );
126+ checker .scrollFactor .set (0 , 0.07 );
127+ }
128+
113129 magenta = new FlxSprite (- 80 ).loadGraphic (Paths .image (ClientPrefs .getBGImage ()));
114130 magenta .antialiasing = ClientPrefs .data .antialiasing ;
115131 magenta .scrollFactor .set (0 , yScroll );
@@ -153,6 +169,41 @@ class MainMenuState extends MusicBeatState
153169 archipelagoItem .x - = archipelagoItem .width ;
154170 }
155171
172+ logoBl = new FlxSprite (- 100 , - 100 );
173+ try {
174+ logoBl .frames = Paths .getSparrowAtlas (' logoBumpin' );
175+ } catch (e : haxe. Exception ) {
176+ trace (' [ERROR] Failed to load logoBumpin atlas: ' + e .details ());
177+ logoBl .frames = null ;
178+ }
179+ if (logoBl .frames == null ) {
180+ logoBl .frames = Paths .getSparrowAtlas (' bump' );
181+ usingDefaultLogo = true ;
182+ }
183+ logoBl .antialiasing = ClientPrefs .data .antialiasing ;
184+
185+ if (usingDefaultLogo ) logoBl .animation .addByPrefix (' bump' , ' bump' , 24 , false );
186+ else logoBl .animation .addByPrefix (' bump' , ' logo bumpin' , 24 , false );
187+ logoBl .animation .play (' bump' );
188+ if (usingDefaultLogo ) logoBl .setGraphicSize (Std .int (logoBl .width * 0.4 ));
189+ logoBl .updateHitbox ();
190+
191+ logoBl .scrollFactor .set ();
192+ logoBl .antialiasing = ClientPrefs .data .antialiasing ;
193+ logoBl .setGraphicSize (Std .int (logoBl .width * 0.6 ));
194+ logoBl .alpha = 0 ;
195+ logoBl .angle = - 4 ;
196+ logoBl .updateHitbox ();
197+ if (optionShit .length < 3 ) add (logoBl );
198+
199+
200+ FlxTween .tween (logoBl , {
201+ y : logoBl .y + 10 ,
202+ x : logoBl .x + 480 ,
203+ angle : - 4 ,
204+ alpha : 1
205+ }, 1.4 , {ease : FlxEase .expoInOut });
206+
156207 var psychVer : FlxText = new FlxText (12 , FlxG .height - 44 , 0 , " Psych Engine v" + psychEngineVersion , 12 );
157208 psychVer .scrollFactor .set ();
158209 psychVer .setFormat (Paths .font (" vcr.ttf" ), 16 , FlxColor .WHITE , LEFT , FlxTextBorderStyle .OUTLINE , FlxColor .BLACK );
@@ -165,8 +216,28 @@ class MainMenuState extends MusicBeatState
165216 mixVer .scrollFactor .set ();
166217 mixVer .setFormat (Paths .font (" comboFont.ttf" ), 16 , FlxColor .WHITE , LEFT , FlxTextBorderStyle .OUTLINE , FlxColor .BLACK );
167218 add (mixVer );
219+ var funnytext : FlxText = new FlxText (mixVer .x , FlxG .height - 44 , 0 , " " , 12 );
220+ funnytext .scrollFactor .set ();
221+ funnytext .setFormat (Paths .font (" comboFont.ttf" ), 16 , FlxColor .WHITE , LEFT , FlxTextBorderStyle .OUTLINE , FlxColor .BLACK );
222+ add (funnytext );
168223 changeItem ();
169224
225+ #if !debug
226+ mixVer .text = " Mixtape Engine v" + mixtapeEngineVersion ;
227+ #else
228+ mixVer .text = " Mixtape Engine v" + mixtapeEngineVersion + ' (debug)' ;
229+ #end
230+
231+ if (ClientPrefs .data .username )
232+ {
233+ #if windows
234+ funnytext .text = " HI " + Sys .environment ()[" USERNAME" ] + " :)" ;
235+ #elseif mac
236+ funnytext .text = " HI " + Sys .environment ()[" USER" ] + " :)" ;
237+ #end
238+ }
239+ else funnytext .text = " You're safe, for now..." ;
240+
170241 #if ACHIEVEMENTS_ALLOWED
171242 // Unlocks "Freaky on a Friday Night" achievement if it's a Friday and between 18:00 PM and 23:59 PM
172243 var leDate = Date .now ();
@@ -228,6 +299,9 @@ class MainMenuState extends MusicBeatState
228299 FlxG .save .data .gotbeatbattle2 = false ;
229300 }
230301
302+ checker .x - = 0.45 / (ClientPrefs .data .framerate / 60 );
303+ checker .y - = 0.16 / (ClientPrefs .data .framerate / 60 );
304+
231305 if (! selectedSomethin )
232306 {
233307 if (controls. UI_UP_P && curColumn != RIGHT )
@@ -240,7 +314,7 @@ class MainMenuState extends MusicBeatState
240314 if (allowMouse && ((FlxG .mouse .deltaScreenX != 0 && FlxG .mouse .deltaScreenY != 0 ) || FlxG .mouse .justPressed )) // FlxG.mouse.deltaScreenX/Y checks is more accurate than FlxG.mouse.justMoved
241315 {
242316 allowMouse = false ;
243- FlxG . mouse . visible = true ;
317+ Cursor . show () ;
244318 timeNotMoving = 0 ;
245319
246320 var selectedItem : FlxSprite ;
@@ -258,6 +332,7 @@ class MainMenuState extends MusicBeatState
258332
259333 if (leftItem != null && FlxG .mouse .overlaps (leftItem ))
260334 {
335+ Cursor .cursorMode = Pointer ;
261336 allowMouse = true ;
262337 if (selectedItem != leftItem )
263338 {
@@ -267,6 +342,7 @@ class MainMenuState extends MusicBeatState
267342 }
268343 else if (rightItem != null && FlxG .mouse .overlaps (rightItem ))
269344 {
345+ Cursor .cursorMode = Pointer ;
270346 allowMouse = true ;
271347 if (selectedItem != rightItem )
272348 {
@@ -276,6 +352,7 @@ class MainMenuState extends MusicBeatState
276352 }
277353 else if (archipelagoItem != null && FlxG .mouse .overlaps (archipelagoItem ))
278354 {
355+ Cursor .cursorMode = Pointer ;
279356 allowMouse = true ;
280357 if (selectedItem != archipelagoItem )
281358 {
@@ -292,14 +369,15 @@ class MainMenuState extends MusicBeatState
292369 var memb : FlxSprite = menuItems .members [i ];
293370 if (FlxG .mouse .overlaps (memb ))
294371 {
372+ Cursor .cursorMode = Pointer ;
295373 var distance : Float = Math .sqrt (Math .pow (memb .getGraphicMidpoint ().x - FlxG .mouse .screenX , 2 ) + Math .pow (memb .getGraphicMidpoint ().y - FlxG .mouse .screenY , 2 ));
296374 if (dist < 0 || distance < dist )
297375 {
298376 dist = distance ;
299377 distItem = i ;
300378 allowMouse = true ;
301379 }
302- }
380+ } else Cursor . cursorMode = Default ;
303381 }
304382
305383 if (distItem != - 1 && selectedItem != menuItems .members [distItem ])
@@ -313,7 +391,7 @@ class MainMenuState extends MusicBeatState
313391 else
314392 {
315393 timeNotMoving + = elapsed ;
316- if (timeNotMoving > 2 ) FlxG . mouse . visible = false ;
394+ if (timeNotMoving > 2 ) Cursor . hide () ;
317395 }
318396
319397 switch (curColumn )
@@ -367,7 +445,7 @@ class MainMenuState extends MusicBeatState
367445 if (controls. BACK )
368446 {
369447 selectedSomethin = true ;
370- FlxG . mouse . visible = false ;
448+ Cursor . hide () ;
371449 FlxG .sound .play (Paths .sound (' cancelMenu' ));
372450 MusicBeatState .switchState (new TitleState ());
373451 }
@@ -376,11 +454,21 @@ class MainMenuState extends MusicBeatState
376454 {
377455 FlxG .sound .play (Paths .sound (' confirmMenu' ));
378456 selectedSomethin = true ;
379- FlxG . mouse . visible = false ;
457+ Cursor . hide () ;
380458
381459 if (ClientPrefs .data .flashing )
382460 FlxFlicker .flicker (magenta , 1.1 , 0.15 , false );
383461
462+ FlxTween .tween (FlxG .camera , {zoom : 5 }, 2 , {ease : FlxEase .expoIn , onComplete : function (twn : FlxTween )
463+ {
464+ FlxG .camera .zoom = 1 ;
465+ }});
466+
467+ new FlxTimer ().start (0.2 , function (tmr : FlxTimer )
468+ {
469+ hideit (1 );
470+ });
471+
384472 var item : FlxSprite ;
385473 var option : String ;
386474 switch (curColumn )
@@ -495,6 +583,19 @@ class MainMenuState extends MusicBeatState
495583 camFollow .y = selectedItem .getGraphicMidpoint ().y ;
496584 }
497585
586+ function hideit (time : Float )
587+ {
588+ menuItems .forEach (function (spr : FlxSprite )
589+ {
590+ FlxTween .tween (spr , {alpha : 0.0 }, time , {ease : FlxEase .quadOut });
591+ });
592+ if (! ClientPrefs .data .lowQuality )
593+ {
594+ FlxTween .tween (checker , {alpha : 0 }, time , {ease : FlxEase .expoIn });
595+ FlxTween .tween (gradientBar , {alpha : 0 }, time , {ease : FlxEase .expoIn });
596+ }
597+ }
598+
498599 override function beatHit ()
499600 {
500601 super .beatHit ();
0 commit comments