示例#1
0
        private void OnSaving(object sender, SavingEventArgs e)
        {
            // Save mapDict to save specific json file
            string modPath = SHelper.DirectoryPath;

            if (!Directory.Exists(Path.Combine(modPath, "save_data")))
            {
                Directory.CreateDirectory(Path.Combine(modPath, "save_data"));
            }
            string path = Path.Combine("save_data", Constants.SaveFolderName + "_map_data.json");

            SMonitor.Log($"Saving {modPath}\\{path}", LogLevel.Trace);
            MapUtils.saveMapData(path, mapDict);
        }
示例#2
0
        private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
        {
            // Populate mapDict
            string modPath = SHelper.DirectoryPath;

            if (!Directory.Exists(Path.Combine(modPath, "save_data")))
            {
                Directory.CreateDirectory(Path.Combine(modPath, "save_data"));
            }
            string path = Path.Combine("save_data", Constants.SaveFolderName + "_map_data.json");

            SMonitor.Log($"Loading {modPath}\\{path}", LogLevel.Trace);
            mapDict = MapUtils.getMapData(path);
        }