diff --git a/DevourClient/Hooks/Hooks.cs b/DevourClient/Hooks/Hooks.cs index e54b050..113095b 100644 --- a/DevourClient/Hooks/Hooks.cs +++ b/DevourClient/Hooks/Hooks.cs @@ -1,9 +1,26 @@ using HarmonyLib; +using DevourClient; namespace DevourClient.Hooks { public class Hooks { + [HarmonyPatch(typeof(NolanBehaviour))] + [HarmonyPatch(nameof(NolanBehaviour.IsCarryingFirstAidOnLocalCharacter))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. + static class NolanBehaviour_IsCarryingFirstAidOnLocalCharacter_Patch + { + static void Postfix(ref bool __result) + { + Load settings = new Load(); + if (settings._IsCarryingFirstAidOnLocalCharacter) + { + __result = true; + } + + return; + } + } + [HarmonyPatch(typeof(Horror.Menu))] [HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. static class Horror_Menu_SetupPerk_Patch diff --git a/DevourClient/MelonMain.cs b/DevourClient/MelonMain.cs index 4dfedc9..489c93d 100644 --- a/DevourClient/MelonMain.cs +++ b/DevourClient/MelonMain.cs @@ -15,6 +15,7 @@ namespace DevourClient bool change_steam_name = false; bool fly = false; float fly_speed = 5; + public bool _IsCarryingFirstAidOnLocalCharacter = false; bool spam_message = false; @@ -86,7 +87,8 @@ namespace DevourClient this.change_steam_name = GUI.Toggle(new Rect(Settings.Settings.x + 200, Settings.Settings.y + 70, 150, 20), this.change_steam_name, "Change steam name"); //Checkbox servername this.fly = GUI.Toggle(new Rect(Settings.Settings.x + 200, Settings.Settings.y + 100, 150, 20), this.fly, "Fly"); //Checkbox fly this.fly_speed = GUI.HorizontalSlider(new Rect(Settings.Settings.x + 200, Settings.Settings.y + 130, 100, 10), this.fly_speed, 5f, 20f); //Slider for the fly speed - GUI.Label(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 125, 100, 30), this.fly_speed.ToString()); //Prints the value of the slider + GUI.Label(new Rect(Settings.Settings.x + 310, Settings.Settings.y + 125, 100, 30), this.fly_speed.ToString()); //Prints the value of the slider; + this._IsCarryingFirstAidOnLocalCharacter = GUI.Toggle(new Rect(Settings.Settings.x + 200, Settings.Settings.y + 190, 150, 20), this._IsCarryingFirstAidOnLocalCharacter, "IsCarryingFirstAid"); if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 40, 150, 20), "Unlock Achievements")) {