public static void AddListeners() { ChallengeExternalModifiers.onChallengeFailedToLoad += ReturnOptions; ChallengeExternalModifiers.onChallengeEnd += ReturnOptions; ChallengeExternalModifiers.RegisterHandler("GameplayRestrictionsPlus", delegate(string[] modifiers) { Plugin.activateDuringIsolated = true; SaveOptions(); SetToDefaultOptions(); foreach (string arg in modifiers) { if (arg.StartsWith("imperfectCutThreshold")) { Config.imperfectCutThreshold = int.TryParse(arg.Split(':')[1], out int value) ? value : Config.imperfectCutThreshold; continue; } switch (arg) { case "failOnMiss": Config.failOnMiss = true; break; case "failOnBadCut": Config.failOnBadCut = true; break; case "failOnBomb": Config.failOnBomb = true; break; case "failOnImperfectCut": Config.failOnImperfectCut = true; break; case "failOnSaberClash": Config.failOnSaberClash = true; break; default: return(false); } } return(true); }); }
public static void AddListeners() { ChallengeExternalModifiers.onChallengeFailedToLoad += ReturnOptions; ChallengeExternalModifiers.onChallengeEnd += ReturnOptions; ChallengeExternalModifiers.RegisterHandler("GameplayModifiersPlus", delegate(string[] modifiers) { Plugin.activateDuringIsolated = true; SaveOptions(); SetToDefaultOptions(); foreach (string arg in modifiers) { if (arg.StartsWith("fixedNoteScale")) { GMPUI.fixedNoteScale = float.Parse(arg.Split(':')[1]); continue; } switch (arg) { case "gnomeOnMiss": GMPUI.gnomeOnMiss = true; break; case "bulletTime": GMPUI.bulletTime = true; break; case "swapSabers": GMPUI.swapSabers = true; break; case "funky": GMPUI.funky = true; break; case "rainbow": GMPUI.rainbow = true; break; case "njsRandom": GMPUI.njsRandom = true; break; case "randomSize": GMPUI.randomSize = true; break; case "noArrows": GMPUI.noArrows = true; break; case "oneColor": GMPUI.oneColor = true; break; default: return(false); } } return(true); }); }