Fix errors with tooltip2

This commit is contained in:
2023-02-15 19:23:04 +01:00
parent 62b8b35f1c
commit c722bf5045
3 changed files with 12 additions and 3 deletions

View File

@@ -219,8 +219,10 @@ func left_double_click_on_bg(position: Vector2) -> void:
func element_focused(element_id: String) -> void:
var target_obj = escoria.object_manager.get_object(element_id).node
$tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
$tooltip_layer/tooltip2.set_target(target_obj.tooltip2_name)
if target_obj is ESCItem:
$tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
if target_obj is ESCItemWithTooltip:
$tooltip_layer/tooltip2.set_target(target_obj.tooltip2_name)
func element_unfocused() -> void:
$tooltip_layer/tooltip.set_target("")

View File

@@ -12,6 +12,8 @@ export(int) var action1_x = 0
# Action 1 Y
export(int) var action1_y = 0
# The text for the tooltip of action2
export(String) var tooltip2_name
#$tooltips.visible = true;
var action1Tooltip: Object
@@ -42,4 +44,3 @@ func _detect_labels() -> void:
#c.set_text("AAAAAAA")
tooltips.append(c)
#tooltipsLayer = c