add tooltips and fix stuff
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user