From 9dc129819ce0b335ced7c59018dfc6a587a4f025 Mon Sep 17 00:00:00 2001 From: scp222thj <82206202+scp222thj@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:35:23 +0200 Subject: [PATCH] Setup Host-Only cheats --- src/UI/MenuUI.cs | 2 +- src/Utilities/Utils.cs | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/UI/MenuUI.cs b/src/UI/MenuUI.cs index 30f4cab..03a79e9 100644 --- a/src/UI/MenuUI.cs +++ b/src/UI/MenuUI.cs @@ -161,7 +161,7 @@ private void Update(){ CheatToggles.changeRole = CheatToggles.killAll = CheatToggles.telekillPlayer = CheatToggles.killAllCrew = CheatToggles.killAllImps = CheatToggles.teleportCursor = CheatToggles.teleportPlayer = CheatToggles.spectate = CheatToggles.freecam = CheatToggles.killPlayer = false; } - if(!Utils.isHost){ + if(!Utils.isHost && !Utils.isFreePlay){ CheatToggles.killAll = CheatToggles.telekillPlayer = CheatToggles.killAllCrew = CheatToggles.killAllImps = CheatToggles.killPlayer = CheatToggles.zeroKillCd = CheatToggles.killAnyone = CheatToggles.killVanished = false; } diff --git a/src/Utilities/Utils.cs b/src/Utilities/Utils.cs index 52ff6ab..a27fd9e 100644 --- a/src/Utilities/Utils.cs +++ b/src/Utilities/Utils.cs @@ -14,18 +14,18 @@ public static class Utils { //Useful for getting full lists of all the Among Us cosmetics IDs public static ReferenceDataManager referenceDataManager = DestroyableSingleton.Instance; - public static bool isShip => ShipStatus.Instance != null; - public static bool isLobby => AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Joined && !isFreePlay; - public static bool isOnlineGame => AmongUsClient.Instance.NetworkMode == NetworkModes.OnlineGame; - public static bool isLocalGame => AmongUsClient.Instance.NetworkMode == NetworkModes.LocalGame; - public static bool isFreePlay => AmongUsClient.Instance.NetworkMode == NetworkModes.FreePlay; - public static bool isPlayer => PlayerControl.LocalPlayer != null; - public static bool isHost = AmongUsClient.Instance.AmHost; - public static bool isInGame => AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started && isPlayer; + public static bool isShip => ShipStatus.Instance; + public static bool isLobby => AmongUsClient.Instance && AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Joined && !isFreePlay; + public static bool isOnlineGame => AmongUsClient.Instance && AmongUsClient.Instance.NetworkMode == NetworkModes.OnlineGame; + public static bool isLocalGame => AmongUsClient.Instance && AmongUsClient.Instance.NetworkMode == NetworkModes.LocalGame; + public static bool isFreePlay => AmongUsClient.Instance && AmongUsClient.Instance.NetworkMode == NetworkModes.FreePlay; + public static bool isPlayer => PlayerControl.LocalPlayer; + public static bool isHost = AmongUsClient.Instance && AmongUsClient.Instance.AmHost; + public static bool isInGame => AmongUsClient.Instance && AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started && isPlayer; public static bool isMeeting => MeetingHud.Instance; public static bool isMeetingVoting => isMeeting && MeetingHud.Instance.state is MeetingHud.VoteStates.Voted or MeetingHud.VoteStates.NotVoted; public static bool isMeetingProceeding => isMeeting && MeetingHud.Instance.state is MeetingHud.VoteStates.Proceeding; - public static bool isExiling => ExileController.Instance != null && !(AirshipIsActive && SpawnInMinigame.Instance.isActiveAndEnabled); + public static bool isExiling => ExileController.Instance && !(AirshipIsActive && SpawnInMinigame.Instance.isActiveAndEnabled); public static bool isNormalGame => GameOptionsManager.Instance.CurrentGameOptions.GameMode == GameModes.Normal; public static bool isHideNSeek => GameOptionsManager.Instance.CurrentGameOptions.GameMode == GameModes.HideNSeek; public static bool SkeldIsActive => (MapNames)GameOptionsManager.Instance.CurrentGameOptions.MapId == MapNames.Skeld;