diff --git a/LoadstonePatch/LoadstoneNighty/LoadstoneNighty.csproj b/LoadstonePatch/LoadstoneNighty/LoadstoneNighty.csproj index 9a7c7f5..f430b43 100644 --- a/LoadstonePatch/LoadstoneNighty/LoadstoneNighty.csproj +++ b/LoadstonePatch/LoadstoneNighty/LoadstoneNighty.csproj @@ -68,7 +68,8 @@ - + + diff --git a/LoadstonePatch/LoadstoneNighty/PatchVer16.cs b/LoadstonePatch/LoadstoneNighty/PatchVer16.cs new file mode 100644 index 0000000..6a8c79e --- /dev/null +++ b/LoadstonePatch/LoadstoneNighty/PatchVer16.cs @@ -0,0 +1,33 @@ +using DunGen.Graph; +using DunGen; +using DunGenPlus.Collections; +using DunGenPlus; +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace LoadstoneNighty { + + // patch 16 and below probably requires me to patch the function no matter what + public class PatchVer16 { + + public static void Activate(){ + try { + Plugin.Instance.harmony.PatchAll(typeof(PatchVer16)); + } catch { + + } + Plugin.logger.LogInfo($"FromProxyEnd function has been patched!"); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(Loadstone.Patches.FromProxyPatches), "FromProxyEnd")] + public static void FromProxyEndPatch(Dictionary dictionary){ + DunGenPlus.API.AddTileToMainPathDictionary(dictionary); + } + + } +} diff --git a/LoadstonePatch/LoadstoneNighty/Patch.cs b/LoadstonePatch/LoadstoneNighty/PatchVer17.cs similarity index 93% rename from LoadstonePatch/LoadstoneNighty/Patch.cs rename to LoadstonePatch/LoadstoneNighty/PatchVer17.cs index a853d3d..ddbf47b 100644 --- a/LoadstonePatch/LoadstoneNighty/Patch.cs +++ b/LoadstonePatch/LoadstoneNighty/PatchVer17.cs @@ -1,20 +1,23 @@ -using System; +using DunGen.Graph; +using DunGen; +using DunGenPlus.Collections; +using DunGenPlus; +using HarmonyLib; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using DunGen; -using DunGen.Graph; -using DunGenPlus; -using DunGenPlus.Collections; -using HarmonyLib; namespace LoadstoneNighty { - public class Patch { + + // patch 17 has the patch functions for me to use + public class PatchVer17 { public static void Activate(){ Loadstone.Patches.DungenOptimizationPatches.tileCollectors.Add(GetTiles); + Plugin.logger.LogInfo($"DungenOptimizationPatches function has been patched!"); } private static HashSet GetTiles(DungeonGenerator generator) { diff --git a/LoadstonePatch/LoadstoneNighty/Plugin.cs b/LoadstonePatch/LoadstoneNighty/Plugin.cs index 927d11b..1e06f0c 100644 --- a/LoadstonePatch/LoadstoneNighty/Plugin.cs +++ b/LoadstonePatch/LoadstoneNighty/Plugin.cs @@ -20,8 +20,8 @@ namespace LoadstoneNighty { private const string modName = "Dungeon Generation Plus Loadstone Patch"; private const string modVersion = "1.0.0"; - public const string targetModGUID = "com.adibtw.loadstone.Nightly"; - public const string targetModVersion = "0.1.16"; + public const string targetModGUID = "com.adibtw.loadstone"; + public const string targetModVersion = "0.1.17"; public readonly Harmony harmony = new Harmony(modGUID); public static Plugin Instance {get; private set;} @@ -32,9 +32,12 @@ namespace LoadstoneNighty { logger = BepInEx.Logging.Logger.CreateLogSource(modGUID); - var modLoaded = Chainloader.PluginInfos.ContainsKey(targetModGUID); + var modLoaded = Chainloader.PluginInfos.ContainsKey(targetModGUID); if (!modLoaded) return; + logger.LogInfo($"Plugin {modName} has been added!"); + PatchVer16.Activate(); + bool validVersion; var pluginInfo = Chainloader.PluginInfos[targetModGUID]; var loadedVersion = pluginInfo.Metadata.Version; @@ -46,15 +49,7 @@ namespace LoadstoneNighty { } if (validVersion){ - logger.LogInfo($"Plugin {modName} has been added!"); - - try { - harmony.PatchAll(typeof(Patch)); - } catch { - - } - - Patch.Activate(); + PatchVer17.Activate(); } } }