Fixed use inventory items
This commit is contained in:
1 parent
c78d37b12a
commit
c633e4bd23
4 files changed
+34
-25
No files matched your search
@@ -236,17 +236,20 @@ func element_unfocused() -> void:
|
|||||||
|
|
||||||
## ITEMS ##
|
## ITEMS ##
|
||||||
func click_on_item(item_global_id: String, event: InputEvent, action: String) -> void:
|
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.action_manager.set_current_action(action)
|
||||||
|
|
||||||
escoria.logger.info(self, "current_action:" + escoria.action_manager.current_action)
|
escoria.logger.info(self, "current_action2:" + escoria.action_manager.current_action)
|
||||||
if escoria.action_manager.current_target == null:
|
escoria.logger.info(self, "action_state2:" + String(escoria.action_manager.action_state))
|
||||||
escoria.logger.info(self, "current_target:null")
|
# if escoria.action_manager.current_target == null:
|
||||||
else:
|
# escoria.logger.info(self, "current_target:null")
|
||||||
escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
# else:
|
||||||
if escoria.action_manager.current_tool == null:
|
# escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
||||||
escoria.logger.info(self, "current_tool:null")
|
# if escoria.action_manager.current_tool == null:
|
||||||
else:
|
# escoria.logger.info(self, "current_tool:null")
|
||||||
escoria.logger.info(self, "current_tool:" + escoria.action_manager.current_tool.to_string())
|
# 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
|
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 ##
|
## INVENTORY ##
|
||||||
func click_on_inventory_item(item_global_id: String, event: InputEvent, action: String) -> void:
|
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.action_manager.set_current_action(action)
|
||||||
|
|
||||||
escoria.logger.info(self, "current_action:" + escoria.action_manager.current_action)
|
escoria.logger.info(self, "current_action2 inv:" + escoria.action_manager.current_action)
|
||||||
if escoria.action_manager.current_target == null:
|
escoria.logger.info(self, "action_state2 inv:" + String(escoria.action_manager.action_state))
|
||||||
escoria.logger.info(self, "current_target:null")
|
# if escoria.action_manager.current_target == null:
|
||||||
else:
|
# escoria.logger.info(self, "current_target:null")
|
||||||
escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
# else:
|
||||||
if escoria.action_manager.current_tool == null:
|
# escoria.logger.info(self, "current_target:" + escoria.action_manager.current_target.to_string())
|
||||||
escoria.logger.info(self, "current_tool:null")
|
# if escoria.action_manager.current_tool == null:
|
||||||
else:
|
# escoria.logger.info(self, "current_tool:null")
|
||||||
escoria.logger.info(self, "current_tool:" + escoria.action_manager.current_tool.to_string())
|
# 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
|
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
|
var target_obj = escoria.object_manager.get_object(inventory_item_global_id).node
|
||||||
if ACTION3 in target_obj.combine_when_selected_action_is_in:
|
if ACTION3 in target_obj.combine_when_selected_action_is_in:
|
||||||
Input.set_custom_mouse_cursor(target_obj.inventory_texture)
|
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:
|
func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
|
||||||
click_on_inventory_item(inventory_item_global_id, event, ACTION4)
|
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
|
tooltip.rect_position = corrected_position + tooltip.offset_from_cursor
|
||||||
|
|
||||||
func _on_event_done(return_code: int, _event_name: String):
|
func _on_event_done(return_code: int, _event_name: String):
|
||||||
if return_code == ESCExecution.RC_OK:
|
escoria.logger.info(self, "EVENT DONE! code=" + String(return_code))
|
||||||
escoria.action_manager.clear_current_action()
|
# if return_code == ESCExecution.RC_OK:
|
||||||
|
# escoria.action_manager.clear_current_action()
|
||||||
# Show tooltips, they were hiddeen while performing action
|
# Show tooltips, they were hiddeen while performing action
|
||||||
$tooltip_layer/tooltip.show()
|
$tooltip_layer/tooltip.show()
|
||||||
$tooltip_layer/tooltip2.show()
|
$tooltip_layer/tooltip2.show()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
:action3 i_bombona2
|
:action1 i_bombona2
|
||||||
say player "He usado la 'bombona' con la puerta"
|
say player "He usado la 'bombona' con la puerta"
|
||||||
# > [eq r5_dialog_advance 2]
|
# > [eq r5_dialog_advance 2]
|
||||||
# say player "I already fixed the water leak."
|
# say player "I already fixed the water leak."
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ say player "Voy a cogerla"
|
|||||||
set_active i_bombona false
|
set_active i_bombona false
|
||||||
inventory_add i_bombona
|
inventory_add i_bombona
|
||||||
|
|
||||||
:action3
|
# :action3
|
||||||
say player "Es el segundo bolsillo más grande que he visto nunca"
|
# say player "Es el segundo bolsillo más grande que he visto nunca"
|
||||||
|
|
||||||
:action4
|
:action4
|
||||||
say player "Antes era una bombona pero ahora es una llave inglesa."
|
say player "Antes era una bombona pero ahora es una llave inglesa."
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ script = ExtResource( 28 )
|
|||||||
global_id = "i_bombona2"
|
global_id = "i_bombona2"
|
||||||
esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona2.esc"
|
esc_script = "res://gymkhana/rooms/trasera_cocina/esc/i_bombona2.esc"
|
||||||
tooltip_name = "TT Mirar bombona"
|
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 )
|
inventory_texture = ExtResource( 29 )
|
||||||
dialog_color = Color( 1, 1, 1, 1 )
|
dialog_color = Color( 1, 1, 1, 1 )
|
||||||
tooltip2_name = "TT2 Coger bombona"
|
tooltip2_name = "TT2 Coger bombona"
|
||||||
|
|||||||
Reference in new issue
Block a user