Merge branch 'master' of https://github.com/Faerdan/Barotrauma into Faerdan-master

Conflicts:
	Barotrauma/BarotraumaClient/Source/Map/MapEntity.cs
	Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs
	Barotrauma/BarotraumaShared/Source/Characters/Character.cs
	Barotrauma/BarotraumaShared/Source/Items/Item.cs
This commit is contained in:
Joonas Rikkonen
2017-07-05 19:32:34 +03:00
47 changed files with 473 additions and 483 deletions
@@ -56,21 +56,16 @@ namespace Barotrauma
public override void AddToGUIUpdateList()
{
if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null)
if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null && Character.Controlled.CanInteractWith(Character.Controlled.SelectedConstruction))
{
if (Character.Controlled.SelectedConstruction == Character.Controlled.ClosestItem)
{
Character.Controlled.SelectedConstruction.AddToGUIUpdateList();
}
Character.Controlled.SelectedConstruction.AddToGUIUpdateList();
}
if (GameMain.GameSession != null) GameMain.GameSession.AddToGUIUpdateList();
Character.AddAllToGUIUpdateList();
}
public override void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
{
cam.UpdateTransform(true);
@@ -80,12 +75,9 @@ namespace Barotrauma
spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, GameMain.ScissorTestEnable);
if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null)
if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null && Character.Controlled.CanInteractWith(Character.Controlled.SelectedConstruction))
{
if (Character.Controlled.SelectedConstruction == Character.Controlled.ClosestItem)
{
Character.Controlled.SelectedConstruction.DrawHUD(spriteBatch, cam, Character.Controlled);
}
Character.Controlled.SelectedConstruction.DrawHUD(spriteBatch, cam, Character.Controlled);
}
if (Character.Controlled != null && cam != null) Character.Controlled.DrawHUD(spriteBatch, cam);