(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
@@ -132,14 +132,16 @@ namespace Barotrauma
//default size
protected Vector2 size;
private float impactTolerance;
private List<XElement> fabricationRecipeElements = new List<XElement>();
private bool canSpriteFlipX, canSpriteFlipY;
private Dictionary<string, PriceInfo> prices;
//an area next to the construction
//the construction can be Activated() by a Character inside the area
/// <summary>
/// Defines areas where the item can be interacted with. If RequireBodyInsideTrigger is set to true, the character
/// has to be within the trigger to interact. If it's set to false, having the cursor within the trigger is enough.
/// </summary>
public List<Rectangle> Triggers;
private List<XElement> fabricationRecipeElements = new List<XElement>();
@@ -196,6 +198,15 @@ namespace Barotrauma
private set;
}
//if true and the item has trigger areas defined, characters need to be within the trigger to interact with the item
//if false, trigger areas define areas that can be used to highlight the item
[Serialize(true, false)]
public bool RequireBodyInsideTrigger
{
get;
private set;
}
//should the camera focus on the item when selected
[Serialize(false, false)]