diff --git a/src/Cheats/MalumESP.cs b/src/Cheats/MalumESP.cs index 7292205..b49e0f1 100644 --- a/src/Cheats/MalumESP.cs +++ b/src/Cheats/MalumESP.cs @@ -28,6 +28,15 @@ public static bool fullBrightActive() return CheatToggles.fullBright || Camera.main.orthographicSize > 3f || Camera.main.gameObject.GetComponent().Target != PlayerControl.LocalPlayer; } + public static void zoomToggle(HudManager hudManager) + { + // Funktion to zoom out 2 times + Camera.main.orthographicSize++; + hudManager.UICamera.orthographicSize++; + Camera.main.orthographicSize++; + hudManager.UICamera.orthographicSize++; + } + public static void zoomOut(HudManager hudManager) { if(CheatToggles.zoomOut){ diff --git a/src/MalumMenu.cs b/src/MalumMenu.cs index 69a88bf..e235505 100644 --- a/src/MalumMenu.cs +++ b/src/MalumMenu.cs @@ -27,6 +27,7 @@ public partial class MalumMenu : BasePlugin public static ConfigEntry guestFriendCode; public static ConfigEntry guestMode; public static ConfigEntry noTelemetry; + public static ConfigEntry ToggleZoom; public override void Load() { @@ -72,6 +73,11 @@ public override void Load() true, "When enabled it will stop Among Us from collecting analytics of your games and sending them to Innersloth using Unity Analytics"); + ToggleZoom = Config.Bind("MalumMenu.Cheats", + "ToggleZoom", + "c", + "The keyboard key used to toggle the zoom hack on on press and off on release. List of supported keycodes: https://docs.unity3d.com/Packages/com.unity.tiny@0.16/api/Unity.Tiny.Input.KeyCode.html"); + Harmony.PatchAll(); diff --git a/src/UI/MenuUI.cs b/src/UI/MenuUI.cs index b89d79d..2ade1ec 100644 --- a/src/UI/MenuUI.cs +++ b/src/UI/MenuUI.cs @@ -1,5 +1,7 @@ using UnityEngine; using System.Collections.Generic; +using System; +using JetBrains.Annotations; namespace MalumMenu; public class MenuUI : MonoBehaviour @@ -10,6 +12,7 @@ public class MenuUI : MonoBehaviour private Rect windowRect = new Rect(10, 10, 300, 500); private bool isGUIActive = false; private GUIStyle submenuButtonStyle; + // Create all groups (buttons) and their toggles on start private void Start() @@ -147,6 +150,19 @@ private void Update(){ windowRect.position = new Vector2(mousePosition.x, Screen.height - mousePosition.y); } + if (Input.GetKeyDown(Utils.stringToKeycode(MalumMenu.ToggleZoom.Value)) && DestroyableSingleton.Instance.Chat.IsClosedOrClosing) + { + // Toggle zoom hack with c key + CheatToggles.zoomOut = true; + + // Also zoom out 2 times for immediate use and easy usablity + MalumESP.zoomToggle(DestroyableSingleton.Instance); + } + else if (Input.GetKeyUp(Utils.stringToKeycode(MalumMenu.ToggleZoom.Value)) && DestroyableSingleton.Instance.Chat.IsClosedOrClosing) + { + CheatToggles.zoomOut = false; + } + //Passive cheats are always on to avoid problems CheatToggles.unlockFeatures = CheatToggles.freeCosmetics = CheatToggles.avoidBans = true;