v0.19.0.0 (unstable)

This commit is contained in:
Regalis11
2022-07-20 18:47:07 +03:00
parent 2e2663a175
commit 6b55adcdd9
170 changed files with 2769 additions and 1634 deletions
@@ -179,7 +179,7 @@ namespace Barotrauma.Items.Components
{
UpdateProjSpecific(deltaTime);
if (user == null || user.SelectedConstruction != item)
if (user == null || user.SelectedItem != item)
{
#if SERVER
if (user != null) { item.CreateServerEvent(this); }
@@ -196,7 +196,7 @@ namespace Barotrauma.Items.Components
return;
}
user.AnimController.UpdateUseItem(true, item.WorldPosition + new Vector2(0.0f, 100.0f) * (((float)Timing.TotalTime / 10.0f) % 0.1f));
user.AnimController.UpdateUseItem(!user.IsClimbing, item.WorldPosition + new Vector2(0.0f, 100.0f) * (((float)Timing.TotalTime / 10.0f) % 0.1f));
}
public override void UpdateBroken(float deltaTime, Camera cam)
@@ -206,7 +206,7 @@ namespace Barotrauma.Items.Components
partial void UpdateProjSpecific(float deltaTime);
public override bool Select(Character picker)
public bool CanRewire()
{
//attaching wires to items with a body is not allowed
//(signal items remove their bodies when attached to a wall)
@@ -214,6 +214,15 @@ namespace Barotrauma.Items.Components
{
return false;
}
return true;
}
public override bool Select(Character picker)
{
if (!CanRewire())
{
return false;
}
user = picker;
#if SERVER
@@ -106,11 +106,11 @@ namespace Barotrauma.Items.Components
{
case "set_text":
case "signal_in":
if (string.IsNullOrEmpty(signal.value)) { return; }
if (signal.value.Length > MaxMessageLength)
{
signal.value = signal.value.Substring(0, MaxMessageLength);
}
string inputSignal = signal.value.Replace("\\n", "\n");
ShowOnDisplay(inputSignal, addToHistory: true, TextColor);
break;
@@ -309,7 +309,7 @@ namespace Barotrauma.Items.Components
if (nodes.Count == 0) { return; }
Character user = item.ParentInventory?.Owner as Character;
editNodeDelay = (user?.SelectedConstruction == null) ? editNodeDelay - deltaTime : 0.5f;
editNodeDelay = (user?.SelectedItem == null) ? editNodeDelay - deltaTime : 0.5f;
Submarine sub = item.Submarine;
if (connections[0] != null && connections[0].Item.Submarine != null) { sub = connections[0].Item.Submarine; }
@@ -369,7 +369,7 @@ namespace Barotrauma.Items.Components
user.AnimController.Collider.ApplyForce(forceDir * user.Mass * 50.0f, maxVelocity: NetConfig.MaxPhysicsBodyVelocity * 0.5f);
if (diff.LengthSquared() > 50.0f * 50.0f)
{
user.AnimController.UpdateUseItem(true, user.WorldPosition + pullBackDir * Math.Min(150.0f, diff.Length()));
user.AnimController.UpdateUseItem(!user.IsClimbing, user.WorldPosition + pullBackDir * Math.Min(150.0f, diff.Length()));
}
if (GameMain.NetworkMember == null || GameMain.NetworkMember.IsServer)
@@ -428,7 +428,7 @@ namespace Barotrauma.Items.Components
public override bool Use(float deltaTime, Character character = null)
{
if (character == null || character != Character.Controlled) { return false; }
if (character.SelectedConstruction != null) { return false; }
if (character.HasSelectedAnyItem) { return false; }
#if CLIENT
if (Screen.Selected == GameMain.SubEditorScreen && !PlayerInput.PrimaryMouseButtonClicked())
{