Пример #1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            inflatableModule = this.part.FindModuleImplementing<WBIInflatablePartModule>();

            foreach (PartModule mod in this.part.Modules)
            {
                if (mod.moduleName == "OseModuleWorkshop")
                    oseWorkshop = mod;
                else if (mod.moduleName == "OseModuleRecycler")
                    oseRecycler = mod;
            }

            /* For some reason we can't seem to hide the fields and events anymore. :(
            //Now, hide the workshop and recycler GUI.
            if (oseWorkshop != null)
            {
                oseWorkshop.Fields["Status"].guiActive = false;
                oseWorkshop.Events["ContextMenuOnOpenWorkbench"].guiActive = false;
            }

            if (oseRecycler != null)
            {
                oseRecycler.Fields["Status"].guiActive = false;
                oseRecycler.Events["ContextMenuOnOpenWorkbench"].guiActive = false;
            }
             */ 

            //Use reflection to find the methods we need.
            findWorkshopMethods();
        }
Пример #2
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            inflatableModule = this.part.FindModuleImplementing <WBIInflatablePartModule>();

            if (this.part.Modules == null)
            {
                return;
            }
            foreach (PartModule mod in this.part.Modules)
            {
                if (mod.moduleName == "OseModuleWorkshop")
                {
                    oseWorkshop = mod;
                }
                else if (mod.moduleName == "OseModuleRecycler")
                {
                    oseRecycler = mod;
                }
            }

            //Use reflection to find the methods we need.
            findWorkshopMethods();
        }
Пример #3
0
        public override void ToggleAnimation()
        {
            //If the part has an inflatable part and it's not deployed,
            //then don't allow the lights to come on.
            WBIInflatablePartModule inflatable = this.part.FindModuleImplementing <WBIInflatablePartModule>();

            if (inflatable != null)
            {
                if (inflatable.isDeployed == false)
                {
                    ScreenMessages.PostScreenMessage("Cannot turn on the lights until the module is inflated.", 5.0f, ScreenMessageStyle.UPPER_CENTER);
                    return;
                }
            }

            base.ToggleAnimation();
            setupLights();
        }
Пример #4
0
        public void TurnOnLights()
        {
            //If the part has an inflatable part and it's not deployed,
            //then don't allow the lights to come on.
            WBIInflatablePartModule inflatable = this.part.FindModuleImplementing <WBIInflatablePartModule>();

            if (inflatable != null)
            {
                if (inflatable.isDeployed == false)
                {
                    ScreenMessages.PostScreenMessage("Cannot turn on the lights until the module is inflated.", 5.0f, ScreenMessageStyle.UPPER_CENTER);
                    return;
                }
            }

            //Play animation for current state
            PlayAnimation(isDeployed);
            isDeployed = true;
            Events["ToggleAnimation"].guiName = endEventGUIName;
            setupLights();
        }