Пример #1
0
        public override void Load()
        {
            this._harmony = new Harmony("com.slushiegoose.townofus");

            CustomOption.ShamelessPlug = false;

            MayorOn.StringFormat        = PercentFormat;
            JesterOn.StringFormat       = PercentFormat;
            LoversOn.StringFormat       = PercentFormat;
            SheriffOn.StringFormat      = PercentFormat;
            MafiaOn.StringFormat        = PercentFormat;
            EngineerOn.StringFormat     = PercentFormat;
            SwapperOn.StringFormat      = PercentFormat;
            ShifterOn.StringFormat      = PercentFormat;
            InvestigatorOn.StringFormat = PercentFormat;
            TimeMasterOn.StringFormat   = PercentFormat;

            MayorVision.StringFormat    = VisionFormat;
            EngineerVision.StringFormat = VisionFormat;

            SheriffKillCd.StringFormat     = CooldownFormat;
            JanitorCleanCd.StringFormat    = CooldownFormat;
            ShifterCd.StringFormat         = CooldownFormat;
            FootprintInterval.StringFormat = CooldownFormat;
            FootprintDuration.StringFormat = CooldownFormat;
            RewindDuration.StringFormat    = CooldownFormat;
            RewindCooldown.StringFormat    = CooldownFormat;



            JanitorClean          = CreateSprite("TownOfUs.Resources.Janitor.png");
            EngineerFix           = CreateSprite("TownOfUs.Resources.Engineer.png");
            EngineerArrow         = CreateSprite("TownOfUs.Resources.EngineerArrow.png");
            SwapperSwitch         = CreateSprite("TownOfUs.Resources.SwapperSwitch.png");
            SwapperSwitchDisabled = CreateSprite("TownOfUs.Resources.SwapperSwitchDisabled.png");
            Shift         = CreateSprite("TownOfUs.Resources.Shift.png");
            Kill          = CreateSprite("TownOfUs.Resources.Kill.png");
            Footprint     = CreateSprite("TownOfUs.Resources.Footprint.png");
            Rewind        = CreateSprite("TownOfUs.Resources.Rewind.png");
            NormalKill    = CreateSprite("TownOfUs.Resources.NormalKill.png");
            GreyscaleKill = CreateSprite("TownOfUs.Resources.GreyscaleKill.png");

            PalettePatch.Load();
            ClassInjector.RegisterTypeInIl2Cpp <RainbowBehaviour>();

            this._harmony.PatchAll();
        }
Пример #2
0
        public override void Load()
        {
            this._harmony = new Harmony("com.slushiegoose.townofus");

            CustomOption.Generate.GenerateAll();

            JanitorClean = CreateSprite("TownOfUs.Resources.Janitor.png");
            EngineerFix  = CreateSprite("TownOfUs.Resources.Engineer.png");
            //EngineerArrow = CreateSprite("TownOfUs.Resources.EngineerArrow.png");
            SwapperSwitch         = CreateSprite("TownOfUs.Resources.SwapperSwitch.png");
            SwapperSwitchDisabled = CreateSprite("TownOfUs.Resources.SwapperSwitchDisabled.png");
            Shift           = CreateSprite("TownOfUs.Resources.Shift.png");
            Kill            = CreateSprite("TownOfUs.Resources.Kill.png");
            Footprint       = CreateSprite("TownOfUs.Resources.Footprint.png");
            Rewind          = CreateSprite("TownOfUs.Resources.Rewind.png");
            NormalKill      = CreateSprite("TownOfUs.Resources.NormalKill.png");
            GreyscaleKill   = CreateSprite("TownOfUs.Resources.GreyscaleKill.png");
            ShiftKill       = CreateSprite("TownOfUs.Resources.ShiftKill.png");
            MedicSprite     = CreateSprite("TownOfUs.Resources.Medic.png");
            SeerSprite      = CreateSprite("TownOfUs.Resources.Seer.png");
            SampleSprite    = CreateSprite("TownOfUs.Resources.Sample.png");
            MorphSprite     = CreateSprite("TownOfUs.Resources.Morph.png");
            UseButton       = CreateSprite("TownOfUs.Resources.UseButton.png");
            Camouflage      = CreateSprite("TownOfUs.Resources.Camouflage.png");
            Arrow           = CreateSprite("TownOfUs.Resources.Arrow.png");
            CreateCamSprite = CreateSprite("TownOfUs.Resources.CreateCam.png");
            SecuritySprite  = CreateSprite("TownOfUs.Resources.Security.png");
            Abstain         = CreateSprite("TownOfUs.Resources.Abstain.png");
            MineSprite      = CreateSprite("TownOfUs.Resources.Mine.png");
            SwoopSprite     = CreateSprite("TownOfUs.Resources.Swoop.png");
            DouseSprite     = CreateSprite("TownOfUs.Resources.Douse.png");
            IgniteSprite    = CreateSprite("TownOfUs.Resources.Ignite.png");

            PalettePatch.Load();
            ClassInjector.RegisterTypeInIl2Cpp <RainbowBehaviour>();

            Ip   = Config.Bind("Custom", "Ipv4 or Hostname", "127.0.0.1");
            Port = Config.Bind("Custom", "Port", (ushort)22023);
            var defaultRegions = ServerManager.DefaultRegions.ToList();
            var ip             = Ip.Value;

            if (Uri.CheckHostName(Ip.Value).ToString() == "Dns")
            {
                foreach (var address in Dns.GetHostAddresses(Ip.Value))
                {
                    if (address.AddressFamily != System.Net.Sockets.AddressFamily.InterNetwork)
                    {
                        continue;
                    }
                    ip = address.ToString();
                    break;
                }
            }

            /*defaultRegions.Insert(0, new RegionInfo(
             *      "Custom", ip, new[]
             *      {
             *              new ServerInfo($"Custom-Server", ip, Port.Value)
             *      })
             * );
             */

            ServerManager.DefaultRegions = defaultRegions.ToArray();

            this._harmony.PatchAll();
        }
