diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/game.gd b/gymkhana/addons/escoria-ui-return-monkey-island/game.gd index a4f91375..ccd85bf2 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/game.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/game.gd @@ -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() diff --git a/gymkhana/rooms/trasera_cocina/esc/entrada_cocina.esc b/gymkhana/rooms/trasera_cocina/esc/entrada_cocina.esc index bc686ef8..5b9df0fe 100644 --- a/gymkhana/rooms/trasera_cocina/esc/entrada_cocina.esc +++ b/gymkhana/rooms/trasera_cocina/esc/entrada_cocina.esc @@ -1,4 +1,4 @@ -:action3 i_bombona2 +:action1 i_bombona2 say player "He usado la 'bombona' con la puerta" # > [eq r5_dialog_advance 2] # say player "I already fixed the water leak." diff --git a/gymkhana/rooms/trasera_cocina/esc/i_bombona.esc b/gymkhana/rooms/trasera_cocina/esc/i_bombona.esc index a82605ff..6faff210 100644 --- a/gymkhana/rooms/trasera_cocina/esc/i_bombona.esc +++ b/gymkhana/rooms/trasera_cocina/esc/i_bombona.esc @@ -6,8 +6,8 @@ say player "Voy a cogerla" set_active i_bombona false inventory_add i_bombona -:action3 -say player "Es el segundo bolsillo más grande que he visto nunca" +# :action3 +# say player "Es el segundo bolsillo más grande que he visto nunca" :action4 say player "Antes era una bombona pero ahora es una llave inglesa." diff --git a/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn b/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn index d635cdc6..7661f708 100644 --- a/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn +++ b/gymkhana/rooms/trasera_cocina/trasera_cocina.tscn @@ -93,7 +93,8 @@ script = ExtResource( 28 ) global_id = "i_bombona2" esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona2.esc" tooltip_name = "TT Mirar bombona" -combine_when_selected_action_is_in = [ "action3" ] +combine_when_selected_action_is_in = [ "action1", "action3" ] +use_from_inventory_only = true inventory_texture = ExtResource( 29 ) dialog_color = Color( 1, 1, 1, 1 ) tooltip2_name = "TT2 Coger bombona"