aboutsummaryrefslogtreecommitdiff
path: root/client/menu/main_menu.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-27 00:02:13 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-27 00:02:13 +0200
commit140090a76e723fec6f3aea07cd7b7f463884be89 (patch)
tree7e4b476b52b65b9289ffff079a76c1171c7dd68a /client/menu/main_menu.gd
parent8784d1a619f4224a4fe659750c91561fcc733100 (diff)
downloadhurrycurry-140090a76e723fec6f3aea07cd7b7f463884be89.tar
hurrycurry-140090a76e723fec6f3aea07cd7b7f463884be89.tar.bz2
hurrycurry-140090a76e723fec6f3aea07cd7b7f463884be89.tar.zst
main menu server start option
Diffstat (limited to 'client/menu/main_menu.gd')
-rw-r--r--client/menu/main_menu.gd16
1 files changed, 16 insertions, 0 deletions
diff --git a/client/menu/main_menu.gd b/client/menu/main_menu.gd
index 28629e0d..168eda7e 100644
--- a/client/menu/main_menu.gd
+++ b/client/menu/main_menu.gd
@@ -20,6 +20,7 @@ extends Control
@onready var quit_button = $side/margin/options/quit
@onready var connect_uri = $side/margin/options/connect/uri
+@onready var server_button = $side/margin/options/server
func _ready():
if OS.has_feature("web"):
@@ -58,3 +59,18 @@ func _on_change_character_pressed():
func _on_settings_pressed():
menu_manager.goto("settings")
+
+func _on_server_pressed():
+ match Server.state:
+ Server.State.RUNNING: Server.stop()
+ Server.State.STOPPED: Server.start()
+
+func _process(_delta):
+ server_button.disabled = Server.state != Server.State.RUNNING and Server.state != Server.State.STOPPED
+ server_button.modulate = Color.AQUAMARINE if Server.state == Server.State.RUNNING else Color.WHITE
+ match Server.state:
+ Server.State.RUNNING: server_button.text = tr("Stop Server")
+ Server.State.TESTING: server_button.text = tr("Server (Testing)")
+ Server.State.STARTING: server_button.text = tr("Server is starting...")
+ Server.State.STOPPED: server_button.text = tr("Start Server")
+ Server.State.UNAVAILABLE: server_button.text = tr("Server (Unavailable)"); server_button.tooltip_text = tr("Server binary was not found. Please install the server seperately.")