예제 #1
0
 internal static void UnloadStaticFields()
 {
     tConfigWrapper.ReportErrors = false;
     tConfigWrapper.ModsPath     = null;
     searchDict   = null;
     containsName = null;
     getID        = null;
     LoadStep.UnloadStaticFields();
     //Loaders.AssemblyLoader.UnloadStaticFields();
     ModState.UnloadStaticFields();
 }
예제 #2
0
 internal static void LoadStaticFields()
 {
     tConfigWrapper.ReportErrors = false;
     tConfigWrapper.ModsPath     = Main.SavePath + "\\tConfigWrapper\\Mods";
     searchDict   = new ConcurrentDictionary <string, object>();
     containsName = typeof(IdDictionary).GetMethod("ContainsName");
     getID        = typeof(IdDictionary).GetMethod("GetId");
     LoadStep.LoadStaticFields();
     //Loaders.AssemblyLoader.LoadStaticFields();
     ModState.LoadStaticFields();
 }
예제 #3
0
        public override void ModifyWorldGenTasks(List <GenPass> tasks, ref float totalWeight)          // Runs on world creation, so that mods are serialized even if you don't enter the world.
        {
            if (ModState.PrevLoadedWorldMods.ContainsKey($"{Main.worldID}:{Main.worldName}"))
            {
                ModState.PrevLoadedWorldMods.Remove($"{Main.worldID}:{Main.worldName}");
            }

            ModState.PrevLoadedWorldMods.Add($"{Main.worldID}:{Main.worldName}", new PrevMods {
                PrevEnabledMods = new HashSet <string>(ModState.EnabledMods)
            });
            ModState.SerializePreviousWorldMods();
        }
예제 #4
0
        public override void SetupStartInventory(IList <Item> items, bool mediumcoreDeath)          // Runs on player creation, so that mods are serialized even if you don't enter the world.
        {
            if (ModState.PrevLoadedPlayerMods.ContainsKey(player.name))
            {
                ModState.PrevLoadedPlayerMods.Remove(player.name);
            }

            ModState.PrevLoadedPlayerMods.Add(player.name, new PrevMods {
                PrevEnabledMods = new HashSet <string>(ModState.EnabledMods)
            });

            ModState.SerializePreviousPlayerMods();
        }
예제 #5
0
        public override void OnEnterWorld(Player player)
        {
            if (ModState.PrevLoadedPlayerMods.ContainsKey(player.name))
            {
                ModState.PrevLoadedPlayerMods.Remove(player.name);
            }

            ModState.PrevLoadedPlayerMods.Add(player.name, new PrevMods {
                PrevEnabledMods = new HashSet <string>(ModState.EnabledMods)
            });

            ModState.SerializePreviousPlayerMods();

            if (ModState.PrevLoadedWorldMods.ContainsKey($"{Main.worldID}:{Main.worldName}"))
            {
                ModState.PrevLoadedWorldMods.Remove($"{Main.worldID}:{Main.worldName}");
            }

            ModState.PrevLoadedWorldMods.Add($"{Main.worldID}:{Main.worldName}", new PrevMods {
                PrevEnabledMods = new HashSet <string>(ModState.EnabledMods)
            });
            ModState.SerializePreviousWorldMods();
        }