From 4a57456e6825c6826bd8a8ac1202e435728fd604 Mon Sep 17 00:00:00 2001 From: siimav Date: Sat, 26 Jul 2025 21:34:12 +0300 Subject: [PATCH] Yeet the B9PS Harmony patch. This was included and released by B9PS itself. --- Source/B9PSPatchProject/B9PSMFTHandler.cs | 40 ------------ Source/B9PSPatchProject/Harmony/B9PS.cs | 32 --------- Source/B9PSPatchProject/HarmonyPatcher.cs | 14 ---- .../RealFuelsB9PSPatch.csproj | 65 ------------------- .../assembly/AssemblyInfoB9PSPatch.cs | 36 ---------- Source/RealFuels.sln | 6 -- 6 files changed, 193 deletions(-) delete mode 100644 Source/B9PSPatchProject/B9PSMFTHandler.cs delete mode 100644 Source/B9PSPatchProject/Harmony/B9PS.cs delete mode 100644 Source/B9PSPatchProject/HarmonyPatcher.cs delete mode 100644 Source/B9PSPatchProject/RealFuelsB9PSPatch.csproj delete mode 100644 Source/B9PSPatchProject/assembly/AssemblyInfoB9PSPatch.cs diff --git a/Source/B9PSPatchProject/B9PSMFTHandler.cs b/Source/B9PSPatchProject/B9PSMFTHandler.cs deleted file mode 100644 index f8ce3528..00000000 --- a/Source/B9PSPatchProject/B9PSMFTHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ - -using B9PartSwitch.PartSwitch.PartModifiers; - -namespace RealFuels.B9PSPatch -{ - public class ModuleFuelTanksHandler : PartModifierBase - { - public const string PART_ASPECT_LOCK = "ModuleFuelTanks"; - - private readonly PartModule module; - private readonly ConfigNode originalNode; - private readonly ConfigNode dataNode; - private readonly BaseEventDetails moduleDataChangedEventDetails; - public ModuleFuelTanksHandler(PartModule module, ConfigNode originalNode, ConfigNode dataNode, BaseEventDetails moduleDataChangedEventDetails) - { - this.module = module; - this.originalNode = originalNode; - this.dataNode = dataNode; - this.moduleDataChangedEventDetails = moduleDataChangedEventDetails; - } - - public object PartAspectLock => PART_ASPECT_LOCK; - public override string Description => "a part's ModuleFuelTanks"; - public override void DeactivateOnStartEditor() => Deactivate(); - public override void ActivateOnStartEditor() => Activate(); - public override void DeactivateOnSwitchEditor() => Deactivate(); - public override void ActivateOnSwitchEditor() => Activate(); - - private void Activate() => ApplyNode(dataNode); - private void Deactivate() => ApplyNode(originalNode); - - private void ApplyNode(ConfigNode sourceNode) - { - var evtDetails = new BaseEventDetails(BaseEventDetails.Sender.USER); - evtDetails.Set("MFTNode", sourceNode); - module.Events.Send("LoadMFTModuleFromConfigNode", evtDetails); - module.Events.Send("ModuleDataChanged", moduleDataChangedEventDetails); - } - } -} diff --git a/Source/B9PSPatchProject/Harmony/B9PS.cs b/Source/B9PSPatchProject/Harmony/B9PS.cs deleted file mode 100644 index e678a0ef..00000000 --- a/Source/B9PSPatchProject/Harmony/B9PS.cs +++ /dev/null @@ -1,32 +0,0 @@ -using HarmonyLib; -using System.Collections.Generic; -using B9PartSwitch.PartSwitch.PartModifiers; -using B9PartSwitch; - -namespace RealFuels.B9PSPatch -{ - [HarmonyPatch(typeof(ModuleModifierInfo))] - internal class PatchModuleModifierInfo - { - [HarmonyPostfix] - [HarmonyPatch("CreatePartModifiers")] - internal static IEnumerable Postfix_CreatePartModifiers(IEnumerable result, Part part, ModuleModifierInfo __instance, BaseEventDetails moduleDataChangedEventDetails) - { - foreach (var partModifier in result) - { - if (partModifier is ModuleDataHandlerBasic) - { - ModuleMatcher moduleMatcher = new ModuleMatcher(__instance.identifierNode); - PartModule module = moduleMatcher.FindModule(part); - ConfigNode originalNode = moduleMatcher.FindPrefabNode(module); - if (module.moduleName == "ModuleFuelTanks") - { - yield return new ModuleFuelTanksHandler(module, originalNode, __instance.dataNode, moduleDataChangedEventDetails); - continue; - } - } - yield return partModifier; - } - } - } -} diff --git a/Source/B9PSPatchProject/HarmonyPatcher.cs b/Source/B9PSPatchProject/HarmonyPatcher.cs deleted file mode 100644 index 00030cc9..00000000 --- a/Source/B9PSPatchProject/HarmonyPatcher.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UnityEngine; - -namespace RealFuels.B9PSPatch -{ - [KSPAddon(KSPAddon.Startup.Instantly, true)] - public class HarmonyPatcher : MonoBehaviour - { - internal void Start() - { - var harmony = new HarmonyLib.Harmony("RealFuels.Harmony.HarmonyPatcher"); - harmony.PatchAll(); - } - } -} \ No newline at end of file diff --git a/Source/B9PSPatchProject/RealFuelsB9PSPatch.csproj b/Source/B9PSPatchProject/RealFuelsB9PSPatch.csproj deleted file mode 100644 index 408392dd..00000000 --- a/Source/B9PSPatchProject/RealFuelsB9PSPatch.csproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - Debug - AnyCPU - {DF215BA9-7879-4C04-A267-145DEAFF92AC} - Library - RealFuelsB9PSPatch - RealFuelsB9PSPatch - v4.7.2 - - 10.8.0 - ..\..\Build\RealFuels\obj - - - portable - False - ..\..\Build\RealFuels\obj\ - ..\..\RealFuels\Plugins\ - DEBUG;ENABLE_PROFILER - prompt - 4 - False - true - false - x64 - - - none - True - ..\..\Build\RealFuels\obj\ - ..\..\RealFuels\Plugins\ - prompt - 4 - False - false - false - x64 - - - - False - - - False - - - False - - - False - - - False - - - - - - - - - - - \ No newline at end of file diff --git a/Source/B9PSPatchProject/assembly/AssemblyInfoB9PSPatch.cs b/Source/B9PSPatchProject/assembly/AssemblyInfoB9PSPatch.cs deleted file mode 100644 index 6893e36b..00000000 --- a/Source/B9PSPatchProject/assembly/AssemblyInfoB9PSPatch.cs +++ /dev/null @@ -1,36 +0,0 @@ -#define CIBUILD_disabled -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("RealFuelsB9PSPatch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("KSP-RO Group")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.0.0")] -// [assembly: AssemblyInformationalVersionAttribute("@FULL_VERSION@")] -#if CIBUILD -[assembly: AssemblyFileVersion("@MAJOR@.@MINOR@.@PATCH@.@BUILD@")] -[assembly: KSPAssembly("RealFuelsB9PSPatch", @MAJOR@, @MINOR@, @PATCH@)] -#else -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: KSPAssembly("RealFuelsB9PSPatch", 1, 0, 0)] -#endif - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] -[assembly: KSPAssemblyDependency("B9PartSwitch", 2, 20)] \ No newline at end of file diff --git a/Source/RealFuels.sln b/Source/RealFuels.sln index 70a7c988..5bc09070 100644 --- a/Source/RealFuels.sln +++ b/Source/RealFuels.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 17.9.34622.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealFuels", "RealFuels.csproj", "{0041813D-DCD1-4AC7-8327-85765BF924A3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealFuelsB9PSPatch", "B9PSPatchProject\RealFuelsB9PSPatch.csproj", "{DF215BA9-7879-4C04-A267-145DEAFF92AC}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -17,10 +15,6 @@ Global {0041813D-DCD1-4AC7-8327-85765BF924A3}.Debug|Any CPU.Build.0 = Debug|Any CPU {0041813D-DCD1-4AC7-8327-85765BF924A3}.Release|Any CPU.ActiveCfg = Release|Any CPU {0041813D-DCD1-4AC7-8327-85765BF924A3}.Release|Any CPU.Build.0 = Release|Any CPU - {DF215BA9-7879-4C04-A267-145DEAFF92AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF215BA9-7879-4C04-A267-145DEAFF92AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF215BA9-7879-4C04-A267-145DEAFF92AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF215BA9-7879-4C04-A267-145DEAFF92AC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE