|
|
|
|
@@ -236,17 +236,20 @@ func element_unfocused() -> void:
|
|
|
|
|
|
|
|
|
|
## ITEMS ##
|
|
|
|
|
func click_on_item(item_global_id: String, event: InputEvent, action: String) -> void:
|
|
|
|
|
escoria.logger.info(self, "current_action:" + escoria.action_manager.current_action)
|
|
|
|
|
escoria.logger.info(self, "action_state:" + String(escoria.action_manager.action_state))
|
|
|
|
|
escoria.action_manager.set_current_action(action)
|
|
|
|
|
|
|
|
|
|
escoria.logger.info(self, "current_action:" + escoria.action_manager.current_action)
|
|
|
|
|
if escoria.action_manager.current_target == null:
|
|
|
|
|
escoria.logger.info(self, "current_target:null")
|
|
|
|
|
else:
|
|
|
|
|
escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
|
|
|
|
if escoria.action_manager.current_tool == null:
|
|
|
|
|
escoria.logger.info(self, "current_tool:null")
|
|
|
|
|
else:
|
|
|
|
|
escoria.logger.info(self, "current_tool:" + escoria.action_manager.current_tool.to_string())
|
|
|
|
|
escoria.logger.info(self, "current_action2:" + escoria.action_manager.current_action)
|
|
|
|
|
escoria.logger.info(self, "action_state2:" + String(escoria.action_manager.action_state))
|
|
|
|
|
# if escoria.action_manager.current_target == null:
|
|
|
|
|
# escoria.logger.info(self, "current_target:null")
|
|
|
|
|
# else:
|
|
|
|
|
# escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
|
|
|
|
# if escoria.action_manager.current_tool == null:
|
|
|
|
|
# escoria.logger.info(self, "current_tool:null")
|
|
|
|
|
# else:
|
|
|
|
|
# escoria.logger.info(self, "current_tool:" + escoria.action_manager.current_tool.to_string())
|
|
|
|
|
|
|
|
|
|
var target_obj = escoria.object_manager.get_object(item_global_id).node
|
|
|
|
|
|
|
|
|
|
@@ -277,17 +280,20 @@ func left_double_click_on_item(item_global_id: String, event: InputEvent) -> voi
|
|
|
|
|
|
|
|
|
|
## INVENTORY ##
|
|
|
|
|
func click_on_inventory_item(item_global_id: String, event: InputEvent, action: String) -> void:
|
|
|
|
|
escoria.logger.info(self, "current_action inv:" + escoria.action_manager.current_action)
|
|
|
|
|
escoria.logger.info(self, "action_state inv:" + String(escoria.action_manager.action_state))
|
|
|
|
|
escoria.action_manager.set_current_action(action)
|
|
|
|
|
|
|
|
|
|
escoria.logger.info(self, "current_action:" + escoria.action_manager.current_action)
|
|
|
|
|
if escoria.action_manager.current_target == null:
|
|
|
|
|
escoria.logger.info(self, "current_target:null")
|
|
|
|
|
else:
|
|
|
|
|
escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
|
|
|
|
if escoria.action_manager.current_tool == null:
|
|
|
|
|
escoria.logger.info(self, "current_tool:null")
|
|
|
|
|
else:
|
|
|
|
|
escoria.logger.info(self, "current_tool:" + escoria.action_manager.current_tool.to_string())
|
|
|
|
|
|
|
|
|
|
escoria.logger.info(self, "current_action2 inv:" + escoria.action_manager.current_action)
|
|
|
|
|
escoria.logger.info(self, "action_state2 inv:" + String(escoria.action_manager.action_state))
|
|
|
|
|
# if escoria.action_manager.current_target == null:
|
|
|
|
|
# escoria.logger.info(self, "current_target:null")
|
|
|
|
|
# else:
|
|
|
|
|
# escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
|
|
|
|
# if escoria.action_manager.current_tool == null:
|
|
|
|
|
# escoria.logger.info(self, "current_tool:null")
|
|
|
|
|
# else:
|
|
|
|
|
# escoria.logger.info(self, "current_tool:" + escoria.action_manager.current_tool.to_string())
|
|
|
|
|
|
|
|
|
|
var target_obj = escoria.object_manager.get_object(item_global_id).node
|
|
|
|
|
|
|
|
|
|
@@ -305,7 +311,8 @@ func left_click_on_inventory_item(inventory_item_global_id: String, event: Input
|
|
|
|
|
var target_obj = escoria.object_manager.get_object(inventory_item_global_id).node
|
|
|
|
|
if ACTION3 in target_obj.combine_when_selected_action_is_in:
|
|
|
|
|
Input.set_custom_mouse_cursor(target_obj.inventory_texture)
|
|
|
|
|
click_on_inventory_item(inventory_item_global_id, event, ACTION3)
|
|
|
|
|
click_on_inventory_item(inventory_item_global_id, event, ACTION1)
|
|
|
|
|
# click_on_inventory_item(inventory_item_global_id, event, ACTION3)
|
|
|
|
|
|
|
|
|
|
func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
|
|
|
|
|
click_on_inventory_item(inventory_item_global_id, event, ACTION4)
|
|
|
|
|
@@ -413,8 +420,9 @@ func update_tooltip_following_mouse_position(tooltip: Object):
|
|
|
|
|
tooltip.rect_position = corrected_position + tooltip.offset_from_cursor
|
|
|
|
|
|
|
|
|
|
func _on_event_done(return_code: int, _event_name: String):
|
|
|
|
|
if return_code == ESCExecution.RC_OK:
|
|
|
|
|
escoria.action_manager.clear_current_action()
|
|
|
|
|
escoria.logger.info(self, "EVENT DONE! code=" + String(return_code))
|
|
|
|
|
# if return_code == ESCExecution.RC_OK:
|
|
|
|
|
# escoria.action_manager.clear_current_action()
|
|
|
|
|
# Show tooltips, they were hiddeen while performing action
|
|
|
|
|
$tooltip_layer/tooltip.show()
|
|
|
|
|
$tooltip_layer/tooltip2.show()
|
|
|
|
|
|