Merge branch 'master' into new-netcode

Conflicts:
	Subsurface/Source/GUI/GUITextBlock.cs
	Subsurface/Source/GameMain.cs
	Subsurface/Source/Items/Components/Machines/Radar.cs
	Subsurface/Source/Networking/GameClient.cs
This commit is contained in:
Regalis
2017-05-17 18:51:22 +03:00
26 changed files with 261 additions and 207 deletions
+26 -13
View File
@@ -550,23 +550,13 @@ namespace Barotrauma
deleteButton.UserData = "delete";
deleteButton.OnClicked = (btn, userdata) =>
{
if (subList.Selected!=null)
if (subList.Selected != null)
{
Submarine sub = subList.Selected.UserData as Submarine;
try
{
File.Delete(sub.FilePath);
}
catch (Exception e)
{
DebugConsole.ThrowError("Couldn't delete file \""+sub.FilePath+"\"!", e);
}
TryDeleteSub(subList.Selected.UserData as Submarine);
}
deleteButton.Enabled = false;
CreateLoadScreen();
return true;
};
@@ -603,6 +593,29 @@ namespace Barotrauma
return true;
}
private void TryDeleteSub(Submarine sub)
{
if (sub == null) return;
var msgBox = new GUIMessageBox("Delete file?", "Are you sure you want to delete \"" + sub.Name + "\"", new string[] { "OK", "Cancel" });
msgBox.Buttons[0].OnClicked += (btn, userData) =>
{
try
{
sub.Remove();
File.Delete(sub.FilePath);
CreateLoadScreen();
}
catch (Exception e)
{
DebugConsole.ThrowError("Couldn't delete file \"" + sub.FilePath + "\"!", e);
}
return true;
};
msgBox.Buttons[0].OnClicked += msgBox.Close;
msgBox.Buttons[1].OnClicked += msgBox.Close;
}
private bool SelectTab(GUIButton button, object obj)
{
if (characterMode) ToggleCharacterMode();
+2 -5
View File
@@ -524,11 +524,8 @@ namespace Barotrauma
{
if (GameMain.GameSession.Map.SelectedConnection == null) return false;
GameMain.ShowLoading(ShiftLoading());
//GameMain.GameSession.StartShift(selectedLevel, false);
//GameMain.GameScreen.Select();
GameMain.Instance.ShowLoading(ShiftLoading());
return true;
}
+1 -1
View File
@@ -509,7 +509,7 @@ namespace Barotrauma
GUI.Draw((float)deltaTime, spriteBatch, null);
GUI.Font.DrawString(spriteBatch, "Barotrauma v"+GameMain.Version, new Vector2(10, GameMain.GraphicsHeight-20), Color.White);
spriteBatch.End();
}