<commit_before>﻿/*
  Copyright© (c) 2014-2017 <NAME>, (aka neuoy).
  Copyright© (c) 2017-2018 A.Korsunsky, (aka fat-lobyte).
  Copyright© (c) 2017-2018 S.Gray, (aka PiezPiedPy).

  This file is part of Trajectories.
  Trajectories is available under the terms of GPL-3.0-or-later.
  See the LICENSE.md file for more details.

  Trajectories is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Trajectories is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  You should have received a copy of the GNU General Public License
  along with Trajectories.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Linq;
using UnityEngine;

namespace Trajectories
{
    class Settings
    {
        private class Persistent: Attribute
        {
            public object DefaultValue;
            public Persistent(object Default) { DefaultValue = Default; }
        }

        public static Settings fetch { get { settings_ = settings_ ?? new Settings(); return settings_; } }

        #region User settings
        [Persistent(Default: false)]
        public bool DisplayTargetGUI { get; set; }

        [Persistent(Default: false)]
        public bool DisplayDescentProfileGUI { get; set; }

        [Persistent(Default: false)]
        public bool DisplaySettingsGUI { get; set; }

        [Persistent(Default: true)]
        public bool UseBlizzyToolbar { get; set; }

        [Persistent(Default: true)]
        public bool DisplayTrajectories { get; set; }

        [Persistent(Default: false)]
        public bool DisplayTrajectoriesInFlight { get; set; }

        [Persistent(Default: false)]
        public bool AlwaysUpdate { get; set; } //Compute trajectory even if DisplayTrajectories && MapView.MapIsEnabled == false.

        [Persistent(Default: false)]
        public bool DisplayCompleteTrajectory { get; set; }

        [Persistent(Default: false)]
        public bool BodyFixedMode { get; set; }

        [Persistent(Default: true)]
        public bool AutoUpdateAerodynamicModel { get; set; }

        [Persistent(Default: null)]
        public Rect MapGUIWindowPos { get; set; }

        [Persistent(Default: false)]
        public bool MainGUIEnabled { get; set; }

        [Persistent(Default: null)]
        public Vector2 MainGUIWindowPos { get; set; }

        [Persistent(Default: null)]
        public int MainGUICurrentPage { get; set; }

        [Persistent(Default: false)]
        public bool GUIEnabled { get; set; }

        [Persistent(Default: true)]
        public bool NewGui { get; set; }

        [Persistent(Default: 2.0d)]
        public double IntegrationStepSize { get; set; }

        [Persistent(Default: 4)]
        public int MaxPatchCount { get; set; }

        [Persistent(Default: 15)]
        public int MaxFramesPerPatch { get; set; }

        [Persistent(Default: true)]
        public bool UseCache { get; set; }

        [Persistent(Default: true)]
        public bool DefaultDescentIsRetro { get; set; }
        #endregion

        private KSP.IO.PluginConfiguration config;

        private static bool ConfigError = false;

        public Settings()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<Settings>();
            try
            {
                config.load();
            }<commit_msg>Disable Forces Cache by default<commit_after>﻿/*
  Copyright© (c) 2014-2017 <NAME>, (aka neuoy).
  Copyright© (c) 2017-2018 A.Korsunsky, (aka fat-lobyte).
  Copyright© (c) 2017-2018 S.Gray, (aka PiezPiedPy).

  This file is part of Trajectories.
  Trajectories is available under the terms of GPL-3.0-or-later.
  See the LICENSE.md file for more details.

  Trajectories is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Trajectories is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  You should have received a copy of the GNU General Public License
  along with Trajectories.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Linq;
using UnityEngine;

namespace Trajectories
{
    class Settings
    {
        private class Persistent: Attribute
        {
            public object DefaultValue;
            public Persistent(object Default) { DefaultValue = Default; }
        }

        public static Settings fetch { get { settings_ = settings_ ?? new Settings(); return settings_; } }

        #region User settings
        [Persistent(Default: false)]
        public bool DisplayTargetGUI { get; set; }

        [Persistent(Default: false)]
        public bool DisplayDescentProfileGUI { get; set; }

        [Persistent(Default: false)]
        public bool DisplaySettingsGUI { get; set; }

        [Persistent(Default: true)]
        public bool UseBlizzyToolbar { get; set; }

        [Persistent(Default: true)]
        public bool DisplayTrajectories { get; set; }

        [Persistent(Default: false)]
        public bool DisplayTrajectoriesInFlight { get; set; }

        [Persistent(Default: false)]
        public bool AlwaysUpdate { get; set; } //Compute trajectory even if DisplayTrajectories && MapView.MapIsEnabled == false.

        [Persistent(Default: false)]
        public bool DisplayCompleteTrajectory { get; set; }

        [Persistent(Default: false)]
        public bool BodyFixedMode { get; set; }

        [Persistent(Default: true)]
        public bool AutoUpdateAerodynamicModel { get; set; }

        [Persistent(Default: null)]
        public Rect MapGUIWindowPos { get; set; }

        [Persistent(Default: false)]
        public bool MainGUIEnabled { get; set; }

        [Persistent(Default: null)]
        public Vector2 MainGUIWindowPos { get; set; }

        [Persistent(Default: null)]
        public int MainGUICurrentPage { get; set; }

        [Persistent(Default: false)]
        public bool GUIEnabled { get; set; }

        [Persistent(Default: true)]
        public bool NewGui { get; set; }

        [Persistent(Default: 2.0d)]
        public double IntegrationStepSize { get; set; }

        [Persistent(Default: 4)]
        public int MaxPatchCount { get; set; }

        [Persistent(Default: 15)]
        public int MaxFramesPerPatch { get; set; }

        [Persistent(Default: false)]
        public bool UseCache { get; set; }

        [Persistent(Default: true)]
        public bool DefaultDescentIsRetro { get; set; }
        #endregion

        private KSP.IO.PluginConfiguration config;

        private static bool ConfigError = false;

        public Settings()
        {
            config = KSP.IO.PluginConfiguration.CreateForType<Settings>();
            try
            {
                config.load();
            }
{'fraction_non_alphanumeric': 0.08784813634474158, 'fraction_numerical': 0.00914507413052515, 'mean_word_length': 2.5644444444444443, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3673774', 'n_tokens_mistral': 2025, 'n_tokens_neox': 1901, 'n_words': 668}