diff --git a/ModSupport/AmandsGraphicsSupport.cs b/ModSupport/AmandsGraphicsSupport.cs index 8416e53..61190af 100644 --- a/ModSupport/AmandsGraphicsSupport.cs +++ b/ModSupport/AmandsGraphicsSupport.cs @@ -38,8 +38,8 @@ private static bool BlockOpticPatch(AmandsGraphicsOpticPatch __instance) return false; } [HarmonyPrefix] - [HarmonyPatch(typeof(AmandsGraphicsmethod_22Patch), "PatchPostFix")] - private static bool BlockSomeOtherOpticPatch(AmandsGraphicsmethod_22Patch __instance) + [HarmonyPatch(typeof(AmandsGraphicsmethod_25Patch), "PatchPostFix")] + private static bool BlockSomeOtherOpticPatch(AmandsGraphicsmethod_25Patch __instance) { return false; } diff --git a/Plugin.cs b/Plugin.cs index 1d93cd5..b0dfd2b 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -92,12 +92,17 @@ private void InitializeConditionalPatches() return; // Skip patching if VR failed to initialize string modDllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BepInEx\\plugins\\kmyuhkyuk-EFTApi\\EFTConfiguration.dll"); + if (File.Exists(modDllPath)) { + // Load the assembly Assembly modAssembly = Assembly.LoadFrom(modDllPath); + + // Check for the required types and methods in the loaded assembly Type configViewType = modAssembly.GetType("EFTConfiguration.Views.EFTConfigurationView"); if (configViewType != null) { + // Apply conditional patches InstalledMods.EFTApiInstalled = true; ApplyPatches("TarkovVR.ModSupport.EFTApi"); MyLog.LogInfo("Dependent mod found and patches applied."); @@ -112,6 +117,57 @@ private void InitializeConditionalPatches() MyLog.LogWarning("Dependent mod DLL not found. Some functionality will be disabled."); } + modDllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BepInEx\\plugins\\AmandsGraphics.dll"); + + if (File.Exists(modDllPath)) + { + // Load the assembly + Assembly modAssembly = Assembly.LoadFrom(modDllPath); + + // Check for the required types and methods in the loaded assembly + Type configViewType = modAssembly.GetType("AmandsGraphics.AmandsGraphicsClass"); + if (configViewType != null) + { + // Apply conditional patches + InstalledMods.AmandsGraphicsInstalled = true; + ApplyPatches("TarkovVR.ModSupport.AmandsGraphics"); + MyLog.LogInfo("Dependent mod found and patches applied."); + } + else + { + MyLog.LogWarning("Required types/methods not found in the dependent mod."); + } + } + else + { + MyLog.LogWarning("Dependent mod DLL not found. Some functionality will be disabled."); + } + + modDllPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BepInEx\\plugins\\Fika.Core.dll"); + + if (File.Exists(modDllPath)) + { + // Load the assembly + Assembly modAssembly = Assembly.LoadFrom(modDllPath); + + // Check for the required types and methods in the loaded assembly + Type configViewType = modAssembly.GetType("MatchMakerUI"); + if (configViewType != null) + { + // Apply conditional patches + InstalledMods.FIKAInstalled = true; + ApplyPatches("TarkovVR.ModSupport.FIKA"); + MyLog.LogInfo("Dependent mod found and patches applied."); + } + else + { + MyLog.LogWarning("Required types/methods not found in the dependent mod."); + } + } + else + { + MyLog.LogWarning("Dependent mod DLL not found. Some functionality will be disabled."); + } // Repeat for other mods (AmandsGraphics, FIKA) as needed } diff --git a/libs/ModSupport/AmandsGraphics.dll b/libs/ModSupport/AmandsGraphics.dll index b877d09..5f85249 100644 Binary files a/libs/ModSupport/AmandsGraphics.dll and b/libs/ModSupport/AmandsGraphics.dll differ