(d2accb97f) Restrict server name length to 60 characters, prevent long server names from overflowing in the "host server" menu & server lobby

This commit is contained in:
Joonas Rikkonen
2019-06-12 16:42:33 +03:00
parent e38c896d42
commit cd5f8735e7
4 changed files with 17 additions and 3 deletions
@@ -335,8 +335,12 @@ namespace Barotrauma
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.03f), rightInfoColumn.RectTransform), style: null);
//server info ------------------------------------------------------------------
ServerName = new GUITextBox(new RectTransform(new Vector2(0.3f, 0.05f), infoFrameContent.RectTransform));
ServerName = new GUITextBox(new RectTransform(new Vector2(infoColumnContainer.RectTransform.RelativeSize.X, 0.05f), infoFrameContent.RectTransform))
{
MaxTextLength = NetConfig.ServerNameMaxLength,
OverflowClip = true
};
ServerName.OnDeselected += (textBox, key) =>
{
GameMain.Client.ServerSettings.ClientAdminWrite(ServerSettings.NetFlags.Name);