Merge remote-tracking branch 'barotrauma/master' into lighting-optimization
This commit is contained in:
@@ -8,7 +8,7 @@ with.
|
|||||||
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
|
||||||
<Asset Type="Graphics:FontDescription">
|
<Asset Type="Graphics:FontDescription">
|
||||||
|
|
||||||
<FontName>Exo Light</FontName>
|
<FontName>Exo 2 Light</FontName>
|
||||||
|
|
||||||
<Size>9</Size>
|
<Size>9</Size>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -11,7 +11,7 @@ with.
|
|||||||
<!--
|
<!--
|
||||||
Modify this string to change the font that will be imported.
|
Modify this string to change the font that will be imported.
|
||||||
-->
|
-->
|
||||||
<FontName>Exo Medium</FontName>
|
<FontName>Exo 2 Medium</FontName>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Size is a float value, measured in points. Modify this value to change
|
Size is a float value, measured in points. Modify this value to change
|
||||||
|
|||||||
Binary file not shown.
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("0.5.4.3")]
|
[assembly: AssemblyVersion("0.5.4.4")]
|
||||||
[assembly: AssemblyFileVersion("0.5.4.3")]
|
[assembly: AssemblyFileVersion("0.5.4.4")]
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
limb.body.Enabled = enabled;
|
limb.body.Enabled = enabled;
|
||||||
}
|
}
|
||||||
|
AnimController.Collider.Enabled = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
public class GUIImage : GUIComponent
|
public class GUIImage : GUIComponent
|
||||||
{
|
{
|
||||||
Sprite sprite;
|
public float Rotation;
|
||||||
|
|
||||||
Rectangle sourceRect;
|
private Sprite sprite;
|
||||||
|
|
||||||
|
private Rectangle sourceRect;
|
||||||
|
|
||||||
bool crop;
|
bool crop;
|
||||||
|
|
||||||
@@ -85,7 +87,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (sprite != null && sprite.Texture != null)
|
if (sprite != null && sprite.Texture != null)
|
||||||
{
|
{
|
||||||
spriteBatch.Draw(sprite.Texture, new Vector2(rect.X, rect.Y), sourceRect, currColor * (currColor.A / 255.0f), 0.0f, Vector2.Zero,
|
spriteBatch.Draw(sprite.Texture, new Vector2(rect.X, rect.Y), sourceRect, currColor * (currColor.A / 255.0f), Rotation, Vector2.Zero,
|
||||||
Scale, SpriteEffects.None, 0.0f);
|
Scale, SpriteEffects.None, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,17 @@ namespace Barotrauma
|
|||||||
: base(new Rectangle(0,0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
|
: base(new Rectangle(0,0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
|
||||||
Color.Black*0.5f, Alignment.TopLeft, null, parent)
|
Color.Black*0.5f, Alignment.TopLeft, null, parent)
|
||||||
{
|
{
|
||||||
|
if (height == 0)
|
||||||
|
{
|
||||||
|
string wrappedText = ToolBox.WrapText(text, width, GUI.Font);
|
||||||
|
string[] lines = wrappedText.Split('\n');
|
||||||
|
foreach (string line in lines)
|
||||||
|
{
|
||||||
|
height += (int)GUI.Font.MeasureString(line).Y;
|
||||||
|
}
|
||||||
|
height += 220;
|
||||||
|
}
|
||||||
|
|
||||||
var frame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, this);
|
var frame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, this);
|
||||||
|
|
||||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
|
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
|
||||||
|
|||||||
@@ -598,7 +598,18 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (contained.body != null)
|
if (contained.body != null)
|
||||||
{
|
{
|
||||||
contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f);
|
try
|
||||||
|
{
|
||||||
|
contained.body.FarseerBody.SetTransformIgnoreContacts(ref simPos, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (NullReferenceException e)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
DebugConsole.ThrowError("SetTransformIgnoreContacts threw an exception in SetContainedItemPositions", e);
|
||||||
|
#endif
|
||||||
|
contained.body.SetTransform(simPos, 0.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contained.Rect =
|
contained.Rect =
|
||||||
|
|||||||
@@ -938,11 +938,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void CheckForErrors()
|
public void CheckForErrors()
|
||||||
{
|
{
|
||||||
string errorMsg = "";
|
List<string> errorMsgs = new List<string>();
|
||||||
|
|
||||||
if (!Hull.hullList.Any())
|
if (!Hull.hullList.Any())
|
||||||
{
|
{
|
||||||
errorMsg = "No hulls found in the submarine. Hulls determine the \"borders\" of an individual room and are required for water and air distribution to work correctly.";
|
errorMsgs.Add("No hulls found in the submarine. Hulls determine the \"borders\" of an individual room and are required for water and air distribution to work correctly.");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Item item in Item.ItemList)
|
foreach (Item item in Item.ItemList)
|
||||||
@@ -951,24 +951,24 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (!item.linkedTo.Any())
|
if (!item.linkedTo.Any())
|
||||||
{
|
{
|
||||||
errorMsg += "\nThe submarine contains vents which haven't been linked to an oxygen generator. Select a vent and click an oxygen generator while holding space to link them.";
|
errorMsgs.Add("The submarine contains vents which haven't been linked to an oxygen generator. Select a vent and click an oxygen generator while holding space to link them.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WayPoint.WayPointList.Find(wp => !wp.MoveWithLevel && wp.SpawnType == SpawnType.Path) == null)
|
if (WayPoint.WayPointList.Find(wp => !wp.MoveWithLevel && wp.SpawnType == SpawnType.Path) == null)
|
||||||
{
|
{
|
||||||
errorMsg += "\nNo waypoints found in the submarine. AI controlled crew members won't be able to navigate without waypoints.";
|
errorMsgs.Add("No waypoints found in the submarine. AI controlled crew members won't be able to navigate without waypoints.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WayPoint.WayPointList.Find(wp => wp.SpawnType == SpawnType.Cargo) == null)
|
if (WayPoint.WayPointList.Find(wp => wp.SpawnType == SpawnType.Cargo) == null)
|
||||||
{
|
{
|
||||||
errorMsg += "\nThe submarine doesn't have spawnpoints for cargo (which are used for determining where to place bought items). "
|
errorMsgs.Add("The submarine doesn't have spawnpoints for cargo (which are used for determining where to place bought items). "
|
||||||
+"To fix this, create a new spawnpoint and change its \"spawn type\" parameter to \"cargo\".";
|
+"To fix this, create a new spawnpoint and change its \"spawn type\" parameter to \"cargo\".");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(errorMsg))
|
if (errorMsgs.Any())
|
||||||
{
|
{
|
||||||
new GUIMessageBox("Warning", errorMsg);
|
new GUIMessageBox("Warning", string.Join("\n\n", errorMsgs), 400, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (MapEntity e in MapEntity.mapEntityList)
|
foreach (MapEntity e in MapEntity.mapEntityList)
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ namespace Barotrauma.Networking
|
|||||||
private ServerLog log;
|
private ServerLog log;
|
||||||
private GUIButton showLogButton;
|
private GUIButton showLogButton;
|
||||||
|
|
||||||
|
private bool initiatedStartGame;
|
||||||
|
private CoroutineHandle startGameCoroutine;
|
||||||
|
|
||||||
private GUIScrollBar clientListScrollBar;
|
private GUIScrollBar clientListScrollBar;
|
||||||
|
|
||||||
public TraitorManager TraitorManager;
|
public TraitorManager TraitorManager;
|
||||||
@@ -305,7 +308,6 @@ namespace Barotrauma.Networking
|
|||||||
if (settingsFrame != null) settingsFrame.Update(deltaTime);
|
if (settingsFrame != null) settingsFrame.Update(deltaTime);
|
||||||
if (log.LogFrame != null) log.LogFrame.Update(deltaTime);
|
if (log.LogFrame != null) log.LogFrame.Update(deltaTime);
|
||||||
|
|
||||||
|
|
||||||
if (!started) return;
|
if (!started) return;
|
||||||
|
|
||||||
base.Update(deltaTime);
|
base.Update(deltaTime);
|
||||||
@@ -348,7 +350,21 @@ namespace Barotrauma.Networking
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (autoRestart && Screen.Selected == GameMain.NetLobbyScreen && connectedClients.Count>0)
|
else if (initiatedStartGame)
|
||||||
|
{
|
||||||
|
//tried to start up the game and StartGame coroutine is not running anymore
|
||||||
|
// -> something wen't wrong during startup, re-enable start button and reset AutoRestartTimer
|
||||||
|
if (startGameCoroutine != null && !CoroutineManager.IsCoroutineRunning(startGameCoroutine))
|
||||||
|
{
|
||||||
|
if (autoRestart) AutoRestartTimer = Math.Max(AutoRestartInterval, 5.0f);
|
||||||
|
GameMain.NetLobbyScreen.StartButton.Enabled = true;
|
||||||
|
|
||||||
|
UpdateNetLobby(null, null);
|
||||||
|
startGameCoroutine = null;
|
||||||
|
initiatedStartGame = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (autoRestart && Screen.Selected == GameMain.NetLobbyScreen && connectedClients.Count > 0)
|
||||||
{
|
{
|
||||||
AutoRestartTimer -= deltaTime;
|
AutoRestartTimer -= deltaTime;
|
||||||
if (AutoRestartTimer < 0.0f && GameMain.NetLobbyScreen.StartButton.Enabled)
|
if (AutoRestartTimer < 0.0f && GameMain.NetLobbyScreen.StartButton.Enabled)
|
||||||
@@ -357,6 +373,7 @@ namespace Barotrauma.Networking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int i = disconnectedClients.Count - 1; i >= 0; i-- )
|
for (int i = disconnectedClients.Count - 1; i >= 0; i-- )
|
||||||
{
|
{
|
||||||
disconnectedClients[i].deleteDisconnectedTimer -= deltaTime;
|
disconnectedClients[i].deleteDisconnectedTimer -= deltaTime;
|
||||||
@@ -914,13 +931,15 @@ namespace Barotrauma.Networking
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameMain.ShowLoading(StartGame(selectedSub, selectedShuttle, selectedMode), false);
|
startGameCoroutine = GameMain.ShowLoading(StartGame(selectedSub, selectedShuttle, selectedMode), false);
|
||||||
|
|
||||||
yield return CoroutineStatus.Success;
|
yield return CoroutineStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<object> StartGame(Submarine selectedSub, Submarine selectedShuttle, GameModePreset selectedMode)
|
private IEnumerable<object> StartGame(Submarine selectedSub, Submarine selectedShuttle, GameModePreset selectedMode)
|
||||||
{
|
{
|
||||||
|
initiatedStartGame = true;
|
||||||
|
|
||||||
Item.Spawner.Clear();
|
Item.Spawner.Clear();
|
||||||
Item.Remover.Clear();
|
Item.Remover.Clear();
|
||||||
|
|
||||||
@@ -936,33 +955,15 @@ namespace Barotrauma.Networking
|
|||||||
int teamCount = 1;
|
int teamCount = 1;
|
||||||
int hostTeam = 1;
|
int hostTeam = 1;
|
||||||
|
|
||||||
try
|
GameMain.GameSession = new GameSession(selectedSub, "", selectedMode, Mission.MissionTypes[GameMain.NetLobbyScreen.MissionTypeIndex]);
|
||||||
|
|
||||||
|
if (GameMain.GameSession.gameMode.Mission != null &&
|
||||||
|
GameMain.GameSession.gameMode.Mission.AssignTeamIDs(connectedClients,out hostTeam))
|
||||||
{
|
{
|
||||||
GameMain.GameSession = new GameSession(selectedSub, "", selectedMode, Mission.MissionTypes[GameMain.NetLobbyScreen.MissionTypeIndex]);
|
teamCount = 2;
|
||||||
|
|
||||||
if (GameMain.GameSession.gameMode.Mission != null &&
|
|
||||||
GameMain.GameSession.gameMode.Mission.AssignTeamIDs(connectedClients,out hostTeam))
|
|
||||||
{
|
|
||||||
teamCount = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (Exception e)
|
GameMain.GameSession.StartShift(GameMain.NetLobbyScreen.LevelSeed, teamCount > 1);
|
||||||
{
|
|
||||||
DebugConsole.ThrowError("Failed to start a new round", e);
|
|
||||||
|
|
||||||
//try again in >5 seconds
|
|
||||||
if (autoRestart) AutoRestartTimer = Math.Max(AutoRestartInterval, 5.0f);
|
|
||||||
GameMain.NetLobbyScreen.StartButton.Enabled = true;
|
|
||||||
|
|
||||||
UpdateNetLobby(null, null);
|
|
||||||
|
|
||||||
couldNotStart = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (couldNotStart) yield return CoroutineStatus.Failure;
|
|
||||||
|
|
||||||
GameServer.Log("Starting a new round...", Color.Cyan);
|
GameServer.Log("Starting a new round...", Color.Cyan);
|
||||||
GameServer.Log("Submarine: " + selectedSub.Name, Color.Cyan);
|
GameServer.Log("Submarine: " + selectedSub.Name, Color.Cyan);
|
||||||
@@ -1082,7 +1083,6 @@ namespace Barotrauma.Networking
|
|||||||
//give some time for the clients to load the map
|
//give some time for the clients to load the map
|
||||||
yield return new WaitForSeconds(2.0f);
|
yield return new WaitForSeconds(2.0f);
|
||||||
|
|
||||||
gameStarted = true;
|
|
||||||
|
|
||||||
GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
|
GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||||
|
|
||||||
@@ -1100,6 +1100,9 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
GameMain.NetLobbyScreen.StartButton.Enabled = true;
|
GameMain.NetLobbyScreen.StartButton.Enabled = true;
|
||||||
|
|
||||||
|
gameStarted = true;
|
||||||
|
initiatedStartGame = false;
|
||||||
|
|
||||||
yield return CoroutineStatus.Success;
|
yield return CoroutineStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -418,6 +418,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private void CreateSaveScreen()
|
private void CreateSaveScreen()
|
||||||
{
|
{
|
||||||
|
if (characterMode) ToggleCharacterMode();
|
||||||
|
if (wiringMode) ToggleWiringMode();
|
||||||
|
|
||||||
int width = 400, height = 400;
|
int width = 400, height = 400;
|
||||||
|
|
||||||
int y = 0;
|
int y = 0;
|
||||||
@@ -502,6 +505,9 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private bool CreateLoadScreen(GUIButton button, object obj)
|
private bool CreateLoadScreen(GUIButton button, object obj)
|
||||||
{
|
{
|
||||||
|
if (characterMode) ToggleCharacterMode();
|
||||||
|
if (wiringMode) ToggleWiringMode();
|
||||||
|
|
||||||
Submarine.RefreshSavedSubs();
|
Submarine.RefreshSavedSubs();
|
||||||
|
|
||||||
int width = 300, height = 400;
|
int width = 300, height = 400;
|
||||||
@@ -596,10 +602,14 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private bool SelectTab(GUIButton button, object obj)
|
private bool SelectTab(GUIButton button, object obj)
|
||||||
{
|
{
|
||||||
|
if (characterMode) ToggleCharacterMode();
|
||||||
|
if (wiringMode) ToggleWiringMode();
|
||||||
|
|
||||||
selectedTab = (int)obj;
|
selectedTab = (int)obj;
|
||||||
|
|
||||||
var searchBox = GUItabs[selectedTab].GetChild<GUITextBox>();
|
var searchBox = GUItabs[selectedTab].GetChild<GUITextBox>();
|
||||||
ClearFilter(searchBox, null);
|
ClearFilter(searchBox, null);
|
||||||
|
searchBox.Text = "";
|
||||||
|
|
||||||
searchBox.AddToGUIUpdateList();
|
searchBox.AddToGUIUpdateList();
|
||||||
searchBox.Select();
|
searchBox.Select();
|
||||||
@@ -899,22 +909,28 @@ namespace Barotrauma
|
|||||||
wiringToolPanel.AddToGUIUpdateList();
|
wiringToolPanel.AddToGUIUpdateList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loadFrame != null)
|
|
||||||
{
|
|
||||||
loadFrame.AddToGUIUpdateList();
|
|
||||||
}
|
|
||||||
else if (saveFrame != null)
|
|
||||||
{
|
|
||||||
saveFrame.AddToGUIUpdateList();
|
|
||||||
}
|
|
||||||
else if (selectedTab > -1)
|
|
||||||
{
|
|
||||||
GUItabs[selectedTab].AddToGUIUpdateList();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((characterMode || wiringMode) && dummyCharacter != null)
|
if ((characterMode || wiringMode) && dummyCharacter != null)
|
||||||
{
|
{
|
||||||
CharacterHUD.AddToGUIUpdateList(dummyCharacter);
|
CharacterHUD.AddToGUIUpdateList(dummyCharacter);
|
||||||
|
if (dummyCharacter.SelectedConstruction != null)
|
||||||
|
{
|
||||||
|
dummyCharacter.SelectedConstruction.AddToGUIUpdateList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (loadFrame != null)
|
||||||
|
{
|
||||||
|
loadFrame.AddToGUIUpdateList();
|
||||||
|
}
|
||||||
|
else if (saveFrame != null)
|
||||||
|
{
|
||||||
|
saveFrame.AddToGUIUpdateList();
|
||||||
|
}
|
||||||
|
else if (selectedTab > -1)
|
||||||
|
{
|
||||||
|
GUItabs[selectedTab].AddToGUIUpdateList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUI.AddToGUIUpdateList();
|
GUI.AddToGUIUpdateList();
|
||||||
|
|||||||
@@ -515,11 +515,18 @@ namespace Barotrauma
|
|||||||
infoButton.UserData = -1;
|
infoButton.UserData = -1;
|
||||||
infoButton.OnClicked += ViewJobInfo;
|
infoButton.OnClicked += ViewJobInfo;
|
||||||
|
|
||||||
GUIButton upButton = new GUIButton(new Rectangle(30, 2, 15, 15), "^", GUI.Style, jobText);
|
GUIButton upButton = new GUIButton(new Rectangle(30, 2, 15, 15), "", GUI.Style, jobText);
|
||||||
|
//TODO: make GUIImages align correctly when scaled/rotated
|
||||||
|
//so there's no need to do this ↓
|
||||||
|
new GUIImage(new Rectangle(3,2,0,0), GUI.Arrow, Alignment.Center, upButton).Scale = 0.6f;
|
||||||
upButton.UserData = -1;
|
upButton.UserData = -1;
|
||||||
upButton.OnClicked += ChangeJobPreference;
|
upButton.OnClicked += ChangeJobPreference;
|
||||||
|
|
||||||
GUIButton downButton = new GUIButton(new Rectangle(50, 2, 15, 15), "˅", GUI.Style, jobText);
|
GUIButton downButton = new GUIButton(new Rectangle(50, 2, 15, 15), "", GUI.Style, jobText);
|
||||||
|
var downArrow = new GUIImage(new Rectangle(13,14,0,0), GUI.Arrow, Alignment.Center, downButton);
|
||||||
|
downArrow.Rotation = MathHelper.Pi;
|
||||||
|
downArrow.Scale = 0.6f;
|
||||||
|
|
||||||
downButton.UserData = 1;
|
downButton.UserData = 1;
|
||||||
downButton.OnClicked += ChangeJobPreference;
|
downButton.OnClicked += ChangeJobPreference;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,8 +198,8 @@ namespace Barotrauma
|
|||||||
return sourceIndex;
|
return sourceIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SoundManager.Loop(this, sourceIndex, relativePos/100.0f, volume);
|
alSourceId = SoundManager.Loop(this, sourceIndex, relativePos / 100.0f, volume);
|
||||||
|
return alSourceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsPlaying
|
public bool IsPlaying
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Barotrauma
|
|||||||
Directory.CreateDirectory(tempPath);
|
Directory.CreateDirectory(tempPath);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ClearFolder(tempPath);
|
ClearFolder(tempPath, new string[] { GameMain.GameSession.Submarine.FilePath });
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -37,7 +37,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Submarine.MainSub != null)
|
if (Submarine.MainSub != null && Submarine.Loaded.Contains(Submarine.MainSub))
|
||||||
{
|
{
|
||||||
Submarine.MainSub.FilePath = Path.Combine(tempPath, Submarine.MainSub.Name + ".sub");
|
Submarine.MainSub.FilePath = Path.Combine(tempPath, Submarine.MainSub.Name + ".sub");
|
||||||
Submarine.MainSub.SaveAs(Submarine.MainSub.FilePath);
|
Submarine.MainSub.SaveAs(Submarine.MainSub.FilePath);
|
||||||
@@ -77,7 +77,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
XDocument doc = ToolBox.TryLoadXml(Path.Combine(TempPath, "gamesession.xml"));
|
XDocument doc = ToolBox.TryLoadXml(Path.Combine(TempPath, "gamesession.xml"));
|
||||||
|
|
||||||
string subPath = Path.Combine(TempPath, ToolBox.GetAttributeString(doc.Root, "submarine", ""));
|
string subPath = Path.Combine(TempPath, ToolBox.GetAttributeString(doc.Root, "submarine", ""))+".sub";
|
||||||
Submarine selectedMap = new Submarine(subPath, "");// Submarine.Load();
|
Submarine selectedMap = new Submarine(subPath, "");// Submarine.Load();
|
||||||
GameMain.GameSession = new GameSession(selectedMap, fileName, doc);
|
GameMain.GameSession = new GameSession(selectedMap, fileName, doc);
|
||||||
|
|
||||||
@@ -285,19 +285,31 @@ namespace Barotrauma
|
|||||||
while (DecompressFile(sDir, zipStream, progress)) ;
|
while (DecompressFile(sDir, zipStream, progress)) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ClearFolder(string FolderName)
|
private static void ClearFolder(string FolderName, string[] ignoredFiles = null)
|
||||||
{
|
{
|
||||||
DirectoryInfo dir = new DirectoryInfo(FolderName);
|
DirectoryInfo dir = new DirectoryInfo(FolderName);
|
||||||
|
|
||||||
foreach (FileInfo fi in dir.GetFiles())
|
foreach (FileInfo fi in dir.GetFiles())
|
||||||
{
|
{
|
||||||
|
bool ignore = false;
|
||||||
|
foreach (string ignoredFile in ignoredFiles)
|
||||||
|
{
|
||||||
|
if (Path.GetFullPath(fi.FullName).Equals(Path.GetFullPath(ignoredFile)))
|
||||||
|
{
|
||||||
|
ignore = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ignore) continue;
|
||||||
|
|
||||||
fi.IsReadOnly = false;
|
fi.IsReadOnly = false;
|
||||||
fi.Delete();
|
fi.Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (DirectoryInfo di in dir.GetDirectories())
|
foreach (DirectoryInfo di in dir.GetDirectories())
|
||||||
{
|
{
|
||||||
ClearFolder(di.FullName);
|
ClearFolder(di.FullName, ignoredFiles);
|
||||||
di.Delete();
|
di.Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
v0.5.4.4
|
||||||
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
- new fonts
|
||||||
|
- spectators see indicators for both subs during combat missions
|
||||||
|
- fixed saves becoming corrupted if the player saves and quits in the "map view"
|
||||||
|
- fixed "OpenAL not found" errors if trying to run the game with no enabled audio devices
|
||||||
|
- fixed OpenAL errors when quitting a round
|
||||||
|
- fixed unconscious/dead characters falling through floors
|
||||||
|
- the server list accepts multiple servers from the same IP (assuming they're running on different ports)
|
||||||
|
- fixed autorestart and the start button getting stuck if the server fails to load the respawn shuttle
|
||||||
|
- fixed server failing to start a round if the cargo spawnpoint has been placed outside the submarine
|
||||||
|
- fixed AddToGUIUpdateList errors
|
||||||
|
- fixed SetTransformIgnoreContacts errors
|
||||||
|
- tickboxes work again in the item UIs in wiring/character mode
|
||||||
|
- fixed characters standing in an incorrect position when using railgun controllers in a mirrored sub
|
||||||
|
- spawning a scorpion (an old placeholder enemy) doesn't crash the game anymore
|
||||||
|
- submarine editor shows a warning if there are structures/items way outside the sub
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
v0.5.4.3
|
v0.5.4.3
|
||||||
---------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user