예제 #1
0
        public void Awake()
        {
            instance = this;
            bHideUI  = false;

            config = ConfigNode.Load(KSP.IO.IOUtils.GetFilePathFor(this.GetType(), "Settings.cfg"));
            if (ReferenceEquals(config, null))
            {
                config = new ConfigNode("");
            }

            bUseStockToolbar = config.TryGetValue("UseStockToolbar", true);

            blizMenuTexPath = config.TryGetValue("blizMenuIcon", "Pilot Assistant/Icon/BlizzyIcon");
            blizAsstTexPath = config.TryGetValue("blizAsstIcon", "Pilot Assistant/Icon/BlizzyIcon");
            blizSSASTexPath = config.TryGetValue("blizSSASIcon", "Pilot Assistant/Icon/BlizzyIcon");
            blizSASTexPath  = config.TryGetValue("blizSASIcon", "Pilot Assistant/Icon/BlizzyIcon");

            if (!bUseStockToolbar && ToolbarManager.ToolbarAvailable)
            {
                ToolbarMod.Instance.Awake();
            }
            else
            {
                AppLauncherFlight.Awake();
            }
        }
예제 #2
0
        public void OnDestroy()
        {
            SaveConfig();
            if (Toolbar.ToolbarManager.ToolbarAvailable && !bUseStockToolbar)
            {
                ToolbarMod.Instance.OnDestroy();
            }
            BindingManager.Instance.OnDestroy();

            GameEvents.onHideUI.Remove(hideUI);
            GameEvents.onShowUI.Remove(showUI);

            PresetManager.saveToFile();
            instance = null;
        }
        public void Awake()
        {
            instance = this;
            bHideUI = false;

            config = ConfigNode.Load(KSP.IO.IOUtils.GetFilePathFor(this.GetType(), "Settings.cfg"));
            if (ReferenceEquals(config, null))
                config = new ConfigNode(string.Empty);

            bUseStockToolbar = config.TryGetValue("UseStockToolbar", true);

            blizMenuTexPath = config.TryGetValue("blizMenuIcon", "Pilot Assistant/Icon/BlizzyIcon");
            blizAsstTexPath = config.TryGetValue("blizAsstIcon", "Pilot Assistant/Icon/BlizzyIcon");
            blizSSASTexPath = config.TryGetValue("blizSSASIcon", "Pilot Assistant/Icon/BlizzyIcon");
            blizSASTexPath = config.TryGetValue("blizSASIcon", "Pilot Assistant/Icon/BlizzyIcon");

            if (!bUseStockToolbar && ToolbarManager.ToolbarAvailable)
                ToolbarMod.Instance.Awake();
            else
                AppLauncherFlight.Awake();
        }
        public void OnDestroy()
        {
            SaveConfig();
            if (Toolbar.ToolbarManager.ToolbarAvailable && !bUseStockToolbar)
                ToolbarMod.Instance.OnDestroy();
            BindingManager.Instance.OnDestroy();

            GameEvents.onHideUI.Remove(hideUI);
            GameEvents.onShowUI.Remove(showUI);

            PresetManager.saveToFile();
            instance = null;
        }