diff options
| author | tpart <tpart120@proton.me> | 2025-12-16 23:11:57 +0100 |
|---|---|---|
| committer | tpart <tpart120@proton.me> | 2025-12-16 23:12:02 +0100 |
| commit | 7810663f3945b00672e7d6011c77d680f9d45a30 (patch) | |
| tree | fbc99cd020809003140db105bfa3e11445655a07 /client | |
| parent | 348e44880c81f1d223f53ab11897bae427073d42 (diff) | |
| download | hurrycurry-7810663f3945b00672e7d6011c77d680f9d45a30.tar hurrycurry-7810663f3945b00672e7d6011c77d680f9d45a30.tar.bz2 hurrycurry-7810663f3945b00672e7d6011c77d680f9d45a30.tar.zst | |
Add screen
Diffstat (limited to 'client')
| -rw-r--r-- | client/gui/menus/screen_info.tscn | 62 | ||||
| -rw-r--r-- | client/gui/resources/shaders/clouds_canvas_item.gdshader | 35 | ||||
| -rw-r--r-- | client/gui/resources/shaders/clouds_canvas_item.gdshader.uid | 1 | ||||
| -rw-r--r-- | client/map/tile_factory.gd | 1 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen.gd | 21 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen.gd.uid | 1 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen.res.depren | bin | 0 -> 7450 bytes | |||
| -rw-r--r-- | client/map/tiles/screen/screen.tscn | 35 | ||||
| -rw-r--r-- | client/map/tiles/screen/screen_base.res | bin | 0 -> 6697 bytes | |||
| -rw-r--r-- | client/map/tiles/screen/screen_display.res | bin | 0 -> 2344 bytes |
10 files changed, 156 insertions, 0 deletions
diff --git a/client/gui/menus/screen_info.tscn b/client/gui/menus/screen_info.tscn new file mode 100644 index 00000000..5709b43a --- /dev/null +++ b/client/gui/menus/screen_info.tscn @@ -0,0 +1,62 @@ +[gd_scene load_steps=5 format=3 uid="uid://dgtdfctc0x78v"] + +[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"] +frequency = 0.004 + +[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_07dxw"] +width = 834 +height = 480 +generate_mipmaps = false +noise = SubResource("FastNoiseLite_ogbng") +seamless = true + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_86n4b"] +shader = ExtResource("1_ogbng") +shader_parameter/noise = SubResource("NoiseTexture2D_07dxw") +shader_parameter/ccloud = Color(0.63119745, 0.6848105, 0.72822344, 1) +shader_parameter/csky = Color(0.2257854, 0.2183806, 0.60477614, 1) + +[node name="ScreenInfo" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="ColorRect" type="ColorRect" parent="."] +material = SubResource("ShaderMaterial_86n4b") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 64 +theme_override_constants/margin_top = 64 +theme_override_constants/margin_right = 64 +theme_override_constants/margin_bottom = 64 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +bbcode_enabled = true +text = "[font_size=48][b]Welcome to example.org![/b] + +This is an example motd. Enjoy![/font_size]" +fit_content = true +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/client/gui/resources/shaders/clouds_canvas_item.gdshader b/client/gui/resources/shaders/clouds_canvas_item.gdshader new file mode 100644 index 00000000..fd5d0377 --- /dev/null +++ b/client/gui/resources/shaders/clouds_canvas_item.gdshader @@ -0,0 +1,35 @@ +/* + 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/>. + +*/ +shader_type canvas_item; + +uniform sampler2D noise : source_color; +uniform vec4 ccloud : source_color; +uniform vec4 csky : source_color; + +void fragment() { + vec2 uv = UV * 0.9; + uv += TIME * vec2(0.01,0.02); + + float f = texture(noise, uv).x; + f = 1. - f; + f = pow(f, 1.5); + f = floor(f*5.)/5.; + f = pow(f, 2.); + + COLOR = mix(csky, ccloud, f); +} diff --git a/client/gui/resources/shaders/clouds_canvas_item.gdshader.uid b/client/gui/resources/shaders/clouds_canvas_item.gdshader.uid new file mode 100644 index 00000000..1b5ea7f0 --- /dev/null +++ b/client/gui/resources/shaders/clouds_canvas_item.gdshader.uid @@ -0,0 +1 @@ +uid://b7p7umdb51hhn diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd index 4cd8c745..ad415cfc 100644 --- a/client/map/tile_factory.gd +++ b/client/map/tile_factory.gd @@ -65,6 +65,7 @@ func produce(raw_name: String, position: Vector2i, neighbors: Array) -> Tile: "oven": return Oven.new(ctx) "path": return Path.new(ctx) "rolling-board": return RollingBoard.new(ctx) + "screen": return Screen.new(ctx) "deep-fryer": return DeepFryer.new(ctx) "sink": return Sink.new(ctx) "stove": return Stove.new(ctx) diff --git a/client/map/tiles/screen/screen.gd b/client/map/tiles/screen/screen.gd new file mode 100644 index 00000000..c1d93e03 --- /dev/null +++ b/client/map/tiles/screen/screen.gd @@ -0,0 +1,21 @@ +# 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/>. +# +class_name Screen +extends Floor + +func _init(ctx: TileFactory.TileCC): + super(ctx) + base.add_child(load("res://map/tiles/screen/screen.tscn").instantiate()) diff --git a/client/map/tiles/screen/screen.gd.uid b/client/map/tiles/screen/screen.gd.uid new file mode 100644 index 00000000..c55416cb --- /dev/null +++ b/client/map/tiles/screen/screen.gd.uid @@ -0,0 +1 @@ +uid://dodq5s5bpfr3c diff --git a/client/map/tiles/screen/screen.res.depren b/client/map/tiles/screen/screen.res.depren Binary files differnew file mode 100644 index 00000000..365a3c86 --- /dev/null +++ b/client/map/tiles/screen/screen.res.depren diff --git a/client/map/tiles/screen/screen.tscn b/client/map/tiles/screen/screen.tscn new file mode 100644 index 00000000..5c45cff1 --- /dev/null +++ b/client/map/tiles/screen/screen.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=5 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="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"] + +[node name="Base" type="MeshInstance3D" parent="."] +transform = Transform3D(2, 0, 0, 0, 0, -2, 0, 2, 0, 0, 0, 0) +mesh = ExtResource("1_mm46a") +skeleton = NodePath("") + +[node name="Display" type="MeshInstance3D" parent="."] +transform = Transform3D(3, 0, 0, 0, 0, -3, 0, 3, 0, -0.004130006, 2.244278, 0.3346749) +mesh = ExtResource("1_d1utq") +skeleton = NodePath("") + +[node name="ScreenViewport" type="SubViewport" parent="Display"] +disable_3d = true +size = Vector2i(834, 480) + +[node name="ScreenInfo" parent="Display/ScreenViewport" instance=ExtResource("4_ebgc8")] + +[node name="Floor" parent="." instance=ExtResource("3_dmy1m")] +transform = Transform3D(12.117, 0, 0, 0, 12.117, 0, 0, 0, 12.117, 0, 0, 0) +visible = false + +[node name="OmniLight3D" type="SpotLight3D" parent="."] +transform = Transform3D(1, 0, 0, 0, -0.9653816, 0.26084167, 0, -0.26084167, -0.9653816, 0, 2.1330748, 0.46361876) +light_color = Color(0.3137255, 0.32941177, 0.76862746, 1) +light_energy = 7.0 +spot_range = 3.25 +spot_angle = 75.0 diff --git a/client/map/tiles/screen/screen_base.res b/client/map/tiles/screen/screen_base.res Binary files differnew file mode 100644 index 00000000..e7ac821a --- /dev/null +++ b/client/map/tiles/screen/screen_base.res diff --git a/client/map/tiles/screen/screen_display.res b/client/map/tiles/screen/screen_display.res Binary files differnew file mode 100644 index 00000000..3cb72591 --- /dev/null +++ b/client/map/tiles/screen/screen_display.res |