private static void Postfix(MenuState __instance, ref MenuState.State state) { if (state == MenuState.State.LaunchPage) { DeleteButton.CreateDeleteButton(); FavoriteButton.CreateFavoriteButton(); AddPlaylistButton.CreatePlaylistButton(); DifficultyDisplay.Show(); } else { DifficultyDisplay.Hide(); } if (state == MenuState.State.SongPage) { ScoreDisplayList.Show(); RandomSongButton.CreateRandomSongButton(); SongSearchButton.CreateSearchButton(); SelectPlaylistButton.CreatePlaylistButton(); PlaylistEndlessButton.CreatePlaylistButton(); RefreshButton.CreateRefreshButton(); PlaylistEndlessManager.ResetIndex(); } else { ScoreDisplayList.Hide(); PlaylistEndlessButton.HidePlaylistButton(); } if (state == MenuState.State.MainPage) { //PlaylistManager.DownloadMissingSongs(); } }
private static void AddButtons(OptionsMenu optionsMenu) { var header = optionsMenu.AddHeader(0, "Marathon Settings"); optionsMenu.scrollable.AddRow(header); string shuffleText = Config.Shuffle ? "<color=\"green\">Shuffle ON" : "<color=\"red\">Shuffle OFF"; shuffleButton = optionsMenu.AddButton(0, shuffleText, new Action(() => { ToggleShuffle(); }), null, "Shuffles the songs", optionsMenu.buttonPrefab); string showScoreText = Config.ShowScores ? "<color=\"green\">Show Score ON" : "<color=\"red\">Show Score OFF"; showScoreButton = optionsMenu.AddButton(1, showScoreText, new Action(() => { ToggleShowScore(); }), null, "Shows 'Level Complete' at the end of each song", optionsMenu.buttonPrefab); string noFailText = Config.NoFail ? "<color=\"green\">NoFail ON" : "<color=\"red\">NoFail OFF"; noFailButton = optionsMenu.AddButton(0, noFailText, new Action(() => { ToggleNoFail(); }), null, "Play the marathon with NoFail on or off", optionsMenu.buttonPrefab); string resetHealthText = Config.ResetHealth ? "<color=\"green\">Reset Health ON" : "<color=\"red\">Reset Health OFF"; resetHealthButton = optionsMenu.AddButton(1, resetHealthText, new Action(() => { ToggleResetHealth(); }), null, "Reset Health at the end of each song", optionsMenu.buttonPrefab); Il2CppSystem.Collections.Generic.List <GameObject> toggles = new Il2CppSystem.Collections.Generic.List <GameObject>(); toggles.Add(shuffleButton.gameObject); toggles.Add(showScoreButton.gameObject); optionsMenu.scrollable.AddRow(toggles); toggles.Clear(); toggles.Add(noFailButton.gameObject); toggles.Add(resetHealthButton.gameObject); optionsMenu.scrollable.AddRow(toggles); var divider = optionsMenu.AddHeader(0, ""); optionsMenu.scrollable.AddRow(divider); var start = optionsMenu.AddButton(1, "Start", new Action(() => { MelonPreferences.Save(); PlaylistEndlessManager.StartEndlessSession(); }), null, "Starts the marathon", optionsMenu.buttonPrefab); optionsMenu.scrollable.AddRow(start.gameObject); }
private static bool Prefix(InGameUI __instance, InGameUI.State state, bool instant) { if (PlaylistManager.state == PlaylistManager.PlaylistState.Endless) { if (state == InGameUI.State.ResultsPage) { PlaylistEndlessManager.NextSong(); return(false); //false = don't run function } } return(true); }
private static bool Prefix(SongEndSequence __instance, ref SongEndSequence.State newState) { if (PlaylistManager.state == PlaylistManager.PlaylistState.Endless) { if (Config.ShowScores) { if (newState == SongEndSequence.State.WaitForScorePercentStars) { PlaylistEndlessManager.FadeOut(); return(true); } } } return(true); }
private static bool Prefix(SongEndSequence __instance) { if (PlaylistManager.state == PlaylistManager.PlaylistState.Endless) { if (!Config.ShowScores) { PlaylistEndlessManager.FadeOut(); __instance.startDelay = 0f; __instance.waitDelay = 0f; __instance.endDelay = 0f; __instance.levelComplete.SetActive(false); __instance.newHighScore.SetActive(false); __instance.scorePercentStars.SetActive(false); __instance.fullCombo.SetActive(false); __instance.SetState(SongEndSequence.State.SequenceComplete); return(false); } } return(true); }
private static void OnInGameSkipButtonShot() { PlaylistEndlessManager.NextSong(); }