From 120c875c823081962f1e694e2f03aef48638291a Mon Sep 17 00:00:00 2001 From: D1GQ Date: Fri, 16 Aug 2024 02:12:55 -0500 Subject: [PATCH] code clean up --- Modules/AntiCheat.cs | 3 +-- Modules/BetterDataManager.cs | 6 ++---- Modules/BetterHostManager.cs | 2 +- Modules/ExtendedPlayerControl.cs | 1 - Modules/GameState.cs | 1 - Patches/ClientOptionsPatch.cs | 5 ++--- Patches/GamePlayManagerPatch.cs | 2 -- Patches/MeetingHudPatch.cs | 1 - Patches/PlayerControlPatch.cs | 3 ++- Patches/PlayerJoinAndLeftPatch.cs | 3 --- Patches/RolePatch.cs | 1 - 11 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index e98bc24..734f8d1 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -2,7 +2,6 @@ using HarmonyLib; using Hazel; using InnerNet; -using UnityEngine; namespace BetterAmongUs; @@ -309,7 +308,7 @@ class AntiCheat return; } } - catch (Exception ex) + catch (Exception ex) { Logger.Error(ex.ToString()); } diff --git a/Modules/BetterDataManager.cs b/Modules/BetterDataManager.cs index b8493ac..6068fe7 100644 --- a/Modules/BetterDataManager.cs +++ b/Modules/BetterDataManager.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Text; -using System.Text.Json; +using System.Text.Json; namespace BetterAmongUs; @@ -115,7 +113,7 @@ class BetterDataManager return jsonData[category][name]; } } - catch (Exception ex) + catch (Exception ex) { Logger.Error(ex.ToString()); } diff --git a/Modules/BetterHostManager.cs b/Modules/BetterHostManager.cs index 6d78d84..dd26901 100644 --- a/Modules/BetterHostManager.cs +++ b/Modules/BetterHostManager.cs @@ -1,8 +1,8 @@ using AmongUs.GameOptions; using Hazel; using InnerNet; -using UnityEngine; using System.Text; +using UnityEngine; namespace BetterAmongUs; diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 78de8c0..2f28a90 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -1,5 +1,4 @@ using AmongUs.GameOptions; -using Hazel; using InnerNet; using TMPro; using UnityEngine; diff --git a/Modules/GameState.cs b/Modules/GameState.cs index 6baa41c..2104b89 100644 --- a/Modules/GameState.cs +++ b/Modules/GameState.cs @@ -1,5 +1,4 @@ using AmongUs.GameOptions; -using BetterAmongUs.Patches; namespace BetterAmongUs; diff --git a/Patches/ClientOptionsPatch.cs b/Patches/ClientOptionsPatch.cs index 798c93a..5702c0f 100644 --- a/Patches/ClientOptionsPatch.cs +++ b/Patches/ClientOptionsPatch.cs @@ -1,5 +1,4 @@ using HarmonyLib; -using Hazel; using UnityEngine; namespace BetterAmongUs.Patches; @@ -61,8 +60,8 @@ public static class OptionsMenuBehaviourPatch if (BetterRoleAlgorithma == null || BetterRoleAlgorithma.ToggleButton == null) { BetterRoleAlgorithma = ClientOptionItem.Create("Better Role Algorithma", Main.BetterRoleAlgorithma, __instance, toggleCheck: () => !toggleCheckInGamePlay("Better Role Algorithma")); - } - + } + if (BetterNotifications == null || BetterNotifications.ToggleButton == null) { BetterNotifications = ClientOptionItem.Create("Better Notifications", Main.BetterNotifications, __instance, BetterNotificationsToggle); diff --git a/Patches/GamePlayManagerPatch.cs b/Patches/GamePlayManagerPatch.cs index 79b0dc9..876318f 100644 --- a/Patches/GamePlayManagerPatch.cs +++ b/Patches/GamePlayManagerPatch.cs @@ -1,6 +1,4 @@ using HarmonyLib; -using Hazel; -using TMPro; namespace BetterAmongUs.Patches; diff --git a/Patches/MeetingHudPatch.cs b/Patches/MeetingHudPatch.cs index 1822659..285fe80 100644 --- a/Patches/MeetingHudPatch.cs +++ b/Patches/MeetingHudPatch.cs @@ -1,5 +1,4 @@ using HarmonyLib; -using Hazel; using System.Text; using TMPro; using UnityEngine; diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 339cd51..89fa4c3 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -209,7 +209,8 @@ class PlayerControlPatch player.SetPlayerTextInfo(sbInfoTop.ToString()); player.SetPlayerTextInfo(sbInfoBottom.ToString(), isBottom: true); player.SetPlayerTextInfo(sbInfo.ToString(), isInfo: true); - } catch (Exception ex) + } + catch (Exception ex) { Logger.Error(ex.ToString()); } diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index af7a5a9..fa29098 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -1,9 +1,6 @@ using BetterAmongUs.Patches; using HarmonyLib; -using Hazel; using InnerNet; -using System.Text.RegularExpressions; -using UnityEngine.ProBuilder; namespace BetterAmongUs; diff --git a/Patches/RolePatch.cs b/Patches/RolePatch.cs index ecfd18e..9991a0e 100644 --- a/Patches/RolePatch.cs +++ b/Patches/RolePatch.cs @@ -1,5 +1,4 @@ using HarmonyLib; -using Rewired; namespace BetterAmongUs.Patches;