From f474d43b778edf91552bcd1fa85bdc787ff7ff37 Mon Sep 17 00:00:00 2001 From: Ryuyan Date: Sat, 29 Oct 2022 05:39:14 -0400 Subject: [PATCH] Updates - Cleaner References - Cleaner Init - Cleaner HarmonyPatch --- src/Harmony/Init.cs | 5 ++-- .../SleeperVolume_UpdatePlayerTouched.cs | 5 +--- src/ModInfo.xml | 2 +- src/StayClear.csproj | 25 +++++-------------- 4 files changed, 11 insertions(+), 26 deletions(-) diff --git a/src/Harmony/Init.cs b/src/Harmony/Init.cs index 455890f..ffd4ff1 100644 --- a/src/Harmony/Init.cs +++ b/src/Harmony/Init.cs @@ -1,12 +1,13 @@ using System.Reflection; +using HarmonyLib; -namespace Harmony +namespace StayClear { public class StayClear : IModApi { public void InitMod(Mod _modInstance) { - var harmony = new HarmonyLib.Harmony("io.stealthbit.7dtdmods.StayClear"); + var harmony = new Harmony("io.stealthbit.7dtdmods.StayClear"); harmony.PatchAll(Assembly.GetExecutingAssembly()); } } diff --git a/src/Harmony/SleeperVolume_UpdatePlayerTouched.cs b/src/Harmony/SleeperVolume_UpdatePlayerTouched.cs index a75a8eb..ec55560 100644 --- a/src/Harmony/SleeperVolume_UpdatePlayerTouched.cs +++ b/src/Harmony/SleeperVolume_UpdatePlayerTouched.cs @@ -1,11 +1,8 @@ -using System; using HarmonyLib; -using UnityEngine; namespace StayClear { - [HarmonyPatch(typeof(SleeperVolume))] - [HarmonyPatch("UpdatePlayerTouched")] + [HarmonyPatch(typeof(SleeperVolume), "UpdatePlayerTouched")] class SleeperVolume_UpdatePlayerTouched { static bool Prefix(ref ulong ___respawnTime, World _world) diff --git a/src/ModInfo.xml b/src/ModInfo.xml index a669c32..6a2cbea 100644 --- a/src/ModInfo.xml +++ b/src/ModInfo.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/src/StayClear.csproj b/src/StayClear.csproj index 62b4610..2f6f244 100644 --- a/src/StayClear.csproj +++ b/src/StayClear.csproj @@ -2,27 +2,14 @@ net4.8 Library - StayClear - StayClear - G:\Games\SteamLibrary\steamapps\common\7 Days To Die + StayClear + StayClear + H:\Games\SteamLibrary\steamapps\common\7 Days To Die - - $(GameDir)\7DaysToDie_Data\Managed\0Harmony.dll - False - - - $(GameDir)\7DaysToDie_Data\Managed\Assembly-CSharp.dll - False - - - $(GameDir)\7DaysToDie_Data\Managed\LogLibrary.dll - False - - - $(GameDir)\7DaysToDie_Data\Managed\UnityEngine.dll - False - + + +