Example #1
0
        public override void Load()
        {
            DebugMode                    = Config.Bind("Custom", "Enable Debug Mode", false);
            StreamerMode                 = Config.Bind("Custom", "Enable Streamer Mode", false);
            GhostsSeeTasks               = Config.Bind("Custom", "Ghosts See Remaining Tasks", true);
            GhostsSeeRoles               = Config.Bind("Custom", "Ghosts See Roles", true);
            HostSeesVotesLog             = Config.Bind("Custom", "Host Sees Votes Log", false);
            StreamerModeReplacementText  = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Other Roles");
            StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#87AAF5FF");


            Ip             = Config.Bind("Custom", "Custom Server IP", "127.0.0.1");
            Port           = Config.Bind("Custom", "Custom Server Port", (ushort)22023);
            defaultRegions = ServerManager.DefaultRegions;

            UpdateRegions();

            GameOptionsData.RecommendedImpostors = GameOptionsData.MaxImpostors = Enumerable.Repeat(3, 16).ToArray(); // Max Imp = Recommended Imp = 3
            GameOptionsData.MinPlayers           = Enumerable.Repeat(4, 15).ToArray();                                // Min Players = 4

            DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
            Instance  = this;
            CustomOptionHolder.Load();
            CustomColors.Load();

            Harmony.PatchAll();
        }
Example #2
0
        public override void Load()
        {
            DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
            Ip        = Config.Bind("Custom", "Custom Server IP", "127.0.0.1");
            Port      = Config.Bind("Custom", "Custom Server Port", (ushort)22023);

            IRegionInfo   customRegion  = new DnsRegionInfo(Ip.Value, "Custom", StringNames.NoTranslation, Ip.Value, Port.Value).Cast <IRegionInfo>();
            ServerManager serverManager = DestroyableSingleton <ServerManager> .CHNDKKBEIDG;

            IRegionInfo[] regions = ServerManager.DefaultRegions;

            regions = regions.Concat(new IRegionInfo[] { customRegion }).ToArray();
            ServerManager.DefaultRegions = regions;
            serverManager.AGFAPIKFOFF    = regions;
            serverManager.SaveServers();

            CEIOGGEDKAN.LMADJLEGIMH = CEIOGGEDKAN.IJGNCMMDGDI = Enumerable.Repeat(3, 16).ToArray(); // Max Imp = Recommended Imp = 3
            CEIOGGEDKAN.JMEMPINECJN = Enumerable.Repeat(4, 15).ToArray();                           // Min Players = 4

            DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
            Instance  = this;
            CustomOptionHolder.Load();

            Harmony.PatchAll();
        }
Example #3
0
        public override void Load()
        {
            DebugMode    = Config.Bind("Custom", "Enable Debug Mode", false);
            StreamerMode = Config.Bind("Custom", "Enable Streamer Mode", false);
            StreamerModeReplacementText  = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Other Roles");
            StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#87AAF5FF");


            Ip   = Config.Bind("Custom", "Custom Server IP", "127.0.0.1");
            Port = Config.Bind("Custom", "Custom Server Port", (ushort)22023);

            CustomRegion = new DnsRegionInfo(Ip.Value, "Custom", StringNames.NoTranslation, Ip.Value, Port.Value);
            ServerManager serverManager = DestroyableSingleton <ServerManager> .Instance;

            IRegionInfo[] regions = ServerManager.DefaultRegions;

            regions = regions.Concat(new IRegionInfo[] { CustomRegion.Cast <IRegionInfo>() }).ToArray();
            ServerManager.DefaultRegions   = regions;
            serverManager.AvailableRegions = regions;
            serverManager.SaveServers();

            GameOptionsData.RecommendedImpostors = GameOptionsData.MaxImpostors = Enumerable.Repeat(3, 16).ToArray(); // Max Imp = Recommended Imp = 3
            GameOptionsData.MinPlayers           = Enumerable.Repeat(4, 15).ToArray();                                // Min Players = 4

            DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
            Instance  = this;
            CustomOptionHolder.Load();
            CustomColors.Load();

            Harmony.PatchAll();
        }
Example #4
0
        public override void Load()
        {
            DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
            Instance  = this;
            CustomOptionHolder.Load();

            Harmony.PatchAll();
        }
