Exemplo n.º 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);
        }
Exemplo n.º 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);
        }