From 93bf97a33b16c97bb02d6baa288ea7bcd8d0cc0c Mon Sep 17 00:00:00 2001 From: GrafDimenzio Date: Tue, 12 Jan 2021 15:54:36 +0100 Subject: [PATCH] more configs --- WaitAndChill/Config.cs | 8 +++++++- WaitAndChill/EventHandlers.cs | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/WaitAndChill/Config.cs b/WaitAndChill/Config.cs index 2fc325c..bd0ee96 100644 --- a/WaitAndChill/Config.cs +++ b/WaitAndChill/Config.cs @@ -6,6 +6,12 @@ public class Config : AbstractConfigSection { public SerializedMapPoint LobbySpawn = new SerializedMapPoint("EZ_Shelter", 0f, 2f, 0f); - public string LobbyText = "Waiting for more Players!\n%players%/%slots%\n%status%"; + public string LobbyText = "Waiting for more Players!\\n%players%/%slots%\\n%status%"; + + public string StatusStart = "Round is starting"; + + public string StatusWaiting = "%seconds% seconds left"; + + public string StatusNoPlayer = ""; } } diff --git a/WaitAndChill/EventHandlers.cs b/WaitAndChill/EventHandlers.cs index e292870..3373701 100644 --- a/WaitAndChill/EventHandlers.cs +++ b/WaitAndChill/EventHandlers.cs @@ -29,20 +29,20 @@ private IEnumerator WaitingForPlayers() { Map.Get.RespawnPoint = PluginClass.Config.LobbySpawn.Parse().Position; - var newmsg = PluginClass.Config.LobbyText.Replace("%players%", Server.Get.Players.Count.ToString()).Replace("%slots%", Server.Get.Slots.ToString()); + var newmsg = PluginClass.Config.LobbyText.Replace("%players%", Server.Get.Players.Count.ToString()).Replace("%slots%", Server.Get.Slots.ToString()).Replace("\\n","\n"); switch (GameCore.RoundStart.singleton.NetworkTimer) { case -2: - newmsg = newmsg.Replace("%status%", ""); + newmsg = newmsg.Replace("%status%", PluginClass.Config.StatusNoPlayer); break; case -1: - newmsg = newmsg.Replace("%status%", "Round is starting"); + newmsg = newmsg.Replace("%status%", PluginClass.Config.StatusStart); break; default: - newmsg = newmsg.Replace("%status%", $"{GameCore.RoundStart.singleton.NetworkTimer} seconds left"); + newmsg = newmsg.Replace("%status%", PluginClass.Config.StatusWaiting.Replace("%seconds%", GameCore.RoundStart.singleton.NetworkTimer.ToString())); break; }