Exemplo n.º 1
0
        protected override void Start()
        {
            instance = this;

            if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER)
            {
                Destroy(gameObject);
            }

            if (settings == null)
            {
                settings = new CapComSettings(filePath);

                //if (settings.useKSPStyle)
                //{
                //	CapComSkins.initializeKSPSkins();
                //	CC_SkinsLibrary.SetCurrent("CCKSPSkin");
                //}
                //else
                //{
                //	CapComSkins.initializeUnitySkins();
                //	CC_SkinsLibrary.SetCurrent("CCUnitySkin");
                //}
            }

            window = gameObject.AddComponent <CapComWindow>();

            if (ToolbarManager.ToolbarAvailable && !settings.stockToolbar)
            {
                if (toolbar == null)
                {
                    toolbar = gameObject.AddComponent <CC_Toolbar>();
                }
                if (appButton != null)
                {
                    Destroy(appButton);
                    appButton = null;
                }
            }
            else
            {
                if (appButton == null)
                {
                    appButton = gameObject.AddComponent <CC_StockToolbar>();
                }
                if (toolbar != null)
                {
                    Destroy(toolbar);
                    toolbar = null;
                }
            }

            contractParser.onContractsParsed.Add(onContractsLoaded);
            contractParser.onContractStateChange.Add(refreshList);
            progressParser.onProgressParsed.Add(onProgressLoaded);
            GameEvents.Contract.onContractsListChanged.Add(onListChanged);
        }
Exemplo n.º 2
0
        protected override void Start()
        {
            instance = this;

            if (HighLogic.CurrentGame.Mode != Game.Modes.CAREER)
                Destroy(this);

            if (settings == null)
            {
                settings = new CapComSettings(filePath);

                //if (settings.useKSPStyle)
                //{
                //	CapComSkins.initializeKSPSkins();
                //	CC_SkinsLibrary.SetCurrent("CCKSPSkin");
                //}
                //else
                //{
                //	CapComSkins.initializeUnitySkins();
                //	CC_SkinsLibrary.SetCurrent("CCUnitySkin");
                //}
            }

            window = gameObject.AddComponent<CapComWindow>();

            if (ToolbarManager.ToolbarAvailable && !settings.stockToolbar)
            {
                if (toolbar == null)
                    toolbar = gameObject.AddComponent<CC_Toolbar>();
                if (appButton != null)
                    Destroy(appButton);
            }
            else
            {
                if (appButton == null)
                    appButton = gameObject.AddComponent<CC_StockToolbar>();
                if (toolbar != null)
                    Destroy(toolbar);
            }

            contractParser.onContractsParsed.Add(onContractsLoaded);
            contractParser.onContractStateChange.Add(refreshList);
            progressParser.onProgressParsed.Add(onProgressLoaded);
            GameEvents.Contract.onContractsListChanged.Add(onListChanged);
        }