diff options
| author | tpart <tpart120@proton.me> | 2024-10-10 12:12:10 +0200 | 
|---|---|---|
| committer | tpart <tpart120@proton.me> | 2024-10-10 12:12:15 +0200 | 
| commit | 64e270447e4eec834e1970ac76a573afd7e9e2cc (patch) | |
| tree | a8041d8ac2c191f61969f153c3a487d212db1b00 | |
| parent | 24281e14ee2a770d517ffa800cdc4e1b8539a288 (diff) | |
| download | hurrycurry-64e270447e4eec834e1970ac76a573afd7e9e2cc.tar hurrycurry-64e270447e4eec834e1970ac76a573afd7e9e2cc.tar.bz2 hurrycurry-64e270447e4eec834e1970ac76a573afd7e9e2cc.tar.zst  | |
Show message if no servers are available
| -rw-r--r-- | client/menu/play.gd | 4 | ||||
| -rw-r--r-- | client/menu/play.tscn | 7 | ||||
| -rw-r--r-- | locale/en.ini | 1 | 
3 files changed, 12 insertions, 0 deletions
diff --git a/client/menu/play.gd b/client/menu/play.gd index 7ef60bea..3d9a0d84 100644 --- a/client/menu/play.gd +++ b/client/menu/play.gd @@ -21,6 +21,7 @@ var url_regex: RegEx = RegEx.new()  @onready var server_list: VBoxContainer = $side/margin/options/second/ScrollContainerCustom/ServerList  @onready var server_list_loading: Label = $side/margin/options/second/Loading +@onready var server_list_empty: Label = $side/margin/options/second/NoServers  @onready var connect_uri = $side/margin/options/second/connect/uri  @onready var server = $side/margin/options/second/server  @onready var server_control = $side/margin/options/second/server/control @@ -88,6 +89,9 @@ func update_server_list(lists: Array[Array]):  			connect_uri.grab_focus()  		else:  			server_list.get_child(idx - 1).grab_focus() +	 +	# Show message if no servers available +	server_list_empty.visible = idx == 0  func update_server_list_loading(status: bool):  	server_list_loading.visible = status diff --git a/client/menu/play.tscn b/client/menu/play.tscn index 94801dfb..43a3414f 100644 --- a/client/menu/play.tscn +++ b/client/menu/play.tscn @@ -66,6 +66,13 @@ size_flags_horizontal = 3  text = "c.menu.play.fetching_list"  horizontal_alignment = 1 +[node name="NoServers" type="Label" parent="side/margin/options/second"] +visible = false +layout_mode = 2 +size_flags_horizontal = 3 +text = "c.menu.play.no_servers" +horizontal_alignment = 1 +  [node name="ScrollContainerCustom" type="ScrollContainer" parent="side/margin/options/second"]  layout_mode = 2  size_flags_vertical = 3 diff --git a/locale/en.ini b/locale/en.ini index 7ecbd8b9..85839ccf 100644 --- a/locale/en.ini +++ b/locale/en.ini @@ -110,6 +110,7 @@ c.menu.play.allow_query_registry=To show a public server list a registry service  c.menu.play.connect=Connect  c.menu.play.fetching_list=Fetching server list...  c.menu.play.list_item={0} ({1} players) +c.menu.play.no_servers=No servers available.  c.menu.play.quick_connect=Quick Connect  c.menu.play.server_binary_not_found=Server binary was not found. Please install the server separately.  c.menu.play.server_failed_tooltip=The server crashed or exited in some way or another.%nYou should try starting the server from the command-line.  |