(d9829ac) v0.9.4.0

This commit is contained in:
Regalis
2019-10-24 18:05:42 +02:00
parent 9aa12bcac2
commit b39922a074
319 changed files with 12516 additions and 6815 deletions
@@ -55,6 +55,8 @@ namespace Barotrauma.Items.Components
public bool Hidden;
private float removeNodeDelay;
private bool locked;
public bool Locked
{
@@ -71,7 +73,7 @@ namespace Barotrauma.Items.Components
get { return connections; }
}
[Serialize(5000.0f, false)]
[Serialize(5000.0f, false, description: "The maximum distance the wire can extend (in pixels).")]
public float MaxLength
{
get;
@@ -255,17 +257,18 @@ namespace Barotrauma.Items.Components
public override void Drop(Character dropper)
{
ClearConnections(dropper);
ClearConnections(dropper);
IsActive = false;
}
public override void Update(float deltaTime, Camera cam)
{
if (nodes.Count == 0) return;
removeNodeDelay -= deltaTime;
if (nodes.Count == 0) { return; }
Submarine sub = null;
if (connections[0] != null && connections[0].Item.Submarine != null) sub = connections[0].Item.Submarine;
if (connections[1] != null && connections[1].Item.Submarine != null) sub = connections[1].Item.Submarine;
if (connections[0] != null && connections[0].Item.Submarine != null) { sub = connections[0].Item.Submarine; }
if (connections[1] != null && connections[1].Item.Submarine != null) { sub = connections[1].Item.Submarine; }
if (Screen.Selected != GameMain.SubEditorScreen)
{
@@ -354,10 +357,12 @@ namespace Barotrauma.Items.Components
public override bool Use(float deltaTime, Character character = null)
{
if (character == null) return false;
#if CLIENT
if (character == Character.Controlled && character.SelectedConstruction != null) return false;
#endif
if (character == null) { return false; }
if (character == Character.Controlled && character.SelectedConstruction != null) { return false; }
if (Screen.Selected == GameMain.SubEditorScreen && !PlayerInput.LeftButtonClicked())
{
return false;
}
if (newNodePos != Vector2.Zero && canPlaceNode && nodes.Count > 0 && Vector2.Distance(newNodePos, nodes[nodes.Count - 1]) > nodeDistance)
{
@@ -384,11 +389,12 @@ namespace Barotrauma.Items.Components
public override bool SecondaryUse(float deltaTime, Character character = null)
{
if (nodes.Count > 1)
if (nodes.Count > 1 && removeNodeDelay <= 0.0f)
{
nodes.RemoveAt(nodes.Count - 1);
UpdateSections();
}
removeNodeDelay = 0.1f;
Drawable = IsActive || sections.Count > 0;
return true;
@@ -668,9 +674,9 @@ namespace Barotrauma.Items.Components
UpdateSections();
}
public override void Load(XElement componentElement)
public override void Load(XElement componentElement, bool usePrefabValues)
{
base.Load(componentElement);
base.Load(componentElement, usePrefabValues);
string nodeString = componentElement.GetAttributeString("nodes", "");
if (nodeString == "") return;