public static void Postfix(NumberOption __instance) { try { var options = AllCustomNumberOptions.Where(x => x.StringNameId == (int)__instance.Title); if (options.Count() != 1) { return; } var option = options.First(); if (option.Value != __instance.Value) { option.Value = Mathf.RoundToInt(__instance.Value); __instance.ValueText.Text = option.ValueStrings[option.Value]; option.ExecuteValueChanged(); } if (__instance.ValueText.Text != option.ValueStrings[option.Value]) { __instance.ValueText.Text = option.ValueStrings[option.Value]; } } catch { } }
public static void Postfix(GameOptionsMenu __instance) { if (UnityEngine.Object.FindObjectsOfType <BCLDBBKFJPK>().Count == 4) { NumberOption killCooldown = GameObject.FindObjectsOfType <PCGDGFIAJJI>().ToList().Where(x => x.TitleText.Text == "Kill Cooldown").First(); GameOptionsMenuUpdatePatch.chameleonDuration = GameObject.Instantiate(killCooldown); GameOptionsMenuUpdatePatch.chameleonDuration.gameObject.name = "ChameleonDurationText"; GameOptionsMenuUpdatePatch.chameleonDuration.TitleText.Text = "Chameleon Duration"; GameOptionsMenuUpdatePatch.chameleonDuration.Value = CustomGameOptions.invisibilityDuration; GameOptionsMenuUpdatePatch.chameleonDuration.ValueText.Text = CustomGameOptions.invisibilityDuration.ToString(); GameOptionsMenuUpdatePatch.chameleonCooldown = GameObject.Instantiate(killCooldown); GameOptionsMenuUpdatePatch.chameleonCooldown.gameObject.name = "ChameleonCooldownText"; GameOptionsMenuUpdatePatch.chameleonCooldown.TitleText.Text = "Chameleon Cooldown"; GameOptionsMenuUpdatePatch.chameleonCooldown.Value = CustomGameOptions.invisibilityCooldown; GameOptionsMenuUpdatePatch.chameleonCooldown.ValueText.Text = CustomGameOptions.invisibilityCooldown.ToString(); OptionBehaviour[] options = new OptionBehaviour[__instance.KJFHAPEDEBH.Count + 2]; __instance.KJFHAPEDEBH.ToArray().CopyTo(options, 0); options[options.Length - 2] = GameOptionsMenuUpdatePatch.chameleonDuration; options[options.Length - 1] = GameOptionsMenuUpdatePatch.chameleonCooldown; __instance.KJFHAPEDEBH = new Il2CppReferenceArray <OptionBehaviour>(options); } }
public static void Postfix1(PHCKLDDNJNP __instance) { if (GameObject.FindObjectsOfType <BCLDBBKFJPK>().Count == 4) { BCLDBBKFJPK showAnonymousvote = GameObject.FindObjectsOfType <BCLDBBKFJPK>().ToList().Where(x => x.TitleText.Text == "Anonymous Votes").First(); showSheriffOption = GameObject.Instantiate(showAnonymousvote); showSheriffOption.TitleText.Text = "Show Sheriff"; showSheriffOption.NHLMDAOEOAE = CustomGameOptions.showSheriff; showSheriffOption.CheckMark.enabled = CustomGameOptions.showSheriff; PCGDGFIAJJI killcd = GameObject.FindObjectsOfType <PCGDGFIAJJI>().ToList().Where(x => x.TitleText.Text == "Kill Cooldown").First(); SheriffCooldown = GameObject.Instantiate(killcd); SheriffCooldown.gameObject.name = "SheriffCDText"; SheriffCooldown.TitleText.Text = "Sheriff Kill Cooldown"; SheriffCooldown.Value = CustomGameOptions.SheriffKillCD; SheriffCooldown.ValueText.Text = CustomGameOptions.SheriffKillCD.ToString(); LLKOLCLGCBD[] options = new LLKOLCLGCBD[__instance.KJFHAPEDEBH.Count + 2]; __instance.KJFHAPEDEBH.ToArray().CopyTo(options, 0); options[options.Length - 2] = showSheriffOption; options[options.Length - 1] = SheriffCooldown; __instance.KJFHAPEDEBH = new Il2CppReferenceArray <LLKOLCLGCBD>(options); } }
public static void Postfix(GameOptionsMenu __instance) { foreach (var customNoOption in AllCustomNumberOptions) { try { Scroller componentInParent = __instance.GetComponentInParent <Scroller>(); componentInParent.YBounds = new FloatRange(componentInParent.YBounds.min, 20f); float num = -8.5f; float num2 = -0.5f; NumberOption option = UnityEngine.Object.Instantiate(__instance.GetComponentsInChildren <NumberOption>().First(), __instance.transform); // Instantiate new option option.transform.localPosition = new Vector3(option.transform.localPosition.x, num + num2 * customNoOption.IndexId, option.transform.localPosition.z); // Update position option.Title = (StringNames)customNoOption.StringNameId; // Set custom string name id option.TitleText.Text = customNoOption.TitleText; // Set the title text option.Value = customNoOption.Value; // Set the current value option.gameObject.AddComponent <NumberOption>(); option.ValidRange = customNoOption.FloatRange; customNoOption.GameNumberOption = option; } catch { } } foreach (var customToggleOption in AllCustomToggleOptions) { try { Scroller componentInParent = __instance.GetComponentInParent <Scroller>(); componentInParent.YBounds = new FloatRange(componentInParent.YBounds.min, 20f); float num = -8.5f; float num2 = -0.5f; ToggleOption option = UnityEngine.Object.Instantiate(__instance.GetComponentsInChildren <ToggleOption>().First(), __instance.transform); // Instantiate new option option.transform.localPosition = new Vector3(option.transform.localPosition.x, num + num2 * customToggleOption.IndexId, option.transform.localPosition.z); // Update position option.Title = (StringNames)customToggleOption.StringNameId; // Set custom string name id option.TitleText.Text = customToggleOption.TitleText; // Set the title text option.CheckMark.enabled = customToggleOption.Value; // Set the current value option.gameObject.AddComponent <NumberOption>(); customToggleOption.GameToggleOption = option; } catch { } } }
public static bool Prefix1(NumberOption __instance) { if (__instance.TitleText.Text == "Sheriff Kill Cooldown") { CustomGameOptions.SheriffKillCD = Math.Min(CustomGameOptions.SheriffKillCD + 2.5f, 40); FFGALNAPKCD.LocalPlayer.RpcSyncSettings(FFGALNAPKCD.GameOptions); GameOptionMenuPatch.SheriffCooldown.NHLMDAOEOAE = CustomGameOptions.SheriffKillCD; GameOptionMenuPatch.SheriffCooldown.Value = CustomGameOptions.SheriffKillCD; GameOptionMenuPatch.SheriffCooldown.ValueText.Text = CustomGameOptions.SheriffKillCD.ToString(); return(false); } return(true); }
static bool Prefix(ref NumberOption __instance) { if (__instance.Title == sheriffCountTitle) { string smh = ""; TranslationController_GetString.Prefix(__instance.Title, ref smh); __instance.TitleText.Text = smh; __instance.OnValueChanged = new Action <OptionBehaviour>(GameOptionsMenu_Start.OnValueChanged); __instance.Value = sheriffCount; __instance.enabled = true; return(false); } return(true); }
public static bool Prefix(NumberOption __instance) { if (__instance.TitleText.Text == "Chameleon Duration") { CustomGameOptions.invisibilityDuration = Math.Max(CustomGameOptions.invisibilityDuration - 2.5f, 10); PlayerControl.LocalPlayer.RpcSyncSettings(PlayerControl.GameOptions); __instance.NHLMDAOEOAE = CustomGameOptions.invisibilityDuration; __instance.Value = CustomGameOptions.invisibilityDuration; __instance.ValueText.Text = $"{CustomGameOptions.invisibilityDuration.ToString()}s"; return(false); } else if (__instance.TitleText.Text == "Chameleon Cooldown") { CustomGameOptions.invisibilityCooldown = Math.Max(CustomGameOptions.invisibilityCooldown - 2.5f, 10); PlayerControl.LocalPlayer.RpcSyncSettings(PlayerControl.GameOptions); __instance.NHLMDAOEOAE = CustomGameOptions.invisibilityCooldown; __instance.Value = CustomGameOptions.invisibilityCooldown; __instance.ValueText.Text = $"{CustomGameOptions.invisibilityCooldown.ToString()}s"; return(false); } return(true); }