- multiple submarines can be "merged" into one file (to be used as escape vessels etc)

- WIP docking ports
This commit is contained in:
Regalis
2016-06-26 14:31:00 +03:00
parent 296c5a14ed
commit b04e204dc3
19 changed files with 740 additions and 108 deletions
+19 -4
View File
@@ -260,6 +260,21 @@ namespace Barotrauma
}
}
public void AddToGrid(Submarine submarine)
{
foreach (EntityGrid grid in entityGrids)
{
if (grid.Submarine != submarine) continue;
rect.Location -= submarine.HiddenSubPosition.ToPoint();
grid.InsertEntity(this);
rect.Location += submarine.HiddenSubPosition.ToPoint();
return;
}
}
public override bool IsMouseOn(Vector2 position)
{
if (!GameMain.DebugDraw && !ShowHulls) return false;
@@ -295,6 +310,7 @@ namespace Barotrauma
public override void Remove()
{
base.Remove();
hullList.Remove(this);
if (Submarine == null || !Submarine.Loading)
{
@@ -324,7 +340,6 @@ namespace Barotrauma
}
hullList.Remove(this);
}
public void AddFireSource(FireSource fireSource, bool createNetworkEvent = true)
@@ -712,7 +727,7 @@ namespace Barotrauma
// return gaps;
//}
public override XElement Save(XDocument doc)
public override XElement Save(XElement parentElement)
{
XElement element = new XElement("Hull");
@@ -725,8 +740,8 @@ namespace Barotrauma
rect.Width + "," + rect.Height),
new XAttribute("water", volume)
);
doc.Root.Add(element);
parentElement.Add(element);
return element;
}