public static void OnValueChanged(OptionBehaviour option) { if (!AmongUsClient.Instance || !AmongUsClient.Instance.AmHost) { return; } /*foreach (CustomNumberOption custom in numOpts) * if (option.Title == custom.numOptionTitle) * { * //custom.value = option.GetInt(); * var checkValue = option.GetInt(); * if (checkValue > custom.maxValue) * custom.value = custom.maxValue; * if (checkValue < custom.minValue) * custom.value = custom.minValue; * // patched increase & decrease now for infinite range * }*/ foreach (CustomBoolOption custom in boolOpts) { if (option.Title == custom.boolOptionTitle) { custom.value = option.GetBool(); } } if (PlayerControl.GameOptions.isDefaults) { PlayerControl.GameOptions.isDefaults = false; UnityEngine.Object.FindObjectOfType <GameOptionsMenu>().Update(); } var local = PlayerControl.LocalPlayer; if (local != null) { local.RpcSyncSettings(PlayerControl.GameOptions); } }
public override void Update(OptionBehaviour option) { value = option.GetBool(); }