add tooltips and fix stuff

This commit is contained in:
2026-07-02 21:19:56 +02:00
parent 3512145a66
commit 922c771185
69 changed files with 1452 additions and 5 deletions

View File

@@ -12,6 +12,9 @@ class_name IconButton
@export var images: Array[Texture]
@export var apply_texture_on_selection: bool = true
@export var enable_tooltip: bool = false
@export var tooltip_scene: PackedScene
@export var tooltip_image: Texture
func _ready():
if image != null and has_node("%Texture"):
@@ -36,3 +39,15 @@ func _on_pressed() -> void:
rotation = 0.0
modulate.a = 1.0
TweenFX.press_rotate(self)
func _make_custom_tooltip(for_text: String) -> Object:
if !enable_tooltip:
return null
var tooltip = tooltip_scene.instantiate()
tooltip.text = for_text
if tooltip_image != null:
tooltip.image = tooltip_image
return tooltip