From 780d63935215869c45ded249b7850a1debf212d2 Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Fri, 15 Sep 2023 11:08:22 -0400 Subject: [PATCH 01/10] WIP using harmony and hooking movement input call --- kOS-EVA/EvaController.cs | 38 ++++++++++++++++++++++++++++++++++++++ kOS-EVA/kOS-EVA.csproj | 19 +++++++++++++++++++ kOS-EVA/packages.config | 4 ++++ 3 files changed, 61 insertions(+) create mode 100644 kOS-EVA/packages.config diff --git a/kOS-EVA/EvaController.cs b/kOS-EVA/EvaController.cs index 96d60bf..bbe43a1 100644 --- a/kOS-EVA/EvaController.cs +++ b/kOS-EVA/EvaController.cs @@ -8,6 +8,42 @@ using kOS.Safe.Encapsulation; using kOS.Safe.Encapsulation.Suffixes; +using HarmonyLib; + +namespace kOSEVA +{ + [KSPAddon(KSPAddon.Startup.Instantly, true)] + public class EvaControllerPatch : MonoBehaviour + { + void Awake() + { + var harmony = new Harmony("kOSEVA"); + harmony.PatchAll(Assembly.GetExecutingAssembly()); + } + + [HarmonyPatch(typeof(KerbalEVA), "HandleMovementInput")] + class KerbalEVA_HandleMovementInput_Patch + { + static void Prefix(KerbalEVA __instance) + { + if (!__instance.VesselUnderControl) + { + return; + } + + __instance.CharacterFrameModeToggle = true; + } + } + } + + public class EvaController : PartModule + { + internal void HandleMovementInput_Prefix(KerbalEVA) + } + +} + +#if false namespace EVAMove { @@ -403,3 +439,5 @@ private void StopAllAnimations() } } + +#endif \ No newline at end of file diff --git a/kOS-EVA/kOS-EVA.csproj b/kOS-EVA/kOS-EVA.csproj index d3c1aca..efa898a 100644 --- a/kOS-EVA/kOS-EVA.csproj +++ b/kOS-EVA/kOS-EVA.csproj @@ -1,5 +1,6 @@  + Debug @@ -12,6 +13,8 @@ v4.8 512 + + true @@ -62,6 +65,9 @@ False + + False + @@ -83,6 +89,9 @@ False + + + @@ -90,9 +99,19 @@ + + + copy $(TargetPath) $(SolutionDir)GameData\kOS-EVA\Plugins\$(TargetFileName) + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + +