diff options
| author | tpart <tpart120@proton.me> | 2026-03-05 19:24:51 +0100 |
|---|---|---|
| committer | tpart <tpart120@proton.me> | 2026-03-05 19:24:51 +0100 |
| commit | e1dc33a6923a840953b8da5fb9f6eac30ff05f28 (patch) | |
| tree | 43e96cf71f982ccf91302340437c485f6c817ced | |
| parent | a4d9e467bb629546f7c663f2d6fa3a8f2a753977 (diff) | |
| download | hurrycurry-e1dc33a6923a840953b8da5fb9f6eac30ff05f28.tar hurrycurry-e1dc33a6923a840953b8da5fb9f6eac30ff05f28.tar.bz2 hurrycurry-e1dc33a6923a840953b8da5fb9f6eac30ff05f28.tar.zst | |
Hide server motd on screen if it is null
| -rw-r--r-- | client/gui/menus/screen_info.tscn | 2 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen_model.gd | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/client/gui/menus/screen_info.tscn b/client/gui/menus/screen_info.tscn index 79fac92f..c05598d9 100644 --- a/client/gui/menus/screen_info.tscn +++ b/client/gui/menus/screen_info.tscn @@ -1,6 +1,5 @@ [gd_scene format=3 uid="uid://dgtdfctc0x78v"] -[ext_resource type="Script" uid="uid://4quq7un7innk" path="res://map/tiles/screen/screen_info.gd" id="1_07dxw"] [ext_resource type="Shader" uid="uid://b7p7umdb51hhn" path="res://gui/resources/shaders/clouds_canvas_item.gdshader" id="1_ogbng"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_ogbng"] @@ -26,7 +25,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("1_07dxw") [node name="ColorRect" type="ColorRect" parent="." unique_id=642803588] material = SubResource("ShaderMaterial_86n4b") diff --git a/client/map/tiles/screen/screen_model.gd b/client/map/tiles/screen/screen_model.gd index c0f0cbde..2a495dae 100644 --- a/client/map/tiles/screen/screen_model.gd +++ b/client/map/tiles/screen/screen_model.gd @@ -17,6 +17,9 @@ extends Node3D class_name ScreenModel func set_server_context(server_context: Game.ServerContext) -> void: - $Display/ScreenViewport/ScreenInfo/MarginContainer/VBoxContainer/RichTextLabel.text = """[font_size=48][b]%s[/b] + if server_context.motd == null: + $Display/ScreenViewport/ScreenInfo/MarginContainer/VBoxContainer/RichTextLabel.text = "[font_size=48][b]%s[/b]" % server_context.name + else: + $Display/ScreenViewport/ScreenInfo/MarginContainer/VBoxContainer/RichTextLabel.text = """[font_size=48][b]%s[/b] %s[/font_size]""" % [server_context.name, server_context.motd] |