diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index 385f0f5..20ac6c5 100644 --- a/AmongUsRevamped.cs +++ b/AmongUsRevamped.cs @@ -43,7 +43,7 @@ public partial class Main : BasePlugin public static bool HasArgumentException; public static string CredentialsText; - public const string ModVersion = "v1.8.0"; + public const string ModVersion = "v1.8.1"; public static float GameTimer; @@ -97,7 +97,7 @@ public partial class Main : BasePlugin Translator.Init(); Translator.Reload(); BanManager.Init(); - + Harmony.PatchAll(); ConsoleManager.DetachConsole(); diff --git a/Modules/CustomRoleManagement.cs b/Modules/CustomRoleManagement.cs index 918a09b..6650898 100644 --- a/Modules/CustomRoleManagement.cs +++ b/Modules/CustomRoleManagement.cs @@ -165,7 +165,7 @@ public static class AbilityManagement private static int PendingRoleMessages = 0; public static void SendRoleMessages() { - if (!AmongUsClient.Instance.AmHost) return; + if (!AmongUsClient.Instance.AmHost || Options.Gamemode.GetValue() > 1) return; if (string.IsNullOrEmpty(RoleList()) || PlayerControl.LocalPlayer.Data.IsDead) { @@ -175,12 +175,12 @@ public static class AbilityManagement } var players = PlayerControl.AllPlayerControls.ToArray().ToList(); - float delay = 4.4f; + float delay = 6.6f; PendingRoleMessages = 0; HandlingRoleMessages = true; - SendRoleList(DestroyableSingleton.Instance.Chat, AbilityManagement.RoleList(), false); + SendRoleList(DestroyableSingleton.Instance.Chat, AbilityManagement.RoleList(), true); foreach (var player in players) { diff --git a/Modules/Translator.cs b/Modules/Translator.cs index 9df1551..69d2e4e 100644 --- a/Modules/Translator.cs +++ b/Modules/Translator.cs @@ -19,6 +19,7 @@ public static class Translator public static void Init() { + Logger.Info($" Among Us Revamped {Main.ModVersion}", "Init"); CheckLanguageFile(_currentLang); LoadLanguage(_currentLang); } diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 52f4f07..ae8df9a 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -231,8 +231,8 @@ public static class Utils PlayerControlSetRolePatch.Seekers.Clear(); PlayerControlSetRolePatch.Jesters.Clear(); PlayerControlSetRolePatch.FirstAssign = true; - CoShowIntroPatch.ScheduleExile = false; + OnGameStartPatch.ScheduleExile = false; CoShowIntroPatch.IntroInitiated = false; } @@ -578,7 +578,7 @@ public static class Utils return null; } - Logger.Info($"Found {methodName}.MoveNext", "GetStateMachineMoveNext"); + // Logger.Info($"Found {methodName}.MoveNext", "GetStateMachineMoveNext"); return moveNext; } diff --git a/Patches/CredentialsPatch.cs b/Patches/CredentialsPatch.cs index cc943a0..f060f7d 100644 --- a/Patches/CredentialsPatch.cs +++ b/Patches/CredentialsPatch.cs @@ -180,6 +180,7 @@ namespace AmongUsRevamped private static PassiveButton template; private static PassiveButton discordButton; private static PassiveButton gitHubButton; + private static PassiveButton animationSceneButton; private static Transform buttonParent; public static void Postfix(MainMenuManager __instance) { @@ -212,6 +213,18 @@ namespace AmongUsRevamped "GitHub"); } + if (animationSceneButton == null) + { + animationSceneButton = CreateButton( + __instance, + "AnimationTestSceneButton", + new(0f, 2.65f, 1f), + new(139, 0, 0, byte.MaxValue), + new(255, 127, 127, byte.MaxValue), + () => SceneChanger.ChangeScene("AnimationTestScene"), + "Animation Tester"); + } + var bg = GameObject.Find("BackgroundTexture"); if (bg != null) { @@ -230,6 +243,12 @@ namespace AmongUsRevamped div.SetActive(false); } + var logo = GameObject.Find("MainUI/AspectScaler/LeftPanel/Sizer/LOGO-AU"); + if (logo != null) + { + logo.SetActive(false); + } + Transform tintTrans = __instance.transform.Find("MainUI/Tint"); var tint = tintTrans.gameObject; @@ -290,7 +309,14 @@ namespace AmongUsRevamped button.name = name; button.transform.localPosition = localPosition; - button.transform.localScale = new Vector3(0.8f, 1f, 1f); + if (name == "GitHubButton" || name == "DiscordButton") + { + button.transform.localScale = new Vector3(0.8f, 1f, 1f); + } + else + { + button.transform.localScale = new Vector3(1.8f, 1.6f, 1f); + } var aspect = button.GetComponent(); if (aspect != null) diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 9fd2eca..54da53b 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -10,7 +10,6 @@ namespace AmongUsRevamped; internal static class CoShowIntroPatch { public static bool IntroInitiated; - public static bool ScheduleExile; public static void Postfix(IntroCutscene __instance) { Logger.Info(" Intro initiated", "CoShowIntro"); @@ -32,12 +31,6 @@ internal static class CoShowIntroPatch Logger.Info($" {p.Data.PlayerName} -> {p.Data.RoleType}", "RoleInfo"); } - - if (ScheduleExile) - { - PlayerControl.LocalPlayer.Exiled(); - ScheduleExile = false; - } Logger.Info($" {AbilityManagement.RoleList()}", "AbilityInfo"); @@ -57,7 +50,7 @@ internal static class CoShowIntroPatch PlayerControl.LocalPlayer.CmdReportDeadBody(null); if (MeetingHud.Instance != null) MeetingHud.Instance.RpcClose(); - }, 9f, "SetChatVisible"); + }, 9.5f, "SetChatVisible"); } } } diff --git a/Patches/OnGameStartedPatch.cs b/Patches/OnGameStartedPatch.cs index cb1ee52..a8c17a7 100644 --- a/Patches/OnGameStartedPatch.cs +++ b/Patches/OnGameStartedPatch.cs @@ -13,8 +13,9 @@ internal class CoStartGamePatch if (!AmongUsClient.Instance.AmHost) return; Logger.Info(" -------- GAME STARTED --------", "StartGame"); - Logger.Info($" Gamemode: {Options.Gamemode.GetValue()}", "StartGame"); + Logger.Info($" Gamemode: {Options.Gamemode.GetString()}", "StartGame"); Logger.Info($" Players: {PlayerControl.AllPlayerControls.Count}", "StartGame"); + Logger.Info($" Map: {(MapNames)GameOptionsManager.Instance.CurrentGameOptions.MapId}", "StartGame"); NormalGameEndChecker.imps.Clear(); NormalGameEndChecker.LastWinReason = ""; @@ -42,7 +43,7 @@ class PlayerControlSetRolePatch if (Main.GM.Value && __instance == PlayerControl.LocalPlayer) { roleType = RoleTypes.Crewmate; - CoShowIntroPatch.ScheduleExile = true; + OnGameStartPatch.ScheduleExile = true; } if (Utils.isHideNSeek && Seekers.Count() == 0) @@ -107,4 +108,18 @@ class PlayerControlSetRolePatch return true; } +} + +[HarmonyPatch(typeof(HudManager), nameof(HudManager.OnGameStart))] +internal static class OnGameStartPatch +{ + public static bool ScheduleExile; + public static void Postfix() + { + if (ScheduleExile) + { + PlayerControl.LocalPlayer.Exiled(); + ScheduleExile = false; + } + } } \ No newline at end of file diff --git a/README.md b/README.md index 375b200..da2f723 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ **** ‎ -# 🎮 Features (v1.8.0): +# 🎮 Features (v1.8.1): ## 🌟 Custom Abilities: - Mayor (Crewmate) - The Mayor has a configurable amount of extra votes @@ -99,6 +99,7 @@ - See player kill/task count and Role when dead - Higher and more accurate Option ranges - Always visible lobby timer +- Access experimental animation test scene - 🎉 And this all works in public lobbies! ### Hotkeys diff --git a/Resources/Language/English.json b/Resources/Language/English.json index 441a650..c6a96fb 100644 --- a/Resources/Language/English.json +++ b/Resources/Language/English.json @@ -10,7 +10,7 @@ "disableInfoWhenDead": "Hide Info When Dead", "disableCommandHelper": "Disable Command Helper", - "gameMasterWarning":"You will now spectate games until Game Master is turned off. WARNING: Ability messages will not be sent if this setting is enabled.", + "gameMasterWarning":"You will now spectate games until Game Master is turned off. WARNING: Ability messages will not be sent and role assigning might be inaccurate if this setting is enabled.", "cancelStartCountdown": "Start countdown canceled", @@ -19,7 +19,7 @@ "kickLowLevelPlayer": "Kick Players Under Level", "tempBanLowLevelPlayer": "Ban Instead Of Kick", "dontKickLevelOnes": "Don't Kick Lv.1 Players For Glitched Lobbies", - "kickInvalidFriendCodes": "Kick Invalid FriendCodes", + "kickInvalidFriendCodes": "Kick Invalid (Empty) Friendcodes", "tempBanInvalidFriendCodes": "Ban Instead Of Kick", "deniedWordsToKick": "Sent Denied Words To Kick Player", "applyBanList": "Apply BanList",