(5a377a8ee) Unstable v0.9.1000.0
This commit is contained in:
@@ -6,7 +6,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using RestSharp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Barotrauma.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
@@ -422,7 +422,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
// Game mode Selection
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), filters.Content.RectTransform), TextManager.Get("gamemode")) { CanBeFocused = false };
|
||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.05f), filters.Content.RectTransform), TextManager.Get("gamemode"), font: GUI.SubHeadingFont) { CanBeFocused = false };
|
||||
|
||||
gameModeTickBoxes = new List<GUITickBox>();
|
||||
foreach (GameModePreset mode in GameModePreset.List)
|
||||
@@ -474,7 +474,7 @@ namespace Barotrauma
|
||||
};
|
||||
btn.Color *= 0.5f;
|
||||
labelTexts.Add(btn.TextBlock);
|
||||
|
||||
|
||||
new GUIImage(new RectTransform(new Vector2(0.5f, 0.3f), btn.RectTransform, Anchor.BottomCenter, scaleBasis: ScaleBasis.BothHeight), style: "GUIButtonVerticalArrow", scaleToFit: true)
|
||||
{
|
||||
CanBeFocused = false,
|
||||
@@ -567,7 +567,18 @@ namespace Barotrauma
|
||||
var directJoinButton = new GUIButton(new RectTransform(new Vector2(0.25f, 0.9f), buttonContainer.RectTransform),
|
||||
TextManager.Get("serverlistdirectjoin"))
|
||||
{
|
||||
OnClicked = (btn, userdata) => { ShowDirectJoinPrompt(); return true; }
|
||||
OnClicked = (btn, userdata) =>
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ClientNameBox.Text))
|
||||
{
|
||||
ClientNameBox.Flash();
|
||||
ClientNameBox.Select();
|
||||
GUI.PlayUISound(GUISoundType.PickItemFail);
|
||||
return false;
|
||||
}
|
||||
ShowDirectJoinPrompt();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
joinButton = new GUIButton(new RectTransform(new Vector2(0.25f, 0.9f), buttonContainer.RectTransform),
|
||||
@@ -672,7 +683,21 @@ namespace Barotrauma
|
||||
if (!File.Exists(file)) { return; }
|
||||
|
||||
XDocument doc = XMLExtensions.TryLoadXml(file);
|
||||
if (doc == null) { return; }
|
||||
if (doc == null)
|
||||
{
|
||||
DebugConsole.NewMessage("Failed to load file \"" + file + "\". Attempting to recreate the file...");
|
||||
try
|
||||
{
|
||||
doc = new XDocument(new XElement("servers"));
|
||||
doc.Save(file);
|
||||
DebugConsole.NewMessage("Recreated \"" + file + "\".");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError("Failed to recreate the file \"" + file + "\".", e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (XElement element in doc.Root.Elements())
|
||||
{
|
||||
@@ -694,7 +719,7 @@ namespace Barotrauma
|
||||
rootElement.Add(info.ToXElement());
|
||||
}
|
||||
|
||||
doc.Save(file);
|
||||
doc.SaveSafe(file);
|
||||
}
|
||||
|
||||
public ServerInfo UpdateServerInfoWithServerSettings(object endpoint, ServerSettings serverSettings)
|
||||
@@ -909,6 +934,12 @@ namespace Barotrauma
|
||||
|
||||
Steamworks.SteamMatchmaking.ResetActions();
|
||||
|
||||
if (GameMain.Client != null)
|
||||
{
|
||||
GameMain.Client.Disconnect();
|
||||
GameMain.Client = null;
|
||||
}
|
||||
|
||||
RefreshServers();
|
||||
}
|
||||
|
||||
@@ -996,7 +1027,7 @@ namespace Barotrauma
|
||||
foreach (GUITickBox tickBox in gameModeTickBoxes)
|
||||
{
|
||||
var gameMode = (string)tickBox.UserData;
|
||||
if (!tickBox.Selected && serverInfo.GameMode.Equals(gameMode, StringComparison.OrdinalIgnoreCase))
|
||||
if (!tickBox.Selected && serverInfo.GameMode != null && serverInfo.GameMode.Equals(gameMode, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
child.Visible = false;
|
||||
break;
|
||||
@@ -1653,7 +1684,7 @@ namespace Barotrauma
|
||||
{
|
||||
CanBeFocused = false,
|
||||
Selected =
|
||||
serverInfo.GameVersion == GameMain.Version.ToString() &&
|
||||
(NetworkMember.IsCompatible(GameMain.Version.ToString(), serverInfo.GameVersion) ?? true) &&
|
||||
serverInfo.ContentPackagesMatch(GameMain.SelectedPackages),
|
||||
UserData = "compatible"
|
||||
};
|
||||
@@ -1679,6 +1710,14 @@ namespace Barotrauma
|
||||
serverName.Text = ToolBox.LimitString(serverName.Text, serverName.Font, serverName.Rect.Width);
|
||||
};
|
||||
|
||||
if (serverInfo.ContentPackageNames.Any())
|
||||
{
|
||||
if (serverInfo.ContentPackageNames.Any(cp => !cp.Equals(GameMain.VanillaContent.Name, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
serverName.TextColor = new Color(219, 125, 217);
|
||||
}
|
||||
}
|
||||
|
||||
new GUITickBox(new RectTransform(new Vector2(columnRelativeWidth[3], 0.9f), serverContent.RectTransform, Anchor.Center), label: "")
|
||||
{
|
||||
ToolTip = TextManager.Get((serverInfo.GameStarted) ? "ServerListRoundStarted" : "ServerListRoundNotStarted"),
|
||||
@@ -1897,6 +1936,8 @@ namespace Barotrauma
|
||||
if (string.IsNullOrWhiteSpace(ClientNameBox.Text))
|
||||
{
|
||||
ClientNameBox.Flash();
|
||||
ClientNameBox.Select();
|
||||
GUI.PlayUISound(GUISoundType.PickItemFail);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user