Interaction logic tweaking again:
- Reverted the item distance calculation change in commitc7fd681(it made interaction way less precise, as items near the character tended to get focus even if the cursor was nowhere near them), and replaced it with: - Aim assist considers the distance to an item to be 0.0 if the cursor is inside a trigger of the item. - Reverted769a012and disabled aim assist when an item is selected. Meaning that now items don't have to be deselected before interacting with another item, but the cursor has to be directly on the other item to make accidental interaction less likely. - Removed some redundant trigger calculations from CanInteractWith.
This commit is contained in:
@@ -552,17 +552,17 @@ namespace Barotrauma
|
||||
public Rectangle TransformTrigger(Rectangle trigger, bool world = false)
|
||||
{
|
||||
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)
|
||||
:
|
||||
new Rectangle(
|
||||
Rect.X + trigger.X,
|
||||
Rect.Y + trigger.Y,
|
||||
(trigger.Width == 0) ? Rect.Width : trigger.Width,
|
||||
(trigger.Height == 0) ? Rect.Height : trigger.Height);
|
||||
new Rectangle(
|
||||
WorldRect.X + trigger.X,
|
||||
WorldRect.Y + trigger.Y,
|
||||
(trigger.Width == 0) ? Rect.Width : trigger.Width,
|
||||
(trigger.Height == 0) ? Rect.Height : trigger.Height)
|
||||
:
|
||||
new Rectangle(
|
||||
Rect.X + trigger.X,
|
||||
Rect.Y + trigger.Y,
|
||||
(trigger.Width == 0) ? Rect.Width : trigger.Width,
|
||||
(trigger.Height == 0) ? Rect.Height : trigger.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1033,7 +1033,7 @@ namespace Barotrauma
|
||||
return c != null && c.Character != null && c.Character.CanInteractWith(this);
|
||||
}
|
||||
|
||||
public bool TryInteract(Character picker, bool ignoreRequiredItems=false, bool forceSelectKey=false, bool forceActionKey=false)
|
||||
public bool TryInteract(Character picker, bool ignoreRequiredItems = false, bool forceSelectKey = false, bool forceActionKey = false)
|
||||
{
|
||||
bool hasRequiredSkills = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user