Spectating, fire, damaged limb sprites, water detector, engineer jumpsuit, new signal comp sprites, resharper cleanup (god knows what else, commit more often)

This commit is contained in:
Regalis
2015-11-10 22:22:26 +02:00
parent cd48d12be6
commit 4d949e3be1
89 changed files with 977 additions and 622 deletions
@@ -191,7 +191,7 @@ namespace Barotrauma.Items.Components
bool mouseInRect = panelRect.Contains(PlayerInput.MousePosition);
Wire equippedWire = null;
//if the character using the panel has a wire item equipped
//if the Character using the panel has a wire item equipped
//and the wire hasn't been connected yet, draw it on the panel
for (int i = 0; i < character.SelectedItems.Length; i++)
{
@@ -246,7 +246,7 @@ namespace Barotrauma.Items.Components
}
}
//if the character using the panel has a wire item equipped
//if the Character using the panel has a wire item equipped
//and the wire hasn't been connected yet, draw it on the panel
if (equippedWire!=null)
{
@@ -262,9 +262,9 @@ namespace Barotrauma.Items.Components
}
}
//for (int i = 0; i < character.SelectedItems.Length; i++ )
//for (int i = 0; i < Character.SelectedItems.Length; i++ )
//{
// Item selectedItem = character.SelectedItems[i];
// Item selectedItem = Character.SelectedItems[i];
// if (selectedItem == null) continue;
@@ -281,7 +281,7 @@ namespace Barotrauma.Items.Components
if (!PlayerInput.LeftButtonDown())
{
panel.Item.NewComponentEvent(panel, true, true);
//draggingConnected.Drop(character);
//draggingConnected.Drop(Character);
draggingConnected = null;
}
}
@@ -0,0 +1,38 @@
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
class WaterDetector : ItemComponent
{
private Hull hull;
public WaterDetector(Item item, XElement element)
: base (item, element)
{
hull = Hull.FindHull(item.Position);
IsActive = true;
}
public override void OnMapLoaded()
{
hull = Hull.FindHull(item.Position);
}
public override void Move(Microsoft.Xna.Framework.Vector2 amount)
{
hull = Hull.FindHull(item.Position);
}
public override void Update(float deltaTime, Camera cam)
{
if (hull == null) return;
float waterDepth = hull.Volume / hull.Size.X;
bool underWater = (hull.Rect.Y-hull.Rect.Height + waterDepth)>item.Position.Y;
item.SendSignal(underWater ? "1" : "0", "signal_out");
}
}
}
@@ -41,7 +41,7 @@ namespace Barotrauma.Items.Components
public override void Move(Vector2 amount)
{
amount = FarseerPhysics.ConvertUnits.ToDisplayUnits(amount);
//amount = FarseerPhysics.ConvertUnits.ToDisplayUnits(amount);
//for (int i = 0; i<Nodes.Count; i++)
//{
// Nodes[i] += amount;