Fixed spectators joining messing up the game, textboxes are deselected when switching the screen, nerfed engineer construction level, tickboxes or textboxes cannot be selected through other ui elements

This commit is contained in:
Regalis
2016-02-16 20:52:39 +02:00
parent 9004205c80
commit f3112e29b4
19 changed files with 55 additions and 37 deletions
@@ -168,8 +168,8 @@ namespace Barotrauma
System.Diagnostics.Debug.Assert(false);
return false;
}
Inventory otherInventory = Items[index].Inventory;
if (otherInventory != null && createNetworkEvent)
Inventory otherInventory = Items[index].ParentInventory;
if (otherInventory != null && otherInventory.Owner!=null && createNetworkEvent)
{
new Networking.NetworkEvent(Networking.NetworkEventType.InventoryUpdate, otherInventory.Owner.ID, true, true);
}
@@ -219,7 +219,7 @@ namespace Barotrauma
string toolTip = "";
Rectangle highlightedSlot = Rectangle.Empty;
if (doubleClickedItem!=null && doubleClickedItem.Inventory!=this)
if (doubleClickedItem!=null && doubleClickedItem.ParentInventory!=this)
{
TryPutItem(doubleClickedItem, doubleClickedItem.AllowedSlots, true);
}
@@ -30,7 +30,7 @@ namespace Barotrauma.Items.Components
[HasDefaultValue(false, true)]
public bool Attached
{
get { return attached && item.Inventory == null; }
get { return attached && item.ParentInventory == null; }
set { attached = value; }
}
@@ -278,7 +278,7 @@ namespace Barotrauma.Items.Components
}
else
{
if (item.Inventory != null)
if (item.ParentInventory != null)
{
if (body != null)
{
+3 -3
View File
@@ -125,11 +125,11 @@ namespace Barotrauma
if (removeItem)
{
item.Drop(null, false);
if (item.Inventory != null) item.Inventory.RemoveItem(item);
if (item.ParentInventory != null) item.ParentInventory.RemoveItem(item);
}
Items[i] = item;
item.Inventory = this;
item.ParentInventory = this;
if (item.body != null)
{
item.body.Enabled = false;
@@ -154,7 +154,7 @@ namespace Barotrauma
{
if (Items[n] != item) continue;
Items[n] = null;
item.Inventory = null;
item.ParentInventory = null;
}
}
+5 -5
View File
@@ -63,20 +63,20 @@ namespace Barotrauma
private bool inWater;
private Inventory inventory;
private Inventory parentInventory;
//the inventory in which the item is contained in
public Inventory Inventory
public Inventory ParentInventory
{
get
{
return inventory;
return parentInventory;
}
set
{
inventory = value;
parentInventory = value;
if (inventory != null) Container = inventory.Owner as Item;
if (parentInventory != null) Container = parentInventory.Owner as Item;
}
}