Hide tooltips while performing action
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user