Exemple #1
0
            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 OnValueChanged(OptionBehaviour option)
            {
                if (!AmongUsClient.Instance || !AmongUsClient.Instance.BEIEANEKAFC)
                {
                    return;
                }
                switch (option.Title)
                {
                case sheriffCountTitle:
                    sheriffCount = (byte)option.GetInt();
                    break;

                case killTargetTitle:
                    doKillSheriffsTarget = option.GetBool();
                    break;
                }
                if (PlayerControl.GameOptions.JFALOOKBBAD)
                {
                    PlayerControl.GameOptions.JFALOOKBBAD = false;
                    UnityEngine.Object.FindObjectOfType <GameOptionsMenu>().POPOILOGEAL();
                }
                var local = PlayerControl.LocalPlayer;

                if (local != null)
                {
                    local.RpcSyncSettings(PlayerControl.GameOptions);
                }
            }
        public static void AddOptions()
        {
            if (GameOptionMenuPatch.showSheriffOption == null | GameOptionMenuPatch.SheriffCooldown == null)
            {
                var showAnonymousvote = GameObject.FindObjectsOfType <ToggleOption>().ToList().Where(x => x.TitleText.Text == "Anonymous Votes").First();
                GameOptionMenuPatch.showSheriffOption = GameObject.Instantiate(showAnonymousvote);
                var killcd = GameObject.FindObjectsOfType <NumberOption>().ToList().Where(x => x.TitleText.Text == "Kill Cooldown").First();
                GameOptionMenuPatch.SheriffCooldown = GameObject.Instantiate(killcd);

                OptionBevavior[] options = new OptionBevavior[GameOptionMenuPatch.instance.KJFHAPEDEBH.Count + 2];
                GameOptionMenuPatch.instance.KJFHAPEDEBH.ToArray().CopyTo(options, 0);
                options[options.Length - 2] = GameOptionMenuPatch.showSheriffOption;
                options[options.Length - 1] = GameOptionMenuPatch.SheriffCooldown;
                GameOptionMenuPatch.instance.KJFHAPEDEBH = new Il2CppReferenceArray <OptionBevavior>(options);
            }
            else
            {
                GameOptionMenuPatch.SheriffCooldown.gameObject.SetActive(true);
                GameOptionMenuPatch.showSheriffOption.gameObject.SetActive(true);
            }

            GameOptionMenuPatch.showSheriffOption.TitleText.Text    = "Show Sheriff";
            GameOptionMenuPatch.showSheriffOption.NHLMDAOEOAE       = CustomGameOptions.showSheriff;
            GameOptionMenuPatch.showSheriffOption.CheckMark.enabled = CustomGameOptions.showSheriff;

            GameOptionMenuPatch.SheriffCooldown.TitleText.Text = "Sheriff Kill Cooldown";
            GameOptionMenuPatch.SheriffCooldown.Value          = CustomGameOptions.SheriffKillCD;
            GameOptionMenuPatch.SheriffCooldown.ValueText.Text = CustomGameOptions.SheriffKillCD.ToString();
        }
        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 Postfix2(PHCKLDDNJNP __instance)
        {
            OptionBevavior option = __instance.KJFHAPEDEBH[__instance.KJFHAPEDEBH.Count - 3];

            if (SheriffCooldown != null & showSheriffOption != null)
            {
                showSheriffOption.transform.position = option.transform.position - new Vector3(0, 2f, 0);
                SheriffCooldown.transform.position   = option.transform.position - new Vector3(0, 2.5f, 0);
            }
        }