private void Save_Generation() { try { string rootPath = Util.GetRootPath(this); if (!string.IsNullOrEmpty(rootPath)) { string json = ""; string keyWord = ""; switch (CurrentEditorMode) { case EditorMode.MapGenerator: json = MGConfig.ToJson(); keyWord = "Map"; break; case EditorMode.CharacterGenerator: json = CGConfig.ToJson(); keyWord = "Character"; break; } if (!string.IsNullOrEmpty(json)) { Util.Write(json, Util.CombinePaths(rootPath, "Data", "Current " + keyWord + " Generation Preset.json")); } } } catch { }; ShowAllAttachment.TrySave(); }
private void Load_Generation() { try { string rootPath = Util.GetRootPath(this); if (!string.IsNullOrEmpty(rootPath)) { string path; switch (CurrentEditorMode) { case EditorMode.MapGenerator: path = Util.CombinePaths(rootPath, "Data", "Current Map Generation Preset.json"); if (Util.FileExists(path)) { MGConfig.LoadFromJson(Util.Read(path)); MGConfig.FixGenerationValues(); } break; case EditorMode.CharacterGenerator: path = Util.CombinePaths(rootPath, "Data", "Current Character Generation Preset.json"); if (Util.FileExists(path)) { CGConfig.LoadFromJson(Util.Read(path)); CGConfig.FixGenerationValues(); ReloadCharacterAttachmentThumbnailMap(true); } break; } } } catch { }; ShowAllAttachment.Load(); }