- host can respawn

- respawn info texts
- camera clamped to the the upper edge of the level
- fixed submarinebody being generated from all walls (and not just the ones belonging to that specific sub)
This commit is contained in:
Regalis
2016-06-23 18:23:20 +03:00
parent dc7956274c
commit 296c5a14ed
12 changed files with 204 additions and 74 deletions

View File

@@ -413,6 +413,11 @@ namespace Barotrauma.Networking
reliableChannel.Update(deltaTime);
if (gameStarted && respawnManager != null)
{
respawnManager.Update(deltaTime);
}
if (updateTimer > DateTime.Now) return;
if (myCharacter != null)
@@ -730,6 +735,8 @@ namespace Barotrauma.Networking
GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
GameMain.LightManager.LosEnabled = false;
respawnManager = null;
float endPreviewLength = 10.0f;
if (Screen.Selected == GameMain.GameScreen)
@@ -779,11 +786,6 @@ namespace Barotrauma.Networking
if (fileStreamReceiver != null &&
(fileStreamReceiver.Status == FileTransferStatus.Receiving || fileStreamReceiver.Status == FileTransferStatus.NotStarted))
{
//Vector2 pos = Screen.Selected == GameMain.NetLobbyScreen ?
// new Vector2(GameMain.NetLobbyScreen.SubList.Rect.X, GameMain.NetLobbyScreen.SubList.Rect.Bottom+5) : new Vector2(GameMain.GraphicsWidth / 2 - 200, 10);
Vector2 pos = new Vector2(GameMain.GraphicsWidth / 2 - 130, GameMain.NetLobbyScreen.InfoFrame.Rect.Y / 2 - 15);
GUI.DrawString(spriteBatch,
@@ -804,6 +806,16 @@ namespace Barotrauma.Networking
}
}
if (respawnManager != null && respawnManager.CurrentState == RespawnManager.State.Waiting &&
myCharacter != null && myCharacter.IsDead)
{
GUI.DrawString(spriteBatch,
new Vector2(GameMain.GraphicsWidth - 300.0f, 20),
"Respawning in " + (int)respawnManager.RespawnTimer + " s",
Color.White, null, 0, GUI.SmallFont);
}
if (!GameMain.DebugDraw) return;
int width = 200, height = 300;