forked from Mirrors/openclonk
interactions: always show action target & use AtRect instead of AtPoint
The players have no notion about the midpoint of an object and are thus confused when clearly standing in front of something and not being able to interact with it. (Yes that happened in a Let's Play and yes, that's why the interaction menu also uses Find_AtRect.)shapetextures
parent
22d9a21ff7
commit
14c413028c
|
@ -338,10 +338,17 @@ func GetInteractableObjects(array sort)
|
|||
actiontype = ACTIONTYPE_EXTRA
|
||||
});
|
||||
}
|
||||
|
||||
// Make sure that the Clonk's action target is always shown.
|
||||
// You can push a lorry out of your bounding box and would, otherwise, then be unable to release it.
|
||||
var main_criterion = Find_AtRect(-5, -10, 10, 20);
|
||||
var action_target = nil;
|
||||
if (action_target = GetActionTarget())
|
||||
{
|
||||
main_criterion = Find_Or(main_criterion, Find_InArray([action_target]));
|
||||
}
|
||||
// add interactables (script interface)
|
||||
var interactables = FindObjects(
|
||||
Find_AtPoint(0, 0),
|
||||
main_criterion,
|
||||
Find_Or(Find_OCF(OCF_Grab), Find_Func("IsInteractable", this), Find_OCF(OCF_Entrance)),
|
||||
Find_NoContainer(), Find_Layer(GetObjectLayer()),
|
||||
sort);
|
||||
|
|
Loading…
Reference in New Issue