Resizing structures/items in editor

This commit is contained in:
Regalis
2016-02-28 21:08:52 +02:00
parent 00c1edad09
commit c64dbed55d
8 changed files with 193 additions and 56 deletions

View File

@@ -74,6 +74,21 @@ namespace Barotrauma
}
}
public override Rectangle Rect
{
get
{
return base.Rect;
}
set
{
base.Rect = value;
Item.UpdateHulls();
Gap.UpdateHulls();
}
}
public override bool IsLinkable
{
get { return true; }
@@ -151,13 +166,13 @@ namespace Barotrauma
}
public Hull(MapEntityPrefab prefab, Rectangle rectangle)
: this (rectangle, Submarine.Loaded)
: this (prefab, rectangle, Submarine.Loaded)
{
}
public Hull(Rectangle rectangle, Submarine submarine)
: base (submarine)
public Hull(MapEntityPrefab prefab, Rectangle rectangle, Submarine submarine)
: base (prefab, submarine)
{
rect = rectangle;
@@ -691,7 +706,7 @@ namespace Barotrauma
int.Parse(element.Attribute("height").Value));
}
Hull h = new Hull(rect, submarine);
Hull h = new Hull(MapEntityPrefab.list.Find(m => m.Name == "Hull"), rect, submarine);
h.volume = ToolBox.GetAttributeFloat(element, "pressure", 0.0f);