Ejemplo n.º 1
0
        public override void Load()
        {
            if (ModLoader.version < RequiredVersion)
            {
                throw new Exception("Magic storage requires a tModLoader version of at least " + RequiredVersion);
            }

            Instance = this;
            UI.Initialize();

            LegendMod    = ModLoader.GetMod("LegendOfTerraria3");
            BluemagicMod = ModLoader.GetMod("Bluemagic");

            // Apply IL patches
#if PATCH
            HarmonyInstance = new Harmony("repertoire.tmodloader.mod.MagicStoragePlus");
            HarmonyInstance.PatchAll();
#endif

            AddTranslations();
            if (!Main.dedServ)
            {
                Interface = new UserInterface();

                StorageUI = new StorageUI();
                StorageUI.Activate();
            }
        }
Ejemplo n.º 2
0
        public override void Unload()
        {
            StorageUI.Unload();
            StorageUI = null;

            Sorting.SortClassList.Uninitialize();
            NetHelper.Unload();

#if PATCH
            HarmonyInstance.UnpatchAll();
#endif
            Instance     = null;
            BluemagicMod = null;
            LegendMod    = null;
        }