Bunch of editor improvements/bugfixes: free node positioning when placing wires, options to hide hulls, gaps & links, hidden entities can't be selected, more accurate stair selecting, disabled UImessages, camera position fixes

This commit is contained in:
Regalis
2016-01-15 23:04:34 +02:00
parent 203e7c4114
commit 8e491ae855
13 changed files with 184 additions and 65 deletions

View File

@@ -16,6 +16,8 @@ namespace Barotrauma
public static List<Hull> hullList = new List<Hull>();
private static EntityGrid entityGrid;
public static bool ShowHulls = true;
public static bool EditWater, EditFire;
public static WaterRenderer renderer;
@@ -186,8 +188,10 @@ namespace Barotrauma
}
}
public override bool Contains(Vector2 position)
public override bool IsMouseOn(Vector2 position)
{
if (!GameMain.DebugDraw && !ShowHulls) return false;
return (Submarine.RectContains(WorldRect, position) &&
!Submarine.RectContains(MathUtils.ExpandRect(WorldRect, -8), position));
}
@@ -228,7 +232,7 @@ namespace Barotrauma
//renderer.Dispose();
entityGrid.RemoveEntity(this);
if (entityGrid!=null) entityGrid.RemoveEntity(this);
hullList.Remove(this);
}
@@ -371,6 +375,8 @@ namespace Barotrauma
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
{
if (!ShowHulls && !GameMain.DebugDraw) return;
if (!editing && !GameMain.DebugDraw) return;
Rectangle drawRect =