diff options
| author | tpart <tpart120@proton.me> | 2026-03-01 22:17:36 +0100 |
|---|---|---|
| committer | tpart <tpart120@proton.me> | 2026-03-01 22:17:41 +0100 |
| commit | a4d9e467bb629546f7c663f2d6fa3a8f2a753977 (patch) | |
| tree | ca667dc9466fa5e152d213319112cb48784f66da /client/map/tiles/screen | |
| parent | 998267627f1b31ca4534eb6b450a1d09379d58ff (diff) | |
| download | hurrycurry-a4d9e467bb629546f7c663f2d6fa3a8f2a753977.tar hurrycurry-a4d9e467bb629546f7c663f2d6fa3a8f2a753977.tar.bz2 hurrycurry-a4d9e467bb629546f7c663f2d6fa3a8f2a753977.tar.zst | |
Implement server name and motd; Update to new data protocol
Diffstat (limited to 'client/map/tiles/screen')
| -rw-r--r-- | client/map/tiles/screen/screen.gd | 5 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen.tscn | 3 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen_model.gd | 22 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen_model.gd.uid | 1 |
4 files changed, 30 insertions, 1 deletions
diff --git a/client/map/tiles/screen/screen.gd b/client/map/tiles/screen/screen.gd index c95f0753..3e059fc1 100644 --- a/client/map/tiles/screen/screen.gd +++ b/client/map/tiles/screen/screen.gd @@ -18,4 +18,7 @@ extends Tile func _init(ctx: TileFactory.TileCC): super(ctx) - base.add_child(load("res://map/tiles/screen/screen.tscn").instantiate()) + var screen_model: ScreenModel = load("res://map/tiles/screen/screen.tscn").instantiate() + base.add_child(screen_model) + screen_model.set_server_context(ctx.server_context) +
\ No newline at end of file diff --git a/client/map/tiles/screen/screen.tscn b/client/map/tiles/screen/screen.tscn index 82221eeb..a1f88294 100644 --- a/client/map/tiles/screen/screen.tscn +++ b/client/map/tiles/screen/screen.tscn @@ -1,11 +1,13 @@ [gd_scene format=3 uid="uid://vqe0wrt0ddq"] [ext_resource type="ArrayMesh" uid="uid://g6nwwhptmmmd" path="res://map/tiles/screen/screen_display.res" id="1_d1utq"] +[ext_resource type="Script" uid="uid://cye7akcsp46cv" path="res://map/tiles/screen/screen_model.gd" id="1_fabw7"] [ext_resource type="ArrayMesh" uid="uid://nsmq1ko2woad" path="res://map/tiles/screen/screen_base.res" id="1_mm46a"] [ext_resource type="PackedScene" uid="uid://d22cslgao5jd4" path="res://map/tiles/floor.tscn" id="3_dmy1m"] [ext_resource type="PackedScene" uid="uid://dgtdfctc0x78v" path="res://gui/menus/screen_info.tscn" id="4_ebgc8"] [node name="Screen" type="Node3D" unique_id=1614533170] +script = ExtResource("1_fabw7") [node name="Base" type="MeshInstance3D" parent="." unique_id=597805735] transform = Transform3D(2, 0, 0, 0, 0, -2, 0, 2, 0, 0, 0, 0) @@ -20,6 +22,7 @@ disable_3d = true size = Vector2i(834, 480) [node name="ScreenInfo" parent="Display/ScreenViewport" unique_id=907327052 instance=ExtResource("4_ebgc8")] +script = null [node name="Floor" parent="." unique_id=527188940 instance=ExtResource("3_dmy1m")] transform = Transform3D(12.117, 0, 0, 0, 12.117, 0, 0, 0, 12.117, 0, 0, 0) diff --git a/client/map/tiles/screen/screen_model.gd b/client/map/tiles/screen/screen_model.gd new file mode 100644 index 00000000..c0f0cbde --- /dev/null +++ b/client/map/tiles/screen/screen_model.gd @@ -0,0 +1,22 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2025 Hurry Curry! contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +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] + +%s[/font_size]""" % [server_context.name, server_context.motd] diff --git a/client/map/tiles/screen/screen_model.gd.uid b/client/map/tiles/screen/screen_model.gd.uid new file mode 100644 index 00000000..6a2a81b0 --- /dev/null +++ b/client/map/tiles/screen/screen_model.gd.uid @@ -0,0 +1 @@ +uid://cye7akcsp46cv |