From e4d58dbd1cdb570f6a1be78ce56636987aba24cd Mon Sep 17 00:00:00 2001 From: Oier Bravo Urtasun Date: Sun, 28 Jan 2024 14:08:10 +0100 Subject: [PATCH] tooltips only when interactive --- .../esc_rich_tooltip.gd | 12 ++++++++---- .../item_components/ESCItemComponentOutline.gd | 5 ++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd b/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd index 73ccf42f..79288150 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/esc_rich_tooltip.gd @@ -156,11 +156,15 @@ func update_tooltip_text(): if(current_target_object == null): return - var item_in_inventory = escoria.inventory_manager.inventory_has(current_target_object.global_id) - var waiting_for_target_item = escoria.action_manager.action_state == ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM + var action1_text = ""; + var action2_text = ""; - var action1_text = get_action_target_text(current_target_object.action3_target_texts) if waiting_for_target_item else get_tooltip_from_current_target("action3") if item_in_inventory else get_tooltip_from_current_target("action1") - var action2_text = get_action_target_text(current_target_object.action4_target_texts) if waiting_for_target_item else get_tooltip_from_current_target("action4") if item_in_inventory else get_tooltip_from_current_target("action2") + if current_target_object.is_interactive and escoria.current_state == escoria.GAME_STATE.DEFAULT: + var item_in_inventory = escoria.inventory_manager.inventory_has(current_target_object.global_id) + var waiting_for_target_item = escoria.action_manager.action_state == ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM + + action1_text = get_action_target_text(current_target_object.action3_target_texts) if waiting_for_target_item else get_tooltip_from_current_target("action3") if item_in_inventory else get_tooltip_from_current_target("action1") + action2_text = get_action_target_text(current_target_object.action4_target_texts) if waiting_for_target_item else get_tooltip_from_current_target("action4") if item_in_inventory else get_tooltip_from_current_target("action2") $tooltip1/label.text = action1_text $tooltip1.visible = !hidden and action1_text != ""; diff --git a/gymkhana/addons/escoria-ui-return-monkey-island/item_components/ESCItemComponentOutline.gd b/gymkhana/addons/escoria-ui-return-monkey-island/item_components/ESCItemComponentOutline.gd index 24090034..13fc54d7 100644 --- a/gymkhana/addons/escoria-ui-return-monkey-island/item_components/ESCItemComponentOutline.gd +++ b/gymkhana/addons/escoria-ui-return-monkey-island/item_components/ESCItemComponentOutline.gd @@ -28,15 +28,14 @@ func _process(_delta: float): if not outline is ItemOutline: return if isHighlighted != lastHighlightState: - if isHighlighted: + if isHighlighted and escoria.current_state == escoria.GAME_STATE.DEFAULT and get_parent().is_interactive: outline.show() else: outline.hide() lastHighlightState = isHighlighted func _input(event): - - if(event.is_action_pressed("ui_show_hints")) and escoria.inputs_manager.input_mode == escoria.inputs_manager.INPUT_ALL: + if event.is_action_pressed("ui_show_hints") and escoria.current_state == escoria.GAME_STATE.DEFAULT: highlight(true) elif (event.is_action_released("ui_show_hints")): highlight(false)