-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGameModeSelection.gd
More file actions
39 lines (26 loc) · 1.03 KB
/
GameModeSelection.gd
File metadata and controls
39 lines (26 loc) · 1.03 KB
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
39
extends Control
onready var url_field = $CenterContainer/HBoxContainer/MultiPlayerBtn/CenterContainer/MultiplayerGame/URL
onready var single_btn = $CenterContainer/HBoxContainer/SinglePlayerBtn
onready var multi_btn = $CenterContainer/HBoxContainer/MultiPlayerBtn
signal on_mode_set
func _ready():
single_btn.connect("button_up",self, "on_single_player")
multi_btn.connect("button_up",self, "on_multi_player")
func on_single_player():
$Tween.remove_all()
$Tween.interpolate_property(self, "modulate:a", null, 0.0, 0.5, Tween.TRANS_QUART, Tween.EASE_IN)
$Tween.start()
yield($Tween, "tween_all_completed")
visible = false
emit_signal("on_mode_set", null)
func on_multi_player():
var url = url_field.text
if url == "":
url_field.placeholder_text = "Please set the server address first!"
return
$Tween.remove_all()
$Tween.interpolate_property(self, "modulate:a", null, 0.0, 0.5, Tween.TRANS_QUART, Tween.EASE_IN)
$Tween.start()
yield($Tween, "tween_all_completed")
visible = false
emit_signal("on_mode_set", url)