(73782c3bc) Don't prevent selecting items in the sub editor when the cursor is on a wire node, because it makes it very difficult (or impossible) to select items in the wiring mode. + Don't start moving wire nodes unless the cursor is moved by at least 16px from the initial position of the node.
This commit is contained in:
@@ -154,11 +154,22 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
Vector2 nodeWorldPos = GameMain.SubEditorScreen.Cam.ScreenToWorld(PlayerInput.MousePosition) - sub.HiddenSubPosition - sub.Position;// Nodes[(int)selectedNodeIndex];
|
Vector2 nodeWorldPos = GameMain.SubEditorScreen.Cam.ScreenToWorld(PlayerInput.MousePosition) - sub.HiddenSubPosition - sub.Position;// Nodes[(int)selectedNodeIndex];
|
||||||
|
|
||||||
nodeWorldPos.X = MathUtils.Round(nodeWorldPos.X, Submarine.GridSize.X / 2.0f);
|
if (selectedNodeIndex.HasValue)
|
||||||
nodeWorldPos.Y = MathUtils.Round(nodeWorldPos.Y, Submarine.GridSize.Y / 2.0f);
|
{
|
||||||
|
nodeWorldPos.X = MathUtils.Round(nodeWorldPos.X, Submarine.GridSize.X / 2.0f);
|
||||||
|
nodeWorldPos.Y = MathUtils.Round(nodeWorldPos.Y, Submarine.GridSize.Y / 2.0f);
|
||||||
|
|
||||||
|
draggingWire.nodes[(int)selectedNodeIndex] = nodeWorldPos;
|
||||||
|
draggingWire.UpdateSections();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Vector2.DistanceSquared(nodeWorldPos, draggingWire.nodes[(int)highlightedNodeIndex]) > Submarine.GridSize.X * Submarine.GridSize.X)
|
||||||
|
{
|
||||||
|
selectedNodeIndex = highlightedNodeIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
draggingWire.nodes[(int)selectedNodeIndex] = nodeWorldPos;
|
|
||||||
draggingWire.UpdateSections();
|
|
||||||
|
|
||||||
MapEntity.SelectEntity(draggingWire.item);
|
MapEntity.SelectEntity(draggingWire.item);
|
||||||
}
|
}
|
||||||
@@ -213,7 +224,8 @@ namespace Barotrauma.Items.Components
|
|||||||
Character.Controlled.ClearInputs();
|
Character.Controlled.ClearInputs();
|
||||||
}
|
}
|
||||||
draggingWire = selectedWire;
|
draggingWire = selectedWire;
|
||||||
selectedNodeIndex = closestIndex;
|
//selectedNodeIndex = closestIndex;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
//remove the node
|
//remove the node
|
||||||
else if (PlayerInput.RightButtonClicked() && closestIndex > 0 && closestIndex < selectedWire.nodes.Count - 1)
|
else if (PlayerInput.RightButtonClicked() && closestIndex > 0 && closestIndex < selectedWire.nodes.Count - 1)
|
||||||
@@ -264,14 +276,6 @@ namespace Barotrauma.Items.Components
|
|||||||
if (highlighted != null)
|
if (highlighted != null)
|
||||||
{
|
{
|
||||||
highlighted.item.IsHighlighted = true;
|
highlighted.item.IsHighlighted = true;
|
||||||
|
|
||||||
if (Character.Controlled != null)
|
|
||||||
{
|
|
||||||
Character.Controlled.FocusedItem = null;
|
|
||||||
Character.Controlled.ResetInteract = true;
|
|
||||||
Character.Controlled.ClearInputs();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlayerInput.LeftButtonClicked())
|
if (PlayerInput.LeftButtonClicked())
|
||||||
{
|
{
|
||||||
MapEntity.DisableSelect = true;
|
MapEntity.DisableSelect = true;
|
||||||
|
|||||||
@@ -1132,6 +1132,10 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
ApplyStatusEffects(!waterProof && inWater ? ActionType.InWater : ActionType.NotInWater, deltaTime);
|
ApplyStatusEffects(!waterProof && inWater ? ActionType.InWater : ActionType.NotInWater, deltaTime);
|
||||||
}
|
}
|
||||||
|
if (!broken)
|
||||||
|
{
|
||||||
|
ApplyStatusEffects(!waterProof && inWater ? ActionType.InWater : ActionType.NotInWater, deltaTime);
|
||||||
|
}
|
||||||
ApplyStatusEffects(!waterProof && inWater ? ActionType.InWater : ActionType.NotInWater, deltaTime);
|
ApplyStatusEffects(!waterProof && inWater ? ActionType.InWater : ActionType.NotInWater, deltaTime);
|
||||||
|
|
||||||
if (body == null || !body.Enabled || !inWater || ParentInventory != null || Removed) { return; }
|
if (body == null || !body.Enabled || !inWater || ParentInventory != null || Removed) { return; }
|
||||||
|
|||||||
Reference in New Issue
Block a user