Skip to content

Commit 78327fb

Browse files
committed
osu freeplay
have to make sure it works with mods but otherwise it works fully
1 parent 34f7eb2 commit 78327fb

36 files changed

+1051
-345
lines changed
26 KB
Loading
11.5 KB
Loading
134 KB
Loading
30.3 KB
Loading
52.4 KB
Loading
5.61 KB
Loading
3.89 KB
Loading
4.76 KB
Loading

source/Main.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class Main extends Sprite
446446
if (PlayState.isStoryMode) {
447447
FlxG.switchState(new states.StoryMenuState());
448448
} else {
449-
FlxG.switchState(new states.FreeplayState());
449+
FreeplayManager.openFreeplay();
450450
}
451451
PlayState.Crashed = false;
452452
}

source/archipelago/APGameState.hx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package archipelago;
22

33
import yutautil.AprilFools;
44
import haxe.DynamicAccess;
5-
import states.FreeplayState;
65
import yutautil.MemoryHelper;
76
import flixel.FlxState;
87
import archipelago.Client;
@@ -489,7 +488,7 @@ class APGameState
489488
return false;
490489
}
491490
}
492-
if (states.FreeplayState.isVictorySong(songName, modName))
491+
if (FreeplayManager.isVictorySong(songName, modName))
493492
{
494493
setGoal();
495494
return true;
@@ -623,23 +622,23 @@ class APGameState
623622
message = "Hint: " + receivingPlayerName + " will find " + itemName + " in " + findingPlayerName + "'s World at " + locationName;
624623
}
625624

626-
if (FreeplayState.hintTable.exists(locationName))
625+
if (FreeplayManager.hintTable.exists(locationName))
627626
{
628-
FreeplayState.hintTable.set(locationName, FreeplayState.hintTable.get(locationName) + "\n" + message);
627+
FreeplayManager.hintTable.set(locationName, FreeplayManager.hintTable.get(locationName) + "\n" + message);
629628
}
630629
else
631630
{
632-
FreeplayState.hintTable.set(locationName, message);
631+
FreeplayManager.hintTable.set(locationName, message);
633632
}
634633
}
635634
}
636635
}
637-
for (hint in FreeplayState.hintTable.keys())
636+
for (hint in FreeplayManager.hintTable.keys())
638637
{
639-
var message = FreeplayState.hintTable.get(hint);
638+
var message = FreeplayManager.hintTable.get(hint);
640639
trace("Hint: " + hint + " - " + message);
641640
var hintSong = getSongAndMod(hint);
642-
FreeplayState.curHinted.push({song: hintSong.song, mod: hintSong.mod != null ? hintSong.mod : ""});
641+
FreeplayManager.curHinted.push({song: hintSong.song, mod: hintSong.mod != null ? hintSong.mod : ""});
643642
trace(hintSong);
644643
}
645644
}
@@ -911,7 +910,7 @@ class APGameState
911910
var tickets = 0;
912911
var nonSongs:Map<String, Int> = [];
913912
var nonSongsNames:Array<String> = [];
914-
states.FreeplayState.curMissing = [];
913+
FreeplayManager.curMissing = [];
915914

916915
for (songName in song)
917916
{
@@ -936,7 +935,7 @@ class APGameState
936935
data.mod = "";
937936
}
938937
var isUnlocked = false;
939-
for (unlocked in states.FreeplayState.curUnlocked)
938+
for (unlocked in FreeplayManager.curUnlocked)
940939
{
941940
if (unlocked.song == data.song && unlocked.mod == data.mod)
942941
{
@@ -951,12 +950,12 @@ class APGameState
951950
{
952951
if (!isSync)
953952
ArchPopup.startPopupSong(data.song, 'archColor');
954-
states.FreeplayState.curUnlocked.push({song: data.song, mod: data.mod});
953+
FreeplayManager.curUnlocked.push({song: data.song, mod: data.mod});
955954
}
956955
}
957956

958957
// Check special items and remove any matching items with no mod
959-
states.FreeplayState.curUnlocked = states.FreeplayState.curUnlocked.filter(unlocked ->
958+
FreeplayManager.curUnlocked = FreeplayManager.curUnlocked.filter(unlocked ->
960959
!(APItems.exists(unlocked.song) && unlocked.mod.trim() == "")
961960
);
962961
}
@@ -1050,8 +1049,7 @@ class APGameState
10501049
info().casualSync = false;
10511050
try
10521051
{
1053-
if (states.FreeplayState.instance != null)
1054-
states.FreeplayState.instance.reloadSongs(true);
1052+
FreeplayManager.reloadFreeplay(true);
10551053
}
10561054
catch (e:Dynamic)
10571055
{
@@ -1146,7 +1144,7 @@ class APGameState
11461144

11471145
function checkIfLocked(song:String, mod:String):Bool
11481146
{
1149-
return !(states.FreeplayState.curUnlocked.contains(APEntryState.apGame.getSongAndMod(song + mod)));
1147+
return !(FreeplayManager.curUnlocked.contains(APEntryState.apGame.getSongAndMod(song + mod)));
11501148
}
11511149

11521150
function validateMods()

0 commit comments

Comments
 (0)