From e3d8c23482bd08471cc358a3d5854ad8cec1ccf2 Mon Sep 17 00:00:00 2001 From: Ape <155788660+ApeMV@users.noreply.github.com> Date: Thu, 29 Oct 2026 19:01:00 +0100 Subject: [PATCH] Diacritics, lobby info, bugfixes --- AmongUsRevamped.cs | 4 +- AmongUsRevamped.csproj | 2 +- Modules/BanManager.cs | 9 ++-- Modules/FixedUpdate.cs | 16 ++++-- Modules/Hotkeys.cs | 9 ++++ Modules/Rehost.cs | 2 +- Modules/Utils.cs | 61 +++++++++++++++++++++++ Patches/ChatPatches.cs | 16 ++++++ Patches/ClientOptionsPatch.cs | 4 ++ Patches/JoinAndLeavePatches.cs | 18 +++++++ Patches/LobbyViewSettingsPatch.cs | 24 --------- README.md | 3 +- Resources/Language/English.json | 3 +- Resources/Language/Italian.json | 3 +- Resources/Language/Japanese.json | 3 +- Resources/Language/Russian.json | 3 +- Resources/Language/SimplifiedChinese.json | 6 +-- Resources/Language/Spanish.json | 7 +-- 18 files changed, 146 insertions(+), 47 deletions(-) diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index 14b2a7e..e4d0e2d 100644 --- a/AmongUsRevamped.cs +++ b/AmongUsRevamped.cs @@ -38,6 +38,7 @@ public partial class Main : BasePlugin public static ConfigEntry DisableCommandHelper { get; private set; } public static ConfigEntry DisableCompatibilityWarning { get; private set; } public static ConfigEntry DisableChatModifier { get; private set; } + public static ConfigEntry DisableLobbyInfo { get; private set; } public static NormalGameOptionsV12 NormalOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentNormalGameOptions : null; public static HideNSeekGameOptionsV12 HideNSeekOptions => GameOptionsManager.Instance != null ? GameOptionsManager.Instance.currentHideNSeekGameOptions : null; @@ -45,7 +46,7 @@ public partial class Main : BasePlugin public static bool HasArgumentException; public static string CredentialsText; - public const string ModVersion = "v2.2.2"; + public const string ModVersion = "v2.2.3"; public static float GameTimer; public static float AfkTimer; @@ -98,6 +99,7 @@ public partial class Main : BasePlugin DisableCommandHelper = Config.Bind("Client Options", "Disable Command Helper", false); DisableCompatibilityWarning = Config.Bind("Client Options", "Disable Compatibility Warning", false); DisableChatModifier = Config.Bind("Client Options", "Disable Chat Modifications", false); + DisableLobbyInfo = Config.Bind("Client Options", "Disable Lobby Info", false); Translator.Init(); Translator.Reload(); diff --git a/AmongUsRevamped.csproj b/AmongUsRevamped.csproj index cf4ee1c..36feddd 100644 --- a/AmongUsRevamped.csproj +++ b/AmongUsRevamped.csproj @@ -19,7 +19,7 @@ - + diff --git a/Modules/BanManager.cs b/Modules/BanManager.cs index 748e8ed..3f5007c 100644 --- a/Modules/BanManager.cs +++ b/Modules/BanManager.cs @@ -162,12 +162,13 @@ public static class BanManager public static bool IsWordBanned(PlayerControl player, string input) { + if (input == "" || !AmongUsClient.Instance.AmHost || Utils.CheckAccessLevel(player.Data.FriendCode) > 0 || !Options.EnableDeniedWords.GetBool()) return false; int clientId = player.Data.ClientId; - var bannedWords = File.ReadAllLines(BanWordPath).Where(x => !x.StartsWith("#")); + var bannedWords = File.ReadAllLines(BanWordPath).Select(l => l.Trim()).Where(l => l.Length > 0 && !l.StartsWith("#")); - if ((Options.DeniedWordsStrength.GetBool() && bannedWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => input.Contains(code, StringComparison.OrdinalIgnoreCase))) || (!Options.DeniedWordsStrength.GetBool() && bannedWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => input.Equals(code, StringComparison.OrdinalIgnoreCase)))) + if ((Options.DeniedWordsStrength.GetBool() && bannedWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => Utils.RemoveDiacritics(input).Trim().Contains(code, StringComparison.OrdinalIgnoreCase))) || (!Options.DeniedWordsStrength.GetBool() && bannedWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => Utils.RemoveDiacritics(input).Trim().Equals(code, StringComparison.OrdinalIgnoreCase)))) { if (!Main.SayDeniedWordTimes.ContainsKey(clientId)) @@ -201,9 +202,9 @@ public static class BanManager if (input == "" || !AmongUsClient.Instance.AmHost || Utils.CheckAccessLevel(player.Data.FriendCode) > 0 || !Options.AutoKickStart.GetBool() || !Utils.IsLobby) return false; int clientId = player.Data.ClientId; - var startWords = File.ReadAllLines(StartWordsPath).Where(x => !x.StartsWith("#")); + var startWords = File.ReadAllLines(StartWordsPath).Select(l => l.Trim()).Where(l => l.Length > 0 && !l.StartsWith("#")); - if ((Options.AutoKickStartStrength.GetBool() && startWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => input.Contains(code, StringComparison.OrdinalIgnoreCase))) || (!Options.AutoKickStartStrength.GetBool() && startWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => input.Equals(code, StringComparison.OrdinalIgnoreCase)))) + if ((Options.AutoKickStartStrength.GetBool() && startWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => Utils.RemoveDiacritics(input).Trim().Contains(code, StringComparison.OrdinalIgnoreCase))) || (!Options.AutoKickStartStrength.GetBool() && startWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => Utils.RemoveDiacritics(input).Trim().Equals(code, StringComparison.OrdinalIgnoreCase)))) { if (!Main.SayStartTimes.ContainsKey(clientId)) { diff --git a/Modules/FixedUpdate.cs b/Modules/FixedUpdate.cs index ffa989a..cfa1a27 100644 --- a/Modules/FixedUpdate.cs +++ b/Modules/FixedUpdate.cs @@ -168,12 +168,11 @@ class FixedUpdateInGamePatch public static void Postfix(PlayerControl __instance) { - if (__instance == null || __instance.PlayerId == 255 || !AmongUsClient.Instance.AmHost) return; + if (__instance == null || __instance.PlayerId == 255) return; t += Time.deltaTime; if (t < 0.2f) return; t = 0f; - if (Utils.IsLobby) { int access = Utils.CheckAccessLevel(__instance.Data.FriendCode); @@ -185,13 +184,22 @@ class FixedUpdateInGamePatch _ => "white" }; - if (!LastColors.TryGetValue(__instance.PlayerId, out var lastColor) || lastColor != color || !__instance.cosmetics.nameText.text.Contains($"")) + //if (!LastColors.TryGetValue(__instance.PlayerId, out var lastColor) || lastColor != color || !__instance.cosmetics.nameText.text.Contains($"")) { - __instance.cosmetics.nameText.text = $"{__instance.Data.PlayerName}"; + if (Main.DisableLobbyInfo.Value && __instance.cosmetics.nameText.text != $"{__instance.Data.PlayerName}") + { + __instance.cosmetics.nameText.text = $"{__instance.Data.PlayerName}"; + } + if ( !Main.DisableLobbyInfo.Value && __instance.cosmetics.nameText.text != $"Lv.{__instance.Data.PlayerLevel} | {AmongUsClient.Instance.GetClientFromCharacter(__instance).PlatformData.Platform}\n{__instance.Data.PlayerName}") + { + __instance.cosmetics.nameText.text = $"Lv.{__instance.Data.PlayerLevel} | {AmongUsClient.Instance.GetClientFromCharacter(__instance).PlatformData.Platform}\n{__instance.Data.PlayerName}"; + } LastColors[__instance.PlayerId] = color; } } + if (!AmongUsClient.Instance.AmHost) return; + if (settingsLabel == null) settingsLabel = GameObject.Find("GameSettingsLabel"); int gamemode = Options.Gamemode.GetValue(); diff --git a/Modules/Hotkeys.cs b/Modules/Hotkeys.cs index 4a72f36..a0bb196 100644 --- a/Modules/Hotkeys.cs +++ b/Modules/Hotkeys.cs @@ -1,4 +1,5 @@ using AmongUs.Data; +using AmongUs.GameOptions; using Hazel; using InnerNet; using UnityEngine; @@ -37,6 +38,14 @@ internal class Hotkeys if (Utils.IsMeeting) { MeetingHud.Instance.RpcClose(); + + foreach (PlayerControl p in PlayerControl.AllPlayerControls) + { + if (p.Data.RoleType == RoleTypes.Shapeshifter) + { + p.CmdCheckRevertShapeshift(false); + } + } } } diff --git a/Modules/Rehost.cs b/Modules/Rehost.cs index cd16b7e..3d72fc9 100644 --- a/Modules/Rehost.cs +++ b/Modules/Rehost.cs @@ -19,7 +19,7 @@ namespace AmongUsRevamped EOSManager.Instance.AdultPermissionsFlow(); } - if (!Options.Rehost.GetBool() || reason == DisconnectReasons.NewConnection || reason == DisconnectReasons.ConnectionLimit || reason == DisconnectReasons.ExitGame) return; + if (!Options.Rehost.GetBool() || reason == DisconnectReasons.NewConnection || reason == DisconnectReasons.ConnectionLimit || reason == DisconnectReasons.ExitGame || reason == DisconnectReasons.GameFull || reason == DisconnectReasons.GameStarted) return; _ = new LateTask(() => { diff --git a/Modules/Utils.cs b/Modules/Utils.cs index a6386d2..caad357 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -852,4 +852,65 @@ public static class Utils } return true; } + + // Thanks to g0aty + public static string RemoveDiacritics(string text) + { + Dictionary diacritics = new Dictionary(){ {"ª","a"},{"à","a"},{"á","a"},{"â","a"},{"ã","a"},{"ä","a"},{"å","a"},{"ā","a"},{"ă","a"},{"ǎ","a"},{"ɑ","a"},{"α","a"},{"а","a"},{"д","a"},{"ạ","a"},{"ả","a"},{"ấ","a"},{"ầ","a"},{"ẩ","a"},{"ẫ","a"},{"ậ","a"},{"ắ","a"},{"ằ","a"},{"ẳ","a"},{"ẵ","a"},{"ặ","a"},{"⒜","a"},{"ⓐ","a"},{"a","a"},{"À","A"},{"Á","A"},{"Â","A"},{"Ã","A"},{"Ä","A"},{"Å","A"},{"Ā","A"},{"Ă","A"},{"Ǎ","A"},{"Α","A"},{"Δ","A"},{"Λ","A"},{"λ","A"},{"А","A"},{"Д","A"},{"Ạ","A"},{"Ả","A"},{"Ấ","A"},{"Ầ","A"},{"Ẩ","A"},{"Ẫ","A"},{"Ậ","A"},{"Ắ","A"},{"Ằ","A"},{"Ẳ","A"},{"Ẵ","A"},{"Ặ","A"},{"Å","A"},{"∆","A"},{"∧","A"},{"⊿","A"},{"⌆","A"},{"⏃","A"},{"⏄","A"},{"⏅","A"},{"Ⓐ","A"},{"▲","A"},{"△","A"},{"★","A"},{"☆","A"},{"⼈","A"},{"⼊","A"},{"⽕","A"},{"ㅅ","A"},{"A","A"},{"♲","A"},{"♳","A"},{"♴","A"},{"♵","A"},{"♶","A"},{"♷","A"},{"♸","A"},{"♹","A"},{"♺","A"},{"♻","A"},{"⚠","A"},{"︽","A"},{"︿","A"},{"♠","A"},{"♣","A"},{"♤","A"},{"♧","A"}, + {"æ","ae"},{"Æ","AE"}, + {"Ъ","b"},{"Ь","b"},{"ъ","b"},{"ь","b"},{"⒝","b"},{"ⓑ","b"},{"♭","b"},{"ß","B"},{"Б","B"},{"В","B"},{"в","B"},{"Ⓑ","B"}, + {"Ы","bl"},{"ы","bi"}, + {"¢","c"},{"©","c"},{"ç","c"},{"с","c"},{"ς","c"},{"⊂","c"},{"⊄","c"},{"⊆","c"},{"⊊","c"},{"⒞","c"},{"ⓒ","c"},{"ㄷ","c"},{"c","c"},{"ᄃ","c"},{"¢","c"},{"㈂","c"},{"㉢","c"},{"ㄸ","cc"},{"ᄄ","cc"},{"Ç","C"},{"С","C"},{"℃","C"},{"Ⓒ","C"},{"⼕","C"},{"⼖","C"},{"⿷","C"},{"【","C"},{"〖","C"},{"ㄈ","C"},{"C","C"}, + {"đ","d"},{"ð","d"},{"δ","d"},{"₫","d"},{"∂","d"},{"⒟","d"},{"ⓓ","d"},{"ㆳ","d"},{"d","d"},{"♩","d"},{"♪","d"},{"Ð","D"},{"Đ","D"},{"Ⓓ","D"},{"D","D"}, + {"è","e"},{"é","e"},{"ê","e"},{"ë","e"},{"ē","e"},{"ě","e"},{"ε","e"},{"е","e"},{"ё","e"},{"ẹ","e"},{"ẻ","e"},{"ẽ","e"},{"ế","e"},{"ề","e"},{"ể","e"},{"ễ","e"},{"ệ","e"},{"℮","e"},{"⒠","e"},{"ⓔ","e"},{"⺋","e"},{"⺒","e"},{"e","e"},{"£","E"},{"È","E"},{"É","E"},{"Ê","E"},{"Ë","E"},{"Ē","E"},{"Ě","E"},{"Ε","E"},{"Ξ","E"},{"Σ","E"},{"ξ","E"},{"Ё","E"},{"Е","E"},{"Ẹ","E"},{"Ẻ","E"},{"Ẽ","E"},{"Ế","E"},{"Ề","E"},{"Ể","E"},{"Ễ","E"},{"Ệ","E"},{"€","E"},{"∈","E"},{"∉","E"},{"∊","E"},{"∑","E"},{"Ⓔ","E"},{"モ","E"},{"ㅌ","E"},{"ㆯ","E"},{"㈋","E"},{"㉫","E"},{"E","E"},{"ミ","E"}, + {"ƒ","f"},{"⒡","f"},{"ⓕ","f"},{"f","f"},{"℉","F"},{"Ⓕ","F"},{"F","F"}, + {"ff","ff"},{"fi","fi"},{"fl","fl"},{"ffi","ffi"},{"ffl","ffl"}, + {"ɡ","g"},{"ℊ","g"},{"⒢","g"},{"ⓖ","g"},{"g","g"},{"Ⓖ","G"},{"⼛","G"},{"G","G"}, + {"ℏ","h"},{"⒣","h"},{"ⓗ","h"},{"ん","h"},{"Η","H"},{"Н","H"},{"н","H"},{"Ⓗ","H"},{"⧺","H"},{"⧻","HH"}, + {"¦","i"},{"¡","i"},{"ì","i"},{"í","i"},{"î","i"},{"ï","i"},{"ĩ","i"},{"ī","i"},{"ι","i"},{"ⅰ","i"},{"↑","i"},{"↕","i"},{"⇧","i"},{"Ⓘ","i"},{"┆","i"},{"┇","i"},{"┊","i"},{"┋","i"},{"╎","i"},{"╏","i"},{"⬆","i"},{"⬇","i"},{"〡","i"},{"㆐","i"},{"㇑","i"},{"︴","i"},{"i","i"},{"¦","i"},{"Ì","I"},{"Í","I"},{"Î","I"},{"Ï","I"},{"Ĩ","I"},{"Ī","I"},{"Ι","I"},{"Ⅰ","I"},{"↓","I"},{"⇩","I"},{"∣","I"},{"⒤","I"},{"ⓘ","I"},{"⼁","I"},{"ㅣ","I"},{"︱","I"},{"︳","I"},{"ᅵ","I"},{"I","I"}, + {"Ⅳ","iv"},{"ⅳ","iv"},{"Ⅵ","vi"},{"ⅵ","vi"},{"Ⅶ","vii"},{"ⅶ","vii"},{"Ⅷ","viii"},{"ⅷ","viii"},{"ⅱ","ii"},{"〢","ii"},{"‼","ii"},{"Ⅱ","II"},{"‖","II"},{"ⅲ","iii"},{"〣","iii"},{"Ⅲ","III"},{"Ю","io"},{"ю","io"}, + {"⒥","j"},{"ⓙ","j"},{"j","j"},{"Ⓙ","J"},{"㆜","J"},{"J","J"}, + {"⒦","k"},{"ⓚ","k"},{"k","k"},{"Κ","K"},{"κ","K"},{"К","K"},{"к","K"},{"Ⓚ","K"},{"K","K"},{"㉿","K"}, + {"⒧","l"},{"ⓛ","l"},{"l","l"},{"│","l"},{"┃","l"},{"▎","l"},{"▏","l"},{"⎱","l"},{"Ⓛ","L"},{"L","L"},{"⎿","L"},{"ㆹ","L"},{"㇄","L"},{"㇏","L"},{"㇗","L"},{"㇙","L"},{"㇜","L"},{"㇟","L"},{"└","L"},{"┕","L"},{"┖","L"},{"┗","L"},{"⻌","L"},{"⻍","L"},{"⻎","L"},{"⿺","L"},{"し","L"},{"じ","L"},{"║","ll"}, + {"ḿ","m"},{"ⓜ","m"},{"m","m"},{"М","M"},{"м","M"},{"Ḿ","M"},{"Ⓜ","M"},{"𝖬","M"},{"M","M"}, + {"ñ","n"},{"ń","n"},{"ň","n"},{"ǹ","n"},{"η","n"},{"Л","n"},{"П","n"},{"л","n"},{"п","n"},{"ⓝ","n"},{"n","n"},{"⺆","n"},{"⺇","n"},{"⼌","n"},{"⼍","n"},{"⼑","n"},{"⾨","n"},{"⾾","n"},{"⿵","n"},{"れ","n"},{"ㄇ","n"},{"︵","n"},{"︷","n"},{"︹","n"},{"︻","n"},{"﹇","n"},{"Ñ","N"},{"Ń","N"},{"Ň","N"},{"Ǹ","N"},{"Ν","N"},{"И","N"},{"Й","N"},{"и","N"},{"й","N"},{"Ⓝ","N"},{"𝖭","N"},{"N","N"},{"ℵ","N"}, + {"№","No"}, + {"¤","o"},{"ò","o"},{"ó","o"},{"ô","o"},{"õ","o"},{"ö","o"},{"ø","o"},{"ō","o"},{"ŏ","o"},{"ơ","o"},{"ǒ","o"},{"ο","o"},{"σ","o"},{"φ","o"},{"о","o"},{"ọ","o"},{"ỏ","o"},{"ố","o"},{"ồ","o"},{"ổ","o"},{"ỗ","o"},{"ộ","o"},{"ớ","o"},{"ờ","o"},{"ở","o"},{"ỡ","o"},{"ợ","o"},{"∅","o"},{"⊕","o"},{"⊖","o"},{"⊗","o"},{"⊘","o"},{"⊙","o"},{"⏀","o"},{"⏁","o"},{"⏂","o"},{"⒪","o"},{"■","o"},{"□","o"},{"▢","o"},{"▣","o"},{"▤","o"},{"▥","o"},{"▦","o"},{"▧","o"},{"▨","o"},{"▩","o"},{"▪","o"},{"▫","o"},{"◆","o"},{"◇","o"},{"◈","o"},{"◉","o"},{"◊","o"},{"○","o"},{"◌","o"},{"◍","o"},{"◎","o"},{"●","o"},{"◐","o"},{"◑","o"},{"◒","o"},{"◓","o"},{"◦","o"},{"◯","o"},{"☉","o"},{"☯","o"},{"♡","o"},{"♢","o"},{"♥","o"},{"♦","o"},{"✿","o"},{"❀","o"},{"⦿","o"},{"㆕","o"},{"ㅁ","o"},{"ㅇ","o"},{"㇣","o"},{"ㇿ","o"},{"㈄","o"},{"㈇","o"},{"㉤","o"},{"㉧","o"},{"㋺","o"},{"o","o"},{"ᄋ","o"},{"○","o"},{"〼","o"},{"Ò","O"},{"Ó","O"},{"Ô","O"},{"Õ","O"},{"Ö","O"},{"Ø","O"},{"Ō","O"},{"Ŏ","O"},{"Ơ","O"},{"Ǒ","O"},{"Θ","O"},{"Ο","O"},{"Φ","O"},{"Ω","O"},{"θ","O"},{"О","O"},{"Ф","O"},{"ф","O"},{"Ọ","O"},{"Ỏ","O"},{"Ố","O"},{"Ồ","O"},{"Ổ","O"},{"Ỗ","O"},{"Ộ","O"},{"Ớ","O"},{"Ờ","O"},{"Ở","O"},{"Ỡ","O"},{"Ợ","O"},{"Ω","O"},{"Ⓞ","O"},{"▇","O"},{"█","O"},{"▉","O"},{"▊","O"},{"▋","O"},{"▱","O"},{"♼","O"},{"♽","O"},{"⚽","O"},{"⚾","O"},{"⼝","O"},{"⼞","O"},{"⿴","O"},{"〇","O"},{"〄","O"},{"O","O"},{"⓪","0"},{"⓿","0"},{"0","0"},{"ㄖ","0"}, + {"œ","oe"},{"Œ","OE"}, + {"ⓟ","p"},{"p","p"},{"þ","p"},{"Þ","p"},{"ρ","p"},{"р","p"},{"Ⓟ","P"},{"𝖯","P"},{"P","P"},{"Ρ","P"},{"Р","P"},{"⼙","P"},{"⼫","P"},{"ㄕ","P"},{"ㄗ","P"},{"ㆡ","P"}, + {"ⓠ","q"},{"q","q"},{"Ⓠ","Q"},{"𝖰","Q"},{"Q","Q"}, + {"ⓡ","r"},{"r","r"},{"Γ","r"},{"⎾","r"},{"┌","r"},{"┍","r"},{"┎","r"},{"┏","r"},{"╒","r"},{"╓","r"},{"╔","r"},{"╭","r"},{"⺁","r"},{"⼚","r"},{"⼴","r"},{"⽧","r"},{"⿸","r"},{"「","r"},{"『","r"},{"ㄏ","r"},{"ㄬ","r"},{"ㆷ","r"},{"Ⓡ","R"},{"𝖱","R"},{"R","R"},{"­","R"},{"®","R"},{"Я","R"},{"я","R"}, + {"ⓢ","s"},{"s","s"},{"$","S"},{"Ⓢ","S"},{"𝖲","S"},{"S","S"},{"⎰","S"},{"∫","S"},{"∮","S"},{"∾","S"},{"ㄎ","S"},{"ㆶ","S"},{"$","S"}, + {"∬","ss"},{"∭","sss"}, + {"ⓣ","t"},{"t","t"},{"⺊","t"},{"⼔","t"},{"⼗","t"},{"⼘","t"},{"〸","t"},{"ㆺ","t"},{"ㇶ","t"},{"㈦","t"},{"㈩","t"},{"Ⓣ","T"},{"𝖳","T"},{"T","T"},{"Τ","T"},{"τ","T"},{"Т","T"},{"т","T"},{"⏇","T"},{"⏉","T"},{"┬","T"},{"┭","T"},{"┮","T"},{"┯","T"},{"┰","T"},{"┱","T"},{"┲","T"},{"┳","T"},{"╤","T"},{"╥","T"},{"╦","T"},{"⺅","T"},{"ィ","T"},{"イ","T"},{"ㄒ","T"},{"ᅮ","T"}, + {"〹","tt"}, + {"µ","u"},{"ũ","u"},{"ū","u"},{"ŭ","u"},{"ư","u"},{"ǔ","u"},{"ǖ","u"},{"ǘ","u"},{"ǚ","u"},{"ǜ","u"},{"ц","u"},{"ụ","u"},{"ủ","u"},{"ứ","u"},{"ừ","u"},{"ú","u"},{"ử","u"},{"ữ","u"},{"ự","u"},{"⒰","u"},{"ⓤ","u"},{"㇃","u"},{"u","u"},{"︶","u"},{"︸","u"},{"︺","u"},{"︼","u"},{"﹈","u"},{"υ","u"},{"Ũ","U"},{"Ū","U"},{"Ŭ","U"},{"Ư","U"},{"Ǔ","U"},{"Ǖ","U"},{"Ǘ","U"},{"Ǚ","U"},{"Ǜ","U"},{"Ц","U"},{"Ụ","U"},{"Ủ","U"},{"Ú","U"},{"Ứ","U"},{"Ừ","U"},{"Ử","U"},{"Ữ","U"},{"Ự","U"},{"∪","U"},{"℧","U"},{"Ⓤ","U"},{"⿶","U"},{"ひ","U"},{"び","U"},{"ぴ","U"},{"U","U"}, + {"˅","v"},{"ⅴ","v"},{"∨","v"},{"⒱","v"},{"ⓥ","v"},{"▼","v"},{"▽","v"},{"✓","v"},{"㇢","v"},{"︾","v"},{"﹀","v"},{"v","v"},{"Ⅴ","V"},{"∀","V"},{"Ⓥ","V"},{"V","V"}, + {"ⓦ","w"},{"w","w"},{"ω","w"},{"ш","w"},{"щ","w"},{"Ⓦ","W"},{"𝖶","W"},{"W","W"},{"Ш","W"},{"Щ","W"},{"₩","W"},{"₩","W"}, + {"ⓧ","x"},{"x","x"},{"χ","x"},{"х","x"},{"ⅹ","x"},{"〆","x"},{"〤","x"},{"×","x"},{"Ⓧ","X"},{"𝖷","X"},{"X","X"},{"Χ","X"},{"Х","X"},{"Ⅹ","X"},{"╳","X"},{"ㄨ","X"},{"ㆫ","X"}, + {"⽹","XX"},{"〷","XX"},{"ⓨ","y"},{"y","y"},{"ý","y"},{"ÿ","y"},{"У","y"},{"у","y"},{"ỳ","y"},{"ỵ","y"},{"ỷ","y"},{"ỹ","y"},{"Ⓨ","Y"},{"𝖸","Y"},{"Y","Y"},{"¥","Y"},{"¥","Y"},{"Ý","Y"},{"Υ","Y"},{"Ỳ","Y"},{"Ỵ","Y"},{"Ỷ","Y"},{"Ỹ","Y"},{"ㄚ","Y"},{"ㆩ","Y"}, + {"ⓩ","z"},{"z","z"},{"Ⓩ","Z"},{"𝖹","Z"},{"Z","Z"},{"Ζ","Z"},{"ζ","Z"},{"⼄","Z"},{"㆚","Z"},{"㇠","Z"}, + {"①","1"},{"⑴","1"},{"⒈","1"},{"⓵","1"},{"❶","1"},{"➀","1"},{"➊","1"},{"1","1"}, + {"②","2"},{"⑵","2"},{"⒉","2"},{"⓶","2"},{"❷","2"},{"➁","2"},{"➋","2"},{"2","2"}, + {"³","3"},{"З","3"},{"Э","3"},{"з","3"},{"э","3"},{"∃","3"},{"∋","3"},{"③","3"},{"⑶","3"},{"⒊","3"},{"⓷","3"},{"❸","3"},{"➂","3"},{"➌","3"},{"⺕","3"},{"⼹","3"},{"る","3"},{"ろ","3"},{"ョ","3"},{"ヨ","3"},{"ヺ","3"},{"ㄋ","3"},{"㇋","3"},{"㇌","3"},{"㇡","3"},{"3","3"}, + {"④","4"},{"⑷","4"},{"⒋","4"},{"⓸","4"},{"❹","4"},{"➃","4"},{"➍","4"},{"4","4"}, + {"⑤","5"},{"⑸","5"},{"⒌","5"},{"⓹","5"},{"❺","5"},{"➄","5"},{"➎","5"},{"5","5"}, + {"⑥","6"},{"⑹","6"},{"⒍","6"},{"⓺","6"},{"❻","6"},{"➅","6"},{"➏","6"},{"6","6"}, + {"⑦","7"},{"⑺","7"},{"⒎","7"},{"⓻","7"},{"❼","7"},{"➆","7"},{"➐","7"},{"7","7"}, + {"⑧","8"},{"⑻","8"},{"⒏","8"},{"⓼","8"},{"❽","8"},{"➇","8"},{"➑","8"},{"8","8"}, + {"⑨","9"},{"⑼","9"},{"⒐","9"},{"⓽","9"},{"❾","9"},{"➈","9"},{"➒","9"},{"9","9"}, + {"@","@"},{"﹫","@"},{"^","^"},{"⌅","^"},{"㆟","^"}, + {"℀","ac"},{"℅","co"},{"℡","TEL"},{"™","TM"},{"℻","FAX"},{"ⅸ","ix"},{"Ⅸ","IX"},{"ⅺ","xi"},{"Ⅺ","XI"},{"ⅻ","xii"},{"Ⅻ","XII"},{"㉐","PTE"},{"㋌","Hg"},{"㋍","erg"},{"㋎","eV"},{"㋏","LTD"},{"㍱","hPa"},{"㍲","da"},{"㍳","AU"},{"㍴","bar"},{"㍵","oV"},{"㍶","pc"},{"㍷","dm"},{"㍸","dm2"},{"㍹","dm3"},{"㍺","IU"},{"㎀","pA"},{"㎁","nA"},{"㎂","uA"},{"㎃","mA"},{"㎄","kA"},{"㎅","KB"},{"㎆","MB"},{"㎇","GB"},{"㎈","cal"},{"㎉","kcal"},{"㎊","pF"},{"㎋","nF"},{"㎌","uF"},{"㎍","ug"},{"㎎","mg"},{"㎏","kg"},{"㎐","Hz"},{"㎑","kHz"},{"㎒","MHz"},{"㎓","GHz"},{"㎔","Thz"},{"㎕","ul"},{"㎖","ml"},{"㎗","dl"},{"㎘","kl"},{"㎙","fm"},{"㎚","nm"},{"㎛","um"},{"㎜","mm"},{"㎝","cm"},{"㎞","km"},{"㎟","mm2"},{"㎠","cm2"},{"㎡","m2"},{"㎢","km2"},{"㎣","mm3"},{"㎤","cm3"},{"㎥","m3"},{"㎦","km3"},{"㎧","ms"},{"㎨","ms2"},{"㎩","Pa"},{"㎪","kPa"},{"㎫","MPa"},{"㎬","GPa"},{"㎭","rad"},{"㎮","rads"},{"㎯","rads2"},{"㎰","ps"},{"㎱","ns"},{"㎲","us"},{"㎳","ms"},{"㎴","pV"},{"㎵","nV"},{"㎶","uV"},{"㎷","mV"},{"㎸","kW"},{"㎹","MV"},{"㎺","pW"},{"㎻","nW"},{"㎼","uW"},{"㎽","mW"},{"㎾","kW"},{"㎿","MW"},{"㏀","kO"},{"㏁","MO"},{"㏂","am"},{"㏃","Bq"},{"㏄","cc"},{"㏅","cd"},{"㏆","Ckg"},{"㏇","Co"},{"㏈","dB"},{"㏉","Gy"},{"㏊","ha"},{"㏋","HP"},{"㏌","in"},{"㏍","KK"},{"㏎","KM"},{"㏏","kt"},{"㏐","lm"},{"㏑","ln"},{"㏒","log"},{"㏓","lx"},{"㏔","mb"},{"㏕","mil"},{"㏖","mol"},{"㏗","pH"},{"㏘","pm"},{"㏙","PPM"},{"㏚","PR"},{"㏛","sr"},{"㏜","Sv"},{"㏝","Wb"},{"㏞","Vm"},{"㏟","Am"},{"㏿","gal"}, + {"⑩","10"},{"⑽","10"},{"⒑","10"},{"⓾","10"},{"❿","10"},{"➉","10"},{"➓","10"},{"㉈","10"},{"⑪","11"},{"⑾","11"},{"⒒","11"},{"⓫","11"},{"⑫","12"},{"⑿","12"},{"⒓","12"},{"⓬","12"},{"⑬","13"},{"⒀","13"},{"⒔","13"},{"⓭","13"},{"⑭","14"},{"⒁","14"},{"⒕","14"},{"⓮","14"},{"⑮","15"},{"⒂","15"},{"⒖","15"},{"⓯","15"},{"⑯","16"},{"⒃","16"},{"⒗","16"},{"⓰","16"},{"⑰","17"},{"⒄","17"},{"⒘","17"},{"⓱","17"},{"⑱","18"},{"⒅","18"},{"⒙","18"},{"⓲","18"},{"⑲","19"},{"⒆","19"},{"⒚","19"},{"⓳","19"},{"⑳","20"},{"⒇","20"},{"⒛","20"},{"⓴","20"},{"㉉","20"},{"㉑","21"},{"㉒","22"},{"㉓","23"},{"㉔","24"},{"㉕","25"},{"㉖","26"},{"㉗","27"},{"㉘","28"},{"㉙","29"},{"㉚","30"},{"㉊","30"},{"㉛","31"},{"㉜","32"},{"㉝","33"},{"㉞","34"},{"㉟","35"},{"㊱","36"},{"㊲","37"},{"㊳","38"},{"㊴","39"},{"㊵","40"},{"㉋","40"},{"㊶","41"},{"㊷","42"},{"㊸","43"},{"㊹","44"},{"㊺","45"},{"㊻","46"},{"㊼","47"},{"㊽","48"},{"㊾","49"},{"㊿","50"},{"㉌","50"},{"㉍","60"},{"㉎","70"},{"㉏","80"}, + {"-"," "},{";"," "},{"."," "},{"'"," "},{"\\"," "},{"/"," "},{","," "},{"、"," "},{";"," "}, {"!"," "} }; + + var newText = text; + + foreach (var i in diacritics) + { + newText = newText.Replace(i.Key, i.Value); + } + + return newText; + } } \ No newline at end of file diff --git a/Patches/ChatPatches.cs b/Patches/ChatPatches.cs index 7251719..234c806 100644 --- a/Patches/ChatPatches.cs +++ b/Patches/ChatPatches.cs @@ -162,6 +162,14 @@ internal static class SendChatPatch if ( !Utils.InGame || !Utils.IsMeeting) return false; MeetingHud.Instance.RpcClose(); + + foreach (PlayerControl p in PlayerControl.AllPlayerControls) + { + if (p.Data.RoleType == RoleTypes.Shapeshifter) + { + p.CmdCheckRevertShapeshift(false); + } + } return false; } @@ -862,6 +870,14 @@ public static class RPCHandlerPatch { if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashEndMeetingCmd.GetValue()) return; MeetingHud.Instance.RpcClose(); + + foreach (PlayerControl p in PlayerControl.AllPlayerControls) + { + if (p.Data.RoleType == RoleTypes.Shapeshifter) + { + p.CmdCheckRevertShapeshift(false); + } + } } } diff --git a/Patches/ClientOptionsPatch.cs b/Patches/ClientOptionsPatch.cs index 0de4680..4dbc65b 100644 --- a/Patches/ClientOptionsPatch.cs +++ b/Patches/ClientOptionsPatch.cs @@ -18,6 +18,7 @@ namespace AmongUsRevamped private static ClientOptionItem DisableCommandHelper; private static ClientOptionItem DisableCompatibilityWarning; private static ClientOptionItem DisableChatModifier; + private static ClientOptionItem DisableLobbyInfo; public static void Postfix(OptionsMenuBehaviour __instance) { @@ -68,6 +69,9 @@ namespace AmongUsRevamped if (DisableChatModifier == null || DisableChatModifier.ToggleButton == null) DisableChatModifier = ClientOptionItem.Create(Translator.Get("disableChatModifier"), Main.DisableChatModifier, __instance); + + if (DisableLobbyInfo == null || DisableLobbyInfo.ToggleButton == null) + DisableLobbyInfo = ClientOptionItem.Create(Translator.Get("disableLobbyInfo"), Main.DisableLobbyInfo, __instance); } } diff --git a/Patches/JoinAndLeavePatches.cs b/Patches/JoinAndLeavePatches.cs index 65ded80..31cfa12 100644 --- a/Patches/JoinAndLeavePatches.cs +++ b/Patches/JoinAndLeavePatches.cs @@ -193,6 +193,24 @@ public static class SetLevelPatch } HandledLevelKicks.Add(__instance); } +/* + int access = Utils.CheckAccessLevel(__instance.Data.FriendCode); + string color = access switch + { + 1 => "yellow", + 2 => "purple", + 3 => "red", + _ => "white" + }; + + if (Main.DisableLobbyInfo.Value) + { + __instance.cosmetics.nameText.text = $"{__instance.Data.PlayerName}"; + } + else + { + __instance.cosmetics.nameText.text = $"Lv.{level} | {AmongUsClient.Instance.GetClientFromCharacter(__instance).PlatformData.Platform}\n{__instance.Data.PlayerName}"; + }*/ } } diff --git a/Patches/LobbyViewSettingsPatch.cs b/Patches/LobbyViewSettingsPatch.cs index ac67102..3e49b0e 100644 --- a/Patches/LobbyViewSettingsPatch.cs +++ b/Patches/LobbyViewSettingsPatch.cs @@ -9,29 +9,13 @@ namespace AmongUsRevamped public class LobbyViewPatch { private static Dictionary ViewSettingsButtons = new(); - private static float num; [HarmonyPatch(nameof(LobbyViewSettingsPane.Awake))] [HarmonyPostfix] public static void AwakePostfix(LobbyViewSettingsPane __instance) { __instance.gameModeText.DestroyTranslator(); - - var OverviewButton = __instance.taskTabButton.gameObject; - OverviewButton.transform.localScale = new Vector3(0.4f, 1f, 1f); - OverviewButton.transform.localPosition += new Vector3(-1.1f, 0f, 0f); - - var RolesButton = __instance.rolesTabButton.gameObject; - RolesButton.transform.localScale = new Vector3(0.4f, 1f, 1f); - num = 1.4f; - RolesButton.transform.localPosition = OverviewButton.transform.localPosition + Vector3.right * num * 1f; - var label = RolesButton.transform.Find("FontPlacer").GetComponentInChildren(); - label.DestroyTranslator(); - label.text = "Vanilla Roles"; - ViewSettingsButtons = new(); - num = 2.8f; - } [HarmonyPatch(nameof(LobbyViewSettingsPane.ChangeTab))] @@ -139,14 +123,6 @@ namespace AmongUsRevamped foreach (var button in ViewSettingsButtons.Values) Object.Destroy(button.gameObject); ViewSettingsButtons = new(); - var OverviewButton = __instance.taskTabButton.gameObject; - var RolesButton = __instance.rolesTabButton.gameObject; - OverviewButton.transform.localScale = new Vector3(0.4f, 1f, 1f); - RolesButton.transform.localScale = new Vector3(0.4f, 1f, 1f); - num = 1.4f; - RolesButton.transform.localPosition = OverviewButton.transform.localPosition + Vector3.right * num * 1f; - num = 2.8f; - } [HarmonyPatch(nameof(LobbyViewSettingsPane.OnEnable))] diff --git a/README.md b/README.md index 0d260b7..aef5c39 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ **** ‎ -# 🎮 Features (v2.2.2): +# 🎮 Features (v2.2.3): ## ♠️ Client Side settings: - Toggle Game Master (Spectator) @@ -46,6 +46,7 @@ - Toggle Info When Dead - Toggle Command Helper - Toggle Chat Modifications +- Toggle Lobby Info ## ⚙️ Technical settings: - Advanced AFK Detection system - Kick/Ban players under/above a certain level diff --git a/Resources/Language/English.json b/Resources/Language/English.json index 2ee60ed..6ce5a78 100644 --- a/Resources/Language/English.json +++ b/Resources/Language/English.json @@ -398,6 +398,7 @@ "snsSuicideMode": "Disable Shield System", "tabGroupNoKcd": "0 Kill Cooldown", - "disablePeacePeriod": "Disable 5s Peace Period" + "disablePeacePeriod": "Disable 5s Peace Period", + "disableLobbyInfo": "Disable Lobby Info" } diff --git a/Resources/Language/Italian.json b/Resources/Language/Italian.json index 36b7145..d8ede42 100644 --- a/Resources/Language/Italian.json +++ b/Resources/Language/Italian.json @@ -321,5 +321,6 @@ "fungleReactorDuration": "Durata Sabotaggio Reattore su Fungle", "fungleMushroomMixupDuration": "Durata Sabotaggio Mixup Fungo", "privateDesc": "Cambia la Visibilità della Lobby in Privata. ", - "publicDesc": "Cambia la Visibilità della Lobby in Pubblica. " + "publicDesc": "Cambia la Visibilità della Lobby in Pubblica. ", + "disableLobbyInfo": "Disable Lobby Info" } \ No newline at end of file diff --git a/Resources/Language/Japanese.json b/Resources/Language/Japanese.json index 71e4b1e..6468959 100644 --- a/Resources/Language/Japanese.json +++ b/Resources/Language/Japanese.json @@ -397,5 +397,6 @@ "disableChatModifier": "チャット変更を無効化", "snsSuicideMode": "シールドシステムを無効化", "tabGroupNoKcd": "キルクールダウン0秒", -"disablePeacePeriod": "5秒間の平和時間を無効化" +"disablePeacePeriod": "5秒間の平和時間を無効化", +"disableLobbyInfo": "Disable Lobby Info" } diff --git a/Resources/Language/Russian.json b/Resources/Language/Russian.json index ebadb98..f43502c 100644 --- a/Resources/Language/Russian.json +++ b/Resources/Language/Russian.json @@ -395,5 +395,6 @@ "disableChatModifier": "Выключить Модификации Чата", "snsSuicideMode": "Выключить Систему Щитов", "tabGroupNoKcd": "0 Перезарядка Убийств", - "disablePeacePeriod": "Выключить Мирный Период Первые 5 секунд" + "disablePeacePeriod": "Выключить Мирный Период Первые 5 секунд", + "disableLobbyInfo": "Disable Lobby Info" } diff --git a/Resources/Language/SimplifiedChinese.json b/Resources/Language/SimplifiedChinese.json index 8a4ff47..b6c28b5 100644 --- a/Resources/Language/SimplifiedChinese.json +++ b/Resources/Language/SimplifiedChinese.json @@ -297,8 +297,6 @@ "enableDeniedWords": "踢出发送违禁词的玩家", "slashMapAndSeekerCmd": "谁可以使用 /seeker 与 /mapvote", "snsChatInGameExtend": "游戏开始后发送游戏模式介绍", - "mapVoteDesc": "发起包含 5 张官方地图的地图投票。", - "allMapVoteDesc": "发起包含全部 6 张地图(包括 Eht Dleks)的地图投票。", "banWordBan": "{0} 因发送了 DeniedWords.txt 中的关键词,第 {1} 次违规,已被封禁。", "startWordBan": "{0} 因发送了 StartWords.txt 中的关键词,第 {1} 次违规,已被封禁。", "moderationSettings": "管理设置", @@ -335,7 +333,6 @@ "shieldFirstDeath": "护盾保护第一个死亡的玩家", "shieldFirstDeathDuration": "护盾持续时间", "snsTwoDesc": "发送 Shift and Seek 扩展说明。", -"modeVoteDesc": "在所有游戏模式之间发起投票。", "automaticModePoll": "重新加入后自动执行 /gmvote", "tabGroupCustomizeSabotages": "自定义破坏", "customizeSabotages": "启用自定义破坏", @@ -384,5 +381,6 @@ "disableChatModifier": "禁用聊天修改", "snsSuicideMode": "禁用护盾系统", "tabGroupNoKcd": "0 秒击杀冷却", -"disablePeacePeriod": "禁用 5 秒和平期" +"disablePeacePeriod": "禁用 5 秒和平期", +"disableLobbyInfo": "Disable Lobby Info" } diff --git a/Resources/Language/Spanish.json b/Resources/Language/Spanish.json index e4b5c79..d45862a 100644 --- a/Resources/Language/Spanish.json +++ b/Resources/Language/Spanish.json @@ -298,10 +298,10 @@ "pnsDisableCloseDoor": "Desactivar sabotajes de puertas de PnS", "tabGroupPNS": "Poof and Seek", "badMoveTimeToSuicide": "El Fantasma se suicida después de moverse visiblemente durante", - "snsImpostorCanVent": "Los impostores pueden usar conductos" + "snsImpostorCanVent": "Los impostores pueden usar conductos", "modeVoteDuration": "Duración de la votación de modo de juego", "snsChatInGameExtendTwo": "Enviar información ampliada al iniciar la partida", - "snsChatInGameFast": "Reunión más rápida (experimental+), + "snsChatInGameFast": "Reunión más rápida (experimental+)", "shieldFirstDeath": " Proteger al primer jugador que murió", "shieldFirstDeathDuration": "Duración de la protección", "snsTwoDesc": "Enviar la descripción ampliada de Shift and Seek.", @@ -347,5 +347,6 @@ "disableChatModifier": "Desactivar modificaciones del chat", "snsSuicideMode": "Desactivar sistema de escudos", "tabGroupNoKcd": "0 s de espera para matar", - "disablePeacePeriod": "Desactivar período de paz de 5 s" + "disablePeacePeriod": "Desactivar período de paz de 5 s", + "disableLobbyInfo": "Disable Lobby Info" }