v0.3.3.1: fixed the inventories of selected players going behind the chatbox, fixed clients sending deselect messages for characters other than their own, using keybinds when moving the camera

This commit is contained in:
Regalis
2016-02-21 00:29:53 +02:00
parent 308ae7a8b0
commit d6443ac6a4
6 changed files with 16 additions and 37 deletions
+4 -4
View File
@@ -166,10 +166,10 @@ namespace Barotrauma
if (PlayerInput.KeyDown(Keys.LeftShift)) moveSpeed *= 2.0f; if (PlayerInput.KeyDown(Keys.LeftShift)) moveSpeed *= 2.0f;
if (PlayerInput.KeyDown(Keys.LeftControl)) moveSpeed *= 0.5f; if (PlayerInput.KeyDown(Keys.LeftControl)) moveSpeed *= 0.5f;
if (PlayerInput.KeyDown(Keys.A)) moveCam.X -= moveSpeed; if (GameMain.Config.KeyBind(InputType.Left).IsDown()) moveCam.X -= moveSpeed;
if (PlayerInput.KeyDown(Keys.D)) moveCam.X += moveSpeed; if (GameMain.Config.KeyBind(InputType.Right).IsDown()) moveCam.X += moveSpeed;
if (PlayerInput.KeyDown(Keys.S)) moveCam.Y -= moveSpeed; if (GameMain.Config.KeyBind(InputType.Down).IsDown()) moveCam.Y -= moveSpeed;
if (PlayerInput.KeyDown(Keys.W)) moveCam.Y += moveSpeed; if (GameMain.Config.KeyBind(InputType.Up).IsDown()) moveCam.Y += moveSpeed;
} }
if (Submarine.Loaded!=null && Screen.Selected == GameMain.GameScreen) if (Submarine.Loaded!=null && Screen.Selected == GameMain.GameScreen)
+4 -4
View File
@@ -671,9 +671,9 @@ namespace Barotrauma
if (selectedCharacter!=null) if (selectedCharacter!=null)
{ {
if (Vector2.Distance(selectedCharacter.SimPosition, SimPosition) > 2.0f || !selectedCharacter.CanBeSelected) if (Vector2.Distance(selectedCharacter.SimPosition, SimPosition) > 3.0f || !selectedCharacter.CanBeSelected)
{ {
DeselectCharacter(); DeselectCharacter(controlled == this);
} }
} }
@@ -905,7 +905,7 @@ namespace Barotrauma
{ {
if (selectedCharacter != null) if (selectedCharacter != null)
{ {
DeselectCharacter(); DeselectCharacter(controlled == this);
} }
else if (closestCharacter != null && closestCharacter.IsHumanoid && closestCharacter.CanBeSelected) else if (closestCharacter != null && closestCharacter.IsHumanoid && closestCharacter.CanBeSelected)
{ {
@@ -915,7 +915,7 @@ namespace Barotrauma
} }
else else
{ {
if (selectedCharacter != null) DeselectCharacter(); if (selectedCharacter != null) DeselectCharacter(controlled==this);
selectedConstruction = null; selectedConstruction = null;
closestItem = null; closestItem = null;
closestCharacter = null; closestCharacter = null;
+1 -25
View File
@@ -60,9 +60,7 @@ namespace Barotrauma
if (character.SelectedCharacter != null && character.SelectedCharacter.Inventory!=null) if (character.SelectedCharacter != null && character.SelectedCharacter.Inventory!=null)
{ {
character.SelectedCharacter.Inventory.DrawOwn(spriteBatch, new Vector2(GameMain.GraphicsWidth - 310, 0.0f)); character.SelectedCharacter.Inventory.DrawOwn(spriteBatch, new Vector2(320.0f, 0.0f));
//if (Vector2.Distance(selectedCharacter.SimPosition, SimPosition) > 2.0f) selectedCharacter = null;
} }
if (character.ClosestCharacter != null && character.ClosestCharacter.CanBeSelected) if (character.ClosestCharacter != null && character.ClosestCharacter.CanBeSelected)
@@ -74,9 +72,6 @@ namespace Barotrauma
textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestCharacter.Info.Name).X / 2, 20); textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestCharacter.Info.Name).X / 2, 20);
GUI.DrawString(spriteBatch, textPos, character.ClosestCharacter.Info.Name, Color.Orange, Color.Black, 2); GUI.DrawString(spriteBatch, textPos, character.ClosestCharacter.Info.Name, Color.Orange, Color.Black, 2);
//spriteBatch.DrawString(GUI.Font, character.ClosestCharacter.Info.Name, textPos, Color.Black);
//spriteBatch.DrawString(GUI.Font, character.ClosestCharacter.Info.Name, textPos + new Vector2(1, -1), Color.Orange);
} }
else if (character.SelectedCharacter == null && character.ClosestItem != null && character.SelectedConstruction == null) else if (character.SelectedCharacter == null && character.ClosestItem != null && character.SelectedConstruction == null)
{ {
@@ -86,9 +81,6 @@ namespace Barotrauma
Vector2 textPos = startPos; Vector2 textPos = startPos;
textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestItem.Name).X / 2, 20); textPos -= new Vector2(GUI.Font.MeasureString(character.ClosestItem.Name).X / 2, 20);
//spriteBatch.DrawString(GUI.Font, character.ClosestItem.Prefab.Name, textPos, Color.Black);
//GUI.DrawRectangle(spriteBatch, textPos-Vector2.One*2.0f, textSize+Vector2.One*4.0f, Color.Black * 0.7f, true);
//spriteBatch.DrawString(GUI.Font, character.ClosestItem.Prefab.Name, textPos, Color.Orange);
GUI.DrawString(spriteBatch, textPos, character.ClosestItem.Name, Color.Orange, Color.Black * 0.7f, 2); GUI.DrawString(spriteBatch, textPos, character.ClosestItem.Name, Color.Orange, Color.Black * 0.7f, 2);
@@ -100,20 +92,9 @@ namespace Barotrauma
GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color, Color.Black*0.7f, 2); GUI.DrawString(spriteBatch, textPos, coloredText.Text, coloredText.Color, Color.Black*0.7f, 2);
//spriteBatch.DrawString(GUI.Font, coloredText.Text, textPos, Color.Black);
//GUI.DrawRectangle(spriteBatch, textPos - Vector2.One * 2.0f, textSize + Vector2.One * 4.0f, Color.Black * 0.7f, true);
//spriteBatch.DrawString(GUI.Font, coloredText.Text, textPos, coloredText.Color);
textPos.Y += 25; textPos.Y += 25;
} }
} }
//Vector2 offset = Rand.Vector(noise.size.X);
//offset.X = Math.Abs(offset.X);
//offset.Y = Math.Abs(offset.Y);
//noise.DrawTiled(spriteBatch, Vector2.Zero - offset, new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) + offset,
// Vector2.Zero,
// Color.White * 0.1f);
if (character.Oxygen < 50.0f && !character.IsDead) if (character.Oxygen < 50.0f && !character.IsDead)
{ {
@@ -124,11 +105,6 @@ namespace Barotrauma
noiseOverlay.DrawTiled(spriteBatch, Vector2.Zero - offset, new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) + offset, noiseOverlay.DrawTiled(spriteBatch, Vector2.Zero - offset, new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) + offset,
Vector2.Zero, Vector2.Zero,
Color.White * ((50.0f - character.Oxygen) / 50.0f)); Color.White * ((50.0f - character.Oxygen) / 50.0f));
//spriteBatch.Draw(noise.Texture,
// new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
// new Rectangle(Rand.Int(GameMain.GraphicsWidth), Rand.Int(GameMain.GraphicsHeight), (int)noise.size.X, (int)noise.size.Y),
// Color.White * ((100.0f - character.Oxygen) / 100.0f));
} }
if (damageOverlayTimer>0.0f) if (damageOverlayTimer>0.0f)
+1 -3
View File
@@ -120,9 +120,7 @@ namespace Barotrauma
{ {
level.Generate(); level.Generate();
Vector2 subOffsetFromCenter = new Vector2(Submarine.Borders.Center.X, Submarine.Borders.Y - Submarine.Borders.Height / 2); submarine.SetPosition(level.StartPosition - new Vector2(0.0f, 2000.0f));
submarine.SetPosition(level.StartPosition - subOffsetFromCenter - new Vector2(0.0f, 2000.0f));
GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(80); GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(80);
} }
@@ -105,6 +105,11 @@ namespace Barotrauma.Networking
get { return inGameHUD; } get { return inGameHUD; }
} }
public GUIListBox ChatBox
{
get { return chatBox; }
}
public NetworkMember() public NetworkMember()
{ {
inGameHUD = new GUIFrame(new Rectangle(0,0,0,0), null, null); inGameHUD = new GUIFrame(new Rectangle(0,0,0,0), null, null);
Binary file not shown.