Ejemplo n.º 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);
                }
            }
            static void Postfix(ref GameOptionsMenu __instance)
            {
                var countOption = UnityEngine.Object.Instantiate(__instance.GetComponentsInChildren <NumberOption>()[1], __instance.transform);

                countOption.transform.localPosition = new Vector3(countOption.transform.localPosition.x, -8.35f, countOption.transform.localPosition.z);
                countOption.Title = sheriffCountTitle;
                countOption.Value = sheriffCount;
                var str = "";

                TranslationController_GetString.Prefix(countOption.Title, ref str);
                countOption.TitleText.Text = str;
                countOption.OnValueChanged = new Action <OptionBehaviour>(OnValueChanged);
                countOption.gameObject.AddComponent <OptionBehaviour>();

                var toggleOption = UnityEngine.Object.Instantiate(__instance.GetComponentsInChildren <ToggleOption>()[1], __instance.transform);

                toggleOption.transform.localPosition = new Vector3(toggleOption.transform.localPosition.x, -8.85f, toggleOption.transform.localPosition.z);
                toggleOption.Title             = killTargetTitle;
                toggleOption.CheckMark.enabled = doKillSheriffsTarget;
                var str2 = "";

                TranslationController_GetString.Prefix(toggleOption.Title, ref str2);
                toggleOption.TitleText.Text = str2;
                toggleOption.OnValueChanged = new Action <OptionBehaviour>(OnValueChanged);
                toggleOption.gameObject.AddComponent <OptionBehaviour>();
                __instance.GetComponentInParent <Scroller>().YBounds.max += 0.3f;
            }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        public static void Postfix2(PHCKLDDNJNP __instance)
        {
            BCLDBBKFJPK showAnonymousvote = GameObject.FindObjectsOfType <BCLDBBKFJPK>().ToList().Where(x => x.TitleText.Text == "Anonymous Votes").First();

            if (SheriffCooldown != null & showSheriffOption != null)
            {
                showSheriffOption.transform.position = showAnonymousvote.transform.position - new Vector3(0, 5.5f, 0);
                SheriffCooldown.transform.position   = showAnonymousvote.transform.position - new Vector3(0, 6f, 0);
            }
        }
            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 { }
                }
            }
Ejemplo n.º 7
0
 public static void Postfix1(GameOptionsMenu __instance)
 {
     instance = __instance;
     CustomPlayerMenuPatch.AddOptions();
 }
Ejemplo n.º 8
0
 static void Postfix(ref GameOptionsMenu __instance)
 {
     __instance.GetComponentsInChildren <NumberOption>()
     .First(o => o.Title == StringNames.GameNumImpostors)
     .ValidRange = new FloatRange(1, (int)(CreateGameOptionsPatches.CreateOptionsPicker_Start.maxPlayers - 0.5f) / 2);
 }