Files
tgcc/core/game_menu/biome_picker.gd
m.cirafisi 53e4afa367 bug fix
2026-07-09 22:14:29 +02:00

48 lines
840 B
GDScript

@tool
extends Button
@export var locked: bool = true
@export var image: Texture:
set(value):
image = value
if is_inside_tree() and has_node("%Texture"):
$%Texture.texture = image
func _ready():
if image != null and has_node("%Texture"):
$%Texture.texture = image
if has_node("%TextureRect"):
if locked:
$%TextureRect.show()
else:
$%TextureRect.hide()
func _on_pressed() -> void:
if locked:
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
modulate.a = 1.0
TweenFX.press_rotate(self)
func _on_mouse_entered() -> void:
if locked:
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
modulate.a = 1.0
TweenFX.breathe(self, 1)
func _on_mouse_exited() -> void:
if locked:
return
TweenFX.stop_all(self)
scale = Vector2.ONE
rotation = 0.0
modulate.a = 1.0