diff --git a/AmongUsRevamped.cs b/AmongUsRevamped.cs index d3b81fc..a5fb14c 100644 --- a/AmongUsRevamped.cs +++ b/AmongUsRevamped.cs @@ -44,7 +44,7 @@ public partial class Main : BasePlugin public static bool HasArgumentException; public static string CredentialsText; - public const string ModVersion = "v1.8.3"; + public const string ModVersion = "v1.8.4"; public static float GameTimer; diff --git a/Modules/Translator.cs b/Modules/Translator.cs index 0e29a9c..c03fdd6 100644 --- a/Modules/Translator.cs +++ b/Modules/Translator.cs @@ -24,18 +24,31 @@ public static class Translator { Logger.Info($" Among Us Revamped {Main.ModVersion}", "Init"); - string path = $"{BanManager.DataPath}/Language/YourLanguage.txt"; + _currentLang = SupportedLangs.English; + if (!Directory.Exists(LanguageFolder)) Directory.CreateDirectory(LanguageFolder); - if (!File.Exists(path)) + try { - Logger.Warn($" Creating a new language file", "Translator"); - File.WriteAllText(path, "# In this file you can set your Among Us Revamped language.\n# To set the language, replace the 'English' text below with the language you want to select.\n# Supported languages: English, Spanish, SimplifiedChinese, Italian\n\nEnglish"); + string path = $"{BanManager.DataPath}/Language/YourLanguage.txt"; + + if (!File.Exists(path)) + { + Logger.Warn($" Creating a new language file", "Translator"); + File.WriteAllText(path, "# In this file you can set your Among Us Revamped language.\n# To set the language, replace the 'English' text below with the language you want to select.\n# Supported languages: English, Spanish, SimplifiedChinese, Italian\n\nEnglish"); + } + + string l = File.ReadAllLines(path).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x) && !x.StartsWith("#"))?.Trim() ?? "English"; + + if (Enum.TryParse(l, true, out SupportedLangs lang)) _currentLang = lang; + } + catch (IOException ex) + { + Logger.Exception(ex, "BanManager"); + } + catch (UnauthorizedAccessException ex) + { + Logger.Exception(ex, "BanManager"); } - - string l = File.ReadAllLines(path).FirstOrDefault(x => !string.IsNullOrWhiteSpace(x) && !x.StartsWith("#"))?.Trim() ?? "English"; - - if (Enum.TryParse(l, true, out SupportedLangs lang)) _currentLang = lang; - else _currentLang = SupportedLangs.English; CheckLanguageFile(_currentLang); LoadLanguage(_currentLang); diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index b06f735..2cdeb72 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -32,7 +32,7 @@ internal static class CoShowIntroPatch Logger.Info($" {p.Data.PlayerName} -> {p.Data.RoleType}", "RoleInfo"); } - Logger.Info($" {AbilityManagement.RoleList()}", "AbilityInfo"); + if (!Utils.isHideNSeek && Options.Gamemode.GetValue() < 2) Logger.Info($" {AbilityManagement.RoleList()}", "AbilityInfo"); if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.isHideNSeek) { diff --git a/Patches/OnGameStartedPatch.cs b/Patches/OnGameStartedPatch.cs index 3b90f25..e52bbd9 100644 --- a/Patches/OnGameStartedPatch.cs +++ b/Patches/OnGameStartedPatch.cs @@ -46,7 +46,7 @@ class PlayerControlSetRolePatch OnGameStartPatch.ScheduleExile = true; } - if (Utils.isHideNSeek && Seekers.Count() == 0) + if (Utils.isHideNSeek && Seekers.Count() == 0 && Options.NumSeekers.GetInt() != 1) { int seekersCount = Options.NumSeekers.GetInt(); @@ -70,7 +70,7 @@ class PlayerControlSetRolePatch } } - if (Utils.isHideNSeek) + if (Utils.isHideNSeek && Options.NumSeekers.GetInt() != 1) { if (Seekers.Contains(__instance.PlayerId)) roleType = RoleTypes.Impostor; else roleType = RoleTypes.Engineer; diff --git a/Resources/Language/Italian.json b/Resources/Language/Italian.json index 045b941..4f52cfc 100644 --- a/Resources/Language/Italian.json +++ b/Resources/Language/Italian.json @@ -8,6 +8,7 @@ "enableLobbyMusic": "Musica Lobby", "disableInfoWhenDead": "Nascondi Info da Morto", "disableCommandHelper": "Disabilita Command Helper", + "disableCompatibilityWarning": "Disattiva avviso di compatibilità", "gameMasterWarning":"Assisterai alle partite come spettatore finché la modalità Spettatore non viene disattivata.AVVISO:I messaggi delle abilità non verranno inviati e l'assegnazione dei ruoli potrebbe non essere accurata se questa impostazione è attiva.", @@ -292,5 +293,21 @@ "banWordKick": "{0} è stato espulso perché ha inviato una parola proibita {1} volta/e", - "pluginWarning": "AVVISO:\nHai 2 o più Plugin rilevati.\nAmong Us Revamped non è compatibile con la maggior parte delle mod.\nSe riscontri dei bug, molto probabilmente sono dovuti all'incompatibilità." + "pluginWarning": "AVVISO:\nHai 2 o più Plugin rilevati.\nAmong Us Revamped non è compatibile con la maggior parte delle mod.\nSe riscontri dei bug, molto probabilmente sono dovuti all'incompatibilità.", + + "systemSettings": "Impostazioni di sistema", + "abilitySettings": "Impostazioni abilità", + "gameplaySettings": "Impostazioni di gioco", + "gamemodeSettings": "Impostazioni modalità di gioco", + + "systemSettingsDesc": "Impostazioni di qualità per migliorare il comfort e i test.", + "abilitySettingsDesc": "Impostazioni delle abilità per potenziare i ruoli base.", + "gameplaySettingsDesc": "Impostazioni di gioco per migliorare l'esperienza in partita.", + "gamemodeSettingsDesc": "Impostazioni situazionali da applicare per specifiche modalità di gioco.", + + "everyone": "Tutti", + "vipAndAbove": "VIP e superiori", + "moderatorAndAbove": "Moderatori e superiori", + "admin": "Admin", + "onlyYou": "Solo tu" } \ No newline at end of file diff --git a/Resources/Language/SimplifiedChinese.json b/Resources/Language/SimplifiedChinese.json index 28dc4ed..bd33930 100644 --- a/Resources/Language/SimplifiedChinese.json +++ b/Resources/Language/SimplifiedChinese.json @@ -8,6 +8,7 @@ "enableLobbyMusic": "大厅音乐", "disableInfoWhenDead": "死亡后隐藏信息", "disableCommandHelper": "禁用命令助手", + "disableCompatibilityWarning": "关闭兼容性警告", "gameMasterWarning": "您现在将进入观战模式,直到关闭游戏主管。警告:启用此设置后,可能无法发送技能消息,且身份分配可能不准确。", @@ -292,5 +293,21 @@ "banWordKick": "{0} 因发送违禁词被踢出,累计次数:{1} 次", - "pluginWarning": "警告:\n检测到您启用了 2 个或更多插件。\nAmong Us Revamped 与大多数模组不兼容。\n如果遇到 Bug,极有可能是因为冲突所致。" + "pluginWarning": "警告:\n检测到您启用了 2 个或更多插件。\nAmong Us Revamped 与大多数模组不兼容。\n如果遇到 Bug,极有可能是因为冲突所致。", + + "systemSettings": "系统设置", + "abilitySettings": "能力设置", + "gameplaySettings": "游戏设置", + "gamemodeSettings": "模式设置", + + "systemSettingsDesc": "用于提升舒适度与测试的画质/系统设置。", + "abilitySettingsDesc": "用于增强原版角色能力的设置。", + "gameplaySettingsDesc": "用于改善游戏内体验的设置。", + "gamemodeSettingsDesc": "适用于特定游戏模式的情境设置。", + + "everyone": "所有人", + "vipAndAbove": "VIP 及以上", + "moderatorAndAbove": "管理员 及以上", + "admin": "管理员", + "onlyYou": "仅自己" } diff --git a/Resources/Language/Spanish.json b/Resources/Language/Spanish.json index fa43b75..27b4a70 100644 --- a/Resources/Language/Spanish.json +++ b/Resources/Language/Spanish.json @@ -7,6 +7,7 @@ "enableLobbyMusic": "Música de la sala", "disableInfoWhenDead": "Ocultar información al morir", "disableCommandHelper": "Desactivar ayuda para comandos", + "disableCompatibilityWarning": "Desactivar advertencia de compatibilidad", "gameMasterWarning": "Ahora observarás las partidas hasta que se desactive el Maestro del Juego. ADVERTENCIA: No se enviarán mensajes de habilidades y la asignación de roles podría ser inexacta si esta opción está activada.", "cancelStartCountdown": "La cuenta regresiva de inicio fue cancelada", "invalidFriendCodeKick": "{0} fue expulsado por tener un código de amigo no válido", @@ -258,5 +259,21 @@ "lastgameDesc": "Enviar información de la última partida.", "templateDesc": "Enviar una plantilla especificada de AUR-DATA/templates.txt.", "banWordKick": "{0} fue expulsado porque envió una palabra prohibida {1} veces", - "pluginWarning": "ADVERTENCIA:\nSe han detectado 2 o más plugins.\nAmong Us Revamped no es compatible con la mayoría de mods.\nSi encuentras errores, probablemente se deban a incompatibilidad." + "pluginWarning": "ADVERTENCIA:\nSe han detectado 2 o más plugins.\nAmong Us Revamped no es compatible con la mayoría de mods.\nSi encuentras errores, probablemente se deban a incompatibilidad.", + + "systemSettings": "Configuración del sistema", + "abilitySettings": "Configuración de habilidades", + "gameplaySettings": "Configuración de la partida", + "gamemodeSettings": "Configuración del modo de juego", + + "systemSettingsDesc": "Ajustes de calidad para mejorar la comodidad y facilitar las pruebas.", + "abilitySettingsDesc": "Ajustes de habilidades para mejorar los roles originales.", + "gameplaySettingsDesc": "Ajustes de la partida para mejorar la experiencia de juego.", + "gamemodeSettingsDesc": "Ajustes específicos para determinados modos de juego.", + + "everyone": "Todos", + "vipAndAbove": "VIP o superior", + "moderatorAndAbove": "Moderador o superior", + "admin": "Administrador", + "onlyYou": "Solo tú" }