(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
@@ -833,16 +833,16 @@ namespace Barotrauma
{
return world ?
new Rectangle(
WorldRect.X + trigger.X,
WorldRect.Y + trigger.Y,
(trigger.Width == 0) ? Rect.Width : trigger.Width,
(trigger.Height == 0) ? Rect.Height : trigger.Height)
(int)(WorldRect.X + trigger.X * Scale),
(int)(WorldRect.Y + trigger.Y * Scale),
(trigger.Width == 0) ? Rect.Width : (int)(trigger.Width * Scale),
(trigger.Height == 0) ? Rect.Height : (int)(trigger.Height * Scale))
:
new Rectangle(
Rect.X + trigger.X,
Rect.Y + trigger.Y,
(trigger.Width == 0) ? Rect.Width : trigger.Width,
(trigger.Height == 0) ? Rect.Height : trigger.Height);
(int)(Rect.X + trigger.X * Scale),
(int)(Rect.Y + trigger.Y * Scale),
(trigger.Width == 0) ? Rect.Width : (int)(trigger.Width * Scale),
(trigger.Height == 0) ? Rect.Height : (int)(trigger.Height * Scale));
}
/// <summary>