(4dba94638) Legacy save file support (= save files present in Data/Saves will still be usable)

This commit is contained in:
Joonas Rikkonen
2019-05-06 11:29:24 +03:00
parent 66871d37a8
commit cffaef3c3c
21 changed files with 106 additions and 858 deletions
@@ -6,7 +6,6 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -20,7 +19,7 @@ namespace Barotrauma
private GUIComponent buttonsParent;
private GUIFrame[] menuTabs;
private readonly GUIFrame[] menuTabs;
private CampaignSetupUI campaignSetupUI;
@@ -751,6 +750,13 @@ namespace Barotrauma
spriteBatch.End();
}
readonly string[] legalCrap = new string[]
{
"Privacy policy: privacypolicy.daedalic.com",
"© " + DateTime.Now.Year + " Undertow Games & FakeFish. All rights reserved.",
"© " + DateTime.Now.Year + " Daedalic Entertainment GmbH. The Daedalic logo is a trademark of Daedalic Entertainment GmbH, Germany. All rights reserved."
};
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
{
DrawBackground(graphics, spriteBatch);
@@ -758,6 +764,8 @@ namespace Barotrauma
spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, GameMain.ScissorTestEnable);
GUI.Draw(Cam, spriteBatch);
GUI.Draw(Cam, spriteBatch);
#if DEBUG
GUI.Font.DrawString(spriteBatch, "Barotrauma v" + GameMain.Version + " (debug build)", new Vector2(10, GameMain.GraphicsHeight - 20), Color.White);
@@ -782,9 +790,9 @@ namespace Barotrauma
{
if (string.IsNullOrEmpty(saveName)) return;
string[] existingSaveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer);
var existingSaveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer);
if (Array.Find(existingSaveFiles, s => s == saveName) != null)
if (existingSaveFiles.Any(s => s == saveName))
{
new GUIMessageBox(TextManager.Get("SaveNameInUseHeader"), TextManager.Get("SaveNameInUseText"));
return;