diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2023-12-25 00:21:50 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2023-12-25 00:21:50 +0100 |
commit | 0bfda86c29d106df5fa3dd16d925c193b3f726c7 (patch) | |
tree | 7d248694a63c346f5e82510b50405e34f8d5afe5 /UI/CharacterSelect.gd | |
parent | 09794cc76678247592ceb4e8b37e1ab129356466 (diff) |
UI + HUD alignmentv2.0.0
Diffstat (limited to 'UI/CharacterSelect.gd')
-rw-r--r-- | UI/CharacterSelect.gd | 18 |
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") |