예제 #1
0
        private static void ExposeData(string filepath, bool useUndoAction = false)
        {
            try {
                if (CurrentMode == Mode.Saving)
                {
                    Data = new ModsConfigData {
                        buildNumber = RimWorld.VersionControl.CurrentBuild,
                        activeMods  = ModsConfigHandler.GetActiveMods()
                    };
                    DirectXmlSaver.SaveDataObject((object)Data, filepath);
                }
                else if (CurrentMode == Mode.Loading)
                {
                    List <string> current = new List <string>();

                    Data = ReadModList(filepath);

                    ModsConfigHandler.ClearLoadedMods(true);
                    foreach (string modID in Data.activeMods)
                    {
                        ModsConfig.SetActive(modID, true);
                    }
                }
            }
            catch (Exception e) {
                Main.Log.ReportException(e);
                ModsConfigHandler.ClearLoadedMods();
            }
        }
예제 #2
0
 static ModListController()
 {
     Data = new ModsConfigData {
         buildNumber = RimWorld.VersionControl.CurrentBuild,
         activeMods  = ModsConfigHandler.GetActiveMods()
     };
 }
예제 #3
0
        /// <summary>
        /// Import mods from a save file into the current game
        /// </summary>
        /// <param name="filename"></param>
        internal static void ImportMods(string filename)
        {
            Read(GenFilePaths.FilePathForSavedGame(filename));

            ModsConfigHandler.SetActiveMods(importList);
        }