Skip to content

Commit bb437c7

Browse files
committed
e
1 parent 11c100a commit bb437c7

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

source/archipelago/APPlayState.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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;

source/states/freeplay/FreeplayState.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

source/states/freeplay/osu/DifficultySelectorSubState.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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
{

source/substates/RankingSubstate.hx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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() != "")

source/yutautil/CollectionUtils.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)