Merge branch 'master' into new-netcode

Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Items/Components/DockingPort.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
This commit is contained in:
Regalis
2016-12-29 22:18:27 +02:00
134 changed files with 1799 additions and 683 deletions
+35 -12
View File
@@ -888,6 +888,11 @@ namespace Barotrauma
}
}
public override bool IsVisible(Rectangle worldView)
{
return drawableComponents.Count > 0 || body == null || body.Enabled;
}
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
{
if (!Visible) return;
@@ -1137,28 +1142,40 @@ namespace Barotrauma
foreach (ItemComponent ic in components)
{
ic.DrawHUD(spriteBatch, character);
if (ic.CanBeSelected) ic.DrawHUD(spriteBatch, character);
}
}
public override void AddToGUIUpdateList()
{
if (condition <= 0.0f)
{
FixRequirement.AddToGUIUpdateList();
return;
}
if (HasInGameEditableProperties)
if (Screen.Selected is EditMapScreen)
{
if (editingHUD != null) editingHUD.AddToGUIUpdateList();
}
foreach (ItemComponent ic in components)
else
{
ic.AddToGUIUpdateList();
if (HasInGameEditableProperties)
{
if (editingHUD != null) editingHUD.AddToGUIUpdateList();
}
}
if (Character.Controlled != null && Character.Controlled.SelectedConstruction == this)
{
if (condition <= 0.0f)
{
FixRequirement.AddToGUIUpdateList();
return;
}
foreach (ItemComponent ic in components)
{
if (ic.CanBeSelected) ic.AddToGUIUpdateList();
}
}
if (Screen.Selected is EditMapScreen && editingHUD != null) editingHUD.AddToGUIUpdateList();
}
public virtual void UpdateHUD(Camera cam, Character character)
{
if (condition <= 0.0f)
@@ -1949,16 +1966,22 @@ namespace Barotrauma
GameMain.Client.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ComponentState, index });
}
/// <summary>
/// Remove the item so that it doesn't appear to exist in the game world (stop sounds, remove bodies etc)
/// but don't reset anything that's required for cloning the item
/// </summary>
public override void ShallowRemove()
{
base.ShallowRemove();
Removed = true;
foreach (ItemComponent ic in components)
{
ic.Remove();
ic.ShallowRemove();
}
ItemList.Remove(this);
if (body != null)
{
body.Remove();
@@ -2000,4 +2023,4 @@ namespace Barotrauma
}
}
}
}