From 4ee632304449b77689bf075d3dbcd2466210e118 Mon Sep 17 00:00:00 2001 From: tpart Date: Sun, 6 Oct 2024 21:17:52 +0200 Subject: Reorganize map files; Fix location of some theme files --- client/map/items/item.gd | 2 +- client/map/palette.png | Bin 38079 -> 0 bytes client/map/palette.png.import | 36 ------------------------- client/map/progress.gd | 24 ----------------- client/map/progress.gdshader | 48 --------------------------------- client/map/progress.tscn | 19 ------------- client/map/progress/progress.gd | 24 +++++++++++++++++ client/map/progress/progress.gdshader | 48 +++++++++++++++++++++++++++++++++ client/map/progress/progress.tscn | 19 +++++++++++++ client/map/textures/palette.png | Bin 0 -> 38079 bytes client/map/textures/palette.png.import | 36 +++++++++++++++++++++++++ client/map/tiles/grass_side.res.depren | Bin 1430 -> 0 bytes 12 files changed, 128 insertions(+), 128 deletions(-) delete mode 100644 client/map/palette.png delete mode 100644 client/map/palette.png.import delete mode 100644 client/map/progress.gd delete mode 100644 client/map/progress.gdshader delete mode 100644 client/map/progress.tscn create mode 100644 client/map/progress/progress.gd create mode 100644 client/map/progress/progress.gdshader create mode 100644 client/map/progress/progress.tscn create mode 100644 client/map/textures/palette.png create mode 100644 client/map/textures/palette.png.import delete mode 100644 client/map/tiles/grass_side.res.depren (limited to 'client/map') diff --git a/client/map/items/item.gd b/client/map/items/item.gd index 80aa4d6d..f7592d87 100644 --- a/client/map/items/item.gd +++ b/client/map/items/item.gd @@ -21,7 +21,7 @@ extends Node3D var owned_by: Node3D var base: Node3D = Node3D.new() -var progress_instance: ProgressBar3D = preload("res://map/progress.tscn").instantiate() +var progress_instance: ProgressBar3D = preload("res://map/progress/progress.tscn").instantiate() var take_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate() var put_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate() var ding_sound := AudioStreamPlayer3D.new() diff --git a/client/map/palette.png b/client/map/palette.png deleted file mode 100644 index e184fe5b..00000000 Binary files a/client/map/palette.png and /dev/null differ diff --git a/client/map/palette.png.import b/client/map/palette.png.import deleted file mode 100644 index 92840fcf..00000000 --- a/client/map/palette.png.import +++ /dev/null @@ -1,36 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dgcs4wkxsxe6a" -path.s3tc="res://.godot/imported/palette.png-3a59900c2345cc4f645d84b8df0a18e7.s3tc.ctex" -path.etc2="res://.godot/imported/palette.png-3a59900c2345cc4f645d84b8df0a18e7.etc2.ctex" -metadata={ -"imported_formats": ["s3tc_bptc", "etc2_astc"], -"vram_texture": true -} - -[deps] - -source_file="res://map/palette.png" -dest_files=["res://.godot/imported/palette.png-3a59900c2345cc4f645d84b8df0a18e7.s3tc.ctex", "res://.godot/imported/palette.png-3a59900c2345cc4f645d84b8df0a18e7.etc2.ctex"] - -[params] - -compress/mode=2 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=true -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=0 diff --git a/client/map/progress.gd b/client/map/progress.gd deleted file mode 100644 index fc31408c..00000000 --- a/client/map/progress.gd +++ /dev/null @@ -1,24 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright 2024 metamuffin -# Copyright 2024 nokoe -# Copyright 2024 tpart -# -# 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 . -# -class_name ProgressBar3D -extends MeshInstance3D - -func update(new_position: float, new_warn: bool): - var mat: ShaderMaterial = get_active_material(0) - mat.set_shader_parameter("progress", new_position) - mat.set_shader_parameter("bad", new_warn) diff --git a/client/map/progress.gdshader b/client/map/progress.gdshader deleted file mode 100644 index a5ebf575..00000000 --- a/client/map/progress.gdshader +++ /dev/null @@ -1,48 +0,0 @@ -/* - Hurry Curry! - a game about cooking - Copyright 2024 nokoe - Copyright 2024 tpart - - 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 . - -*/ -shader_type spatial; -render_mode unshaded; - -uniform float progress = 0.; -uniform bool bad = false; - -void fragment() { - vec3 color = vec3(0., .5, 0.); - float alpha_fac = 1.; - if (bad) { - color = vec3(progress, 1. - progress, 0.); - alpha_fac = (sin(TIME * 15.) + 1.) * .5; - } - if (UV.x > progress) { - ALPHA = 1.; - color = vec3(0.1, 0.1, 0.1); - } - ALPHA *= alpha_fac; - ALBEDO = color; -} - -void vertex() { - mat4 modified_model_view = VIEW_MATRIX * mat4( - INV_VIEW_MATRIX[0], - INV_VIEW_MATRIX[1], - INV_VIEW_MATRIX[2], - MODEL_MATRIX[3] - ); - MODELVIEW_MATRIX = modified_model_view; -} diff --git a/client/map/progress.tscn b/client/map/progress.tscn deleted file mode 100644 index 7a0629a1..00000000 --- a/client/map/progress.tscn +++ /dev/null @@ -1,19 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://4ewufm6tqhpb"] - -[ext_resource type="Shader" path="res://map/progress.gdshader" id="1_6f2a0"] -[ext_resource type="Script" path="res://map/progress.gd" id="2_bb3u3"] - -[sub_resource type="QuadMesh" id="QuadMesh_m0itj"] -size = Vector2(0.75, 0.1) - -[sub_resource type="ShaderMaterial" id="ShaderMaterial_4k6cy"] -resource_local_to_scene = true -render_priority = 0 -shader = ExtResource("1_6f2a0") -shader_parameter/progress = 0.0 -shader_parameter/bad = false - -[node name="Progress" type="MeshInstance3D"] -mesh = SubResource("QuadMesh_m0itj") -surface_material_override/0 = SubResource("ShaderMaterial_4k6cy") -script = ExtResource("2_bb3u3") diff --git a/client/map/progress/progress.gd b/client/map/progress/progress.gd new file mode 100644 index 00000000..fc31408c --- /dev/null +++ b/client/map/progress/progress.gd @@ -0,0 +1,24 @@ +# Hurry Curry! - a game about cooking +# Copyright 2024 metamuffin +# Copyright 2024 nokoe +# Copyright 2024 tpart +# +# 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 . +# +class_name ProgressBar3D +extends MeshInstance3D + +func update(new_position: float, new_warn: bool): + var mat: ShaderMaterial = get_active_material(0) + mat.set_shader_parameter("progress", new_position) + mat.set_shader_parameter("bad", new_warn) diff --git a/client/map/progress/progress.gdshader b/client/map/progress/progress.gdshader new file mode 100644 index 00000000..a5ebf575 --- /dev/null +++ b/client/map/progress/progress.gdshader @@ -0,0 +1,48 @@ +/* + Hurry Curry! - a game about cooking + Copyright 2024 nokoe + Copyright 2024 tpart + + 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 . + +*/ +shader_type spatial; +render_mode unshaded; + +uniform float progress = 0.; +uniform bool bad = false; + +void fragment() { + vec3 color = vec3(0., .5, 0.); + float alpha_fac = 1.; + if (bad) { + color = vec3(progress, 1. - progress, 0.); + alpha_fac = (sin(TIME * 15.) + 1.) * .5; + } + if (UV.x > progress) { + ALPHA = 1.; + color = vec3(0.1, 0.1, 0.1); + } + ALPHA *= alpha_fac; + ALBEDO = color; +} + +void vertex() { + mat4 modified_model_view = VIEW_MATRIX * mat4( + INV_VIEW_MATRIX[0], + INV_VIEW_MATRIX[1], + INV_VIEW_MATRIX[2], + MODEL_MATRIX[3] + ); + MODELVIEW_MATRIX = modified_model_view; +} diff --git a/client/map/progress/progress.tscn b/client/map/progress/progress.tscn new file mode 100644 index 00000000..7f2ec175 --- /dev/null +++ b/client/map/progress/progress.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=5 format=3 uid="uid://4ewufm6tqhpb"] + +[ext_resource type="Shader" path="res://map/progress/progress.gdshader" id="1_6f2a0"] +[ext_resource type="Script" path="res://map/progress/progress.gd" id="2_bb3u3"] + +[sub_resource type="QuadMesh" id="QuadMesh_m0itj"] +size = Vector2(0.75, 0.1) + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_4k6cy"] +resource_local_to_scene = true +render_priority = 0 +shader = ExtResource("1_6f2a0") +shader_parameter/progress = 0.0 +shader_parameter/bad = false + +[node name="Progress" type="MeshInstance3D"] +mesh = SubResource("QuadMesh_m0itj") +surface_material_override/0 = SubResource("ShaderMaterial_4k6cy") +script = ExtResource("2_bb3u3") diff --git a/client/map/textures/palette.png b/client/map/textures/palette.png new file mode 100644 index 00000000..e184fe5b Binary files /dev/null and b/client/map/textures/palette.png differ diff --git a/client/map/textures/palette.png.import b/client/map/textures/palette.png.import new file mode 100644 index 00000000..97dc821b --- /dev/null +++ b/client/map/textures/palette.png.import @@ -0,0 +1,36 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgcs4wkxsxe6a" +path.s3tc="res://.godot/imported/palette.png-7d1d158ba6a12563fba40a96786b0940.s3tc.ctex" +path.etc2="res://.godot/imported/palette.png-7d1d158ba6a12563fba40a96786b0940.etc2.ctex" +metadata={ +"imported_formats": ["s3tc_bptc", "etc2_astc"], +"vram_texture": true +} + +[deps] + +source_file="res://map/textures/palette.png" +dest_files=["res://.godot/imported/palette.png-7d1d158ba6a12563fba40a96786b0940.s3tc.ctex", "res://.godot/imported/palette.png-7d1d158ba6a12563fba40a96786b0940.etc2.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/client/map/tiles/grass_side.res.depren b/client/map/tiles/grass_side.res.depren deleted file mode 100644 index 3116171f..00000000 Binary files a/client/map/tiles/grass_side.res.depren and /dev/null differ -- cgit v1.2.3-70-g09d2