Client name is saved in config.xml (no need to re-enter every time you start the game). Closes #224

This commit is contained in:
Joonas Rikkonen
2018-01-12 14:45:01 +02:00
parent 03bff643f8
commit 4e7e6ef60e
3 changed files with 28 additions and 5 deletions
@@ -61,6 +61,7 @@ namespace Barotrauma
new GUITextBlock(new Rectangle(0, 30, 0, 30), TextManager.Get("YourName"), "", menu);
clientNameBox = new GUITextBox(new Rectangle(0, 60, 200, 30), "", menu);
clientNameBox.Text = GameMain.Config.DefaultPlayerName;
new GUITextBlock(new Rectangle(0, 100, 0, 30), TextManager.Get("ServerIP"), "", menu);
ipBox = new GUITextBox(new Rectangle(0, 130, 200, 30), "", menu);
@@ -348,6 +349,8 @@ namespace Barotrauma
return false;
}
GameMain.Config.DefaultPlayerName = clientNameBox.Text;
string ip = ipBox.Text;
if (string.IsNullOrWhiteSpace(ip))
@@ -358,7 +361,6 @@ namespace Barotrauma
CoroutineManager.StartCoroutine(ConnectToServer(ip));
return true;
}