Esempio n. 1
0
        internal static void Load(CancellationToken token)
        {
            CacheVanillaState();

            Interface.loadMods.SetLoadStage("tModLoader.MSIntializing", ModLoader.Mods.Length);
            LoadModContent(token, mod => {
                ContentInstance.Register(mod);
                mod.loading = true;
                mod.AutoloadConfig();
                mod.PrepareAssets();
                mod.Autoload();
                mod.Load();
                SystemHooks.OnModLoad(mod);
                mod.loading = false;
            });

            Interface.loadMods.SetLoadStage("tModLoader.MSSettingUp");
            ResizeArrays();
            RecipeGroupHelper.FixRecipeGroupLookups();

            Interface.loadMods.SetLoadStage("tModLoader.MSLoading", ModLoader.Mods.Length);
            LoadModContent(token, mod => {
                mod.SetupContent();
                mod.PostSetupContent();
                SystemHooks.PostSetupContent(mod);
            });

            MemoryTracking.Finish();

            if (Main.dedServ)
            {
                ModNet.AssignNetIDs();
            }

            Main.player[255] = new Player(false);             // setup inventory is unnecessary

            RefreshModLanguage(Language.ActiveCulture);
            MapLoader.SetupModMap();
            RarityLoader.Initialize();

            ContentSamples.Initialize();
            PlayerInput.reinitialize = true;
            SetupBestiary(token);
            SetupRecipes(token);
            ContentSamples.RebuildItemCreativeSortingIDsAfterRecipesAreSetUp();
            ItemSorting.SetupWhiteLists();

            MenuLoader.GotoSavedModMenu();
            BossBarLoader.GotoSavedStyle();
        }
Esempio n. 2
0
        internal static void Load()
        {
            CacheVanillaState();

            Interface.loadMods.SetLoadStage("tModLoader.MSIntializing", ModLoader.Mods.Length);
            MemoryTracking.Start();
            LoadModContent(mod => {
                mod.AutoloadConfig();
                mod.loading = true;
                mod.LoadResources();
                mod.Autoload();
                mod.Load();
                mod.loading = false;
                MemoryTracking.Load(mod);
            });

            Interface.loadMods.SetLoadStage("tModLoader.MSSettingUp");
            ResizeArrays();
            RecipeGroupHelper.FixRecipeGroupLookups();

            MemoryTracking.MidReset();
            Interface.loadMods.SetLoadStage("tModLoader.MSLoading", ModLoader.Mods.Length);
            LoadModContent(mod => {
                mod.SetupContent();
                mod.PostSetupContent();
                MemoryTracking.Finish(mod);
            });

            if (Main.dedServ)
            {
                ModNet.AssignNetIDs();
            }

            Main.player[255] = new Player(false);             // setup inventory is unnecessary

            RefreshModLanguage(Language.ActiveCulture);
            MapLoader.SetupModMap();
            ItemSorting.SetupWhiteLists();
            PlayerInput.ReInitialize();
            SetupRecipes();
        }