mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-25 14:17:29 -04:00
gate info
This commit is contained in:
parent
71b8d06c69
commit
a425178538
10 changed files with 177 additions and 72 deletions
25
app/scripts/ui/ui_mode_animation.gd
Normal file
25
app/scripts/ui/ui_mode_animation.gd
Normal file
|
@ -0,0 +1,25 @@
|
|||
extends AnimationPlayer
|
||||
|
||||
@export var ui_events: UiEvents
|
||||
@export var gate_events: GateEvents
|
||||
|
||||
const RESET := "RESET"
|
||||
const INITIAL := "initial"
|
||||
const FOCUSED := "focused"
|
||||
|
||||
var focused := false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
ui_events.ui_mode_changed.connect(on_ui_mode_changed)
|
||||
gate_events.open_gate.connect(func(_url): on_ui_mode_changed(UiEvents.UiMode.INITIAL))
|
||||
|
||||
|
||||
func on_ui_mode_changed(mode: UiEvents.UiMode) -> void:
|
||||
if mode == UiEvents.UiMode.INITIAL and focused:
|
||||
focused = false
|
||||
play(INITIAL)
|
||||
|
||||
if mode == UiEvents.UiMode.FOCUSED and not focused:
|
||||
focused = true
|
||||
play(FOCUSED)
|
Loading…
Add table
Add a link
Reference in a new issue