From e56b3149c85fb19b6924388f51a2c63a84e1b444 Mon Sep 17 00:00:00 2001 From: Oier Bravo Urtasun Date: Sun, 17 Mar 2024 20:02:52 +0100 Subject: [PATCH] outline fix --- .../esc/esc_action_manager_monkey.gd | 6 ++--- .../esc_item_with_tooltip.gd | 24 ------------------- .../escoria-ui-return-monkey-island/game.gd | 2 +- project.godot | 2 +- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd b/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd index 7d60f9e7..8757875b 100644 --- a/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd +++ b/addons/escoria-ui-return-monkey-island/esc/esc_action_manager_monkey.gd @@ -342,10 +342,8 @@ func has_actions(current_target_object): return false func get_tooltip_from_current_target(verb,current_target_object): - var tooltips = current_target_object.get('tooltips') - if(tooltips.has(verb)): - return tooltips.get(verb) - return "" + return gymkhana.tooltip_manager.getTooltip(current_target_object.global_id, verb) + func get_action_target_text(action_target_texts: Dictionary): var action_target_text = action_target_texts.get(escoria.action_manager.current_tool.global_id) return action_target_text if action_target_text else "" diff --git a/addons/escoria-ui-return-monkey-island/esc_item_with_tooltip.gd b/addons/escoria-ui-return-monkey-island/esc_item_with_tooltip.gd index 1a1a350d..eaaded50 100644 --- a/addons/escoria-ui-return-monkey-island/esc_item_with_tooltip.gd +++ b/addons/escoria-ui-return-monkey-island/esc_item_with_tooltip.gd @@ -2,26 +2,6 @@ tool extends ESCItem class_name ESCItemWithTooltip, "res://addons/escoria-core/design/esc_item.svg" -# Action 1 Label text -export(String) var action1_text = "" - -# Action 2 Label text -export(String) var action2_text = "" - -# Action 3 tooltip text if item in inventory -export(String) var action3_text = "" - -# Action 4 tooltip text if item in inventory -export(String) var action4_text = "" - -export(Dictionary) var tooltips = {} - -# Action 3 tooltip texts if item is target. Dictionary with tool's global id as key. -export(Dictionary) var action3_target_texts = {} - -# Action 4 tooltip texts if item is target. Dictionary with tool's global id as key -export(Dictionary) var action4_target_texts = {} - # If action used by player is in this list, this is a valid target (second item in combination) export(Array) var target_when_selected_action_is_in = [] @@ -33,10 +13,6 @@ func _ready(): register_components() -func set_tooltip(action: String, text: String): - tooltips[action] = text - - func has_component(key: String)->bool: return components.has(key) diff --git a/addons/escoria-ui-return-monkey-island/game.gd b/addons/escoria-ui-return-monkey-island/game.gd index 287ede1a..efdf6fc9 100644 --- a/addons/escoria-ui-return-monkey-island/game.gd +++ b/addons/escoria-ui-return-monkey-island/game.gd @@ -355,7 +355,7 @@ func right_click_on_inventory_item(inventory_item_global_id: String, event: Inpu func inventory_item_focused(inventory_item_global_id: String) -> void: var target_obj = escoria.object_manager.get_object(inventory_item_global_id).node if target_obj is ESCItemWithTooltip: - $tooltip_layer/tooltip.set_target(target_obj.action3_text) + #$tooltip_layer/tooltip.set_target(target_obj.action3_text) $tooltip_layer/tooltip.set_target_object(target_obj) diff --git a/project.godot b/project.godot index fb589da8..c9d29581 100644 --- a/project.godot +++ b/project.godot @@ -897,7 +897,7 @@ _global_script_class_icons={ "InventoryAddCommand": "", "InventoryRemoveCommand": "", "ItemCountAddCommand": "", -"ItemOutline": "", +"ItemOutline": "res://addons/escoria-core/design/esc_item.svg", "PlayLibSound": "", "PlaySndCommand": "", "PlayVideoCommand": "",