Build 0.21.6.0 (1.0 pre-patch)

This commit is contained in:
Regalis11
2023-01-31 18:08:26 +02:00
parent e1c04bc31d
commit cf9ecd35b3
231 changed files with 4479 additions and 2276 deletions
@@ -17,14 +17,19 @@ using System.Linq;
using System.Reflection;
using System.Threading;
using Barotrauma.Extensions;
using System.Collections.Immutable;
namespace Barotrauma
{
class GameMain : Game
{
public static bool ShowFPS = false;
public static bool ShowPerf = false;
public static bool ShowFPS;
public static bool ShowPerf;
public static bool DebugDraw;
/// <summary>
/// Doesn't automatically enable los or bot AI or do anything like that. Probably not fully implemented.
/// </summary>
public static bool DevMode;
public static bool IsSingleplayer => NetworkMember == null;
public static bool IsMultiplayer => NetworkMember != null;
@@ -397,7 +402,7 @@ namespace Barotrauma
TextureLoader.Init(GraphicsDevice);
//do this here because we need it for the loading screen
WaterRenderer.Instance = new WaterRenderer(base.GraphicsDevice, Content);
WaterRenderer.Instance = new WaterRenderer(base.GraphicsDevice);
Quad.Init(GraphicsDevice);
@@ -475,6 +480,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();
@@ -498,10 +516,10 @@ namespace Barotrauma
TitleScreen.LoadState = 75.0f;
yield return CoroutineStatus.Running;
GameScreen = new GameScreen(GraphicsDeviceManager.GraphicsDevice, Content);
GameScreen = new GameScreen(GraphicsDeviceManager.GraphicsDevice);
ParticleManager = new ParticleManager(GameScreen.Cam);
LightManager = new Lights.LightManager(base.GraphicsDevice, Content);
LightManager = new Lights.LightManager(base.GraphicsDevice);
TitleScreen.LoadState = 80.0f;
yield return CoroutineStatus.Running;
@@ -735,8 +753,8 @@ namespace Barotrauma
{
Client.Quit();
Client = null;
MainMenuScreen.Select();
}
MainMenuScreen.Select();
if (connectCommand.EndpointOrLobby.TryGet(out ulong lobbyId))
{
@@ -1099,37 +1117,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")