public static bool Remove(Preset preset) { if (File.Exists(Path.Combine(rootPath, preset.FileName))) { File.Delete(Path.Combine(rootPath, preset.FileName)); } return Presets.Remove(preset); }
private void SavePreset(Preset preset) { if (preset == null) { preset = new Preset(); } preset.Name = this.ParentSection.Name; preset.Abbreviation = this.ParentSection.Abbreviation; preset.ReadoutNames = this.ParentSection.ReadoutModuleNames; preset.IsHud = this.ParentSection.IsHud; preset.IsHudBackground = this.ParentSection.IsHudBackground; PresetLibrary.Save(preset); }
private void DrawPresetButton(Preset preset) { if (!GUILayout.Button("<b>" + preset.Name.ToUpper() + "</b>", this.categoryButtonStyle)) { return; } this.ParentSection.Name = preset.Name; this.ParentSection.Abbreviation = preset.Abbreviation; this.ParentSection.ReadoutModuleNames = preset.ReadoutNames; this.ParentSection.IsHud = preset.IsHud; this.ParentSection.IsHudBackground = preset.IsHudBackground; this.presetList.enabled = false; }
public static void Save(Preset preset) { if (!Directory.Exists(rootPath)) { Directory.CreateDirectory(rootPath); } if (!Presets.Contains(preset)) { Presets.Add(preset); } var handler = new SettingHandler(); handler.Set("preset", preset); handler.Save(Path.Combine("../Presets", preset.FileName)); ScreenMessages.PostScreenMessage("Saved Preset: " + preset.Name, 2.0f, ScreenMessageStyle.UPPER_CENTER); }
public static void Add(Preset preset) { Presets.Add(preset); }