summaryrefslogtreecommitdiff
path: root/UI/CharacterSelect.gd
diff options
context:
space:
mode:
Diffstat (limited to 'UI/CharacterSelect.gd')
-rw-r--r--UI/CharacterSelect.gd18
1 files changed, 13 insertions, 5 deletions
diff --git a/UI/CharacterSelect.gd b/UI/CharacterSelect.gd
index 6ae7de0..348ef22 100644
--- a/UI/CharacterSelect.gd
+++ b/UI/CharacterSelect.gd
@@ -1,4 +1,4 @@
-extends Panel
+extends Control
var players_selected = {}
@@ -12,17 +12,20 @@ func _ready():
self.style_selected.set_bg_color(self.bg_color_selected)
self.style_deselected.set_bg_color(Color(0, 0, 0, 0))
self.set_Wait_text()
+
+ if multiplayer.is_server():
+ $Panel/VBoxContainer/StartButton.visible = true
func set_Wait_text():
- $Wait.text = "Waiting for " + str(Network.get_player_count() - self.players_selected.size()) + " players to choose"
+ $Panel/VBoxContainer/MarginContainer/Wait.text = "Waiting for " + str(Network.get_player_count() - self.players_selected.size()) + " players to choose"
func set_bg_color_selected(character, previous_character = null):
if previous_character:
- get_node(previous_character + "Panel").set("theme_override_styles/panel", self.style_deselected)
+ get_node("Panel/VBoxContainer/GridContainer/" + previous_character + "Panel").set("theme_override_styles/panel", self.style_deselected)
- get_node(character + "Panel").set("theme_override_styles/panel", self.style_selected)
+ get_node("Panel/VBoxContainer/GridContainer/" + character + "Panel").set("theme_override_styles/panel", self.style_selected)
func _button_pressed(event, character):
@@ -41,4 +44,9 @@ func _button_pressed(event, character):
self.set_Wait_text()
if Network.get_player_count() == self.players_selected.size():
- get_tree().change_scene_to_file("res://UI/LevelSelect.tscn")
+ if multiplayer.is_server():
+ $Panel/VBoxContainer/StartButton.disabled = false
+
+
+func _on_start_button_pressed():
+ get_tree().change_scene_to_file("res://UI/LevelSelect.tscn")