Updated and refactored how items and characters are chosen for interactions in the world. The new system has more precision, with items under the cursor taking priority (this helps with small items which are in front of large items). A new method CanInteractWith(Item) has been added to the Character class which does all validation of interaction with items, including new distance calculations based on bounding boxes. This gives more consistency in selecting and interacting with all sizes and shapes of items. Because of this pickdistance (not interactdistance) has been removed from all item configurations (in their XML config files) and the default InteractDistance for all items is now 120.

This commit is contained in:
Faerdan
2017-06-18 22:30:54 +01:00
parent 5cd2a5a838
commit a09367c78f
45 changed files with 483 additions and 476 deletions

View File

@@ -388,7 +388,7 @@ namespace Barotrauma.Tutorials
while (!HasItem("Diving Mask") && !HasItem("Diving Suit"))
{
if (!divingMaskSelected &&
Character.Controlled.ClosestItem != null && Character.Controlled.ClosestItem.Name == "Diving Suit")
Character.Controlled.FocusedItem != null && Character.Controlled.FocusedItem.Name == "Diving Suit")
{
infoBox = CreateInfoFrame("There can only be one item in each inventory slot, so you need to take off "
+ "the jumpsuit if you wish to wear a diving suit.");