Skip to content

Commit

Permalink
more configs
Browse files Browse the repository at this point in the history
  • Loading branch information
GrafDimenzio committed Jan 12, 2021
1 parent 14d0043 commit 93bf97a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion WaitAndChill/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ public class Config : AbstractConfigSection
{
public SerializedMapPoint LobbySpawn = new SerializedMapPoint("EZ_Shelter", 0f, 2f, 0f);

public string LobbyText = "<i><color=blue>Waiting for more Players!</color></i>\n<i><color=red>%players%/%slots%</color></i>\n<i>%status%</color></i>";
public string LobbyText = "<i><color=blue>Waiting for more Players!</color></i>\\n<i><color=red>%players%/%slots%</color></i>\\n<i>%status%</color></i>";

public string StatusStart = "Round is starting";

public string StatusWaiting = "%seconds% seconds left";

public string StatusNoPlayer = "";
}
}
8 changes: 4 additions & 4 deletions WaitAndChill/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ private IEnumerator<float> 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;
}

Expand Down

0 comments on commit 93bf97a

Please sign in to comment.