From 7550443ead7c1af2bcc0f426b44b1f4fa44227f7 Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 12 Jan 2023 20:52:44 +0300 Subject: [PATCH 1/5] return keyword has been changed to break --- DevourClient/MelonMain.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/DevourClient/MelonMain.cs b/DevourClient/MelonMain.cs index 7d20d70..1f60a76 100644 --- a/DevourClient/MelonMain.cs +++ b/DevourClient/MelonMain.cs @@ -523,6 +523,7 @@ namespace DevourClient i += 30; } } + switch (Helpers.Map.GetActiveScene()) { case "Menu": @@ -531,7 +532,7 @@ namespace DevourClient Il2CppHorror.Menu menu = UnityEngine.Object.FindObjectOfType(); menu.OnLobbyStartButtonClick(); } - return; + break; case "Devour": if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 120, 20), "Burn One Goat")) @@ -563,7 +564,7 @@ namespace DevourClient Hacks.Misc.DespawnDemons(); } - return; + break; case "Molly": if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 120, 20), "Burn One Rat")) @@ -595,7 +596,7 @@ namespace DevourClient Hacks.Misc.DespawnDemons(); } - return; + break; case "Inn": if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 120, 20), "Burn One Egg")) @@ -631,7 +632,7 @@ namespace DevourClient { Hacks.Misc.DespawnSpiders(); } - return; + break; case "Town": if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 430, 120, 20), "Burn One Book")) @@ -662,10 +663,10 @@ namespace DevourClient { Hacks.Misc.DespawnGhosts(); } - return; + break; default: - return; + break; } } } From ea9a4e13ab159b6e80a80f0658a429195dc6825b Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:01:16 +0300 Subject: [PATCH 2/5] LoadMap function has been added. --- DevourClient/Helpers/Map.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DevourClient/Helpers/Map.cs b/DevourClient/Helpers/Map.cs index bb920ee..3dbcf0c 100644 --- a/DevourClient/Helpers/Map.cs +++ b/DevourClient/Helpers/Map.cs @@ -28,5 +28,17 @@ { return Helpers.Entities.Azazels[0].gameObject; } + + public static void LoadMap(string mapName) + { + if (Il2CppPhoton.Bolt.BoltNetwork.IsServer) + { + Il2CppPhoton.Bolt.BoltNetwork.LoadScene(mapName); + } + else + { + DevourClient.Hacks.Misc.ShowMessageBox("You must be the host to use this command!"); + } + } } } From 929aaeacd05422f761a42ba0bd5b144f581f7ab7 Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:46:02 +0300 Subject: [PATCH 3/5] Log messages have been added for LoadMap. --- DevourClient/Helpers/Map.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DevourClient/Helpers/Map.cs b/DevourClient/Helpers/Map.cs index 3dbcf0c..563e6d2 100644 --- a/DevourClient/Helpers/Map.cs +++ b/DevourClient/Helpers/Map.cs @@ -34,10 +34,12 @@ if (Il2CppPhoton.Bolt.BoltNetwork.IsServer) { Il2CppPhoton.Bolt.BoltNetwork.LoadScene(mapName); + + MelonLoader.MelonLogger.Warning("Please press the button only once, it may take some time for the map to load."); } else { - DevourClient.Hacks.Misc.ShowMessageBox("You must be the host to use this command!"); + MelonLoader.MelonLogger.Warning("You must be the host to use this command!"); } } } From 3000f18eeb17cb53959db0ba027f33b2ec31631d Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:53:02 +0300 Subject: [PATCH 4/5] Buttons have been added for the Load Map. --- DevourClient/MelonMain.cs | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/DevourClient/MelonMain.cs b/DevourClient/MelonMain.cs index 1f60a76..1bc5c42 100644 --- a/DevourClient/MelonMain.cs +++ b/DevourClient/MelonMain.cs @@ -668,6 +668,63 @@ namespace DevourClient default: break; } + + // load map + switch (Helpers.Map.GetActiveScene()) + { + case "Menu": + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 470, 100, 30), $"Load Map"); + + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 500, 100, 20), "Farmhouse")) + { + Helpers.Map.LoadMap("Devour"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 500, 100, 20), "Asylum")) + { + Helpers.Map.LoadMap("Molly"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 230, Settings.Settings.y + 500, 100, 20), "Inn")) + { + Helpers.Map.LoadMap("Inn"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 340, Settings.Settings.y + 500, 100, 20), "Town")) + { + Helpers.Map.LoadMap("Town"); + } + break; + case "Devour": + case "Molly": + case "Inn": + case "Town": + GUI.Label(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 490, 100, 30), "Load Map"); + + if (GUI.Button(new Rect(Settings.Settings.x + 10, Settings.Settings.y + 520, 100, 20), "Farmhouse")) + { + Helpers.Map.LoadMap("Devour"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 120, Settings.Settings.y + 520, 100, 20), "Asylum")) + { + Helpers.Map.LoadMap("Molly"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 230, Settings.Settings.y + 520, 100, 20), "Inn")) + { + Helpers.Map.LoadMap("Inn"); + } + + if (GUI.Button(new Rect(Settings.Settings.x + 340, Settings.Settings.y + 520, 100, 20), "Town")) + { + Helpers.Map.LoadMap("Town"); + } + break; + default: + break; + } } } } From 0dec95a512f6d239e41c7724f918202e2e27ca6a Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Fri, 13 Jan 2023 02:54:38 +0300 Subject: [PATCH 5/5] old code has been removed from the comment line. Until a better method is discovered, this method will be used temporarily. --- DevourClient/Helpers/StateHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DevourClient/Helpers/StateHelper.cs b/DevourClient/Helpers/StateHelper.cs index d75d941..51f33be 100644 --- a/DevourClient/Helpers/StateHelper.cs +++ b/DevourClient/Helpers/StateHelper.cs @@ -50,7 +50,6 @@ namespace DevourClient.Helpers return; } - /* Il2Cpp.SurvivalAzazelBehaviour sab = Il2Cpp.SurvivalAzazelBehaviour.FindObjectOfType(); if (sab == null) @@ -59,12 +58,13 @@ namespace DevourClient.Helpers } sab.OnPickedUpPlayer(sab.gameObject, p_GameObject, false); - */ + /* MelonLogger.Msg(Name); Il2Cpp.JumpScare _jumpscare = UnityEngine.Object.FindObjectOfType(); _jumpscare.player = p_GameObject; _jumpscare.Activate(p_GameObject.GetComponent()); + */ } public void LockInCage()