private static void Prefix(PauseScreen __instance) { if (KataConfig.I.practiceMode) { return; } GrindMode.SetPaused(false); }
private static bool Prefix(InGameUI __instance) { if (KataConfig.I.practiceMode) { return(true); } GrindMode.RestartSong(true); return(true); }
private static void Prefix(InGameUI __instance) { if (KataConfig.I.practiceMode) { return; } GrindMode.ResetVariables(); GrindMode.DontRecordRestart(); }
private static void Postfix(SongCues __instance) { if (KataConfig.I.practiceMode) { return; } if (GrindMode.grindMode && Config.highscoreMode) { GrindMode.SetCues(__instance.mCues.cues); } }
private static void Postfix(ScoreKeeper __instance, ref SongCues.Cue cue) { if (KataConfig.I.practiceMode) { return; } if (GrindMode.waitForRestart) { return; } if (GrindMode.grindMode && Config.highscoreMode && !GrindMode.highscoreIsSetup) { GrindMode.SetHighscore(ScoreKeeper.I.GetHighScore()); } if (cue is null) { return; } if (!GrindMode.grindMode || KataConfig.I.NoFail()) { return; } if (Config.highscoreMode) { //if (!GrindMode.skipSetScoreMiss) GrindMode.SetCurrentScore(__instance.mScore, __instance.mStreak, __instance.mMultiplier, cue, true); //GrindMode.skipSetScoreMiss = !GrindMode.skipSetScoreMiss; return; } if (!Config.includeChainSustainBreak) { if (cue.behavior == Target.TargetBehavior.Chain) { //MelonModLogger.Log("Chain break! Ignoring."); return; } else if (cue.behavior == Target.TargetBehavior.Hold && cue.target.mSustainFailed) { //MelonModLogger.Log("Sustain break! Ignoring."); return; } } GrindMode.ReportMiss(cue); }
private static void Prefix(MenuState __instance, ref MenuState.State state) { if (KataConfig.I.practiceMode) { return; } if (GrindMode.recordRestarted) { if (state == MenuState.State.SongPage) { GrindMode.RecordRestart(); } } }
private static void Prefix(AudioDriver __instance) { if (KataConfig.I.practiceMode) { return; } if (GrindMode.waitForRestart) { GrindMode.waitForRestart = false; } if (GrindMode.skipQueued || Config.autoSkip) { GrindMode.SkipIntro(); } }
private static void Postfix(MenuState __instance, ref MenuState.State state) { if (state == MenuState.State.LaunchPage && !GrindMode.grindButtonCreated && !GrindMode.autoSkipButtonCreated && !GrindMode.allowedMissCountButtonCreated) { MelonCoroutines.Start(GrindMode.AddLaunchPanelButtons()); } else if (GrindMode.grindButtonCreated || GrindMode.autoSkipButtonCreated) { if (state == MenuState.State.LaunchPage) { MelonCoroutines.Start(GrindMode.SetLaunchPanelButtonsActive(true)); } else if (state != MenuState.State.Launched) { MelonCoroutines.Start(GrindMode.SetLaunchPanelButtonsActive(false)); } } if (state == MenuState.State.SongPage && GrindMode.menuButton is null) { GrindMode.CreateIntroSkipButton(); } if (GrindMode.introSkipButtonCreated) { if (state != MenuState.State.Launched || state != MenuState.State.Launching) { GrindMode.SetIntroSkipButtonActive(false); } else if (state == MenuState.State.Launched && (Config.autoSkip || KataConfig.I.practiceMode)) { GrindMode.SetIntroSkipButtonActive(false); } } if (state == MenuState.State.Launched && !KataConfig.I.practiceMode) { GrindMode.ResetVariables(); } if (GrindMode.audiocomponent is null && state == MenuState.State.SongPage) { GrindMode.GetAudioComponent(); } }
public static void OnModSettingsApplied() { foreach (var fieldInfo in typeof(Config).GetFields(BindingFlags.Static | BindingFlags.Public)) { if (fieldInfo.Name == "Category") { continue; } if (fieldInfo.FieldType == typeof(bool)) { fieldInfo.SetValue(null, MelonPrefs.GetBool(Category, fieldInfo.Name)); } else if (fieldInfo.FieldType == typeof(int)) { fieldInfo.SetValue(null, MelonPrefs.GetInt(Category, fieldInfo.Name)); } } GrindMode.UpdateQuickButtons(); }
private static void Postfix(ScoreKeeper __instance, ref SongCues.Cue cue) { if (KataConfig.I.practiceMode) { return; } if (!GrindMode.grindMode || KataConfig.I.NoFail()) { return; } if (Config.highscoreMode) { if (!GrindMode.highscoreIsSetup) { GrindMode.SetHighscore(ScoreKeeper.I.GetHighScore()); } // if (!GrindMode.skipSetScoreSuccess) GrindMode.SetCurrentScore(__instance.mScore, __instance.mStreak, __instance.mMultiplier, cue); //GrindMode.skipSetScoreSuccess = !GrindMode.skipSetScoreSuccess; return; } if (GrindMode.chainLH) { if (cue.handType == Target.TargetHandType.Left) { GrindMode.chainLH = false; } } else if (GrindMode.chainRH) { if (cue.handType == Target.TargetHandType.Right) { GrindMode.chainRH = false; } } }