(714944a46) - Item triggers can be used to define areas that cause the item to be highlighted, not just areas that the player has to be inside to interact with the item. - Triggers take item scale into account. - Added triggers around the integrated buttons in the new hatch/window variants (-> fixes hatches not being highlighted by putting the cursor on the button when there's a ladder next to the player).

This commit is contained in:
Joonas Rikkonen
2019-04-25 17:46:26 +03:00
parent 7d65c53bb6
commit d98c245183
3 changed files with 26 additions and 16 deletions
@@ -1546,12 +1546,11 @@ namespace Barotrauma
}
}
}
if (item.InteractDistance == 0.0f && !item.Prefab.Triggers.Any()) return false;
if (item.InteractDistance == 0.0f && !item.Prefab.Triggers.Any()) { return false; }
Pickable pickableComponent = item.GetComponent<Pickable>();
if (pickableComponent != null && (pickableComponent.Picker != null && !pickableComponent.Picker.IsDead)) return false;
if (pickableComponent != null && (pickableComponent.Picker != null && !pickableComponent.Picker.IsDead)) { return false; }
Vector2 characterDirection = Vector2.Transform(Vector2.UnitY, Matrix.CreateRotationZ(AnimController.Collider.Rotation));
@@ -1565,7 +1564,7 @@ namespace Barotrauma
}
bool insideTrigger = item.IsInsideTrigger(upperBodyPosition) || item.IsInsideTrigger(lowerBodyPosition);
if (item.Prefab.Triggers.Count > 0 && !insideTrigger) return false;
if (item.Prefab.Triggers.Count > 0 && !insideTrigger && item.Prefab.RequireBodyInsideTrigger) { return false; }
Rectangle itemDisplayRect = new Rectangle(item.InteractionRect.X, item.InteractionRect.Y - item.InteractionRect.Height, item.InteractionRect.Width, item.InteractionRect.Height);