public override void DoFailure()
 {
     base.DoFailure();
     this.state = base.module.wheelState;
     base.module.Events["OnToggle"].active = false;
     base.module.wheelState = ModuleReactionWheel.WheelState.Broken;
 }
 public override void DoFailure()
 {
     base.DoFailure();
     this.state = base.module.wheelState;
     base.module.Events["OnToggle"].active = false;
     base.module.wheelState = ModuleReactionWheel.WheelState.Broken;
 }
Ejemplo n.º 3
0
        void DrawVessel(VesselInfo ves)
        {
            Color backgroundColour = GUI.backgroundColor;

            if (ves.Vessel == FlightGlobals.ActiveVessel)
            {
                GUI.backgroundColor = XKCDColors.Green;
            }

            ves.DisplayVes = GUILayout.Toggle(ves.DisplayVes, ves.Vessel.vesselName, GUI.skin.button);

            GUI.backgroundColor = backgroundColour;

            if (ves.DisplayVes)
            {
                bool state = GUILayout.Toggle(ves.ForcedActive, "Toggle Vessel Torque");

                if (state != ves.ForcedActive)
                {
                    ves.ForcedActive = state;

                    ModuleReactionWheel.WheelState stateToSet = state ? ModuleReactionWheel.WheelState.Active : ModuleReactionWheel.WheelState.Disabled;

                    foreach (SaturableRW rw in ves.Wheels)
                    {
                        rw.wheelRef.State = stateToSet;
                    }
                }

                GUILayout.BeginHorizontal();

                GUILayout.Space(25);

                GUILayout.BeginVertical();

                GUILayout.Space(15);

                foreach (SaturableRW rw in ves.Wheels)
                {
                    DrawWheel(rw);
                }

                GUILayout.EndVertical();

                GUILayout.EndHorizontal();
            }
        }