Hide tooltips while performing action

This commit is contained in:
2023-02-13 20:17:37 +01:00
parent 143086c4f3
commit 477ddca540
2 changed files with 12 additions and 7 deletions

View File

@@ -1,5 +1,7 @@
extends ESCGame
const ACTION1 = "action1"
const ACTION2 = "action2"
const VERB_USE = "use"
const VERB_WALK = "walk"
@@ -255,12 +257,16 @@ func click_on_item(item_global_id: String, event: InputEvent, action: String) ->
[item_global_id, event],
true
)
if (action == ACTION1 && target_obj.tooltip_name != "") || (action == ACTION2 && target_obj.tooltip2_name != ""):
$tooltip_layer/tooltip.hide()
$tooltip_layer/tooltip2.hide()
func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
click_on_item(item_global_id, event, "action1")
click_on_item(item_global_id, event, ACTION1)
func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
click_on_item(item_global_id, event, "action2")
click_on_item(item_global_id, event, ACTION2)
func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
escoria.action_manager.do(
@@ -437,12 +443,12 @@ func _on_action_finished():
$mouse_layer/verbs_menu.iterate_actions_cursor(0)
func _on_event_done(_return_code: int, _event_name: String):
if _return_code == ESCExecution.RC_OK:
func _on_event_done(return_code: int, _event_name: String):
if return_code == ESCExecution.RC_OK:
escoria.action_manager.clear_current_action()
$mouse_layer/verbs_menu.clear_tool_texture()
$tooltip_layer/tooltip.set_target("")
$tooltip_layer/tooltip2.set_target("")
$tooltip_layer/tooltip.show()
$tooltip_layer/tooltip2.show()
func _on_MenuButton_pressed() -> void:

View File

@@ -108,7 +108,6 @@ global_id = "r1_wall_item1"
esc_script = "res://gymkhana/rooms/home/esc/wall_item.esc"
tooltip_name = "This is action1"
tooltip2_name = "This is action2"
default_action = "action2"
combine_when_selected_action_is_in = [ ]
inventory_texture = ExtResource( 10 )
dialog_color = Color( 1, 1, 1, 1 )