Пример #1
0
 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);
 }
Пример #2
0
        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);
        }
Пример #3
0
        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;
        }
Пример #4
0
        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);
        }
Пример #5
0
 public static void Add(Preset preset)
 {
     Presets.Add(preset);
 }