diff --git a/Changelog.txt b/Changelog.txt index 802d5e7..b8536c5 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -74,4 +74,7 @@ 0.1.9.11 Reverted change to line 317 in MuMechModuleHullCamera, caused issues with cameras Fixed cameras for the inline docking ports to match the navball when the docking port is the active control point - New feature, holding down Alt (on Windows) when hitting + or - will change the control point to the docking port with the camera, only works on docking ports and the original controlling part \ No newline at end of file + New feature, holding down Alt (on Windows) when hitting + or - will change the control point to the docking port with the camera, only works on docking ports and the original controlling part + +0.1.9.12 + Fixed resetting the control point when using the Alt (on Windows) when cycling past the last camera \ No newline at end of file diff --git a/GameData/HullCameraVDS/HullcamVDSContinued.version b/GameData/HullCameraVDS/HullcamVDSContinued.version index bf3b168..cbe1555 100644 --- a/GameData/HullCameraVDS/HullcamVDSContinued.version +++ b/GameData/HullCameraVDS/HullcamVDSContinued.version @@ -11,7 +11,7 @@ "MAJOR": 0, "MINOR": 1, "PATCH": 9, - "BUILD": 11 + "BUILD": 12 }, "KSP_VERSION": { "MAJOR": 1, diff --git a/GameData/HullCameraVDS/Plugins/settings.cfg b/GameData/HullCameraVDS/Plugins/settings.cfg index 75e7061..013a1c5 100644 --- a/GameData/HullCameraVDS/Plugins/settings.cfg +++ b/GameData/HullCameraVDS/Plugins/settings.cfg @@ -6,7 +6,7 @@ HullCameraVDSConfig DebugOutput = true DisplayCameraNameWhenSwitching = true DisplayVesselNameWhenSwitching = true - MessageDuration = 9 + MessageDuration = 3 CAMERA_NEXT { diff --git a/GameData/HullCameraVDS/Plugins/settings.cfg.bak b/GameData/HullCameraVDS/Plugins/settings.cfg.bak new file mode 100644 index 0000000..75e7061 --- /dev/null +++ b/GameData/HullCameraVDS/Plugins/settings.cfg.bak @@ -0,0 +1,32 @@ +HullCameraVDSConfig +{ + AllowMainCamera = true + CycleMainCamera = true + CycleOnlyActiveVessel = false + DebugOutput = true + DisplayCameraNameWhenSwitching = true + DisplayVesselNameWhenSwitching = true + MessageDuration = 9 + + CAMERA_NEXT + { + primary = Minus + secondary = None + group = 0 + switchState = Any + } + CAMERA_PREV + { + primary = Equals + secondary = None + group = 0 + switchState = Any + } + CAMERA_RESET + { + primary = Backspace + secondary = None + group = 0 + switchState = Any + } +} diff --git a/HullCamera/AssemblyVersion.cs b/HullCamera/AssemblyVersion.cs index 93d85a6..7b65711 100644 --- a/HullCamera/AssemblyVersion.cs +++ b/HullCamera/AssemblyVersion.cs @@ -10,4 +10,4 @@ using System.Reflection; - [assembly: AssemblyVersion("0.1.9.11")] \ No newline at end of file + [assembly: AssemblyVersion("0.1.9.12")] \ No newline at end of file diff --git a/HullCamera/MuMechModuleHullCamera.cs b/HullCamera/MuMechModuleHullCamera.cs index e17749a..e562220 100644 --- a/HullCamera/MuMechModuleHullCamera.cs +++ b/HullCamera/MuMechModuleHullCamera.cs @@ -154,7 +154,7 @@ protected struct ActionFlags protected static void DebugOutput(object o) { - // if (sDebugOutput) + if (sDebugOutput) { Debug.Log("HullCam: " + o.ToString()); } @@ -164,7 +164,6 @@ protected static void DebugOutput(object o) protected static void StaticInit() { - Debug.Log("StaticInit"); // Commented out so that we can reload the config by reloading a save file rather than restarting KSP. /* if (sInit) @@ -248,6 +247,11 @@ protected static void SaveMainCamera() sOrigFov = Camera.main.fieldOfView; sOrigPosition = sCam.transform.localPosition; sOrigRotation = sCam.transform.localRotation; + if (sOrigVesselTransformPart == null) + { + sOrigVesselTransformPart = FlightGlobals.ActiveVessel.GetReferenceTransformPart(); + ScreenMessages.PostScreenMessage("Original Control Point: " + sOrigVesselTransformPart.partInfo.title); + } } protected static void RestoreMainCamera() @@ -284,12 +288,20 @@ protected static void RestoreMainCamera() { if (GameSettings.MODIFIER_KEY.GetKey(false)) { +#if false ModuleDockingNode mdn = sOrigVesselTransformPart.FindModuleImplementing(); if (mdn != null) + { sOrigVesselTransformPart.SetReferenceTransform(mdn.controlTransform); - FlightGlobals.ActiveVessel.SetReferenceTransform(sOrigVesselTransformPart, true); - ScreenMessages.PostScreenMessage("Control Point changed to " + sOrigVesselTransformPart.partInfo.title); + } else +#endif + { + // sOrigVesselTransformPart.SetReferenceTransform(sOrigVesselTransformPart.GetReferenceTransform()); + } + FlightGlobals.ActiveVessel.SetReferenceTransform(sOrigVesselTransformPart, true); + ScreenMessages.PostScreenMessage("Control Point restored to " + sOrigVesselTransformPart.partInfo.title); + sOrigVesselTransformPart = null; } } ///////////////////////////////////// @@ -374,6 +386,7 @@ protected static void CycleCamera(int direction) newCam = sCameras[nextCam]; #if true + if (newCam.vessel == FlightGlobals.ActiveVessel) { if (GameSettings.MODIFIER_KEY.GetKey(false)) @@ -381,6 +394,12 @@ protected static void CycleCamera(int direction) ModuleDockingNode mdn = newCam.part.FindModuleImplementing(); if (mdn != null) { + if (sOrigVesselTransformPart == null) + { + sOrigVesselTransformPart = FlightGlobals.ActiveVessel.GetReferenceTransformPart(); + ScreenMessages.PostScreenMessage("Original Control Point: " + sOrigVesselTransformPart.partInfo.title); + } + newCam.part.SetReferenceTransform(mdn.controlTransform); FlightGlobals.ActiveVessel.SetReferenceTransform(newCam.part, true); @@ -471,16 +490,7 @@ protected void Activate() } return; } - else - { - - ///////////////////////////////////// - - sOrigVesselTransformPart = FlightGlobals.ActiveVessel.GetReferenceTransformPart(); - Debug.Log("OrigVesselTransformPart: " + sOrigVesselTransformPart.partInfo.title); - ///////////////////////////////////// - } sCurrentCamera = this; camActive = true; changeCameraMode(); @@ -495,7 +505,7 @@ protected void DirtyWindow() } } - #region Events +#region Events // Note: Events show in the part menu in flight. @@ -519,9 +529,9 @@ public void EnableCamera() DirtyWindow(); } - #endregion +#endregion - #region Actions +#region Actions // Note: Actions are available to action groups. @@ -555,9 +565,9 @@ public void PreviousCameraAction(KSPActionParam ap) sActionFlags.prevCamera = true; } - #endregion +#endregion - #region Callbacks +#region Callbacks void DebugList() { @@ -780,13 +790,6 @@ public void FixedUpdate() { return; } - - ///////////////////////////////////// - - sOrigVesselTransformPart = FlightGlobals.ActiveVessel.GetReferenceTransformPart(); - Debug.Log("OrigVesselTransformPart: " + sOrigVesselTransformPart.partInfo.title); - - ///////////////////////////////////// } // Either we haven't set sOriginParent, or we've nulled it when restoring the main camera, so we save it again here. @@ -923,7 +926,7 @@ private void Remove() - #endregion +#endregion } } \ No newline at end of file diff --git a/HullcamVDSContinued.version b/HullcamVDSContinued.version index bf3b168..cbe1555 100644 --- a/HullcamVDSContinued.version +++ b/HullcamVDSContinued.version @@ -11,7 +11,7 @@ "MAJOR": 0, "MINOR": 1, "PATCH": 9, - "BUILD": 11 + "BUILD": 12 }, "KSP_VERSION": { "MAJOR": 1,