blob: fb108c7059b8fbfb280a8e5e81f06cd939380e32 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
extends Menu
@onready var anim = $AnimationPlayer
@onready var options = $Side/Margin/Options
var opened
func _ready():
opened = Time.get_ticks_msec()
super()
func anim_setup(): pass
func menu_anim_open():
print("ingame open")
anim.play("activate")
await anim.animation_finished
func menu_anim_exit():
print("ingame exit")
anim.play_backwards("activate")
await anim.animation_finished
func _on_resume_pressed():
exit()
func _on_main_menu_pressed():
parent_menu.replace_menu("res://menu/main.tscn")
func _on_settings_pressed():
submenu("res://menu/settings.tscn", true)
func _on_reconnect_pressed():
parent_menu.replace_menu("res://menu/game.tscn")
func _on_quit_pressed():
quit()
func _input(event):
if Time.get_ticks_msec() - opened < 100: return # TODO: Prevent close from same action as open
if Input.is_action_just_pressed("pause"): exit()
|