From 87e80e33beabea86a4690f6504a216d7e4bf548d Mon Sep 17 00:00:00 2001 From: iRebbok Date: Sun, 6 Oct 2019 10:58:41 +0300 Subject: [PATCH] added translate --- scp035/EventHandler.cs | 8 +++++++- scp035/Logic.cs | 16 ++++++++++++---- scp035/Plugin.cs | 7 ++++++- scp035/scp035.csproj | 14 +++++++------- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/scp035/EventHandler.cs b/scp035/EventHandler.cs index 9cb69b1..a39aef5 100644 --- a/scp035/EventHandler.cs +++ b/scp035/EventHandler.cs @@ -41,7 +41,13 @@ partial class EventHandler : IEventHandlerWaitingForPlayers, IEventHandlerRoundS private bool corrodeLifeSteal; private bool isEnabled; - public EventHandler(Plugin plugin) + // Translate + private uint bctime; + private string infection; + private string picked; + private string hiding; + + public EventHandler(Plugin plugin) { instance = plugin; hInstance = this; diff --git a/scp035/Logic.cs b/scp035/Logic.cs index e321281..7faf5cd 100644 --- a/scp035/Logic.cs +++ b/scp035/Logic.cs @@ -32,7 +32,15 @@ private void LoadConfigs() corrodeInterval = instance.GetConfigFloat("035_corrode_interval"); corrodeLifeSteal = instance.GetConfigBool("035_corrode_life_steal"); isEnabled = instance.GetConfigBool("035_enabled"); - } + + int ConfigBCTime = instance.GetConfigInt("035_bc_time"); + if (ConfigBCTime > -1) bctime = (uint)ConfigBCTime; + else bctime = 10; + + hiding = instance.GetTranslation("hiding"); + picked = instance.GetTranslation("picked"); + infection = instance.GetTranslation("infection"); + } private void ResetItemDurability() { @@ -123,12 +131,12 @@ private void InfectPlayer(Player player, Smod2.API.Item pItem) p035.SetAmmo(AmmoType.DROPPED_7, player.GetAmmo(AmmoType.DROPPED_7)); p035.SetAmmo(AmmoType.DROPPED_9, player.GetAmmo(AmmoType.DROPPED_9)); p035.SetRank("red", "SCP-035"); - p035.PersonalBroadcast(10, $"You are SCP-035! You have infected a body and have gained control over it, use it to help the other SCPs!", false); + p035.PersonalBroadcast(bctime, infection, false); scpPlayer = p035; isRotating = false; player.ChangeRole(Role.SPECTATOR); - player.PersonalBroadcast(10, $"You have picked up SCP-035. He has infected your body and is now in control of you.", false); + player.PersonalBroadcast(bctime, picked, false); if (spawnNewItems) RemovePossessedItems(); else ResetItemDurability(); } @@ -167,7 +175,7 @@ private void CorrodePlayer(Player player) public bool HandleHideTagHook(CharacterClassManager __instance) { bool a = __instance.SteamId == scpPlayer?.SteamId; - if (a) __instance.TargetConsolePrint(__instance.connectionToClient, "You're not trying to exploit the system by hiding your tag as SCP-035 now, are you?", "green"); + if (a) __instance.TargetConsolePrint(__instance.connectionToClient, hiding, "green"); return !a; } } diff --git a/scp035/Plugin.cs b/scp035/Plugin.cs index 9fbdaf9..f41730b 100644 --- a/scp035/Plugin.cs +++ b/scp035/Plugin.cs @@ -44,6 +44,11 @@ public override void Register() AddConfig(new Smod2.Config.ConfigSetting("035_corrode_interval", 1f, false, true, "The interval in seconds for corrosion damage.")); AddConfig(new Smod2.Config.ConfigSetting("035_corrode_life_steal", true, false, true, "If SCP-035 should steal any health taken from other players by corrosion.")); AddConfig(new Smod2.Config.ConfigSetting("035_enabled", true, false, true, "If SCP-035 is enabled.")); - } + + AddConfig(new Smod2.Config.ConfigSetting("035_bc_time", 10, true, "Broadcast time")); + AddTranslation(new Smod2.Lang.LangSetting("infection", "You are SCP-035! You have infected a body and have gained control over it, use it to help the other SCPs!", "SCP035")); + AddTranslation(new Smod2.Lang.LangSetting("picked", "You have picked up SCP-035. He has infected your body and is now in control of you.", "SCP035")); + AddTranslation(new Smod2.Lang.LangSetting("hiding", "You're not trying to exploit the system by hiding your tag as SCP-035 now, are you?", "SCP035)")); + } } } diff --git a/scp035/scp035.csproj b/scp035/scp035.csproj index cfb6838..1a7e4ca 100644 --- a/scp035/scp035.csproj +++ b/scp035/scp035.csproj @@ -32,18 +32,18 @@ - ..\..\..\..\Desktop\References\0Harmony.dll + F:\Visual Studio\forproject\0Harmony.dll False - ..\..\..\..\Desktop\3.5.0\Assembly-CSharp.dll + F:\Visual Studio\forproject\Assembly-CSharp.dll - D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll + F:\Visual Studio\forproject\Assembly-CSharp-firstpass.dll False - ..\..\..\..\Desktop\3.5.0\Smod2.dll + F:\Visual Studio\forproject\Smod2.dll @@ -54,13 +54,13 @@ - D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\UnityEngine.dll + F:\Visual Studio\forproject\UnityEngine.dll - D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\UnityEngine.CoreModule.dll + F:\Visual Studio\forproject\UnityEngine.CoreModule.dll - D:\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory\SCPSL_Data\Managed\UnityEngine.Networking.dll + F:\Visual Studio\forproject\UnityEngine.Networking.dll