Actions in caja_herramientas
This commit is contained in:
@@ -52,7 +52,8 @@ func _get_event_to_queue(
|
||||
if target.node is ESCItem \
|
||||
and (action in target.node.combine_when_selected_action_is_in
|
||||
# MODIFIED FOR RETURN TO MONKEY UI
|
||||
or (combine_with && action in combine_with.node.combine_when_selected_action_is_in)):
|
||||
or combine_with):
|
||||
# or (combine_with && action in combine_with.node.combine_when_selected_action_is_in)):
|
||||
|
||||
# Check if object must be in inventory to be used
|
||||
if target.node.use_from_inventory_only:
|
||||
@@ -204,7 +205,7 @@ func perform_inputevent_on_object(
|
||||
# depending on the used action verb.
|
||||
var tool_just_set = _set_tool_and_action(obj, default_action)
|
||||
# MODIFIED FOR RETURN TO MONKEY UI
|
||||
var need_combine = _check_item_needs_combine_obj(obj)
|
||||
var need_combine = _check_item_needs_combine_obj(obj, tool_just_set)
|
||||
|
||||
# If the current tool was not set, this is our first item, make it the tool
|
||||
if not current_tool or (current_tool and not need_combine):
|
||||
@@ -356,9 +357,10 @@ func _set_tool_and_action(obj: ESCObject, default_action: bool):
|
||||
#
|
||||
# *Returns* True if current action on "obj" requires a combination
|
||||
# MODIFIED FOR RETURN TO MONKEY UI
|
||||
func _check_item_needs_combine_obj(obj: ESCObject) -> bool:
|
||||
func _check_item_needs_combine_obj(obj: ESCObject, tool_just_set: bool) -> bool:
|
||||
return current_action \
|
||||
and current_tool \
|
||||
and (current_action in current_tool.node.combine_when_selected_action_is_in
|
||||
# MODIFIED FOR RETURN TO MONKEY UI
|
||||
or current_action in obj.node.combine_when_selected_action_is_in)
|
||||
or !tool_just_set)
|
||||
# or current_action in obj.node.combine_when_selected_action_is_in)
|
||||
|
||||
@@ -285,6 +285,8 @@ func click_on_inventory_item(item_global_id: String, event: InputEvent, action:
|
||||
true
|
||||
)
|
||||
|
||||
# Hide tooltip if some action is being performed
|
||||
# if escoria.action_manager.action_state == ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
|
||||
if (target_obj is ESCItemWithTooltip) && (action == ACTION3 && target_obj.action3_text != "") || (action == ACTION4 && target_obj.action4_text != ""):
|
||||
$tooltip_layer/tooltip.hide()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user