v1.4.4.1 (Blood in the Water Update)

This commit is contained in:
Regalis11
2024-04-24 18:09:05 +03:00
parent 89b91d1c3e
commit ff1b8951a7
397 changed files with 15250 additions and 6479 deletions
@@ -306,22 +306,6 @@ namespace Barotrauma
OverflowClip = true
};
if (string.IsNullOrEmpty(ClientNameBox.Text))
{
TaskPool.Add("GetDefaultUserName",
GetDefaultUserName(),
t =>
{
if (!t.TryGetResult(out string name)) { return; }
if (ClientNameBox.Text.IsNullOrEmpty()) { ClientNameBox.Text = name; }
});
}
ClientNameBox.OnTextChanged += (textbox, text) =>
{
MultiplayerPreferences.Instance.PlayerName = text;
return true;
};
var tabButtonHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f - sidebarWidth - infoHolder.RelativeSpacing, 0.5f), infoHolder.RectTransform), isHorizontal: true);
tabs[TabEnum.All] = new Tab(TabEnum.All, this, tabButtonHolder, "");
@@ -874,11 +858,44 @@ namespace Barotrauma
return 0;
}
}
public override void Select()
{
base.Select();
if (string.IsNullOrEmpty(ClientNameBox.Text))
{
TaskPool.Add("GetDefaultUserName",
GetDefaultUserName(),
t =>
{
if (!t.TryGetResult(out string name)) { return; }
if (ClientNameBox.Text.IsNullOrEmpty())
{
ClientNameBox.Text = name;
string nameWithoutInvisibleSymbols = string.Empty;
foreach (char c in ClientNameBox.Text)
{
Vector2 size = ClientNameBox.Font.MeasureChar(c);
if (size.X > 0 && size.Y > 0)
{
nameWithoutInvisibleSymbols += c;
}
}
if (nameWithoutInvisibleSymbols != ClientNameBox.Text)
{
MultiplayerPreferences.Instance.PlayerName = ClientNameBox.Text = nameWithoutInvisibleSymbols;
new GUIMessageBox(TextManager.Get("Warning"), TextManager.GetWithVariable("NameContainsInvisibleSymbols", "[name]", nameWithoutInvisibleSymbols));
}
}
});
}
ClientNameBox.OnTextChanged += (textbox, text) =>
{
MultiplayerPreferences.Instance.PlayerName = text;
return true;
};
if (EosInterface.IdQueries.IsLoggedIntoEosConnect)
{
if (SteamManager.IsInitialized)