Improved wire editing logic:

- wires have to be selected by clicking before any nodes can be moved
- wires can be selected by clicking either the nodes or the sections
- new nodes can be added by clicking a section while holding ctrl
- the selected wire is drawn on top of all other entities
This commit is contained in:
Regalis
2016-11-30 16:45:21 +02:00
parent 2e2c206d5f
commit 568c909ff0
3 changed files with 195 additions and 54 deletions
+13 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using Barotrauma.Items.Components;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
@@ -920,6 +921,17 @@ namespace Barotrauma
me.IsHighlighted = false;
}
if (wiringMode)
{
List<Wire> wires = new List<Wire>();
foreach (Item item in Item.ItemList)
{
var wire = item.GetComponent<Wire>();
if (wire != null) wires.Add(wire);
}
Wire.UpdateEditing(wires);
}
if (dummyCharacter.SelectedConstruction==null)
{
Vector2 mouseSimPos = FarseerPhysics.ConvertUnits.ToSimUnits(dummyCharacter.CursorPosition);