ajout des graines procédurales et des cinamatiques
This commit is contained in:
30
gui/game/tutorial/step_gui/scripts/step_gui.gd
Normal file
30
gui/game/tutorial/step_gui/scripts/step_gui.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
@tool
|
||||
extends HBoxContainer
|
||||
class_name TutorialStepGui
|
||||
|
||||
const DEFAULT_ICON = preload("res://common/icons/circle-dotted.svg")
|
||||
const SUCEEDED_ICON = preload("res://common/icons/circle-check.svg")
|
||||
const SUCEEDED_OPACITY = 0.5
|
||||
|
||||
@export var suceeded := false : set = set_suceeded
|
||||
@export var text := "" : set = set_text
|
||||
|
||||
func _ready():
|
||||
update()
|
||||
|
||||
|
||||
func set_suceeded(v := suceeded):
|
||||
suceeded = v
|
||||
if is_node_ready():
|
||||
update()
|
||||
|
||||
|
||||
func set_text(v := text):
|
||||
text = v
|
||||
if is_node_ready():
|
||||
update()
|
||||
|
||||
func update():
|
||||
%Icon.texture = SUCEEDED_ICON if suceeded else DEFAULT_ICON
|
||||
%Label.text = tr(text)
|
||||
modulate.a = SUCEEDED_OPACITY if suceeded else 1.
|
||||
Reference in New Issue
Block a user