@@ -440,25 +440,27 @@ class FreeplayState extends MusicBeatState
440440 }
441441
442442 // trace (curUnlocked);
443-
443+ FreeplayManager . checkSongStatus ();
444444 for (i in 0 ... WeekData .weeksList .length ) {
445+ var leWeek : WeekData = WeekData .weeksLoaded .get (WeekData .weeksList [i ]);
446+ WeekData .setDirectoryFromWeek (leWeek );
445447 for (i in 0 ... FreeplayManager .songList .length )
446448 {
447449 var songName : String = ' ' ;
448450 var modName : String = ' ' ;
449451 var isMissing : Bool = false ;
452+ var locationId : Array <Int > = [];
450453 var color : FlxColor = 0xFFFFFFFF ;
451454 var someLocationsNotMissing : Bool = false ;
452455
453- songName = songList [i ].songName ;
454- modName = WeekData .weeksLoaded .get (WeekData .weeksList [songList [i ].week ]).folder ;
456+ songName = FreeplayManager .songList [i ].songName ;
457+ modName = leWeek .folder ;
458+ if (APEntryState .inArchipelagoMode ) locationId = APEntryState .apGame .locationData (songName , modName ).concat (APEntryState .apGame .noteData (songName , modName ));
459+ isMissing = [for (ID in locationId ) APEntryState .apGame .isLocationMissing (APEntryState .apGame .info ().get_location_name (ID ))].indexOf (true ) != - 1 || locationId .length == 0 ;
460+ color = isMissing ? FlxColor .RED : FlxColor .GREEN ;
461+
455462
456463 var songText : Alphabet = null ;
457- // for (locId in locationId) {
458- // // trace("Location ID: " + locId + " Location Name -> " + APEntryState.apGame.info().get_location_name(locId));
459- // }
460- // trace("Song Name: " + songName + " Mod Name: " + modName + " Missing: " + isMissing);
461-
462464 if (APEntryState .inArchipelagoMode ) {
463465 var isBronze : Bool = FlxG .random .bool (50 ); // Randomly decide between orange and bronze
464466 var bronzeOrOrangeColor : Int = isBronze ? 0xFFCD7F32 : 0xFFFFA500 ; // Bronze or Orange color
@@ -483,37 +485,20 @@ class FreeplayState extends MusicBeatState
483485 APEntryState .apGame .checkGoal (songName , modName );
484486 }
485487
486- // // Potential Emergency For Later.
487-
488- // if (callVictory && !APEntryState.apGame.info().clientStatus != archipelago.PacketTypes.ClientStatus.GOAL)
489- // {
490- // trace("Apparently, AP didn't get the memo. Forcing goal...");
491- // APEntryState.apGame.setGoal();
492- // }
493-
494488 songText .scaleX = Math .min (1 , 980 / songText .width );
495489 songText .snapToPosition ();
496490
497491 Mods .currentModDirectory = FreeplayManager .songList [i ].folder ;
498492
499- // too laggy with a lot of songs, so i had to recode the logic for it
500493 songText .visible = songText .active = songText .isMenuItem = false ;
501494
502495 var isLock : Bool = APEntryState .inArchipelagoMode && CategoryState .loadWeekForce == " all" && isMissing && ! FreeplayManager .unplayedList .contains (songName );
503496 var icon : HealthIcon = new HealthIcon (isLock ? " lock" : FreeplayManager .songList [i ].songCharacter );
504497 icon .sprTracker = songText ;
505498 icon .visible = icon .active = false ;
506- // using a FlxGroup is too much fuss!
507- // but over on mixtape engine we do arrays better
508499 iconArray .push (icon );
509500 iconList .add (icon );
510- // }
511-
512- // songText.x += 40;
513- // DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
514- // songText.screenCenter(X);
515501 }
516- WeekData .setDirectoryFromWeek ();
517502 }
518503 if (FreeplayManager .songList .length == - 1 || FreeplayManager .songList .length == 0 )
519504 FreeplayManager .addSong (' SONG NOT FOUND' , - 999 , ' face' , [[255 , 255 , 255 ], [FlxColor .fromRGB (255 , 255 , 255 )]]);
@@ -1187,17 +1172,15 @@ class FreeplayState extends MusicBeatState
11871172
11881173 var bullShit : Int = 0 ;
11891174
1190- try {
1191- for (i in 0 ... iconArray .length )
1175+ for (i in 0 ... iconArray .length )
1176+ {
1177+ if (iconArray [i ] != null && iconArray [i ].animation != null && iconArray [i ].animation .curAnim != null )
11921178 {
1193- if (iconArray [i ] != null && iconArray [i ].animation != null )
1194- {
1195- iconArray [i ].alpha = 0.4 ;
1196- switch (iconArray [i ].type ) {
1197- case SINGLE : iconArray [i ].animation .curAnim .curFrame = 0 ;
1198- case WINNING : iconArray [i ].animation .curAnim .curFrame = 0 ;
1199- default : iconArray [i ].animation .curAnim .curFrame = 0 ;
1200- }
1179+ iconArray [i ].alpha = 0.4 ;
1180+ switch (iconArray [i ].type ) {
1181+ case SINGLE : iconArray [i ].animation .curAnim .curFrame = 0 ;
1182+ case WINNING : iconArray [i ].animation .curAnim .curFrame = 2 ;
1183+ default : iconArray [i ].animation .curAnim .curFrame = 1 ;
12011184 }
12021185 }
12031186
@@ -1211,10 +1194,6 @@ class FreeplayState extends MusicBeatState
12111194 }
12121195 }
12131196 }
1214- catch (e )
1215- {
1216- trace (" Your icon broke! Skipping..." );
1217- }
12181197
12191198 for (item in grpSongs .members )
12201199 {
0 commit comments