diff --git a/CHANGES.md b/CHANGES.md index 5fc3543..e3371ff 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,55 +1,61 @@ -## v1.2.1-alpha -##### Fixes -- Fix example configuration patch to show how to actually change toggle keys. - -## v1.2.0 -##### New -- Add `defaultControlMode`, `defaultVabControlMode`, `defaultSphControlMode` configuration settings to control default - control mode used for various situations. - -## v1.1.0 -##### New -- Add `KSPAssembly` attribute to assembly. - -##### Changes -- `PLANEMODE_USER_SETTINGS` is deprecated (although still supported), a Module Manager patch should now be used to - modify settings. An example patch is distributed in the `PlaneMode/Configuration` directory. -- Clarified log message that made it appeared as if code was being executed more times than it was. -- Simplified the way textures are loaded. - -##### Fixes -- Fix Plane mode settings being persisted in certain situations. -- Fix the display of the log level for debug messages. - -## v1.0.0 -##### Fixes -- Initalize ControlMode to Rocket to avoid warning on vessel load - -## v0.4.1 -##### Fixes -- Kerbal Space Program v1.0 compatibility - -## v0.4.0 -##### New -- Added setting to disable Application Launcher (stock toolbar) button. -- Docking controls are now supported. - -##### Fixes -- Interaction with trim controls should now be fixed. -- Interaction with SAS/Autopilot should now be fixed. - -## v0.3.0 -##### New -- Use stock Application Launcher. -- Control mode is persisted with command pods, probe cores, and docking ports. The mode used is determined by whichever - part is selected with the *Control From Here* button. -- Control mode is automatically selected for new parts in the editor. Parts in the VAB are placed in Rocket mode and - parts in the SPH are placed in Plane mode. - -##### Changes -- Renamed from "Aeroplane Mode" to "Plane Mode". -- Settings configuration has been changed slightly and toggle and hold keys have both been defaulted to None rather - than ScrollLock and Home. - -##### Fixes -- Handle switching vessels better. +## v1.3.0-alpha +##### New +- Add actions to all applicables parts to change control modes, making them available to action groups. Available actions are: + - `Control Mode: Toggle` + - `Control Mode: Rocket` + - `Control Mode: Plane` + +##### Fixes +- Fix example configuration patch to show how to actually change toggle keys. + +## v1.2.0 +##### New +- Add `defaultControlMode`, `defaultVabControlMode`, `defaultSphControlMode` configuration settings to control default + control mode used for various situations. + +## v1.1.0 +##### New +- Add `KSPAssembly` attribute to assembly. + +##### Changes +- `PLANEMODE_USER_SETTINGS` is deprecated (although still supported), a Module Manager patch should now be used to + modify settings. An example patch is distributed in the `PlaneMode/Configuration` directory. +- Clarified log message that made it appeared as if code was being executed more times than it was. +- Simplified the way textures are loaded. + +##### Fixes +- Fix Plane mode settings being persisted in certain situations. +- Fix the display of the log level for debug messages. + +## v1.0.0 +##### Fixes +- Initalize ControlMode to Rocket to avoid warning on vessel load + +## v0.4.1 +##### Fixes +- Kerbal Space Program v1.0 compatibility + +## v0.4.0 +##### New +- Added setting to disable Application Launcher (stock toolbar) button. +- Docking controls are now supported. + +##### Fixes +- Interaction with trim controls should now be fixed. +- Interaction with SAS/Autopilot should now be fixed. + +## v0.3.0 +##### New +- Use stock Application Launcher. +- Control mode is persisted with command pods, probe cores, and docking ports. The mode used is determined by whichever + part is selected with the *Control From Here* button. +- Control mode is automatically selected for new parts in the editor. Parts in the VAB are placed in Rocket mode and + parts in the SPH are placed in Plane mode. + +##### Changes +- Renamed from "Aeroplane Mode" to "Plane Mode". +- Settings configuration has been changed slightly and toggle and hold keys have both been defaulted to None rather + than ScrollLock and Home. + +##### Fixes +- Handle switching vessels better. diff --git a/README.md b/README.md index 5a83f64..11bdcc8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ The control mode is stored with command pods, probe cores, and docking ports. Th whether the part was created in the VAB (Rocket) or SPH (Plane). Existing parts in flight will default to Rocket mode. The part used is determined by which is selected by the *Control From Here* button. You can toggle the control mode of a part by right clicking on it in the editor or in flight and press *Toggle Control Mode*. Pressing the Application -Launcher button will also toggle the control mode of the current controlling part. +Launcher button will also toggle the control mode of the current controlling part. Actions are also available for use +in action groups to toggle the control mode or switch to a specific mode. ## Configuration diff --git a/Source/PlaneMode/ModulePlaneMode.cs b/Source/PlaneMode/ModulePlaneMode.cs index 52ac0f9..b5c6cfa 100644 --- a/Source/PlaneMode/ModulePlaneMode.cs +++ b/Source/PlaneMode/ModulePlaneMode.cs @@ -125,6 +125,24 @@ public void ToggleControlMode() Log.Trace("Leaving ModulePlaneMode.ToggleControlMode()"); } + [KSPAction("Control Mode: Toggle")] + public void ActionToggleControlMode(KSPActionParam p) + { + ToggleControlMode(); + } + + [KSPAction("Control Mode: Rocket")] + public void ActionSetRocketControlMode(KSPActionParam p) + { + SetControlMode(ControlMode.Rocket); + } + + [KSPAction("Control Mode: Plane")] + public void ActionSetPlaneControlMode(KSPActionParam p) + { + SetControlMode(ControlMode.Plane); + } + public void SetControlMode(ControlMode controlMode) { Log.Trace("Entering ModulePlaneMode.SetControlMode()");