Пример #1
0
        public override void Unload()
        {
            //DrawMapInjection.revert();
            UpdateBiomesInjection.InjectMe();

            Main.SavePath   = SAVE_PATH;
            Main.PlayerPath = Main.SavePath + "/Player";
            Main.WorldPath  = Main.SavePath + "/World";

            instance = null;
            quote.Clear();
            FieldInfo info2 = typeof(ModLoader).GetField("versionedName",
                                                         BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public);

            info2.SetValue(null, string.Format("tModLoader v{0}", (object)ModLoader.version)
                           + (ModLoader.branchName.Length == 0 ? "" : " " + ModLoader.branchName)
                           + (ModLoader.beta == 0 ? "" : string.Format(" Beta {0}", (object)ModLoader.beta)));

            MoonEventManagerWorld.moonEventList.Clear();

            if (!Main.dedServ)
            {
                DRPSystem.Kill();
                Main.OnTick -= DRPSystem.Update;
            }

            ReflManager <Type> .Clear();

            RaidsManager.Clear();
        }
Пример #2
0
        public override void Load()
        {
            instance = this;

            Patch.Load();

            //UpdateBiomesInjection.InjectMe();
            //MethodInfo attempt = StaticManager<Type>.GetItem("TMain").Assembly.GetType("Terraria.ModLoader.UI.UIModBrowser")
            //    .GetMethod("PopulateModBrowser", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
            //ReflectionUtils.MethodSwap(StaticManager<Type>.GetItem("TMain").Assembly.GetType("Terraria.ModLoader.UI.UIModBrowser"), "PopulateModBrowser", typeof(ModBrowserInjection), "PopulateModBrowser");
            CustomMMHooker.Populatebrowser_Hook            += ModBrowserInjection.PopulateModBrowser;
            On.Terraria.Cinematics.CinematicManager.Update += (orig, inst, time) =>
            {
                gameTime = time;
                orig.Invoke(inst, gameTime);
            };

            Main.SavePath  += "/Tapocalypse";
            Main.PlayerPath = Main.SavePath + "/Player";
            Main.WorldPath  = Main.SavePath + "/World";

            if (!Main.dedServ)
            {
                SolarFog = GetTexture("CustomScreenShader/HeavyMist");

                Main.OnTick += DRPSystem.Update;

                DRPSystem.Boot();

                UIManager.InitAll();

                AddFilter();
                AddHotWTranslations();
            }
            HookGenLoader();
        }