Exemplo n.º 1
0
 protected override void OnDestroy()
 {
     GameEvents.onGUIRnDComplexSpawn.Remove(RnDComplexSpawn);
     GameEvents.onGUIRnDComplexDespawn.Remove(RnDComplexDespawn);
     base.OnDestroy();
     QDebug.Log("OnDestroy", "QRnD");
 }
Exemplo n.º 2
0
        public void Save()
        {
            ConfigNode _temp = ConfigNode.CreateConfigFromObject(this, new ConfigNode());

            _temp.Save(QuickSearch.FileConfig);
            QDebug.Log("Settings Saved", "QSettings", true);
        }
Exemplo n.º 3
0
        void OnDestroy()
        {
            GameEvents.onFlightReady.Remove(OnFlightReady);

            QDebug.Log("OnDestroy", "QFlight");
            Destroy(this);
        }
Exemplo n.º 4
0
 protected override void Awake()
 {
     if (HighLogic.LoadedScene != GameScenes.SPACECENTER)
     {
         QDebug.Warning("The RnD search function works only on the SpaceCenter. Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     QStock.ResetScenes();
     if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER && HighLogic.CurrentGame.Mode != Game.Modes.SCIENCE_SANDBOX)
     {
         QDebug.Warning("The RnD search function works only on a Career or on a Science gamemode. Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     if (Instance != null)
     {
         QDebug.Warning("There's already an Instance of " + MOD + ". Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     Instance = this;
     if (!QSettings.Instance.RnDSearch)
     {
         QDebug.Warning("The RnD search function is disabled. Destroy.", "QRnD");
         Destroy(this);
         return;
     }
     base.Awake();
     QDebug.Log("Awake", "QRnD");
 }
Exemplo n.º 5
0
 void HideSettings()
 {
     WindowSettings = false;
     QStock.Instance.Set(WindowSettings);
     Save();
     QDebug.Log("HideSettings", "QGUI");
 }
Exemplo n.º 6
0
        void Awake()
        {
            if (Instance != null)
            {
                QDebug.Log("Destroy, already exists!");
                Destroy(this);
                return;
            }
            Instance = this;

            GameEvents.onVesselGoOffRails.Add(OnVesselGoOffRails);
            if (System.Math.Abs(GameSettings.MASTER_VOLUME) < float.Epsilon)
            {
                GameSettings.MASTER_VOLUME = QSettings.Instance.Master;
                GameSettings.SaveSettings();
            }
            volume = new QVolume(GameSettings.MASTER_VOLUME, QSettings.Instance.Muted);
            level  = new QLevel(volume);
            qKey   = new QKey();
            gui    = new QGui(qKey, level);
            DontDestroyOnLoad(this);
            QDebug.Log("Awake");

            FileConfig = RegisterToolbar.PATH + "/Config.txt";
            Debug.Log("QM.Awake, PATH: " + RegisterToolbar.PATH);
        }
Exemplo n.º 7
0
        internal static void ResetScenes()
        {
            if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER && HighLogic.CurrentGame.Mode != Game.Modes.SCIENCE_SANDBOX)
            {
                AppScenes = ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB;
                QDebug.Warning("Hide applauncher on the SpaceCenter", "QStockToolbar");
            }
            else
            {
                AppScenes = ApplicationLauncher.AppScenes.SPACECENTER | ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB;
            }
            if (QStock.Instance == null)
            {
                return;
            }
            if (QStock.Instance.toolbarControl != null)
            {
                QStock.Instance.toolbarControl.OnDestroy();
                Destroy(QStock.Instance.toolbarControl);
                QStock.Instance.toolbarControl = null;
            }
            QStock.Instance.Init();

            QDebug.Log("ResetScenes", "QStockToolbar");
        }
Exemplo n.º 8
0
 void Init()
 {
     if (toolbarControl == null)
     {
         if (HighLogic.CurrentGame != null && HighLogic.CurrentGame.Mode != Game.Modes.CAREER && HighLogic.CurrentGame.Mode != Game.Modes.SCIENCE_SANDBOX)
         {
             AppScenes = ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB;
             QDebug.Warning("Hide applauncher on the SpaceCenter", "QStockToolbar");
         }
         else
         {
             AppScenes = ApplicationLauncher.AppScenes.SPACECENTER | ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB;
         }
         toolbarControl = gameObject.AddComponent <ToolbarControl>();
         toolbarControl.AddToAllToolbars(OnClick, OnClick,
                                         AppScenes,
                                         MODID,
                                         "quickSearchButton",
                                         QUtils.Texture.STOCKTOOLBAR_PATH,
                                         QUtils.Texture.BLIZZY_PATH,
                                         MODNAME
                                         );
     }
     QDebug.Log("Init", "QStockToolbar");
 }
Exemplo n.º 9
0
 void OnDestroy()
 {
     GameEvents.onFlightReady.Remove(OnFlightReady);
     GameEvents.onVesselChange.Remove(OnVesselChange);
     GameEvents.onGameSceneSwitchRequested.Remove(OnSceneSwitch);
     QDebug.Log("OnDestroy", "QPersistent");
 }
Exemplo n.º 10
0
 void DestroyThis()
 {
     QDebug.Log("DestroyThis", "QMainMenu");
     QuickStart_Persistent.vesselID = string.Empty;
     QLoading.Ended = true;
     Destroy(this);
 }
Exemplo n.º 11
0
 public void Init(Solver initialSolver, int r, int c, int value, int id)
 {
     this.Solver = initialSolver;
     this.Solver.SetValue(r, c, value);
     ID = id;
     QDebug.Log("in Init ID:" + id);
 }
Exemplo n.º 12
0
        void Awake()
        {
            if (QLoading.Ended)
            {
                QDebug.Warning("Reload? Destroy.", "QLoading");
                Destroy(this);
                return;
            }
            if (!QSettings.Instance.enablePauseOnFlight || !QSettings.Instance.Enabled || QSettings.Instance.gameScene != (int)GameScenes.FLIGHT)
            {
                QDebug.Log("No need to keep it loaded.", "QFlight");
                QLoading.Ended = true;
                Destroy(this);
                return;
            }
            if (Instance != null)
            {
                QDebug.Warning("There's already an Instance", "QFlight");
                Destroy(this);
                return;
            }
            Instance = this;

            GameEvents.onFlightReady.Add(OnFlightReady);

            QDebug.Log("Awake", "QFlight");
        }
Exemplo n.º 13
0
 void LateUpdate()
 {
     if (!Ready)
     {
         QDebug.Log("Ready", "QSpaceCenter");
         Ready = true;
     }
 }
Exemplo n.º 14
0
 void LateUpdate()
 {
     if (!Ready)
     {
         QDebug.Log("Ready", "QMainMenu");
         Ready = true;
     }
 }
Exemplo n.º 15
0
 protected void ShowHistory()
 {
     if (WindowHistory)
     {
         return;
     }
     WindowHistory = true;
     QDebug.Log("ShowHistory", "QGUI");
 }
Exemplo n.º 16
0
 void Start()
 {
     if (HighLogic.LoadedSceneIsEditor && QSettings.Instance.enableEditorAutoSaveShip)
     {
         StartCoroutine(autoSaveShip());
     }
     Ready = true;
     QDebug.Log("Start", "QPersistent");
 }
Exemplo n.º 17
0
 void Settings()
 {
     WindowSettings = !WindowSettings;
     if (!WindowSettings)
     {
         QSettings.Instance.Save();
     }
     QDebug.Log("Settings", "QGUI");
 }
Exemplo n.º 18
0
        //[KSPField(isPersistant = true)] static QBlizzy BlizzyToolbar;

        protected virtual void Awake()
        {
            //if (BlizzyToolbar == null) BlizzyToolbar = new QBlizzy ();
            TextField = new GUIStyle(HighLogic.Skin.textField);
            TextField.stretchWidth  = true;
            TextField.stretchHeight = true;
            TextField.alignment     = TextAnchor.MiddleCenter;
            QDebug.Log("Awake");
        }
Exemplo n.º 19
0
    void OnSolveFailed()
    {
        QDebug.Log("Solve failed");

        nestedSolver.Solver.Print("Partial output");

        EnableLoadingGear(false);

        nestedSolver = null;
    }
Exemplo n.º 20
0
 void Mute(bool mute)
 {
     volume.isMute = mute;
     Refresh();
     if (QSettings.Instance.MuteIcon)
     {
         StartCoroutine(Wait(5));
     }
     QDebug.Log("Mute");
 }
Exemplo n.º 21
0
 void Settings()
 {
     WindowSettings = !WindowSettings;
     QStock.Instance.Set(WindowSettings);
     if (!WindowSettings)
     {
         Save();
     }
     QDebug.Log("Settings", "QGUI");
 }
Exemplo n.º 22
0
 void SearchField_OnEndEdit(string s)
 {
     if (QSettings.Instance.enableEnterToSearch)
     {
         QSearch.Text = s;
     }
     HideHistory();
     InputLockManager.RemoveControlLock(RegisterToolbar.MOD + "-KeyBoard");
     QDebug.Log("SearchField_OnEndEdit", "QEditor");
 }
Exemplo n.º 23
0
 void SearchField_OnValueChange(string s)
 {
     if (!isReady || QSettings.Instance.enableEnterToSearch)
     {
         return;
     }
     ShowHistory();
     QSearch.Text = s;
     QDebug.Log("SearchField_OnValueChange: " + s, "QEditor");
 }
Exemplo n.º 24
0
 void Start()
 {
     if (!QSettings.Instance.Enabled)
     {
         QDebug.Log("No need to keep it loaded.", "QMainMenu");
         DestroyThis();
         return;
     }
     start = StartCoroutine(QStart());
     QDebug.Log("Start", "QMainMenu");
 }
Exemplo n.º 25
0
        protected virtual void Awake()
        {
            TextField = new GUIStyle(HighLogic.Skin.textField);
            TextField.stretchWidth  = true;
            TextField.stretchHeight = true;
            TextField.alignment     = TextAnchor.MiddleCenter;

            FileConfig = RegisterToolbar.PATH + "/Config.txt";
            Debug.Log("QS.Awake, PATH: " + RegisterToolbar.PATH);
            QDebug.Log("Awake");
        }
Exemplo n.º 26
0
 public void Refresh()
 {
     //if (BlizzyToolbar != null) {
     //    BlizzyToolbar.Refresh();
     // }
     if (QStock.Instance != null)
     {
         QStock.Instance.Refresh();
     }
     QDebug.Log("Refresh");
 }
Exemplo n.º 27
0
 protected override void Start()
 {
     ButtonStyle               = new GUIStyle(HighLogic.Skin.button);
     ButtonStyle.alignment     = TextAnchor.MiddleCenter;
     ButtonStyle.padding       = new RectOffset(0, 0, 0, 0);
     ButtonStyle.imagePosition = ImagePosition.ImageOnly;
     GameEvents.onGUIRnDComplexSpawn.Add(RnDComplexSpawn);
     GameEvents.onGUIRnDComplexDespawn.Add(RnDComplexDespawn);
     base.Start();
     QDebug.Log("Start", "QRnD");
 }
Exemplo n.º 28
0
 public override void OnSave(ConfigNode node)
 {
     try {
         if (!string.IsNullOrEmpty(vesselID))
         {
             node.AddValue("vesselID", vesselID);
         }
         QDebug.Log("OnSave " + vesselID, "QPersistent");
     } catch (Exception e) {
         QDebug.Warning("Can't save: {0} " + e, "QPersistent");
     }
 }
Exemplo n.º 29
0
        IEnumerator autoSaveShip()
        {
            QDebug.Log("autoSaveShip: start", "QPersistent");
            while (HighLogic.LoadedSceneIsEditor && QSettings.Instance.enableEditorAutoSaveShip)
            {
                yield return(new WaitForSeconds(QSettings.Instance.editorTimeToSave));

                ShipConstruction.SaveShip(shipFilename);
                QDebug.Log("autoSaveShip: save", "QPersistent");
            }
            QDebug.Log("autoSaveShip: end", "QPersistent");
        }
Exemplo n.º 30
0
 void Update()
 {
     if (QKey.isKeyDown(QKey.Key.Escape))
     {
         if (start != null)
         {
             StopCoroutine(start);
             QDebug.Log("Escape", "QSpaceCenter");
             DestroyThis();
         }
     }
 }