Advertisement
Guest User

in-flight patch for TweakableReactionWheels

a guest
May 3rd, 2015
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.77 KB | None | 0 0
  1. --- E:/gama/kspmodz/TweakableEverything-1.9.1/Source/TweakableReactionWheels/ModuleTweakableReactionWheel.cs    Fri May 01 14:46:02 2015
  2. +++ C:/Users/jazzkutya/Documents/Projects/TweakableReactionWheels/TweakableReactionWheels/ModuleTweakableReactionWheel.cs   Sun May 03 18:38:05 2015
  3. @@ -52,17 +52,17 @@
  4.         protected bool startEnabledState;
  5.  
  6.         // Stores our tweaked value for roll torque.
  7. -       [KSPField(isPersistant = true, guiName = "Roll Torque (kN-m)", guiActiveEditor = true)]
  8. +       [KSPField(isPersistant = true, guiName = "Roll Torque (kN-m)", guiActive = true)]
  9.         [UI_FloatRange(minValue = float.MinValue, maxValue = float.MaxValue, stepIncrement = 1f)]
  10.         public float RollTorque;
  11.  
  12.         // Stores our tweaked value for pitch torque.
  13. -       [KSPField(isPersistant = true, guiName = "Pitch Torque (kN-m)", guiActiveEditor = true)]
  14. +       [KSPField(isPersistant = true, guiName = "Pitch Torque (kN-m)", guiActive = true)]
  15.         [UI_FloatRange(minValue = float.MinValue, maxValue = float.MaxValue, stepIncrement = 1f)]
  16.         public float PitchTorque;
  17.  
  18.         // Stores our tweaked value for yaw torque.
  19. -       [KSPField(isPersistant = true, guiName = "Yaw Torque (kN-m)", guiActiveEditor = true)]
  20. +       [KSPField(isPersistant = true, guiName = "Yaw Torque (kN-m)", guiActive = true)]
  21.         [UI_FloatRange(minValue = float.MinValue, maxValue = float.MaxValue, stepIncrement = 1f)]
  22.         public float YawTorque;
  23.  
  24. @@ -144,6 +144,11 @@
  25.                         this.reactionWheelModule.State = ModuleReactionWheel.WheelState.Disabled;
  26.                     }
  27.                 }
  28. +           }
  29. +           if (HighLogic.LoadedSceneIsFlight && this.reactionWheelModule != null) {
  30. +               this.reactionWheelModule.RollTorque = this.RollTorque;
  31. +               this.reactionWheelModule.PitchTorque = this.PitchTorque;
  32. +               this.reactionWheelModule.YawTorque = this.YawTorque;
  33.             }
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement