Exemplo n.º 1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            //Set up the ops window
            opsWindow             = new SciLabOpsWindow("Science Lab");
            opsWindow.part        = this.part;
            opsWindow.WindowTitle = this.part.partInfo.title;
            opsWindow.FindPartModules();

            //If we want to show the ops view dialog instead of the context buttons,
            //then hide the context buttons.
            if (opsWindow.converter == null)
            {
                return;
            }
            if (showOpsView)
            {
                Events["ShowOpsView"].guiActive = true;

                opsWindow.converter.Events["TransmitResearch"].guiActive       = false;
                opsWindow.converter.Events["PublishResearch"].guiActive        = false;
                opsWindow.converter.Events["SellResearch"].guiActive           = false;
                opsWindow.converter.Events["StartResourceConverter"].guiActive = false;
                opsWindow.converter.Events["StopResourceConverter"].guiActive  = false;
            }
        }
Exemplo n.º 2
0
        public void ShowOpsView()
        {
            if (opsWindow == null)
            {
                WBISciLabOpsView opsView = this.part.FindModuleImplementing <WBISciLabOpsView>();

                if (opsView == null)
                {
                    ScreenMessages.PostScreenMessage("WBISciLabOpsView required in config file to show the window.", 5.0f, ScreenMessageStyle.UPPER_CENTER);
                    converter.SetGuiVisible(true);
                    Events["ShowOpsView"].guiActive = false;
                    return;
                }

                opsWindow             = new SciLabOpsWindow(this.part.partInfo.title);
                opsWindow.templateOps = this;
            }

            opsWindow.SetVisible(true);
        }