Example #5
0
        public override void Load()
        {
            ModTranslation.Load();
            Logger                       = Log;
            DebugMode                    = Config.Bind("Custom", "Enable Debug Mode", false);
            StreamerMode                 = Config.Bind("Custom", "Enable Streamer Mode", false);
            GhostsSeeTasks               = Config.Bind("Custom", "Ghosts See Remaining Tasks", true);
            GhostsSeeRoles               = Config.Bind("Custom", "Ghosts See Roles", true);
            GhostsSeeVotes               = Config.Bind("Custom", "Ghosts See Votes", true);
            ShowRoleSummary              = Config.Bind("Custom", "Show Role Summary", true);
            HideNameplates               = Config.Bind("Custom", "Hide Nameplates", false);
            ShowLighterDarker            = Config.Bind("Custom", "Show Lighter / Darker", false);
            HideTaskArrows               = Config.Bind("Custom", "Hide Task Arrows", false);
            ShowPopUpVersion             = Config.Bind("Custom", "Show PopUp", "0");
            StreamerModeReplacementText  = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Other Roles GM");
            StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#87AAF5FF");
            DebugRepo                    = Config.Bind("Custom", "Debug Hat Repo", "");

            Ip             = Config.Bind("Custom", "Custom Server IP", "127.0.0.1");
            Port           = Config.Bind("Custom", "Custom Server Port", (ushort)22023);
            defaultRegions = ServerManager.DefaultRegions;

            UpdateRegions();

            GameOptionsData.RecommendedImpostors = Enumerable.Repeat(3, 16).ToArray();
            GameOptionsData.MaxImpostors         = Enumerable.Repeat(15, 16).ToArray(); // Max Imp = Recommended Imp = 3
            GameOptionsData.MinPlayers           = Enumerable.Repeat(4, 15).ToArray();  // Min Players = 4

            DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
            Instance  = this;
            CustomOptionHolder.Load();
            RoleInfo.Load();
            CustomColors.Load();
            RandomGenerator.Initialize();

            Harmony.PatchAll();
            Patches.SubmergedPatch.Patch();
            SubmergedCompatibility.Initialize();
        }
Example #6
0
        public static void Postfix(RegionMenu __instance)
        {
            var template = DestroyableSingleton <JoinGameButton> .Instance;

            if (ipField == null || ipField.gameObject == null)
            {
                ipField = UnityEngine.Object.Instantiate(template.GameIdText, __instance.transform);
                ipField.gameObject.name = "IpTextBox";
                UnityEngine.Object.DestroyImmediate(ipField.transform.FindChild("arrowEnter").gameObject);

                ipField.transform.localPosition = new Vector3(0, -1f, -100f);
                ipField.characterLimit          = 30;
                ipField.AllowSymbols            = true;
                ipField.ForceUppercase          = false;
                ipField.SetText(TheOtherRolesPlugin.Ip.Value);
                __instance.StartCoroutine(Effects.Lerp(0.1f, new Action <float>((p) => {
                    ipField.outputText.SetText(TheOtherRolesPlugin.Ip.Value);
                    ipField.SetText(TheOtherRolesPlugin.Ip.Value);
                })));

                ipField.ClearOnFocus = false;
                ipField.OnEnter      = ipField.OnChange = new Button.ButtonClickedEvent();
                ipField.OnFocusLost  = new Button.ButtonClickedEvent();
                ipField.OnChange.AddListener((UnityAction)onEnterOrIpChange);
                ipField.OnFocusLost.AddListener((UnityAction)onFocusLost);

                void onEnterOrIpChange()
                {
                    TheOtherRolesPlugin.Ip.Value = ipField.text;
                }

                void onFocusLost()
                {
                    TheOtherRolesPlugin.UpdateRegions();
                    __instance.ChooseOption(ServerManager.DefaultRegions[ServerManager.DefaultRegions.Length - 1]);
                }
            }
            if (portField == null || portField.gameObject == null)
            {
                portField = UnityEngine.Object.Instantiate(template.GameIdText, __instance.transform);
                portField.gameObject.name = "PortTextBox";
                UnityEngine.Object.DestroyImmediate(portField.transform.FindChild("arrowEnter").gameObject);

                portField.transform.localPosition = new Vector3(0, -1.75f, -100f);
                portField.characterLimit          = 5;
                portField.SetText(TheOtherRolesPlugin.Port.Value.ToString());
                __instance.StartCoroutine(Effects.Lerp(0.1f, new Action <float>((p) => {
                    portField.outputText.SetText(TheOtherRolesPlugin.Port.Value.ToString());
                    portField.SetText(TheOtherRolesPlugin.Port.Value.ToString());
                })));


                portField.ClearOnFocus = false;
                portField.OnEnter      = portField.OnChange = new Button.ButtonClickedEvent();
                portField.OnFocusLost  = new Button.ButtonClickedEvent();
                portField.OnChange.AddListener((UnityAction)onEnterOrPortFieldChange);
                portField.OnFocusLost.AddListener((UnityAction)onFocusLost);

                void onEnterOrPortFieldChange()
                {
                    ushort port = 0;

                    if (ushort.TryParse(portField.text, out port))
                    {
                        TheOtherRolesPlugin.Port.Value = port;
                        portField.outputText.color     = Color.white;
                    }
                    else
                    {
                        portField.outputText.color = Color.red;
                    }
                }

                void onFocusLost()
                {
                    TheOtherRolesPlugin.UpdateRegions();
                    __instance.ChooseOption(ServerManager.DefaultRegions[ServerManager.DefaultRegions.Length - 1]);
                }
            }
        }