mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 17:17:31 -04:00
add license, move folders
This commit is contained in:
parent
185cc74060
commit
271c4a46a1
132 changed files with 21 additions and 0 deletions
32
app/scripts/ui/hint.gd
Normal file
32
app/scripts/ui/hint.gd
Normal file
|
@ -0,0 +1,32 @@
|
|||
extends Control
|
||||
|
||||
@export var section: String = "hints"
|
||||
@export var key: String = ""
|
||||
@export var button: BaseButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
visible = false
|
||||
if key.is_empty() or button == null: Debug.logerr("hint has empty vars")
|
||||
var first = DataSaver.get_value(section, key)
|
||||
if first == null or not first: show_hint()
|
||||
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
if not what == NOTIFICATION_VISIBILITY_CHANGED: return
|
||||
if is_visible_in_tree(): play_anim()
|
||||
|
||||
|
||||
func show_hint() -> void:
|
||||
visible = true
|
||||
play_anim()
|
||||
if button != null: button.pressed.connect(hide_hint)
|
||||
|
||||
|
||||
func play_anim() -> void:
|
||||
$AnimationPlayer.play("Bounce")
|
||||
|
||||
|
||||
func hide_hint() -> void:
|
||||
visible = false
|
||||
DataSaver.set_value(section, key, true)
|
Loading…
Add table
Add a link
Reference in a new issue