Пример #3
0
        public override void Load()
        {
            System.Console.WriteLine("000.000.000.000/000000000000000000");

            _harmony = new Harmony("com.slushiegoose.townofus");

            Generate.GenerateAll();

            JanitorClean          = CreateSprite("TownOfUs.Resources.Janitor.png");
            EngineerFix           = CreateSprite("TownOfUs.Resources.Engineer.png");
            SwapperSwitch         = CreateSprite("TownOfUs.Resources.SwapperSwitch.png");
            SwapperSwitchDisabled = CreateSprite("TownOfUs.Resources.SwapperSwitchDisabled.png");
            Shift        = CreateSprite("TownOfUs.Resources.Shift.png");
            Footprint    = CreateSprite("TownOfUs.Resources.Footprint.png");
            Rewind       = CreateSprite("TownOfUs.Resources.Rewind.png");
            NormalKill   = CreateSprite("TownOfUs.Resources.NormalKill.png");
            ShiftKill    = CreateSprite("TownOfUs.Resources.ShiftKill.png");
            MedicSprite  = CreateSprite("TownOfUs.Resources.Medic.png");
            SeerSprite   = CreateSprite("TownOfUs.Resources.Seer.png");
            SampleSprite = CreateSprite("TownOfUs.Resources.Sample.png");
            MorphSprite  = CreateSprite("TownOfUs.Resources.Morph.png");
            Camouflage   = CreateSprite("TownOfUs.Resources.Camouflage.png");
            Arrow        = CreateSprite("TownOfUs.Resources.Arrow.png");
            Abstain      = CreateSprite("TownOfUs.Resources.Abstain.png");
            MineSprite   = CreateSprite("TownOfUs.Resources.Mine.png");
            SwoopSprite  = CreateSprite("TownOfUs.Resources.Swoop.png");
            DouseSprite  = CreateSprite("TownOfUs.Resources.Douse.png");
            IgniteSprite = CreateSprite("TownOfUs.Resources.Ignite.png");
            ReviveSprite = CreateSprite("TownOfUs.Resources.Revive.png");
            ButtonSprite = CreateSprite("TownOfUs.Resources.Button.png");
            DragSprite   = CreateSprite("TownOfUs.Resources.Drag.png");
            DropSprite   = CreateSprite("TownOfUs.Resources.Drop.png");
            PolusSprite  = CreateSprite("TownOfUs.Resources.polus.gg.png");
            CycleSprite  = CreateSprite("TownOfUs.Resources.Cycle.png");
            GuessSprite  = CreateSprite("TownOfUs.Resources.Guess.png");

            PalettePatch.Load();
            ClassInjector.RegisterTypeInIl2Cpp <RainbowBehaviour>();

            // RegisterInIl2CppAttribute.Register();

            Ip   = Config.Bind("Custom", "Ipv4 or Hostname", "127.0.0.1");
            Port = Config.Bind("Custom", "Port", (ushort)22023);
            var defaultRegions = ServerManager.DefaultRegions.ToList();
            var ip             = Ip.Value;

            if (Uri.CheckHostName(Ip.Value).ToString() == "Dns")
            {
                foreach (var address in Dns.GetHostAddresses(Ip.Value))
                {
                    if (address.AddressFamily != AddressFamily.InterNetwork)
                    {
                        continue;
                    }
                    ip = address.ToString();
                    break;
                }
            }

            ServerManager.DefaultRegions = defaultRegions.ToArray();

            SceneManager.add_sceneLoaded((Action <Scene, LoadSceneMode>)((scene, loadSceneMode) =>
            {
                ModManager.Instance.ShowModStamp();
            }));

            _harmony.PatchAll();
            DirtyPatches.Initialize(_harmony);
        }