(3a5d98b) v0.9.6.0

This commit is contained in:
Regalis
2019-12-17 14:38:24 +01:00
parent 5c95c53118
commit a3569b8bf0
95 changed files with 1579 additions and 728 deletions
@@ -85,8 +85,7 @@ namespace Barotrauma
{
if (character.Inventory != null)
{
if (!character.LockHands && character.Stun < 0.1f &&
(character.SelectedConstruction == null || character.SelectedConstruction?.GetComponent<Controller>()?.User != character))
if (!LockInventory(character))
{
character.Inventory.Update(deltaTime, cam);
}
@@ -325,7 +324,7 @@ namespace Barotrauma
}
if (character.Inventory != null && !character.LockHands)
{
character.Inventory.Locked = (character.SelectedConstruction?.GetComponent<Controller>()?.User == character);
character.Inventory.Locked = LockInventory(character);
character.Inventory.DrawOwn(spriteBatch);
character.Inventory.CurrentLayout = CharacterHealth.OpenHealthWindow == null && character.SelectedCharacter == null ?
CharacterInventory.Layout.Default :
@@ -368,6 +367,17 @@ namespace Barotrauma
}
}
private static bool LockInventory(Character character)
{
if (character?.Inventory == null || !character.AllowInput || character.LockHands) { return true; }
//lock if using a controller, except if we're also using a connection panel in the same item
return
character.SelectedConstruction != null &&
character.SelectedConstruction?.GetComponent<Controller>()?.User == character &&
character.SelectedConstruction?.GetComponent<ConnectionPanel>()?.User != character;
}
private static void DrawOrderIndicator(SpriteBatch spriteBatch, Camera cam, Character character, Order order, float iconAlpha = 1.0f)
{
if (order.TargetAllCharacters)