Build 0.21.1.0
This commit is contained in:
@@ -17,6 +17,7 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using Barotrauma.Extensions;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -475,6 +476,19 @@ namespace Barotrauma
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
var corePackage = ContentPackageManager.EnabledPackages.Core;
|
||||
if (corePackage.EnableError.TryUnwrap(out var error))
|
||||
{
|
||||
if (error.ErrorsOrException.TryGet(out ImmutableArray<string> errorMessages))
|
||||
{
|
||||
throw new Exception($"Error while loading the core content package \"{corePackage.Name}\": {errorMessages.First()}");
|
||||
}
|
||||
else if (error.ErrorsOrException.TryGet(out Exception exception))
|
||||
{
|
||||
throw new Exception($"Error while loading the core content package \"{corePackage.Name}\": {exception.Message}", exception);
|
||||
}
|
||||
}
|
||||
|
||||
TextManager.VerifyLanguageAvailable();
|
||||
|
||||
DebugConsole.Init();
|
||||
@@ -735,8 +749,8 @@ namespace Barotrauma
|
||||
{
|
||||
Client.Quit();
|
||||
Client = null;
|
||||
MainMenuScreen.Select();
|
||||
}
|
||||
MainMenuScreen.Select();
|
||||
|
||||
if (connectCommand.EndpointOrLobby.TryGet(out ulong lobbyId))
|
||||
{
|
||||
@@ -1099,37 +1113,6 @@ namespace Barotrauma
|
||||
GameSession = null;
|
||||
}
|
||||
|
||||
public void ShowEditorDisclaimer()
|
||||
{
|
||||
var msgBox = new GUIMessageBox(TextManager.Get("EditorDisclaimerTitle"), TextManager.Get("EditorDisclaimerText"));
|
||||
var linkHolder = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.25f), msgBox.Content.RectTransform)) { Stretch = true, RelativeSpacing = 0.025f };
|
||||
linkHolder.RectTransform.MaxSize = new Point(int.MaxValue, linkHolder.Rect.Height);
|
||||
List<(LocalizedString Caption, string Url)> links = new List<(LocalizedString, string)>()
|
||||
{
|
||||
(TextManager.Get("EditorDisclaimerWikiLink"), TextManager.Get("EditorDisclaimerWikiUrl").Fallback("https://barotraumagame.com/wiki").Value),
|
||||
(TextManager.Get("EditorDisclaimerDiscordLink"), TextManager.Get("EditorDisclaimerDiscordUrl").Fallback("https://discordapp.com/invite/undertow").Value),
|
||||
};
|
||||
foreach (var link in links)
|
||||
{
|
||||
new GUIButton(new RectTransform(new Vector2(1.0f, 0.2f), linkHolder.RectTransform), link.Caption, style: "MainMenuGUIButton", textAlignment: Alignment.Left)
|
||||
{
|
||||
UserData = link.Url,
|
||||
OnClicked = (btn, userdata) =>
|
||||
{
|
||||
ShowOpenUrlInWebBrowserPrompt(userdata as string);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
msgBox.InnerFrame.RectTransform.MinSize = new Point(0,
|
||||
msgBox.InnerFrame.Rect.Height + linkHolder.Rect.Height + msgBox.Content.AbsoluteSpacing * 2 + 10);
|
||||
var config = GameSettings.CurrentConfig;
|
||||
config.EditorDisclaimerShown = true;
|
||||
GameSettings.SetCurrentConfig(config);
|
||||
GameSettings.SaveCurrentConfig();
|
||||
}
|
||||
|
||||
public void ShowBugReporter()
|
||||
{
|
||||
if (GUIMessageBox.VisibleBox != null && GUIMessageBox.VisibleBox.UserData as string == "bugreporter")
|
||||
|
||||
Reference in New Issue
Block a user