Unstable v0.10.601.0

This commit is contained in:
Juan Pablo Arce
2020-10-07 10:39:32 -03:00
parent ebe1ce1427
commit 768f516e7c
65 changed files with 743 additions and 139 deletions
@@ -717,11 +717,10 @@ namespace Barotrauma.Items.Components
bool leakFixed = (leak.Open <= 0.0f || leak.Removed) &&
(leak.ConnectedWall == null || leak.ConnectedWall.Sections.Average(s => s.damage) < 1);
if (leakFixed && leak.FlowTargetHull != null)
if (leakFixed && leak.FlowTargetHull?.DisplayName != null)
{
if (!leak.FlowTargetHull.ConnectedGaps.Any(g => !g.IsRoomToRoom && g.Open > 0.0f))
{
{
character.Speak(TextManager.GetWithVariable("DialogLeaksFixed", "[roomname]", leak.FlowTargetHull.DisplayName, true), null, 0.0f, "leaksfixed", 10.0f);
}
else
@@ -146,7 +146,7 @@ namespace Barotrauma.Items.Components
public bool DrawHudWhenEquipped
{
get;
private set;
protected set;
}
[Serialize(false, false, description: "Can the item be selected by interacting with it.")]
@@ -0,0 +1,21 @@
using Barotrauma.Networking;
using System.Xml.Linq;
#if CLIENT
using Microsoft.Xna.Framework.Graphics;
#endif
namespace Barotrauma.Items.Components
{
class NameTag : ItemComponent
{
[InGameEditable, Serialize("", false, description: "Name written on the tag.", alwaysUseInstanceValues: true)]
public string WrittenName { get; set; }
public NameTag(Item item, XElement element) : base(item, element)
{
AllowInGameEditing = true;
DrawHudWhenEquipped = true;
item.EditableWhenEquipped = true;
}
}
}
@@ -1,10 +1,11 @@
using System.Xml.Linq;
using Barotrauma.Networking;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
partial class Terminal : ItemComponent
{
private const int MaxMessageLength = 150;
private const int MaxMessageLength = ChatMessage.MaxLength;
public string DisplayedWelcomeMessage
{
@@ -304,13 +304,16 @@ namespace Barotrauma
for (int j = 0; j < otherInventory.capacity; j++)
{
if (otherInventory.Items[j] == item) otherInventory.Items[j] = null;
if (otherInventory.Items[j] == item) { otherInventory.Items[j] = null; }
}
for (int j = 0; j < capacity; j++)
{
if (Items[j] == existingItem) Items[j] = null;
if (Items[j] == existingItem) { Items[j] = null; }
}
(otherInventory.Owner as Character)?.DeselectItem(item);
(otherInventory.Owner as Character)?.DeselectItem(existingItem);
bool swapSuccessful = false;
if (otherIsEquipped)
{
@@ -119,6 +119,8 @@ namespace Barotrauma
}
}
public bool EditableWhenEquipped { get; set; } = false;
//the inventory in which the item is contained in
public Inventory ParentInventory
{
@@ -2257,7 +2259,7 @@ namespace Barotrauma
var propertyOwner = allProperties.Find(p => p.Second == property);
if (allProperties.Count > 1)
{
msg.WriteRangedInteger(allProperties.FindIndex(p => p.Second == property), 0, allProperties.Count - 1);
msg.Write((byte)allProperties.FindIndex(p => p.Second == property));
}
object value = property.GetValue(propertyOwner.First);
@@ -2339,7 +2341,7 @@ namespace Barotrauma
int propertyIndex = 0;
if (allProperties.Count > 1)
{
propertyIndex = msg.ReadRangedInteger(0, allProperties.Count - 1);
propertyIndex = msg.ReadByte();
}
bool allowEditing = true;
@@ -2360,6 +2362,7 @@ namespace Barotrauma
if (type == typeof(string))
{
string val = msg.ReadString();
logValue = val;
if (allowEditing)
{
property.TrySetValue(parentObject, val);