File tree Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class APPlayState extends PlayState {
3232 public var checkedNotes : Array <Note > = new Array <Note >();
3333
3434 public static var currentMod = " " ;
35+ public static var currentSong = " " ;
3536 public static var deathLinkPacket : Dynamic ;
3637 public static var effectiveScrollSpeed : Float ;
3738 public static var effectiveDownScroll : Bool ;
Original file line number Diff line number Diff line change @@ -988,7 +988,10 @@ class FreeplayState extends MusicBeatState
988988 alreadyClicked = true ;
989989 MusicBeatState .reopen = false ; // Fix a sticker bug
990990 LoadingState .prepareToSong ();
991- LoadingState .loadAndSwitchState (APEntryState .inArchipelagoMode ? new archipelago. APPlayState () : new states. PlayState ());
991+ LoadingState .loadAndSwitchState (APEntryState .inArchipelagoMode ? new archipelago. APPlayState ().funcAndReturn (function (ps : archipelago. APPlayState ) {
992+ archipelago. APPlayState .currentSong = fpManager .songList [curSelected ].songName ;
993+ archipelago. APPlayState .currentMod = fpManager .songList [curSelected ].folder ;
994+ }) : new PlayState ());
992995 }
993996 #if !SHOW_LOADING_SCREEN FlxG .sound .music .stop (); #end
994997 stopMusicPlay = true ;
Original file line number Diff line number Diff line change @@ -146,7 +146,13 @@ class DifficultySelectorSubState extends MusicBeatSubstate
146146 return ;
147147 }
148148 LoadingState .prepareToSong ();
149- LoadingState .loadAndSwitchState (archipelago. APEntryState .inArchipelagoMode ? new archipelago. APPlayState () : new states. PlayState ());
149+ LoadingState .loadAndSwitchState (archipelago. APEntryState .inArchipelagoMode ? new archipelago. APPlayState ().funcAndReturn (function (ps : archipelago. APPlayState ) {
150+ @:privateAccess
151+ {
152+ archipelago. APPlayState .currentSong = OsuFreeplayState .instance .fpManager .songList [OsuFreeplayState .instance .curSelected ].songName ;
153+ archipelago. APPlayState .currentMod = OsuFreeplayState .instance .fpManager .songList [OsuFreeplayState .instance .curSelected ].folder ;
154+ }
155+ }) : new states. PlayState ());
150156 }
151157 if (FlxG .keys .firstJustPressed () != FlxKey .NONE && missingText .visible )
152158 {
Original file line number Diff line number Diff line change @@ -216,7 +216,9 @@ class RankingSubstate extends MusicBeatSubstate
216216 var attempts = 0 ;
217217
218218
219- var locationId = (PlayState .SONG .song );
219+ var locationId = (archipelago. APPlayState .currentSong != null && archipelago. APPlayState .currentSong .trim () != " " )
220+ ? archipelago. APPlayState .currentSong
221+ : PlayState .SONG .song ;
220222 if (APInfo .unlockMethod != " Note Checks" ) {
221223 trace (archipelago. APPlayState .currentMod );
222224 // if (archipelago.APPlayState.currentMod.trim() != "")
Original file line number Diff line number Diff line change @@ -663,6 +663,12 @@ class CollectionUtils
663663 return null ;
664664 }
665665
666+ public static inline function global <O >(input : O ): Class <O >
667+ {
668+ return Type .getClass (input ) != null ? Type .getClass (input ) : throw " Input has no class (null)" ;
669+ }
670+
671+
666672 public static inline function objectDynamic <T >(input : Dynamic ): Dynamic
667673 {
668674 if (Std .is (input , Array ))
You can’t perform that action at this time.
0 commit comments