waypoint selection bug, unequipped captain uniform sprites, repairtool sounds & particle tweaking, wire overlap bug, connectionpanel loading bug, looting dead crew members
This commit is contained in:
@@ -58,8 +58,8 @@ namespace Subsurface.Items.Components
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
public float ItemRotation
|
||||
{
|
||||
get { return itemRotation; }
|
||||
set { itemRotation = value; }
|
||||
get { return MathHelper.ToDegrees(itemRotation); }
|
||||
set { itemRotation = MathHelper.ToRadians(value); }
|
||||
}
|
||||
private float itemRotation;
|
||||
|
||||
|
||||
@@ -183,6 +183,17 @@ namespace Subsurface.Items.Components
|
||||
if (!attachable || item.body==null) return true;
|
||||
|
||||
item.Drop();
|
||||
|
||||
var containedItems = item.ContainedItems;
|
||||
if (containedItems!=null)
|
||||
{
|
||||
foreach (Item contained in containedItems)
|
||||
{
|
||||
if (contained.body == null) continue;
|
||||
contained.SetTransform(item.SimPosition, contained.body.Rotation);
|
||||
}
|
||||
}
|
||||
|
||||
item.body.Enabled = false;
|
||||
item.body = null;
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Subsurface.Items.Components
|
||||
Body targetBody = Submarine.PickBody(TransformedBarrelPos, targetPosition, ignoredBodies);
|
||||
pickedPosition = Submarine.LastPickedPosition;
|
||||
|
||||
if (targetBody==null || targetBody.UserData==null) return true;
|
||||
if (targetBody == null || targetBody.UserData == null) return true;
|
||||
|
||||
//ApplyStatusEffects(ActionType.OnUse, 1.0f, character);
|
||||
|
||||
|
||||
@@ -550,9 +550,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public virtual void Load(XElement componentElement)
|
||||
{
|
||||
if (componentElement == null) return;
|
||||
|
||||
|
||||
if (componentElement == null) return;
|
||||
|
||||
foreach (XAttribute attribute in componentElement.Attributes())
|
||||
{
|
||||
|
||||
@@ -179,6 +179,10 @@ namespace Subsurface.Items.Components
|
||||
foreach (Item contained in item.ContainedItems)
|
||||
{
|
||||
contained.Condition = 0.0f;
|
||||
if (contained.body!=null)
|
||||
{
|
||||
contained.body.SetTransform(item.SimPosition, contained.body.Rotation);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
private List<StatusEffect> effects;
|
||||
|
||||
int[] wireId;
|
||||
public readonly int[] wireId;
|
||||
|
||||
public List<Connection> Recipients
|
||||
{
|
||||
@@ -463,7 +463,7 @@ namespace Subsurface.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
wireId = null;
|
||||
//wireId = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,21 +74,26 @@ namespace Subsurface.Items.Components
|
||||
public override void Load(XElement element)
|
||||
{
|
||||
base.Load(element);
|
||||
|
||||
connections.Clear();
|
||||
|
||||
List<Connection> loadedConnections = new List<Connection>();
|
||||
|
||||
foreach (XElement subElement in element.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString())
|
||||
{
|
||||
case "input":
|
||||
connections.Add(new Connection(subElement, item));
|
||||
loadedConnections.Add(new Connection(subElement, item));
|
||||
break;
|
||||
case "output":
|
||||
connections.Add(new Connection(subElement, item));
|
||||
loadedConnections.Add(new Connection(subElement, item));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i<loadedConnections.Count && i<connections.Count; i++)
|
||||
{
|
||||
loadedConnections[i].wireId.CopyTo(connections[i].wireId, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Remove()
|
||||
|
||||
@@ -274,12 +274,12 @@ namespace Subsurface.Items.Components
|
||||
|
||||
for (int i = 1; i < Nodes.Count; i++)
|
||||
{
|
||||
DrawSection(spriteBatch, Nodes[i], Nodes[i - 1], i, item.Color);
|
||||
DrawSection(spriteBatch, Nodes[i], Nodes[i - 1], item.Color);
|
||||
}
|
||||
|
||||
if (isActive && Vector2.Distance(newNodePos, Nodes[Nodes.Count - 1]) > nodeDistance)
|
||||
{
|
||||
DrawSection(spriteBatch, Nodes[Nodes.Count - 1], newNodePos, Nodes.Count, item.Color * 0.5f);
|
||||
DrawSection(spriteBatch, Nodes[Nodes.Count - 1], newNodePos, item.Color * 0.5f);
|
||||
//nodes.Add(newNodePos);
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ selectedNodeIndex = null;
|
||||
|
||||
}
|
||||
|
||||
private void DrawSection(SpriteBatch spriteBatch, Vector2 start, Vector2 end, int i, Color color)
|
||||
private void DrawSection(SpriteBatch spriteBatch, Vector2 start, Vector2 end, Color color)
|
||||
{
|
||||
start.Y = -start.Y;
|
||||
end.Y = -end.Y;
|
||||
@@ -344,7 +344,7 @@ selectedNodeIndex = null;
|
||||
new Vector2(0.0f, wireSprite.size.Y / 2.0f),
|
||||
new Vector2((Vector2.Distance(start, end)) / wireSprite.Texture.Width, 0.3f),
|
||||
SpriteEffects.None,
|
||||
wireSprite.Depth + 0.1f + i * 0.00001f);
|
||||
wireSprite.Depth + ((item.ID % 100) * 0.00001f));
|
||||
}
|
||||
|
||||
public override XElement Save(XElement parentElement)
|
||||
|
||||
Reference in New Issue
Block a user