Esempio n. 1
0
        private void Update()
        {
            //Updating of size if possible
            if (!CompatibilityChecker.IsCompatible())
            {
                return;
            }
            if ((!HighLogic.LoadedSceneIsEditor && !HighLogic.LoadedSceneIsFlight) || ((this.part.Modules["RealChuteModule"] != null && !((RealChuteModule)this.part.Modules["RealChuteModule"]).isTweakable)))
            {
                return;
            }

            if (moduleNodes.Keys.Contains(this.part.partInfo.name) && this.part.transform.GetChild(0).localScale != Vector3.Scale(originalSize, sizes[size].size))
            {
                UpdateScale(this.part, rcModule);
            }

            //If unselected
            if (!HighLogic.LoadedSceneIsEditor || !EditorLogic.fetch || EditorLogic.fetch.editorScreen != EditorLogic.EditorScreen.Actions || !this.part.Modules.Contains("RealChuteModule"))
            {
                this.visible = false;
                return;
            }

            //Checks if the part is selected
            if (actionPanel.GetSelectedParts().Contains(this.part))
            {
                this.visible = true;
            }
            else
            {
                this.visible             = false;
                this.materialsVisible    = false;
                this.secMaterialsVisible = false;
                this.failedVisible       = false;
                this.successfulVisible   = false;
            }

            //Checks if size must update
            if (moduleNodes.Keys.Contains(this.part.partInfo.name) && lastSize != size)
            {
                UpdateScale(this.part, rcModule);
            }

            //Checks if case texture must update
            if (this.textures.caseNames.Length > 0 && lastCaseID != caseID)
            {
                UpdateCaseTexture(this.part, rcModule);
            }
            main.SwitchType();
            if (secondaryChute)
            {
                secondary.SwitchType();
            }
        }
Esempio n. 2
0
        private void Update()
        {
            //Updating of size if possible
            if (!CompatibilityChecker.IsAllCompatible() || ((IntPtr.Size == 8) && (Environment.OSVersion.Platform == PlatformID.Win32NT)))
            {
                return;
            }
            if ((!HighLogic.LoadedSceneIsEditor && !HighLogic.LoadedSceneIsFlight))
            {
                return;
            }

            if (sizes.Count > 0 && this.part.transform.GetChild(0).localScale != Vector3.Scale(originalSize, sizes[size].size))
            {
                UpdateScale(this.part, rcModule);
            }

            //If unselected
            if (!HighLogic.LoadedSceneIsEditor || !EditorLogic.fetch || EditorLogic.fetch.editorScreen != EditorLogic.EditorScreen.Actions || !this.part.Modules.Contains("RealChuteModule"))
            {
                this.editorGUI.visible = false;
                return;
            }

            //Checks if the part is selected
            if (actionPanel.GetSelectedParts().Contains(this.part))
            {
                this.editorGUI.visible = true;
            }
            else
            {
                this.editorGUI.visible = false;
                chutes.ForEach(c => c.materialsVisible = false);
                this.editorGUI.failedVisible           = false;
                this.editorGUI.successfulVisible       = false;
            }
            //Checks if size must update
            if (sizes.Count > 0 && lastSize != size)
            {
                UpdateScale(this.part, rcModule);
            }
            //Checks if case texture must update
            if (this.textures.caseNames.Length > 0 && lastCaseID != caseID)
            {
                UpdateCaseTexture(this.part, rcModule);
            }
            chutes.ForEach(c => c.SwitchType());
        }
Esempio n. 3
0
        private IEnumerator <YieldInstruction> CheckActionGroupEditor()
        {
            while (EditorLogic.fetch == null)
            {
                yield return(null);
            }
            EditorLogic editor = EditorLogic.fetch;

            while (EditorLogic.fetch != null)
            {
                if (editor.editorScreen == EditorScreen.Actions)
                {
                    if (!ActionGroupMode)
                    {
                        HideGUI();
                        OnActionGroupEditorOpened.Fire();
                    }
                    EditorActionGroups age = EditorActionGroups.Instance;
                    if (missile_module && !age.GetSelectedParts().Contains(missile_module.part))
                    {
                        HideGUI();
                    }
                    ActionGroupMode = true;
                }
                else
                {
                    if (ActionGroupMode)
                    {
                        HideGUI();
                        OnActionGroupEditorClosed.Fire();
                    }
                    ActionGroupMode = false;
                }
                yield return(null);
            }
        }