Always medkit added

This commit is contained in:
ALittlePatate
2022-04-03 11:09:43 +02:00
parent f8e57df71d
commit 7340c53813
2 changed files with 20 additions and 1 deletions

View File

@@ -1,9 +1,26 @@
using HarmonyLib; using HarmonyLib;
using DevourClient;
namespace DevourClient.Hooks namespace DevourClient.Hooks
{ {
public class 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(typeof(Horror.Menu))]
[HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. [HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs.
static class Horror_Menu_SetupPerk_Patch static class Horror_Menu_SetupPerk_Patch

View File

@@ -15,6 +15,7 @@ namespace DevourClient
bool change_steam_name = false; bool change_steam_name = false;
bool fly = false; bool fly = false;
float fly_speed = 5; float fly_speed = 5;
public bool _IsCarryingFirstAidOnLocalCharacter = false;
bool spam_message = 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.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 = 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 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")) if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 40, 150, 20), "Unlock Achievements"))
{ {