diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf new file mode 100644 index 00000000..8c93043d Binary files /dev/null and b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf differ diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf.import b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf.import new file mode 100644 index 00000000..d44c5635 --- /dev/null +++ b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://beyuejetf7ycm" +path="res://.godot/imported/JetBrainsMono-Bold.ttf-f29f0959786568265ca0b04685a7f475.fontdata" + +[deps] + +source_file="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-Bold.ttf" +dest_files=["res://.godot/imported/JetBrainsMono-Bold.ttf-f29f0959786568265ca0b04685a7f475.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf new file mode 100644 index 00000000..435d7a72 Binary files /dev/null and b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf differ diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf.import b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf.import new file mode 100644 index 00000000..90c817d7 --- /dev/null +++ b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bdwhigsqf5qep" +path="res://.godot/imported/JetBrainsMono-ExtraBold.ttf-7a6a3ddd8768cc4cb6e7d099d52e7d29.fontdata" + +[deps] + +source_file="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraBold.ttf" +dest_files=["res://.godot/imported/JetBrainsMono-ExtraBold.ttf-7a6a3ddd8768cc4cb6e7d099d52e7d29.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf new file mode 100644 index 00000000..c131cbf2 Binary files /dev/null and b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf differ diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf.import b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf.import new file mode 100644 index 00000000..8e0c1ae0 --- /dev/null +++ b/Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bag3qoyv7q1dp" +path="res://.godot/imported/JetBrainsMono-ExtraLight.ttf-2c9c32f1e84e31d0c8be5cd2abf05103.fontdata" + +[deps] + +source_file="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-ExtraLight.ttf" +dest_files=["res://.godot/imported/JetBrainsMono-ExtraLight.ttf-2c9c32f1e84e31d0c8be5cd2abf05103.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf new file mode 100644 index 00000000..15f15a2a Binary files /dev/null and b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf differ diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf.import b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf.import new file mode 100644 index 00000000..0772bad0 --- /dev/null +++ b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bbgsdt6m154mi" +path="res://.godot/imported/JetBrainsMono-Light.ttf-1b2390cc40ec8db9bd6c07a5e1129b83.fontdata" + +[deps] + +source_file="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-Light.ttf" +dest_files=["res://.godot/imported/JetBrainsMono-Light.ttf-1b2390cc40ec8db9bd6c07a5e1129b83.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf new file mode 100644 index 00000000..97671156 Binary files /dev/null and b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf differ diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf.import b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf.import new file mode 100644 index 00000000..8ed99ce0 --- /dev/null +++ b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://dhsne0nw6w5j" +path="res://.godot/imported/JetBrainsMono-Medium.ttf-2bbcf4794b5f37eb961d7ee378e707c3.fontdata" + +[deps] + +source_file="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf" +dest_files=["res://.godot/imported/JetBrainsMono-Medium.ttf-2bbcf4794b5f37eb961d7ee378e707c3.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf new file mode 100644 index 00000000..7dbe2ac6 Binary files /dev/null and b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf differ diff --git a/Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf.import b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf.import new file mode 100644 index 00000000..d50c11af --- /dev/null +++ b/Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://buwtg1010xlov" +path="res://.godot/imported/JetBrainsMono-Thin.ttf-fcc3529e66308d2b1551bdd12a71acfd.fontdata" + +[deps] + +source_file="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-Thin.ttf" +dest_files=["res://.godot/imported/JetBrainsMono-Thin.ttf-fcc3529e66308d2b1551bdd12a71acfd.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/JetBrains_Mono_outline.tres b/Assets/Fonts/JetBrains_Mono_outline.tres new file mode 100644 index 00000000..548c018a --- /dev/null +++ b/Assets/Fonts/JetBrains_Mono_outline.tres @@ -0,0 +1,9 @@ +[gd_resource type="LabelSettings" format=3 uid="uid://dvlx486vdob4h"] + +[ext_resource type="FontFile" uid="uid://dhsne0nw6w5j" path="res://Assets/Fonts/JetBrains Mono/JetBrainsMono-Medium.ttf" id="1_1vtnq"] + +[resource] +font = ExtResource("1_1vtnq") +font_size = 18 +outline_size = 5 +outline_color = Color(0.078431375, 0.08627451, 0.12941177, 1) diff --git a/Assets/Images/Icons/Ammo.svg b/Assets/Images/Icons/Ammo.svg new file mode 100644 index 00000000..cdbf6cc2 --- /dev/null +++ b/Assets/Images/Icons/Ammo.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Assets/Images/Icons/Ammo.svg.import b/Assets/Images/Icons/Ammo.svg.import new file mode 100644 index 00000000..0f6b90fe --- /dev/null +++ b/Assets/Images/Icons/Ammo.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bva1hvwd6n7p8" +path="res://.godot/imported/Ammo.svg-0c4b9adb184a13c36119e0d4a4ee7205.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Images/Icons/Ammo.svg" +dest_files=["res://.godot/imported/Ammo.svg-0c4b9adb184a13c36119e0d4a4ee7205.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Assets/Images/Icons/Dead.svg b/Assets/Images/Icons/Dead.svg new file mode 100644 index 00000000..b2cc03ce --- /dev/null +++ b/Assets/Images/Icons/Dead.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/Assets/Images/Icons/Dead.svg.import b/Assets/Images/Icons/Dead.svg.import new file mode 100644 index 00000000..c5693bcb --- /dev/null +++ b/Assets/Images/Icons/Dead.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://q78n2abn6ynq" +path="res://.godot/imported/Dead.svg-cbdbe63e4c67f1f332dadfb021192c7e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Images/Icons/Dead.svg" +dest_files=["res://.godot/imported/Dead.svg-cbdbe63e4c67f1f332dadfb021192c7e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Assets/Images/Icons/Reload.svg b/Assets/Images/Icons/Reload.svg new file mode 100644 index 00000000..7a7138cf --- /dev/null +++ b/Assets/Images/Icons/Reload.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Assets/Images/Icons/Reload.svg.import b/Assets/Images/Icons/Reload.svg.import new file mode 100644 index 00000000..601d24ed --- /dev/null +++ b/Assets/Images/Icons/Reload.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1j4l5yo6ta2g" +path="res://.godot/imported/Reload.svg-662da23fd9bd4c35d88c2d69600a8a7f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Images/Icons/Reload.svg" +dest_files=["res://.godot/imported/Reload.svg-662da23fd9bd4c35d88c2d69600a8a7f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Assets/Images/Icons/health.svg b/Assets/Images/Icons/health.svg new file mode 100644 index 00000000..0a4bfb21 --- /dev/null +++ b/Assets/Images/Icons/health.svg @@ -0,0 +1,27 @@ + + + + + + diff --git a/Assets/Images/Icons/health.svg.import b/Assets/Images/Icons/health.svg.import new file mode 100644 index 00000000..12fc33ca --- /dev/null +++ b/Assets/Images/Icons/health.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4ssi7te2psou" +path="res://.godot/imported/health.svg-75a9dc897c04da5b1f7f1c3c21cf08ab.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Images/Icons/health.svg" +dest_files=["res://.godot/imported/health.svg-75a9dc897c04da5b1f7f1c3c21cf08ab.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Assets/Shaders/chromatic_aberration.gdshader b/Assets/Shaders/chromatic_aberration.gdshader index 3700135b..af850b9f 100644 --- a/Assets/Shaders/chromatic_aberration.gdshader +++ b/Assets/Shaders/chromatic_aberration.gdshader @@ -1,6 +1,6 @@ shader_type canvas_item; -uniform sampler2D screen_texture : hint_screen_texture, filter_nearest_mipmap, repeat_disable; +uniform sampler2D screen_texture : hint_screen_texture, filter_nearest, repeat_disable; uniform float offsetR = 3; uniform float offsetG = 6; uniform float offsetB = 9; @@ -17,16 +17,15 @@ void fragment(){ else { // The direction of the vector that will shift the channels vec2 direction = normalize(uv); + // Calculating offsets vec2 redOffset = d * (offsetR * 0.001) * direction; vec2 greenOffset = d * (offsetG * 0.001) * direction; vec2 blueOffset = d * (offsetB * 0.001) * direction; - // Calculating lod (equivalent to the blurriness) - float lod = d * .5; // Applying offsets - COLOR.r = textureLod(screen_texture, SCREEN_UV - redOffset, lod).r; - COLOR.g = textureLod(screen_texture, SCREEN_UV - greenOffset, lod).g; - COLOR.b = textureLod(screen_texture, SCREEN_UV - blueOffset, lod).b; + COLOR.r = texture(screen_texture, SCREEN_UV - redOffset).r; + COLOR.g = texture(screen_texture, SCREEN_UV - greenOffset).g; + COLOR.b = texture(screen_texture, SCREEN_UV - blueOffset).b; } } diff --git a/Prefabs/BehideObjects/Dungeon/Candles/candle_thin_light.tscn b/Prefabs/BehideObjects/Dungeon/Candles/candle_thin_light.tscn index 74c2b252..b13cef88 100644 --- a/Prefabs/BehideObjects/Dungeon/Candles/candle_thin_light.tscn +++ b/Prefabs/BehideObjects/Dungeon/Candles/candle_thin_light.tscn @@ -32,11 +32,12 @@ Mass = 1.0 [node name="candle_thin" parent="." unique_id=1107089462 instance=ExtResource("2_bf74a")] -[node name="candle_thin" parent="candle_thin" index="0" unique_id=1161904277] +[node name="candle_thin" parent="candle_thin" index="0" unique_id=1474827763] layers = 18 [node name="OmniLight3D" type="OmniLight3D" parent="candle_thin" unique_id=382861156 groups=["ShadowingLights"]] transform = Transform3D(0.9999998, 0, 0, 0, 1, 0, 0, 0, 0.9999998, 0, 0.9039156, 0) +layers = 7 light_color = Color(1, 0.741769, 0.563201, 1) shadow_enabled = true shadow_caster_mask = 4294967279 diff --git a/Prefabs/BehideObjects/Dungeon/Candles/candle_triple.tscn b/Prefabs/BehideObjects/Dungeon/Candles/candle_triple.tscn index c6340c49..fa716fcc 100644 --- a/Prefabs/BehideObjects/Dungeon/Candles/candle_triple.tscn +++ b/Prefabs/BehideObjects/Dungeon/Candles/candle_triple.tscn @@ -32,11 +32,12 @@ Mass = 1.0 [node name="candle_triple" parent="." unique_id=278025502 instance=ExtResource("2_rkgqh")] -[node name="candle_triple" parent="candle_triple" index="0" unique_id=2058380968] +[node name="candle_triple" parent="candle_triple" index="0" unique_id=199734979] layers = 18 [node name="OmniLight3D" type="OmniLight3D" parent="candle_triple" unique_id=922791052 groups=["ShadowingLights"]] transform = Transform3D(0.9999998, 0, 0, 0, 1, 0, 0, 0, 0.9999998, 0.022366501, 0.859392, 0.038353004) +layers = 7 light_color = Color(1, 0.741769, 0.563201, 1) shadow_enabled = true shadow_blur = 2.0 diff --git a/Prefabs/BehideObjects/SpaceBase/light.tscn b/Prefabs/BehideObjects/SpaceBase/light.tscn index 201eb35b..da0aa06e 100644 --- a/Prefabs/BehideObjects/SpaceBase/light.tscn +++ b/Prefabs/BehideObjects/SpaceBase/light.tscn @@ -37,6 +37,7 @@ Mass = 1.0 [node name="SpotLight3D" type="SpotLight3D" parent="light" unique_id=360463542 groups=["ShadowingLights"]] transform = Transform3D(1, 0, 0, 0, -4.371139e-08, 1, 0, -1, -4.371139e-08, 0, 0.85550284, 0) +layers = 7 light_color = Color(0.99999994, 0.86785364, 0.6317274, 1) light_energy = 1.6 shadow_enabled = true diff --git a/Prefabs/BehideObjects/Sphere/mirror_sphere.tscn b/Prefabs/BehideObjects/Sphere/mirror_sphere.tscn index af3b38a8..458e4719 100644 --- a/Prefabs/BehideObjects/Sphere/mirror_sphere.tscn +++ b/Prefabs/BehideObjects/Sphere/mirror_sphere.tscn @@ -33,6 +33,7 @@ Mass = 1.0 [node name="mirror_sphere" type="MeshInstance3D" parent="." unique_id=421554897] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) +layers = 3 material_override = ExtResource("2_eaa14") gi_mode = 2 mesh = SubResource("SphereMesh_mkb23") diff --git a/Prefabs/Controls/BezelContainer.cs b/Prefabs/Controls/BezelContainer.cs index 34de51d1..89d10e7e 100644 --- a/Prefabs/Controls/BezelContainer.cs +++ b/Prefabs/Controls/BezelContainer.cs @@ -9,7 +9,7 @@ public partial class BezelContainer : Control private int BezelSize { get; set { field = value; QueueRedraw(); } } = 45; [Export] - private Color Color { get; set { field = value; QueueRedraw(); } } = Color.Color8(255, 255, 255); + public Color Color { get; set { field = value; QueueRedraw(); } } = Color.Color8(255, 255, 255); [Export] private int BorderWidth { get; set { field = value; QueueRedraw(); } } diff --git a/Prefabs/Controls/Logo.tscn b/Prefabs/Controls/Logo.tscn index fc1e5462..39c4afca 100644 --- a/Prefabs/Controls/Logo.tscn +++ b/Prefabs/Controls/Logo.tscn @@ -18,7 +18,7 @@ spacing_bottom = -2 [sub_resource type="LabelSettings" id="LabelSettings_285fj"] font = SubResource("FontVariation_dt7yx") font_size = 33 -font_color = Color(0.0980392, 0.109804, 0.117647, 1) +font_color = Color(0.019607844, 0.050980393, 0.09411765, 1) [node name="Logo" type="MarginContainer" unique_id=1711532571] offset_right = 194.0 @@ -30,7 +30,6 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 10 script = ExtResource("1_crkf7") BezelSize = 20 -BorderRadius = 0 Color = Color(0.89411765, 0.94509804, 0.96862745, 1) [node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=744804482] diff --git a/Prefabs/Controls/PlayerListItem/PlayerListItem.cs b/Prefabs/Controls/PlayerListItem/PlayerListItem.cs index bf206d65..b1b217a5 100644 --- a/Prefabs/Controls/PlayerListItem/PlayerListItem.cs +++ b/Prefabs/Controls/PlayerListItem/PlayerListItem.cs @@ -1,13 +1,14 @@ +using Behide.Game.UI.Lobby; using Godot; namespace Behide.UI.Controls; -[Tool, SceneTree] -public partial class PlayerListItem : Control +[SceneTree] +public partial class PlayerListItem : PlayerCard { - private Label UsernameLabel => _.Container.MarginUsername.Username; - private Label StatusLabel => _.Container.Ready.Label; + private Label UsernameLabel => _.Margin.HBox.Username; + private TextureRect Logo => _.Margin.HBox.DeadIcon.TextureRect; public void SetPlayerName(string playerName) => UsernameLabel.Text = playerName; - public void SetStatus(string status) => StatusLabel.Text = status; + public void SetAlive(bool alive) => Logo.Modulate = Logo.Modulate with { A = alive ? 0f : 1f }; } diff --git a/Prefabs/Controls/PlayerListItem/PlayerListItem.tscn b/Prefabs/Controls/PlayerListItem/PlayerListItem.tscn index e8c73542..f5f43b0e 100644 --- a/Prefabs/Controls/PlayerListItem/PlayerListItem.tscn +++ b/Prefabs/Controls/PlayerListItem/PlayerListItem.tscn @@ -2,53 +2,52 @@ [ext_resource type="Script" uid="uid://cnv83qrck0bgc" path="res://Prefabs/Controls/PlayerListItem/PlayerListItem.cs" id="1_e7184"] [ext_resource type="Script" uid="uid://b287r2c48ldja" path="res://Prefabs/Controls/BezelContainer.cs" id="2_vtxhq"] -[ext_resource type="FontVariation" uid="uid://cxmeg2qdqylds" path="res://Assets/Fonts/Space Grotesk/Space Grotesk.tres" id="3_p8wd1"] +[ext_resource type="FontVariation" uid="uid://bqpb46gqbs0cm" path="res://Assets/Fonts/Space Grotesk/Space Grotesk Medium.tres" id="3_d8dgs"] +[ext_resource type="Texture2D" uid="uid://q78n2abn6ynq" path="res://Assets/Images/Dead.svg" id="4_d8dgs"] -[sub_resource type="LabelSettings" id="LabelSettings_mt0eq"] -font = ExtResource("3_p8wd1") - -[sub_resource type="LabelSettings" id="LabelSettings_url6u"] -font = ExtResource("3_p8wd1") +[sub_resource type="LabelSettings" id="LabelSettings_mxfh4"] +font = ExtResource("3_d8dgs") +font_size = 20 [node name="PlayerListItem" type="MarginContainer" unique_id=1963591353] +offset_right = 132.0 +offset_bottom = 31.0 size_flags_horizontal = 3 script = ExtResource("1_e7184") -[node name="Container" type="HBoxContainer" parent="." unique_id=754872024] +[node name="Margin" type="MarginContainer" parent="." unique_id=1146646143] +custom_minimum_size = Vector2(0, 60) +custom_maximum_size = Vector2(-1, 60) layout_mode = 2 -theme_override_constants/separation = 10 +size_flags_horizontal = 3 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 8 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 8 script = ExtResource("2_vtxhq") -BezelSize = 10 -BorderRadius = 0 -Color = Color(0.133333, 0.341176, 0.478431, 1) +BezelSize = 15 +Color = Color(0.13333334, 0.34117648, 0.47843137, 1) -[node name="MarginUsername" type="MarginContainer" parent="Container" unique_id=1061078266] +[node name="HBox" type="HBoxContainer" parent="Margin" unique_id=1233091568] layout_mode = 2 -size_flags_horizontal = 0 -theme_override_constants/margin_left = 15 -theme_override_constants/margin_top = 10 -theme_override_constants/margin_bottom = 10 +theme_override_constants/separation = 10 -[node name="Username" type="Label" parent="Container/MarginUsername" unique_id=1100396652] +[node name="Username" type="Label" parent="Margin/HBox" unique_id=1713017238] layout_mode = 2 -mouse_filter = 1 -text = "username" -label_settings = SubResource("LabelSettings_mt0eq") +size_flags_horizontal = 3 +text = "Username" +label_settings = SubResource("LabelSettings_mxfh4") -[node name="Ready" type="MarginContainer" parent="Container" unique_id=1065794298] +[node name="Dead Icon" type="MarginContainer" parent="Margin/HBox" unique_id=860044148] layout_mode = 2 -size_flags_horizontal = 10 -theme_override_constants/margin_left = 10 -theme_override_constants/margin_top = 10 -theme_override_constants/margin_right = 10 -theme_override_constants/margin_bottom = 10 -script = ExtResource("2_vtxhq") -BezelSize = 10 -BorderRadius = 0 -Color = Color(0.74902, 0.0901961, 0.419608, 1) - -[node name="Label" type="Label" parent="Container/Ready" unique_id=1041698326] +size_flags_horizontal = 8 +theme_override_constants/margin_left = 1 +theme_override_constants/margin_top = 6 +theme_override_constants/margin_right = 1 +theme_override_constants/margin_bottom = 6 + +[node name="TextureRect" type="TextureRect" parent="Margin/HBox/Dead Icon" unique_id=332063374] +modulate = Color(0, 0, 0, 1) layout_mode = 2 -mouse_filter = 1 -text = "Not ready" -label_settings = SubResource("LabelSettings_url6u") +texture = ExtResource("4_d8dgs") +expand_mode = 3 diff --git a/Prefabs/Dungeon/torch_mounted_lighted.tscn b/Prefabs/Dungeon/torch_mounted_lighted.tscn index 4a10a024..890725df 100644 --- a/Prefabs/Dungeon/torch_mounted_lighted.tscn +++ b/Prefabs/Dungeon/torch_mounted_lighted.tscn @@ -4,11 +4,9 @@ [node name="torch_mounted_with_light" unique_id=1317728564 instance=ExtResource("1_ygi67")] -[node name="torch_mounted" parent="." index="0" unique_id=135786180] -layers = 16 - [node name="OmniLight3D" type="OmniLight3D" parent="." index="1" unique_id=878820410 groups=["ShadowingLights"]] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.7, 0.29999995) +layers = 7 light_color = Color(1, 0.7411765, 0.5647059, 1) shadow_enabled = true shadow_caster_mask = 4294967279 diff --git a/Prefabs/Player/Gun.cs b/Prefabs/Player/Gun.cs index 8549a613..1903f4bf 100644 --- a/Prefabs/Player/Gun.cs +++ b/Prefabs/Player/Gun.cs @@ -7,6 +7,8 @@ public abstract partial class Gun : Node3D public abstract Control Hud { get; } public abstract Label PlayerUsernameLabel { get; } protected abstract Label AmmoLabel { get; } + protected abstract TextureRect AmmoIcon { get; } + protected abstract TextureRect ReloadIcon { get; } public abstract int DamagePerAmmo { get; } protected abstract int TotalAmmoCount { get; set; } @@ -20,7 +22,7 @@ private int AmmoCount set { field = value; - AmmoLabel.Text = value + " / " + TotalAmmoCount; + AmmoLabel.Text = value + " | " + TotalAmmoCount; } } @@ -43,7 +45,11 @@ public override void _Process(double delta) var realAmmoAmountAdded = int.Min(ammoDiff, TotalAmmoCount); TotalAmmoCount -= realAmmoAmountAdded; AmmoCount += realAmmoAmountAdded; + + AmmoIcon.Show(); + ReloadIcon.Hide(); } + ReloadIcon.OffsetTransformRotation += (float)delta*10; reloadTimeRemaining -= delta; } @@ -66,7 +72,12 @@ public override void _Process(double delta) public void Reload() { + if (!CanReload) return; + reloadTimeRemaining = ReloadTime; + AmmoIcon.Hide(); + ReloadIcon.Show(); + ReloadIcon.OffsetTransformRotation = 0f; AmmoLabel.Text = "Reloading"; ReloadCore(); } diff --git a/Prefabs/Player/HealthBar/HealthBar.cs b/Prefabs/Player/HealthBar/HealthBar.cs new file mode 100644 index 00000000..ed113225 --- /dev/null +++ b/Prefabs/Player/HealthBar/HealthBar.cs @@ -0,0 +1,24 @@ +using Godot; + +namespace Behide.Game.Player; + +[SceneTree] +public partial class HealthBar : VBoxContainer +{ + private Label Label => _.HBox.Label; + private Panel Bar => _.PanelContainer.Margin.Clip.Panel; + [Export] private Color healthMaxColor; + + public void SetHealth(double health, int maxHealth) + { + Label.Text = ((int)Math.Ceiling(health * maxHealth)).ToString(); + Bar.OffsetTransformPositionRatio = new Vector2((float)health - 1, 0); + + const float redHueAngle = 0f; + Bar.Modulate = Color.FromHsv( + Mathf.LerpAngle(redHueAngle, healthMaxColor.H, (float)health), + healthMaxColor.S, + healthMaxColor.V + ); + } +} diff --git a/Prefabs/Player/HealthBar/HealthBar.cs.uid b/Prefabs/Player/HealthBar/HealthBar.cs.uid new file mode 100644 index 00000000..5e03c4df --- /dev/null +++ b/Prefabs/Player/HealthBar/HealthBar.cs.uid @@ -0,0 +1 @@ +uid://fepjt8qpgbel diff --git a/Prefabs/Player/HealthBar/HealthBar.tscn b/Prefabs/Player/HealthBar/HealthBar.tscn new file mode 100644 index 00000000..4b9dd3f1 --- /dev/null +++ b/Prefabs/Player/HealthBar/HealthBar.tscn @@ -0,0 +1,75 @@ +[gd_scene format=3 uid="uid://nkor8n0q2s8j"] + +[ext_resource type="Texture2D" uid="uid://4ssi7te2psou" path="res://Assets/Images/Icons/health.svg" id="1_0x5gc"] +[ext_resource type="Script" uid="uid://fepjt8qpgbel" path="res://Prefabs/Player/HealthBar/HealthBar.cs" id="1_b5sgl"] +[ext_resource type="LabelSettings" uid="uid://dvlx486vdob4h" path="res://Assets/Fonts/JetBrains_Mono_outline.tres" id="3_b5sgl"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ceia4"] +bg_color = Color(0.07842832, 0.084945954, 0.13061652, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jaxhj"] +bg_color = Color(1, 1, 1, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y37n2"] +bg_color = Color(1, 1, 1, 1) + +[node name="HealthBar" type="VBoxContainer" unique_id=2051133214] +custom_minimum_size = Vector2(200, 0) +offset_right = 146.0 +offset_bottom = 40.0 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme_override_constants/separation = 0 +script = ExtResource("1_b5sgl") +healthMaxColor = Color(0.09019608, 1, 0.8352941, 1) + +[node name="HBox" type="HBoxContainer" parent="." unique_id=1400750105] +layout_mode = 2 +theme_override_constants/separation = 3 + +[node name="IconMargin" type="MarginContainer" parent="HBox" unique_id=1068827552] +layout_mode = 2 +size_flags_horizontal = 0 +theme_override_constants/margin_left = 3 +theme_override_constants/margin_top = 3 +theme_override_constants/margin_right = 3 +theme_override_constants/margin_bottom = 3 + +[node name="Icon" type="TextureRect" parent="HBox/IconMargin" unique_id=522492705] +modulate = Color(0.09019608, 1, 0.8352941, 1) +layout_mode = 2 +texture = ExtResource("1_0x5gc") +expand_mode = 3 + +[node name="Label" type="Label" parent="HBox" unique_id=1266037613] +layout_mode = 2 +size_flags_horizontal = 0 +text = "100" +label_settings = ExtResource("3_b5sgl") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="PanelContainer" type="PanelContainer" parent="." unique_id=46186733] +custom_minimum_size = Vector2(0, 20) +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_ceia4") + +[node name="Margin" type="MarginContainer" parent="PanelContainer" unique_id=242391594] +layout_mode = 2 +theme_override_constants/margin_left = 3 +theme_override_constants/margin_top = 3 +theme_override_constants/margin_right = 3 +theme_override_constants/margin_bottom = 3 + +[node name="Clip" type="PanelContainer" parent="PanelContainer/Margin" unique_id=1916934808] +clip_children = 1 +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_jaxhj") + +[node name="Panel" type="Panel" parent="PanelContainer/Margin/Clip" unique_id=631687451] +modulate = Color(0.09019608, 1, 0.8352941, 1) +custom_minimum_size = Vector2(194, 0) +layout_mode = 2 +size_flags_horizontal = 0 +offset_transform_enabled = true +theme_override_styles/panel = SubResource("StyleBoxFlat_y37n2") diff --git a/Prefabs/Player/HunterBody.cs b/Prefabs/Player/HunterBody.cs index 12d328a6..d6c3f918 100644 --- a/Prefabs/Player/HunterBody.cs +++ b/Prefabs/Player/HunterBody.cs @@ -18,8 +18,7 @@ public partial class HunterBody : PlayerBody protected override Camera3D Camera => _.Camera; protected override RayCast3D RayCast => _.Camera.RayCast; protected override Label PlayerUsername => Gun.PlayerUsernameLabel; - protected override ProgressBar HealthBar => _.HUD.Health.HealthBar; - protected override Label HealthLabel => _.HUD.Health.HealthLabel; + protected override HealthBar HealthBar => _.HUD.HealthBar; public override MultiplayerSynchronizer PositionSynchronizer => _.PositionSynchronizer; public override void _EnterTree() @@ -39,7 +38,6 @@ public override void _Process(double delta) { if (!IsMultiplayerAuthority()) return; if (!Alive) return; - // Show players names base._Process(delta); @@ -64,10 +62,29 @@ public override void _Process(double delta) if (Input.IsActionJustPressed(InputActions.Reload)) Gun.Reload(); // Listen crouch - if (Input.IsActionJustPressed(InputActions.Crouch)) + var crouchMode = GameManager.Settings.CrouchMode; + if (crouchMode == CrouchMode.Push) { var canStandUp = !_.Area3D.Get().HasOverlappingBodies(); - if (!isCrouching || canStandUp && isCrouching) ToggleCrouch(!isCrouching); + if (Input.IsActionPressed(InputActions.Crouch)) + { + if (!isCrouching) ToggleCrouch(true); + } + else + { + if (canStandUp && isCrouching) + { + ToggleCrouch(false); + } + } + } + else if (crouchMode == CrouchMode.Toggle) + { + if (Input.IsActionJustPressed(InputActions.Crouch)) + { + var canStandUp = !_.Area3D.Get().HasOverlappingBodies(); + if (!isCrouching || canStandUp && isCrouching) ToggleCrouch(!isCrouching); + } } } diff --git a/Prefabs/Player/PlayerBody.Movements.cs b/Prefabs/Player/PlayerBody.Movements.cs index 8f0b7091..daa4e705 100644 --- a/Prefabs/Player/PlayerBody.Movements.cs +++ b/Prefabs/Player/PlayerBody.Movements.cs @@ -24,7 +24,7 @@ public abstract partial class PlayerBody private float rotationY; private float preLockRotationY; - private bool isLocked; + protected bool RotationLocked; // --- Movements --- private void ProcessPhysics(double delta) @@ -79,7 +79,7 @@ private void ProcessPhysics(double delta) private void ProcessRotation() { - if (isLocked) + if (RotationLocked) { CameraDisk.SetRotation(new Vector3(rotationX, rotationY - preLockRotationY, 0)); // Not the visible body return; @@ -102,13 +102,5 @@ public override void _UnhandledInput(InputEvent rawEvent) rotationX -= mouseMotion.Relative.Y * VerticalSensitivity; rotationX = Math.Clamp(rotationX, -maxRotation, maxRotation); } - - // Locking - if (this is not PropBody prop) return; - if (rawEvent.IsActionPressed(InputActions.Lock) && !rawEvent.IsEcho()) - { - isLocked = !isLocked; - prop.ShowLockedLogo(isLocked); - } } } diff --git a/Prefabs/Player/PlayerBody.cs b/Prefabs/Player/PlayerBody.cs index fab8ae9a..0dc6ff12 100644 --- a/Prefabs/Player/PlayerBody.cs +++ b/Prefabs/Player/PlayerBody.cs @@ -13,41 +13,42 @@ public abstract partial class PlayerBody : CharacterBody3D protected abstract Camera3D Camera { get; } protected abstract RayCast3D RayCast { get; } protected abstract Label PlayerUsername { get; } - protected abstract ProgressBar HealthBar { get; } - protected abstract Label HealthLabel { get; } + protected abstract HealthBar HealthBar { get; } public abstract MultiplayerSynchronizer PositionSynchronizer { get; } private Supervisor supervisor = null!; protected GodotObject? FocusedObject; protected Vector3 FocusedPoint; + private Color healthMaxColor; + private double Health { get; set { field = Mathf.Clamp(value, 0, 1); - HealthBar.Value = value * 100; - HealthLabel.Text = ((int)Math.Ceiling(value * MaxHealth)).ToString(); + HealthBar.SetHealth(field, MaxHealth); } } - public void DecreaseHealth(PlayerBody damager, int amount) - { - Health -= (double)amount / MaxHealth; - if (Health <= 0) Died(damager); - } - protected int MaxHealth { get; set { field = value; - HealthLabel.Text = ((int)Math.Ceiling(Health * field)).ToString(); + HealthBar.SetHealth(Health, field); } } + public void DecreaseHealth(PlayerBody damager, int amount) + { + Health -= (double)amount / MaxHealth; + if (Health <= 0) Died(damager); + } + + private bool freeze; public bool Alive = true; private readonly CancellationTokenSource nodeAliveCts = new(); @@ -77,11 +78,22 @@ public override void _EnterTree() else supervisor = GameManager.Supervisor; Health = 1; + healthMaxColor = HealthBar.Modulate; // Set authority var ownerPeerId = int.Parse(Name); SetMultiplayerAuthority(ownerPeerId); + // Subscribe to color changes + var players = GameManager.Room.Room?.Players; + if (players is null) + log.Error("Could not get local player: Not in a room"); + else if (players.TryGetValue(ownerPeerId, out var player)) + player.Subscribe( + PlayerPropertiesChanged, + NodeAliveCt + ); + // Set spawn position var transform = Transform; transform.Origin = new Vector3(0, 1, ownerPeerId * 1.2f); @@ -95,11 +107,9 @@ public override void _EnterTree() } Camera.MakeCurrent(); - Camera.Fov = (float)GameManager.Settings.Fov; - GameManager.Settings.Changed.Subscribe( - _ => Camera.Fov = (float)GameManager.Settings.Fov, - NodeAliveCt - ); + + // Ignore PlayerBody + RayCast.AddException(this); } // Show players names @@ -140,4 +150,5 @@ public override void _PhysicsProcess(double delta) } protected abstract void SetHudsVisibility(bool value); + protected virtual void PlayerPropertiesChanged(Types.Player player) { } } diff --git a/Prefabs/Player/PropBody.cs b/Prefabs/Player/PropBody.cs index b1c7825a..21f035e1 100644 --- a/Prefabs/Player/PropBody.cs +++ b/Prefabs/Player/PropBody.cs @@ -2,13 +2,15 @@ namespace Behide.Game.Player; -[SceneTree("prop.tscn")] +[SceneTree("prop.tscn", traverseInstancedScenes: true)] public partial class PropBody : PlayerBody { private Node3D currentVisualNode = null!; + private Node3D currentOutlineNode = null!; private CollisionShape3D[] collisionNodes = null!; [Export] private float maxKickForce = 17f; + [Export] private ShaderMaterial maskMaterial = null!; [ExportGroup("Camera adjust transition")] [Export] private double cameraAdjustDuration = 0.4; @@ -20,24 +22,68 @@ public partial class PropBody : PlayerBody private const float speed = 1.55f; private const float slowSpeed = 0.3f; + private bool isOutlineVisible; protected override Node3D CameraDisk => _.CameraDisk; protected override Camera3D Camera => _.CameraDisk.SpringArm3D.Camera; + private Camera3D OutlineCamera => _.SubViewport.OutlineCamera; + private SubViewport SubViewport => _.SubViewport; + private SubViewport HorizontalViewport => _.HorizontalViewport; + private SubViewport VerticalViewport => _.SubViewportContainer.VerticalViewport; + private ColorRect ColorRectHorizontal => _.HorizontalViewport.ColorRect; + private ColorRect ColorRectVertical => _.SubViewportContainer.VerticalViewport.ColorRect; + private ShaderMaterial HorizontalMaterial => (ShaderMaterial)ColorRectHorizontal.GetMaterial(); + private ShaderMaterial VerticalMaterial => (ShaderMaterial)ColorRectVertical.GetMaterial(); protected override RayCast3D RayCast => _.CameraDisk.SpringArm3D.Camera.RayCast; - protected override ProgressBar HealthBar => _.HUD.BottomLeft.Health.HealthBar; - protected override Label HealthLabel => _.HUD.BottomLeft.Health.HealthLabel; + protected override HealthBar HealthBar => _.HUD.BottomLeft.Health.HealthBar; protected override Label PlayerUsername => _.HUD.Center.PlayerUsername; public override MultiplayerSynchronizer PositionSynchronizer => _.PositionSynchronizer; public override void _EnterTree() { + currentOutlineNode = _.MeshInstance3DOutline; + ((MeshInstance3D)currentOutlineNode).SetSurfaceOverrideMaterial(0, maskMaterial); base._EnterTree(); currentVisualNode = _.MeshInstance3D; + + /*var room = GameManager.Room.Room; + var color = new Color(1f, 0.8f, 0f, 1f); + if(room?.Players.TryGetValue(GetMultiplayerAuthority(), out var playerObservable) ?? false) + { + color = playerObservable.Value.Color; + } + MaskMaterial.SetShaderParameter("colorID", color);*/ + collisionNodes = [_.CollisionShape3D]; initialCameraPosition = CameraDisk.Position; ShowLockedLogo(false); AdjustProperties(); + + if (!IsMultiplayerAuthority()) + { + return; + } + + MoveSpeed = speed; + + OutlineCamera.MakeCurrent(); + #if !DEBUG + currentOutlineNode.Hide(); + #endif + ColorRectVertical.Visible = isOutlineVisible; + + HorizontalMaterial.SetShaderParameter("input_texture", SubViewport.GetTexture()); + VerticalMaterial.SetShaderParameter("input_texture", HorizontalViewport.GetTexture()); + + GetWindow().SizeChanged += ResizeViewports; + ResizeViewports(); + } + + private void ResizeViewports() + { + SubViewport.Size = GetWindow().Size; + HorizontalViewport.Size = GetWindow().Size; } protected override void SetHudsVisibility(bool value) => _.HUD.Get().SetVisible(value); @@ -50,12 +96,32 @@ public override void _UnhandledInput(InputEvent rawEvent) if (Input.MouseMode != Input.MouseModeEnum.Captured) return; // Morph - if (Input.IsActionJustPressed(InputActions.Morph) && FocusedObject is BehideObject focusedBehideObject) - Rpc(nameof(Morph), focusedBehideObject.GetPath()); + if (rawEvent.IsActionPressed(InputActions.Morph) && FocusedObject is BehideObject focusedBehideObject) + { + GetWindow().SetInputAsHandled(); + MorphRpc(focusedBehideObject.GetPath()); + } + } + + public override void _UnhandledKeyInput(InputEvent rawEvent) + { + if (!IsMultiplayerAuthority()) return; + if (!Alive) return; + if (Input.MouseMode != Input.MouseModeEnum.Captured) return; + + // Rotation locking + if (rawEvent.IsActionPressed(InputActions.Lock)) + { + RotationLocked = !RotationLocked; + ShowLockedLogo(RotationLocked); + GetWindow().SetInputAsHandled(); + } // Kick - if (Input.IsActionJustPressed(InputActions.Kick) && FocusedObject is BehideObject objectToKick) + if (rawEvent.IsActionPressed(InputActions.Kick) && FocusedObject is BehideObject objectToKick) { + GetWindow().SetInputAsHandled(); + var kickForce = Input.IsActionPressed(InputActions.Slow) ? maxKickForce / 5 @@ -75,11 +141,19 @@ public override void _UnhandledInput(InputEvent rawEvent) ); } + // Toggle outline + if (rawEvent.IsAction(InputActions.ToggleOutline)) + { + ColorRectVertical.Visible = rawEvent.IsPressed(); + GetWindow().SetInputAsHandled(); + } + // Adjust speed - MoveSpeed = - Input.IsActionPressed(InputActions.Slow) - ? slowSpeed - : speed; + if (rawEvent.IsAction(InputActions.Slow)) + { + MoveSpeed = rawEvent.IsPressed() ? slowSpeed : speed; + GetWindow().SetInputAsHandled(); + } } [Rpc(CallLocal = true)] @@ -88,9 +162,11 @@ private void Morph(NodePath behideObjectPath) if (GetNode(behideObjectPath) is not BehideObject behideObject) return; if (behideObject.VisualNode.Duplicate() is not Node3D newVisualNode) return; - // Remove current visual node and collision nodes + // Remove current visual node, outline node and collision nodes currentVisualNode.QueueFree(); RemoveChild(currentVisualNode); + currentOutlineNode.QueueFree(); + RemoveChild(currentOutlineNode); foreach (var collisionNode in collisionNodes) { collisionNode.QueueFree(); @@ -101,7 +177,46 @@ private void Morph(NodePath behideObjectPath) var initialVisualNodePos = newVisualNode.Position; currentVisualNode = newVisualNode; newVisualNode.Position = Vector3.Zero; - AddChild(newVisualNode); + currentOutlineNode = (Node3D)newVisualNode.Duplicate(); + AddChild(currentVisualNode); + if (currentOutlineNode is MeshInstance3D currentOutlineMesh) + { + currentOutlineMesh.Name = "OutlineMesh"; + currentOutlineMesh.SetLayerMaskValue(2, false); + currentOutlineMesh.SetLayerMaskValue(4, true); + for (var i = 0; i < currentOutlineMesh.Mesh.GetSurfaceCount(); i++) + currentOutlineMesh.SetSurfaceOverrideMaterial(i, maskMaterial); + + AddChild(currentOutlineMesh); + currentOutlineNode = currentOutlineMesh; + } + else + { + currentOutlineNode.Name = "OutlineGroup"; + foreach (var meshCandidate in currentOutlineNode.FindChildren("", "MeshInstance3D", true, false)) + { + if (meshCandidate is not MeshInstance3D mesh) + { + meshCandidate.QueueFree(); + continue; + } + + mesh.SetLayerMaskValue(1, false); + mesh.SetLayerMaskValue(2, false); + mesh.SetLayerMaskValue(3, false); + mesh.SetLayerMaskValue(4, true); + for (var i = 0; i < mesh.Mesh.GetSurfaceCount(); i++) + mesh.SetSurfaceOverrideMaterial(i, maskMaterial); + } + + AddChild(currentOutlineNode); + } +#if DEBUG + +#else + if(IsMultiplayerAuthority()) currentOutlineNode.Hide(); +#endif + // Set new collision shapes var newCollisionNodes = new List(behideObject.CollisionNodes.Length); @@ -156,5 +271,28 @@ private void AdjustProperties() cameraAdjustTween.Parallel().TweenProperty(CameraDisk, "scale", newScaleVector, cameraAdjustDuration); } - public void ShowLockedLogo(bool show) => _.HUD.BottomLeft.RotationLockedLabel.SetVisible(show); + private void ShowLockedLogo(bool show) => _.HUD.BottomLeft.RotationLockedLabel.SetVisible(show); + + protected override void PlayerPropertiesChanged(Types.Player player) + { + var color = player.Color; + if (currentOutlineNode is MeshInstance3D currentOutlineMesh) + for (var i = 0; i < currentOutlineMesh.GetSurfaceOverrideMaterialCount(); i++) + ((ShaderMaterial)currentOutlineMesh.GetSurfaceOverrideMaterial(i)).SetShaderParameter("colorID", color); + else + { + currentOutlineNode.Name = "OutlineGroup"; + foreach (var meshCandidate in currentOutlineNode.FindChildren("", nameof(MeshInstance3D), true, false)) + { + if (meshCandidate is not MeshInstance3D mesh) + { + meshCandidate.QueueFree(); + continue; + } + + for (var i = 0; i < mesh.GetSurfaceOverrideMaterialCount(); i++) + ((ShaderMaterial)mesh.GetSurfaceOverrideMaterial(i)).SetShaderParameter("colorID", color); + } + } + } } diff --git a/Prefabs/Player/SubmachineGun.cs b/Prefabs/Player/SubmachineGun.cs index d537c695..2b7eb66b 100644 --- a/Prefabs/Player/SubmachineGun.cs +++ b/Prefabs/Player/SubmachineGun.cs @@ -16,6 +16,8 @@ public partial class SubmachineGun : Gun public override Control Hud => _.Hud; public override Label PlayerUsernameLabel => _.Hud.Center.PlayerUsername; protected override Label AmmoLabel => _.Hud.RBottom.Ammo; + protected override TextureRect AmmoIcon => _.Hud.RBottom.AmmoIcon; + protected override TextureRect ReloadIcon => _.Hud.RBottom.ReloadIcon; private Control HitMark => _.Hud.Center.Crosshair.CrosshairHit; private RayCast3D Raycast => _.RayCast; @@ -26,6 +28,31 @@ public partial class SubmachineGun : Gun private double crosshairHitDuration = 0.3; private Tween? crosshairHitTween; + public override void _EnterTree() + { + base._EnterTree(); + if (IsMultiplayerAuthority()) SetZClipScale(); + } + + private void SetZClipScale() + { + var descendants = _.Model.FindChildren("*", nameof(MeshInstance3D), owned: false); + foreach (var descendant in descendants) + { + if (descendant is not MeshInstance3D mesh) continue; + for (var i = 0; i < mesh.GetSurfaceOverrideMaterialCount(); i++) + { + var material = mesh.GetActiveMaterial(i); + if (material is not StandardMaterial3D standardMaterial) continue; + + var newMaterial = (StandardMaterial3D)standardMaterial.Duplicate(); + newMaterial.UseZClipScale = true; + newMaterial.ZClipScale = 0.01f; + mesh.SetSurfaceOverrideMaterial(i, newMaterial); + } + } + } + protected override Node3D? ShootCore() { // Play sounds diff --git a/Prefabs/Player/SubmachineGun.tscn b/Prefabs/Player/SubmachineGun.tscn index 0043c4cd..aab7c904 100644 --- a/Prefabs/Player/SubmachineGun.tscn +++ b/Prefabs/Player/SubmachineGun.tscn @@ -7,6 +7,8 @@ [ext_resource type="AudioStream" uid="uid://bw0bgab4c1prs" path="res://Assets/Sounds/gunshot.wav" id="2_abca7"] [ext_resource type="Shader" uid="uid://dcub67rxcrt5x" path="res://Prefabs/Player/crosshair.gdshader" id="3_lrncf"] [ext_resource type="Texture2D" uid="uid://bfeh2aof53ta0" path="res://Assets/Images/crosshair.svg" id="4_1ol2f"] +[ext_resource type="Texture2D" uid="uid://bva1hvwd6n7p8" path="res://Assets/Images/Icons/Ammo.svg" id="8_abca7"] +[ext_resource type="Texture2D" uid="uid://c1j4l5yo6ta2g" path="res://Assets/Images/Icons/Reload.svg" id="8_h7rq2"] [sub_resource type="AudioStream" id="AudioStream_8uwrk"] @@ -27,7 +29,8 @@ outline_color = Color(0, 0, 0, 1) [sub_resource type="LabelSettings" id="LabelSettings_8uwrk"] font = ExtResource("2_8uwrk") -outline_size = 1 +font_size = 20 +outline_size = 2 outline_color = Color(0, 0, 0, 1) [node name="SubmachineGun" type="Node3D" unique_id=411671082] @@ -122,8 +125,17 @@ layout_mode = 2 size_flags_horizontal = 8 size_flags_vertical = 8 -[node name="TextureRect" type="TextureRect" parent="Hud/RBottom" unique_id=646447357] +[node name="ReloadIcon" type="TextureRect" parent="Hud/RBottom" unique_id=1692347698] +visible = false +layout_mode = 2 +offset_transform_enabled = true +texture = ExtResource("8_h7rq2") +expand_mode = 2 + +[node name="AmmoIcon" type="TextureRect" parent="Hud/RBottom" unique_id=646447357] layout_mode = 2 +texture = ExtResource("8_abca7") +expand_mode = 2 [node name="Ammo" type="Label" parent="Hud/RBottom" unique_id=376044258] layout_mode = 2 diff --git a/Prefabs/Player/hunter.tscn b/Prefabs/Player/hunter.tscn index 5c393172..02f100ca 100644 --- a/Prefabs/Player/hunter.tscn +++ b/Prefabs/Player/hunter.tscn @@ -2,6 +2,8 @@ [ext_resource type="Script" uid="uid://luuofj7aqswe" path="res://Prefabs/Player/HunterBody.cs" id="1_w58js"] [ext_resource type="PackedScene" uid="uid://duc1guf2tc711" path="res://Prefabs/Player/SubmachineGun.tscn" id="2_1qbrv"] +[ext_resource type="Script" uid="uid://csmaw8snfg308" path="res://Prefabs/SettingsAwareCamera3D.cs" id="2_w58js"] +[ext_resource type="PackedScene" uid="uid://nkor8n0q2s8j" path="res://Prefabs/Player/HealthBar/HealthBar.tscn" id="3_svrpp"] [sub_resource type="CapsuleMesh" id="CapsuleMesh_svrpp"] @@ -62,7 +64,9 @@ replication_config = SubResource("SceneReplicationConfig_n61o8") [node name="Camera" type="Camera3D" parent="." unique_id=1142722186] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05, 0) keep_aspect = 0 +cull_mask = 1048567 fov = 90.0 +script = ExtResource("2_w58js") [node name="SubmachineGun" parent="Camera" unique_id=411671082 instance=ExtResource("2_1qbrv")] @@ -84,21 +88,6 @@ theme_override_constants/margin_top = 30 theme_override_constants/margin_right = 30 theme_override_constants/margin_bottom = 30 -[node name="Health" type="MarginContainer" parent="HUD" unique_id=366987484] +[node name="HealthBar" parent="HUD" unique_id=1371579750 instance=ExtResource("3_svrpp")] layout_mode = 2 -size_flags_horizontal = 0 size_flags_vertical = 8 - -[node name="HealthBar" type="ProgressBar" parent="HUD/Health" unique_id=295005643] -custom_minimum_size = Vector2(130, 30) -layout_mode = 2 -mouse_filter = 1 -show_percentage = false - -[node name="HealthLabel" type="Label" parent="HUD/Health" unique_id=1444016133] -layout_mode = 2 -size_flags_vertical = 1 -mouse_filter = 1 -text = "100" -horizontal_alignment = 1 -vertical_alignment = 1 diff --git a/Prefabs/Player/mask.gdshader b/Prefabs/Player/mask.gdshader new file mode 100644 index 00000000..87d231fc --- /dev/null +++ b/Prefabs/Player/mask.gdshader @@ -0,0 +1,22 @@ +shader_type spatial; + +render_mode cull_front, unshaded; + +uniform vec3 colorID : source_color = vec3(1., 0.8, 0.); + +/*void vertex() { + vec4 clip_position = PROJECTION_MATRIX * (MODELVIEW_MATRIX * vec4(VERTEX, 1.0)); + vec3 clip_normal = mat3(PROJECTION_MATRIX) * (mat3(MODELVIEW_MATRIX) * NORMAL); + + vec2 offset = normalize(clip_normal.xy) / VIEWPORT_SIZE * clip_position.w * 5. * 2.0; + + clip_position.xy += offset; + + POSITION = clip_position; +}*/ + +void fragment() +{ + ALBEDO = colorID; + ALPHA = 1.; +} diff --git a/Prefabs/Player/mask.gdshader.uid b/Prefabs/Player/mask.gdshader.uid new file mode 100644 index 00000000..0838372d --- /dev/null +++ b/Prefabs/Player/mask.gdshader.uid @@ -0,0 +1 @@ +uid://cpic26ffvr8hs diff --git a/Prefabs/Player/outlineHorizontal.gdshader b/Prefabs/Player/outlineHorizontal.gdshader new file mode 100644 index 00000000..b31be13d --- /dev/null +++ b/Prefabs/Player/outlineHorizontal.gdshader @@ -0,0 +1,39 @@ +shader_type canvas_item; + +uniform int outline_width = 3; +uniform sampler2D input_texture : repeat_disable, filter_nearest; + +void fragment() { + vec2 suv = SCREEN_UV; + ivec2 size = textureSize(input_texture,0); + ivec2 iuv = ivec2(suv*vec2(size)); + vec4 temp_color = texelFetch(input_texture, iuv, 0); + + bool is_inner = temp_color.a > 0.; + bool is_outline = false; + vec3 mean_color = vec3(0.); + int weight_count = 0; + + if (!is_inner) { + for (int x = -outline_width; x <= outline_width; ++x) { + if (x == 0) { continue; } + ivec2 n_iuv = clamp(iuv + ivec2(x, 0), ivec2(0), size-ivec2(1)); + vec4 currentPixel = texelFetch(input_texture, n_iuv, 0); + float n_d_h = currentPixel.a; + if(n_d_h > 0.01) { + int weight = outline_width - abs(x) + 1; + mean_color += currentPixel.rgb/currentPixel.a*float(weight); + weight_count += weight; + is_outline = true; + } + } + } + + if(is_inner) { + COLOR = vec4(temp_color.rgb/temp_color.a, 0.5); + } + else if(is_outline) { + COLOR = vec4(mean_color/float(weight_count), 1.); + } + else discard; +} diff --git a/Prefabs/Player/outlineHorizontal.gdshader.uid b/Prefabs/Player/outlineHorizontal.gdshader.uid new file mode 100644 index 00000000..87b891b9 --- /dev/null +++ b/Prefabs/Player/outlineHorizontal.gdshader.uid @@ -0,0 +1 @@ +uid://cevjxarqmxigr diff --git a/Prefabs/Player/outlineVertical.gdshader b/Prefabs/Player/outlineVertical.gdshader new file mode 100644 index 00000000..f5f3409b --- /dev/null +++ b/Prefabs/Player/outlineVertical.gdshader @@ -0,0 +1,40 @@ +shader_type canvas_item; + +uniform int outline_width = 3; +uniform float inner_opacity : hint_range(0.0, 1.0, 0.01) = 0.5; +uniform float outline_opacity : hint_range(0.0, 1.0, 0.01) = 1.; +uniform sampler2D input_texture : repeat_disable, filter_nearest; + +void fragment() { + vec2 suv = SCREEN_UV; + ivec2 size = textureSize(input_texture,0); + ivec2 iuv = ivec2(suv*vec2(size)); + vec4 temp_color = texelFetch(input_texture, iuv, 0); + + bool is_inner = temp_color.a > 0. && temp_color.a < 1.; + bool is_outline = temp_color.a > 0.; + vec3 mean_color = vec3(0.); + int weight_count = 0; + + if (!is_inner) { + for (int y = -outline_width; y <= outline_width; ++y) { + ivec2 n_iuv = clamp(iuv + ivec2(0, y), ivec2(0), size-ivec2(1)); + vec4 currentPixel = texelFetch(input_texture, n_iuv, 0); + float n_d_h = currentPixel.a; + if(n_d_h > 0.01) { + int weight = outline_width - abs(y) + 1; + mean_color += currentPixel.rgb/currentPixel.a*float(weight); + weight_count += weight; + is_outline = true; + } + } + } + + if(is_inner) { + COLOR = vec4(temp_color.rgb/temp_color.a, inner_opacity); + } + else if(is_outline) { + COLOR = vec4(mean_color/float(weight_count), outline_opacity); + } + else discard; +} diff --git a/Prefabs/Player/outlineVertical.gdshader.uid b/Prefabs/Player/outlineVertical.gdshader.uid new file mode 100644 index 00000000..7d8d8661 --- /dev/null +++ b/Prefabs/Player/outlineVertical.gdshader.uid @@ -0,0 +1 @@ +uid://buxh8r3j3w4yh diff --git a/Prefabs/Player/prop.tscn b/Prefabs/Player/prop.tscn index a94eb2ec..8df7b3b7 100644 --- a/Prefabs/Player/prop.tscn +++ b/Prefabs/Player/prop.tscn @@ -1,11 +1,30 @@ [gd_scene format=3 uid="uid://iwqa8xgo1ip3"] [ext_resource type="FontFile" uid="uid://84qi1iqqj525" path="res://Assets/Fonts/Space Grotesk/static/SpaceGrotesk-Bold.ttf" id="2_7hld8"] +[ext_resource type="Shader" uid="uid://buxh8r3j3w4yh" path="res://Prefabs/Player/outlineVertical.gdshader" id="2_7odvv"] +[ext_resource type="Shader" uid="uid://cpic26ffvr8hs" path="res://Prefabs/Player/mask.gdshader" id="2_dg5hw"] [ext_resource type="Shader" uid="uid://dcub67rxcrt5x" path="res://Prefabs/Player/crosshair.gdshader" id="2_ky5tt"] [ext_resource type="Script" uid="uid://bnid2w67fk441" path="res://Prefabs/Player/PropBody.cs" id="2_m4go7"] +[ext_resource type="Script" uid="uid://csmaw8snfg308" path="res://Prefabs/SettingsAwareCamera3D.cs" id="3_8fnhj"] +[ext_resource type="Shader" uid="uid://cevjxarqmxigr" path="res://Prefabs/Player/outlineHorizontal.gdshader" id="3_dg5hw"] +[ext_resource type="PackedScene" uid="uid://nkor8n0q2s8j" path="res://Prefabs/Player/HealthBar/HealthBar.tscn" id="4_7hld8"] +[ext_resource type="Script" uid="uid://cg2f8nc5ylod2" path="res://Prefabs/SettingsAwareSubViewport.cs" id="4_scsbf"] +[ext_resource type="LabelSettings" uid="uid://dvlx486vdob4h" path="res://Assets/Fonts/JetBrains_Mono_outline.tres" id="10_q65ab"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_scsbf"] +render_priority = 0 +shader = ExtResource("2_dg5hw") +shader_parameter/colorID = Color(1, 0.8, 0, 1) [sub_resource type="BoxMesh" id="BoxMesh_x40yu"] +[sub_resource type="BoxMesh" id="BoxMesh_w1hta"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_j2ufq"] +render_priority = 0 +shader = ExtResource("2_dg5hw") +shader_parameter/colorID = Color(1, 0.8, 0, 1) + [sub_resource type="BoxShape3D" id="BoxShape3D_rr4v2"] [sub_resource type="SphereShape3D" id="SphereShape3D_ky5tt"] @@ -18,6 +37,16 @@ properties/1/path = NodePath(".:rotation") properties/1/spawn = true properties/1/replication_mode = 1 +[sub_resource type="ShaderMaterial" id="ShaderMaterial_37tqn"] +shader = ExtResource("3_dg5hw") +shader_parameter/outline_width = 5 + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_8fnhj"] +shader = ExtResource("2_7odvv") +shader_parameter/outline_width = 5 +shader_parameter/inner_opacity = 0.5 +shader_parameter/outline_opacity = 1.0 + [sub_resource type="LabelSettings" id="LabelSettings_j2ufq"] font = ExtResource("2_7hld8") font_size = 18 @@ -30,22 +59,23 @@ shader = ExtResource("2_ky5tt") [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_52r4e"] load_path = "res://.godot/imported/cross-visor.svg-00ba57c13ac8beaa6b3e0195f079b92d.ctex" -[sub_resource type="LabelSettings" id="LabelSettings_ky5tt"] -font = ExtResource("2_7hld8") -outline_size = 1 -outline_color = Color(0, 0, 0, 1) - [node name="Prop" type="CharacterBody3D" unique_id=486043969] collision_layer = 2 collision_mask = 23 platform_on_leave = 2 script = ExtResource("2_m4go7") maxKickForce = 17.5 +maskMaterial = SubResource("ShaderMaterial_scsbf") [node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=817965567] gi_mode = 2 mesh = SubResource("BoxMesh_x40yu") +[node name="MeshInstance3DOutline" type="MeshInstance3D" parent="." unique_id=1255137576] +layers = 8 +mesh = SubResource("BoxMesh_w1hta") +surface_material_override/0 = SubResource("ShaderMaterial_j2ufq") + [node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=247171871] shape = SubResource("BoxShape3D_rr4v2") @@ -59,16 +89,77 @@ spring_length = 5.0 [node name="Camera" type="Camera3D" parent="CameraDisk/SpringArm3D" unique_id=484317060] keep_aspect = 0 +cull_mask = 1048567 fov = 90.0 +script = ExtResource("3_8fnhj") [node name="RayCast" type="RayCast3D" parent="CameraDisk/SpringArm3D/Camera" unique_id=1015855657] target_position = Vector3(0, 0, -20) collision_mask = 23 debug_shape_custom_color = Color(0.237397, 0.706651, 1, 1) +[node name="RemoteTransform3D" type="RemoteTransform3D" parent="CameraDisk/SpringArm3D/Camera" unique_id=657472308] +remote_path = NodePath("../../../../SubViewport/OutlineCamera") + [node name="PositionSynchronizer" type="MultiplayerSynchronizer" parent="." unique_id=512832509] replication_config = SubResource("SceneReplicationConfig_n61o8") +[node name="SubViewport" type="SubViewport" parent="." unique_id=1030597066] +transparent_bg = true +handle_input_locally = false +render_target_update_mode = 4 +script = ExtResource("4_scsbf") + +[node name="OutlineCamera" type="Camera3D" parent="SubViewport" unique_id=262317903] +transform = Transform3D(1, 0, 0, 0, 0.99691737, 0.07845913, 0, -0.07845913, 0.99691737, 0, 1, 0) +keep_aspect = 0 +cull_mask = 8 +script = ExtResource("3_8fnhj") + +[node name="HorizontalViewport" type="SubViewport" parent="." unique_id=1074722499] +transparent_bg = true +handle_input_locally = false +size_2d_override_stretch = true +script = ExtResource("4_scsbf") + +[node name="ColorRect" type="ColorRect" parent="HorizontalViewport" unique_id=1206307843] +material = SubResource("ShaderMaterial_37tqn") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="SubViewportContainer" type="SubViewportContainer" parent="." unique_id=1724181968] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +stretch = true + +[node name="VerticalViewport" type="SubViewport" parent="SubViewportContainer" unique_id=450090553] +transparent_bg = true +handle_input_locally = false +size = Vector2i(1920, 1080) +size_2d_override_stretch = true +render_target_update_mode = 4 +script = ExtResource("4_scsbf") + +[node name="ColorRect" type="ColorRect" parent="SubViewportContainer/VerticalViewport" unique_id=783961637] +visible = false +material = SubResource("ShaderMaterial_8fnhj") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +mouse_filter = 2 + [node name="HUD" type="MarginContainer" parent="." unique_id=858932803] anchors_preset = 15 anchor_right = 1.0 @@ -123,25 +214,15 @@ theme_override_constants/separation = 20 layout_mode = 2 size_flags_horizontal = 0 size_flags_vertical = 8 +theme_override_constants/margin_right = 0 -[node name="HealthBar" type="ProgressBar" parent="HUD/BottomLeft/Health" unique_id=1064215690] -custom_minimum_size = Vector2(130, 30) -layout_mode = 2 -mouse_filter = 1 -show_percentage = false - -[node name="HealthLabel" type="Label" parent="HUD/BottomLeft/Health" unique_id=1288792058] +[node name="HealthBar" parent="HUD/BottomLeft/Health" unique_id=73779187 instance=ExtResource("4_7hld8")] layout_mode = 2 -size_flags_vertical = 1 -mouse_filter = 1 -text = "100" -horizontal_alignment = 1 -vertical_alignment = 1 [node name="RotationLockedLabel" type="Label" parent="HUD/BottomLeft" unique_id=1306155919] -visible = false layout_mode = 2 size_flags_horizontal = 4 +size_flags_vertical = 8 mouse_filter = 1 text = "Rot. Lock" -label_settings = SubResource("LabelSettings_ky5tt") +label_settings = ExtResource("10_q65ab") diff --git a/Prefabs/SettingsAwareCamera3D.cs b/Prefabs/SettingsAwareCamera3D.cs new file mode 100644 index 00000000..cde5fea6 --- /dev/null +++ b/Prefabs/SettingsAwareCamera3D.cs @@ -0,0 +1,19 @@ +using Godot; + +namespace Behide.Prefabs; + +public partial class SettingsAwareCamera3D : Camera3D +{ + private IDisposable? disposable; + + public override void _EnterTree() + { + disposable = GameManager.Settings.Changed.Subscribe(_ => SettingsChanged()); + SettingsChanged(); + } + + public override void _ExitTree() => disposable?.Dispose(); + + private void SettingsChanged() => + Fov = (float)GameManager.Settings.Fov; +} diff --git a/Prefabs/SettingsAwareCamera3D.cs.uid b/Prefabs/SettingsAwareCamera3D.cs.uid new file mode 100644 index 00000000..418fadbd --- /dev/null +++ b/Prefabs/SettingsAwareCamera3D.cs.uid @@ -0,0 +1 @@ +uid://csmaw8snfg308 diff --git a/Prefabs/SettingsAwareSubViewport.cs b/Prefabs/SettingsAwareSubViewport.cs new file mode 100644 index 00000000..98bba9ac --- /dev/null +++ b/Prefabs/SettingsAwareSubViewport.cs @@ -0,0 +1,25 @@ +using Godot; + +namespace Behide.Prefabs; + +public partial class SettingsAwareSubViewport : SubViewport +{ + private IDisposable? disposable; + + public override void _EnterTree() + { + disposable = GameManager.Settings.Changed.Subscribe(_ => SettingsChanged()); + SettingsChanged(); + } + + public override void _ExitTree() => disposable?.Dispose(); + + private void SettingsChanged() + { + Scaling3DMode = GetWindow().Scaling3DMode; + Scaling3DScale = GetWindow().Scaling3DScale; + Msaa3D = GetWindow().Msaa3D; + ScreenSpaceAA = GetWindow().ScreenSpaceAA; + UseTaa = GetWindow().UseTaa; + } +} diff --git a/Prefabs/SettingsAwareSubViewport.cs.uid b/Prefabs/SettingsAwareSubViewport.cs.uid new file mode 100644 index 00000000..70ca26a9 --- /dev/null +++ b/Prefabs/SettingsAwareSubViewport.cs.uid @@ -0,0 +1 @@ +uid://cg2f8nc5ylod2 diff --git a/Prefabs/Spectator/Spectator.cs b/Prefabs/Spectator/Spectator.cs index 9c082b38..e5e083ff 100644 --- a/Prefabs/Spectator/Spectator.cs +++ b/Prefabs/Spectator/Spectator.cs @@ -20,10 +20,6 @@ public partial class Spectator : CharacterBody3D private static float HorizontalSensitivity => (float)(0.005 * GameManager.Settings.HorizontalSensitivity); private static float VerticalSensitivity => (float)(0.005 * GameManager.Settings.VerticalSensitivity); - private readonly CancellationTokenSource nodeAliveCts = new(); - private CancellationToken NodeAliveCt => nodeAliveCts.Token; - public override void _ExitTree() => nodeAliveCts.Cancel(); - public void Enable() { nodes.Camera.Get().MakeCurrent(); @@ -36,12 +32,6 @@ public override void _EnterTree() { if (GameManager.Supervisor is null) log.Error("Supervisor is null"); else supervisor = GameManager.Supervisor; - - nodes.Camera.Get().Fov = (float)GameManager.Settings.Fov; - GameManager.Settings.Changed.Subscribe( - _ => nodes.Camera.Get().Fov = (float)GameManager.Settings.Fov, - NodeAliveCt - ); } public override void _UnhandledInput(InputEvent rawEvent) diff --git a/Prefabs/Spectator/Spectator.tscn b/Prefabs/Spectator/Spectator.tscn index 929335ae..14994b3f 100644 --- a/Prefabs/Spectator/Spectator.tscn +++ b/Prefabs/Spectator/Spectator.tscn @@ -1,6 +1,7 @@ [gd_scene format=3 uid="uid://1t0iy2imhdg4"] [ext_resource type="Script" uid="uid://cdmg4qsk6n7vj" path="res://Prefabs/Spectator/Spectator.cs" id="1_6po2o"] +[ext_resource type="Script" uid="uid://csmaw8snfg308" path="res://Prefabs/SettingsAwareCamera3D.cs" id="2_bq1p5"] [ext_resource type="FontFile" uid="uid://84qi1iqqj525" path="res://Assets/Fonts/Space Grotesk/static/SpaceGrotesk-Bold.ttf" id="2_r1tvc"] [ext_resource type="Shader" uid="uid://dcub67rxcrt5x" path="res://Prefabs/Player/crosshair.gdshader" id="3_bq1p5"] @@ -20,7 +21,10 @@ collision_mask = 16 script = ExtResource("1_6po2o") [node name="Camera" type="Camera3D" parent="." unique_id=441094346] +keep_aspect = 0 +cull_mask = 1048567 current = true +script = ExtResource("2_bq1p5") [node name="RayCast" type="RayCast3D" parent="Camera" unique_id=1647716969] target_position = Vector3(0, 0, -1000) diff --git a/Prefabs/Supervisors/PropHuntSupervisor.tscn b/Prefabs/Supervisors/PropHuntSupervisor.tscn index d787f2d3..bf3e58d5 100644 --- a/Prefabs/Supervisors/PropHuntSupervisor.tscn +++ b/Prefabs/Supervisors/PropHuntSupervisor.tscn @@ -15,6 +15,9 @@ [ext_resource type="FontFile" uid="uid://xdtqfye7tlou" path="res://Assets/Fonts/Space Grotesk/SpaceGrotesk-VariableFont_wght.ttf" id="11_yncfe"] [ext_resource type="PackedScene" uid="uid://bneom7724ud4p" path="res://Prefabs/Supervisors/TabMenu.tscn" id="13_5do5a"] +[sub_resource type="LabelSettings" id="LabelSettings_w1hta"] +font_color = Color(0.019607844, 0.050980393, 0.09411765, 1) + [sub_resource type="LabelSettings" id="LabelSettings_6mxck"] font_size = 20 @@ -81,8 +84,8 @@ theme = ExtResource("5_sfeev") [node name="AdvancedLabelCountdown" type="Node" parent="UI" unique_id=1393435489 node_paths=PackedStringArray("labels")] script = ExtResource("5_7hsgi") -labels = [NodePath("../Pre-game Prop/HBoxContainer/CountdownLabel"), NodePath("../Pre-game Hunter/BoxContainer/CountdownLabel")] -runningTextFormats = PackedStringArray("Time to hide: {0:mm\\:ss}", "The hunt begins in {0:mm\\:ss}") +labels = [NodePath("../Pre-game Prop/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer/MarginContainer/CountdownLabel"), NodePath("../Pre-game Hunter/BoxContainer/CountdownLabel")] +runningTextFormats = PackedStringArray("{0:mm\\:ss}", "The hunt begins in {0:mm\\:ss}") beforeRunningTexts = PackedStringArray("", "") afterRunningTexts = PackedStringArray("", "") metadata/_custom_type_script = "uid://sggdi83gahf1" @@ -93,27 +96,65 @@ layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 +offset_right = -1920.0 +offset_bottom = -1080.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 1 -[node name="HBoxContainer" type="VBoxContainer" parent="UI/Pre-game Prop" unique_id=550277550] -layout_mode = 1 -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -102.0 -offset_right = 102.0 +[node name="MarginContainer" type="MarginContainer" parent="UI/Pre-game Prop" unique_id=317886007] +layout_mode = 0 +offset_left = 858.0 +offset_right = 1062.0 offset_bottom = 56.0 -grow_horizontal = 2 +theme_override_constants/margin_top = 20 + +[node name="HBoxContainer" type="VBoxContainer" parent="UI/Pre-game Prop/MarginContainer" unique_id=550277550] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer" unique_id=1873961067] +layout_mode = 2 +size_flags_horizontal = 4 +script = ExtResource("9_efs40") +BezelSize = 10 +Color = Color(0.89411765, 0.94509804, 0.96862745, 1) + +[node name="HBoxContainer" type="HBoxContainer" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer/MarginContainer" unique_id=1824494438] +layout_mode = 2 + +[node name="Margin" type="MarginContainer" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer" unique_id=256956324] +layout_mode = 2 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_right = 10 + +[node name="Label" type="Label" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer/Margin" unique_id=722162276] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +text = "Time to hide" +label_settings = SubResource("LabelSettings_w1hta") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="MarginContainer" type="MarginContainer" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer" unique_id=466559119] +layout_mode = 2 +size_flags_horizontal = 10 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 15 +theme_override_constants/margin_bottom = 5 +script = ExtResource("9_efs40") +BezelSize = 10 +Color = Color(0.13333334, 0.34117648, 0.47843137, 1) -[node name="CountdownLabel" type="Label" parent="UI/Pre-game Prop/HBoxContainer" unique_id=1205335919] +[node name="CountdownLabel" type="Label" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer/MarginContainer" unique_id=1205335919] layout_mode = 2 -text = "Time to hide: 5:00" +text = "5:00" label_settings = SubResource("LabelSettings_6mxck") horizontal_alignment = 1 -[node name="Label" type="Label" parent="UI/Pre-game Prop/HBoxContainer" unique_id=354903745] +[node name="Label" type="Label" parent="UI/Pre-game Prop/MarginContainer/HBoxContainer" unique_id=354903745] +visible = false layout_mode = 2 text = "Hide!" label_settings = SubResource("LabelSettings_w7xx4") @@ -159,35 +200,114 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 1 -[node name="IsProp" type="Label" parent="UI/In-game" unique_id=383943983] +[node name="IsHunter" type="MarginContainer" parent="UI/In-game" unique_id=1508032552] +visible = false +layout_mode = 0 +offset_right = 179.0 +offset_bottom = 51.0 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 + +[node name="MarginContainer" type="MarginContainer" parent="UI/In-game/IsHunter" unique_id=1753701527] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 15 +theme_override_constants/margin_bottom = 5 +script = ExtResource("9_efs40") +BezelSize = 10 +Color = Color(0.13333334, 0.34117648, 0.47843137, 1) + +[node name="IsHunter" type="Label" parent="UI/In-game/IsHunter/MarginContainer" unique_id=1939703750] +layout_mode = 2 +text = "You are a hunter" + +[node name="IsProp" type="MarginContainer" parent="UI/In-game" unique_id=184896069] visible = false layout_mode = 0 offset_right = 114.0 -offset_bottom = 23.0 +offset_bottom = 21.0 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 20 + +[node name="MarginContainer" type="MarginContainer" parent="UI/In-game/IsProp" unique_id=402776818] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 15 +theme_override_constants/margin_bottom = 5 +script = ExtResource("9_efs40") +BezelSize = 10 +Color = Color(0.13333334, 0.34117648, 0.47843137, 1) + +[node name="IsProp" type="Label" parent="UI/In-game/IsProp/MarginContainer" unique_id=383943983] +layout_mode = 2 text = "You are a prop" -[node name="IsHunter" type="Label" parent="UI/In-game" unique_id=1939703750] -visible = false +[node name="MarginContainer" type="MarginContainer" parent="UI/In-game" unique_id=1119457365] layout_mode = 0 -offset_right = 146.0 -offset_bottom = 23.0 -text = "You are the hunter" +offset_left = 858.0 +offset_right = 1062.0 +offset_bottom = 56.0 +theme_override_constants/margin_top = 20 -[node name="CountdownLabel" type="Label" parent="UI/In-game" unique_id=948842489] -layout_mode = 1 -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -20.0 -offset_right = 20.0 -offset_bottom = 23.0 -grow_horizontal = 2 -text = "Time remaining: 5:00" +[node name="HBoxContainer" type="VBoxContainer" parent="UI/In-game/MarginContainer" unique_id=815281295] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="UI/In-game/MarginContainer/HBoxContainer" unique_id=1584583498] +layout_mode = 2 +size_flags_horizontal = 4 +script = ExtResource("9_efs40") +BezelSize = 10 +Color = Color(0.89411765, 0.94509804, 0.96862745, 1) + +[node name="HBoxContainer" type="HBoxContainer" parent="UI/In-game/MarginContainer/HBoxContainer/MarginContainer" unique_id=1799210419] +layout_mode = 2 + +[node name="Margin" type="MarginContainer" parent="UI/In-game/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer" unique_id=1707072852] +layout_mode = 2 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_right = 10 + +[node name="Label" type="Label" parent="UI/In-game/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer/Margin" unique_id=339096710] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +text = "Remaining time" +label_settings = SubResource("LabelSettings_w1hta") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="MarginContainer" type="MarginContainer" parent="UI/In-game/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer" unique_id=1467384339] +layout_mode = 2 +size_flags_horizontal = 10 +theme_override_constants/margin_left = 15 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 15 +theme_override_constants/margin_bottom = 5 +script = ExtResource("9_efs40") +BezelSize = 10 +Color = Color(0.13333334, 0.34117648, 0.47843137, 1) + +[node name="CountdownLabel" type="Label" parent="UI/In-game/MarginContainer/HBoxContainer/MarginContainer/HBoxContainer/MarginContainer" unique_id=948842489] +layout_mode = 2 +text = "5:00" + +[node name="Label" type="Label" parent="UI/In-game/MarginContainer/HBoxContainer" unique_id=761731032] +visible = false +layout_mode = 2 +text = "Hide!" +label_settings = SubResource("LabelSettings_w7xx4") +horizontal_alignment = 1 [node name="Countdown" type="Node" parent="UI/In-game" unique_id=1223747700 node_paths=PackedStringArray("label")] script = ExtResource("6_w7xx4") -label = NodePath("../CountdownLabel") -runningTextFormat = "Remaining time: {0:mm\\:ss}" +label = NodePath("../MarginContainer/HBoxContainer/MarginContainer/HBoxContainer/MarginContainer/CountdownLabel") +runningTextFormat = "{0:mm\\:ss}" beforeRunningText = "Spawning players..." afterRunningText = "Game finished" metadata/_custom_type_script = "uid://djqbwwelecick" @@ -208,7 +328,7 @@ theme_override_constants/margin_bottom = 30 [node name="LeftPanel" type="VBoxContainer" parent="UI/End-game" unique_id=182473767] layout_mode = 2 size_flags_horizontal = 0 -theme_override_constants/separation = -20 +theme_override_constants/separation = 0 [node name="Winner" type="MarginContainer" parent="UI/End-game/LeftPanel" unique_id=2040026077] layout_mode = 2 @@ -220,7 +340,6 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 15 script = ExtResource("9_efs40") BezelSize = 20 -BorderRadius = 0 Color = Color(0.89411765, 0.94509804, 0.96862745, 1) [node name="PropsWin" type="Label" parent="UI/End-game/LeftPanel/Winner" unique_id=831366820] @@ -243,7 +362,13 @@ text = "Hunter wins !" label_settings = SubResource("LabelSettings_yncfe") uppercase = true -[node name="Hunters" type="MarginContainer" parent="UI/End-game/LeftPanel" unique_id=667904677] +[node name="Players" type="VBoxContainer" parent="UI/End-game/LeftPanel" unique_id=1283871422] +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 10 +theme_override_constants/separation = -20 + +[node name="Hunters" type="MarginContainer" parent="UI/End-game/LeftPanel/Players" unique_id=667904677] z_index = 1 layout_mode = 2 size_flags_vertical = 10 @@ -253,23 +378,22 @@ theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 15 script = ExtResource("9_efs40") BezelSize = 20 -BorderRadius = 0 Color = Color(0.89411765, 0.94509804, 0.96862745, 1) -[node name="PlayerList" type="VBoxContainer" parent="UI/End-game/LeftPanel/Hunters" unique_id=640442055] +[node name="PlayerList" type="VBoxContainer" parent="UI/End-game/LeftPanel/Players/Hunters" unique_id=640442055] layout_mode = 2 -[node name="Title" type="MarginContainer" parent="UI/End-game/LeftPanel/Hunters/PlayerList" unique_id=1608657333] +[node name="Title" type="MarginContainer" parent="UI/End-game/LeftPanel/Players/Hunters/PlayerList" unique_id=1608657333] layout_mode = 2 theme_override_constants/margin_bottom = 5 -[node name="Label" type="Label" parent="UI/End-game/LeftPanel/Hunters/PlayerList/Title" unique_id=864597452] +[node name="Label" type="Label" parent="UI/End-game/LeftPanel/Players/Hunters/PlayerList/Title" unique_id=864597452] layout_mode = 2 text = "Hunters" label_settings = SubResource("LabelSettings_xer8t") uppercase = true -[node name="Props" type="MarginContainer" parent="UI/End-game/LeftPanel" unique_id=475210221] +[node name="Props" type="MarginContainer" parent="UI/End-game/LeftPanel/Players" unique_id=475210221] layout_mode = 2 size_flags_vertical = 8 theme_override_constants/margin_left = 15 @@ -278,18 +402,17 @@ theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 15 script = ExtResource("9_efs40") BezelSize = 20 -BorderRadius = 0 Color = Color(0.7921569, 0.8784314, 0.8980392, 1) -[node name="PlayerList" type="VBoxContainer" parent="UI/End-game/LeftPanel/Props" unique_id=1539544944] +[node name="PlayerList" type="VBoxContainer" parent="UI/End-game/LeftPanel/Players/Props" unique_id=1539544944] layout_mode = 2 -[node name="Title" type="MarginContainer" parent="UI/End-game/LeftPanel/Props/PlayerList" unique_id=266902820] +[node name="Title" type="MarginContainer" parent="UI/End-game/LeftPanel/Players/Props/PlayerList" unique_id=266902820] layout_mode = 2 theme_override_constants/margin_top = 20 theme_override_constants/margin_bottom = 5 -[node name="Label" type="Label" parent="UI/End-game/LeftPanel/Props/PlayerList/Title" unique_id=1730307490] +[node name="Label" type="Label" parent="UI/End-game/LeftPanel/Players/Props/PlayerList/Title" unique_id=1730307490] layout_mode = 2 text = "Props" label_settings = SubResource("LabelSettings_xer8t") @@ -306,7 +429,6 @@ theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 15 script = ExtResource("9_efs40") BezelSize = 20 -BorderRadius = 0 Color = Color(0.89411765, 0.94509804, 0.96862745, 1) [node name="Label" type="Label" parent="UI/End-game/TimedOut" unique_id=1177322988] @@ -330,7 +452,6 @@ z_index = 1 layout_mode = 2 script = ExtResource("9_efs40") BezelSize = 20 -BorderRadius = 0 Color = Color(0.039215688, 0.15686275, 0.32941177, 1) [node name="MarginContainer" type="MarginContainer" parent="UI/End-game/Buttons/Restart" unique_id=1566249671] @@ -361,7 +482,6 @@ size_flags_vertical = 3 theme_override_constants/margin_left = 20 script = ExtResource("9_efs40") BezelSize = 20 -BorderRadius = 0 Color = Color(0.7294118, 0.101960786, 0.101960786, 1) [node name="MarginContainer" type="MarginContainer" parent="UI/End-game/Buttons/Quit" unique_id=94754414] diff --git a/Scenes/Dungeon/Dungeon.tscn b/Scenes/Dungeon/Dungeon.tscn index 8862725c..150380d3 100644 --- a/Scenes/Dungeon/Dungeon.tscn +++ b/Scenes/Dungeon/Dungeon.tscn @@ -632,6 +632,7 @@ environment = SubResource("Environment_n6ef1") [node name="LightmapGI" type="LightmapGI" parent="." unique_id=1443591995] transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 6, 0, 6) +layers = 7 supersampling = true texel_scale = 2.0 generate_probes_subdiv = 3 @@ -1802,6 +1803,7 @@ shape = SubResource("BoxShape3D_f8atq") transform = Transform3D(-1, 0, 1.509958e-07, 0, 1, 0, -1.509958e-07, 0, -1, -5.9999995, 6, 15.5) [node name="OmniLight3D" parent="World/StaticProps/torch_mounted_with_light" index="1" unique_id=878820410] +layers = 7 light_bake_mode = 1 light_cull_mask = 4294967279 distance_fade_enabled = true @@ -1813,6 +1815,7 @@ omni_range = 10.0 transform = Transform3D(-1, 0, 1.509958e-07, 0, 1, 0, -1.509958e-07, 0, -1, -5.999998, 6, 23.8) [node name="OmniLight3D" parent="World/StaticProps/torch_mounted_with_light2" index="1" unique_id=878820410] +layers = 7 light_indirect_energy = 2.0 light_bake_mode = 1 light_cull_mask = 4294967279 @@ -1826,6 +1829,7 @@ omni_attenuation = 0.5 transform = Transform3D(-4.3711392e-08, 0, -1, 0, 1, 0, 1, 0, -4.3711392e-08, -6.5499997, 2, 16) [node name="OmniLight3D" parent="World/StaticProps/torch_mounted_with_light3" index="1" unique_id=878820410] +layers = 7 light_bake_mode = 1 light_cull_mask = 4294967279 distance_fade_enabled = true @@ -1837,6 +1841,7 @@ omni_range = 9.5 transform = Transform3D(4.5695568e-08, 0, 1, 0, 1, 0, -1, 0, 4.5695568e-08, -5.449998, 2, 16) [node name="OmniLight3D" parent="World/StaticProps/torch_mounted_with_light4" index="1" unique_id=878820410] +layers = 7 light_bake_mode = 1 light_cull_mask = 4294967279 distance_fade_enabled = true @@ -1848,6 +1853,7 @@ omni_range = 9.5 transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -38, 4, 23.500002) [node name="OmniLight3D" parent="World/StaticProps/torch_mounted_with_light5" index="1" unique_id=878820410] +layers = 7 light_indirect_energy = 2.0 light_bake_mode = 1 light_cull_mask = 4294967279 @@ -1860,6 +1866,7 @@ omni_range = 13.938019 transform = Transform3D(1, 0, 2.0762417e-07, 0, 1, 0, -2.0762417e-07, 0, 1, -38, 4, 0.5000019) [node name="OmniLight3D" parent="World/StaticProps/torch_mounted_with_light6" index="1" unique_id=878820410] +layers = 7 light_indirect_energy = 2.0 light_bake_mode = 1 light_cull_mask = 4294967279 diff --git a/Scenes/Home/Home.tscn b/Scenes/Home/Home.tscn index 36916b74..0fafbd11 100644 --- a/Scenes/Home/Home.tscn +++ b/Scenes/Home/Home.tscn @@ -14,7 +14,7 @@ font_size = 25 [sub_resource type="LabelSettings" id="LabelSettings_ogb76"] font = ExtResource("7_xbfhp") font_size = 30 -font_color = Color(0.09803922, 0.10980392, 0.11764706, 1) +font_color = Color(0.019607844, 0.050980393, 0.09411765, 1) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ogb76"] content_margin_left = 4.0 @@ -191,7 +191,7 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_colors/font_color = Color(0, 0, 0, 1) -theme_override_colors/font_placeholder_color = Color(0.309385, 0.309385, 0.309385, 1) +theme_override_colors/font_placeholder_color = Color(0.30980393, 0.30980393, 0.30980393, 1) theme_override_colors/caret_color = Color(0, 0, 0, 1) theme_override_fonts/font = ExtResource("8_yypu2") theme_override_font_sizes/font_size = 25 @@ -252,6 +252,8 @@ transform = Transform3D(0.7592496, 0.1596941, -0.6309024, 0, 0.96942663, 0.24538 [editable path="Dungeon/World/StaticProps/torch_mounted_with_light2"] [editable path="Dungeon/World/StaticProps/torch_mounted_with_light3"] [editable path="Dungeon/World/StaticProps/torch_mounted_with_light4"] +[editable path="Dungeon/World/StaticProps/torch_mounted_with_light5"] +[editable path="Dungeon/World/StaticProps/torch_mounted_with_light6"] [editable path="Dungeon/World/BehideObjects/BehideObjects/BehideObject6"] [editable path="Dungeon/World/BehideObjects/Arthur"] [editable path="Dungeon/World/BehideObjects/Arthur/candle_triple"] diff --git a/Scenes/Lobby/Lobby.UI.cs b/Scenes/Lobby/Lobby.UI.cs index b49d51df..87c20b1e 100644 --- a/Scenes/Lobby/Lobby.UI.cs +++ b/Scenes/Lobby/Lobby.UI.cs @@ -37,14 +37,14 @@ public partial class Lobby private Control PropList => Groups.Props.VBox; private Control AllPlayerList => Groups.All.VBox; - private Label ReadyButton => nodes.UI.HBox.Others.Buttons.Ready.MarginContainer.Label; - private Label RoleButton => nodes.UI.HBox.Others.Buttons.Role.MarginContainer.Label; + private Label ReadyButton => nodes.UI.HBox.Others.Column.Buttons.Ready.MarginContainer.Label; + private Label RoleButton => nodes.UI.HBox.Others.Column.Buttons.Role.MarginContainer.Label; - private _SceneTree.__0_UI.__1_HBox.__2_Others.__3_Settings.__4_Margin.__5_VBox.__6_HunterSelection HunterSelection => - nodes.UI.HBox.Others.Settings.Margin.VBox.HunterSelection; + private _SceneTree.__0_UI.__1_HBox.__2_Others.__3_Column.__4_Settings.__5_Margin.__6_VBox.__7_HunterSelection HunterSelection => + nodes.UI.HBox.Others.Column.Settings.Margin.VBox.HunterSelection; - private _SceneTree.__0_UI.__1_HBox.__2_Others.__3_Settings.__4_Margin.__5_VBox.__6_MapSelection MapSelection => - nodes.UI.HBox.Others.Settings.Margin.VBox.MapSelection; + private _SceneTree.__0_UI.__1_HBox.__2_Others.__3_Column.__4_Settings.__5_Margin.__6_VBox.__7_MapSelection MapSelection => + nodes.UI.HBox.Others.Column.Settings.Margin.VBox.MapSelection; private Label UsernameLabel => nodes.UI.HBox.Players.LocalPlayer.MarginContainer.Label; diff --git a/Scenes/Lobby/Lobby.tscn b/Scenes/Lobby/Lobby.tscn index 4c1a9a9b..da6a63ce 100644 --- a/Scenes/Lobby/Lobby.tscn +++ b/Scenes/Lobby/Lobby.tscn @@ -49,11 +49,11 @@ bg_color = Color(0.38431373, 0.34901962, 0.4862745, 1) [sub_resource type="LabelSettings" id="LabelSettings_jaxhj"] font = ExtResource("5_lj1ok") font_size = 18 -font_color = Color(0, 0, 0, 1) +font_color = Color(0.019607844, 0.050980393, 0.09411765, 1) [sub_resource type="LabelSettings" id="LabelSettings_rxs5b"] font = ExtResource("6_4hucq") -font_color = Color(0, 0, 0, 1) +font_color = Color(0.019607844, 0.050980393, 0.09411765, 1) [sub_resource type="LabelSettings" id="LabelSettings_q0f47"] font = ExtResource("7_rk5ct") @@ -242,7 +242,7 @@ theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 10 script = ExtResource("5_ew8go") BezelSize = 15 -Color = Color(1, 0, 0.458824, 1) +Color = Color(1, 0, 0.45882353, 1) [node name="Countdown" type="Label" parent="UI/HBox/Others/Info/Room State" unique_id=1001992688] layout_mode = 2 @@ -268,7 +268,7 @@ theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 10 script = ExtResource("5_ew8go") BezelSize = 15 -Color = Color(0.878431, 0.878431, 0, 1) +Color = Color(0.8784314, 0.8784314, 0, 1) [node name="Label" type="Label" parent="UI/HBox/Others/Info/Code/Label" unique_id=1429702073] layout_mode = 2 @@ -287,48 +287,53 @@ Color = Color(0.93333334, 0.96862745, 0.06666667, 1) [node name="Label" type="Label" parent="UI/HBox/Others/Info/Code/Value" unique_id=505538744] layout_mode = 2 -text = "abc01" +text = "ab01" label_settings = SubResource("LabelSettings_8edeb") vertical_alignment = 1 -[node name="Settings" type="VBoxContainer" parent="UI/HBox/Others" unique_id=1656864180] -clip_children = 2 +[node name="Column" type="VBoxContainer" parent="UI/HBox/Others" unique_id=868783573] layout_mode = 2 size_flags_horizontal = 0 size_flags_vertical = 3 +theme_override_constants/separation = 25 + +[node name="Settings" type="VBoxContainer" parent="UI/HBox/Others/Column" unique_id=1656864180] +clip_children = 2 +layout_mode = 2 +size_flags_vertical = 3 theme_override_constants/separation = 0 script = ExtResource("5_ew8go") BezelSize = 25 Color = Color(0.9098039, 0.87058824, 1, 1) -[node name="Title" type="PanelContainer" parent="UI/HBox/Others/Settings" unique_id=1427813056] +[node name="Title" type="PanelContainer" parent="UI/HBox/Others/Column/Settings" unique_id=1427813056] layout_mode = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_lj1ok") -[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Settings/Title" unique_id=743631870] +[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Title" unique_id=743631870] layout_mode = 2 theme_override_constants/margin_top = 18 theme_override_constants/margin_bottom = 18 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Title/MarginContainer" unique_id=1010430127] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Title/MarginContainer" unique_id=1010430127] layout_mode = 2 text = "Settings" label_settings = SubResource("LabelSettings_r0noc") horizontal_alignment = 1 uppercase = true -[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Settings" unique_id=2120879252] +[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Column/Settings" unique_id=2120879252] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 20 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 20 -[node name="VBox" type="VBoxContainer" parent="UI/HBox/Others/Settings/Margin" unique_id=867535445] +[node name="VBox" type="VBoxContainer" parent="UI/HBox/Others/Column/Settings/Margin" unique_id=867535445] layout_mode = 2 theme_override_constants/separation = 15 -[node name="Hunter Selection" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox" unique_id=2005587981] +[node name="Hunter Selection" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox" unique_id=2005587981] layout_mode = 2 theme_override_constants/margin_left = 18 theme_override_constants/margin_top = 12 @@ -338,22 +343,22 @@ script = ExtResource("5_ew8go") BezelSize = 15 Color = Color(0.9764706, 0.9764706, 0.9882353, 1) -[node name="HBox" type="HBoxContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection" unique_id=862844185] +[node name="HBox" type="HBoxContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection" unique_id=862844185] layout_mode = 2 theme_override_constants/separation = 30 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox" unique_id=305398790] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox" unique_id=305398790] layout_mode = 2 size_flags_horizontal = 2 text = "Hunter selection" label_settings = SubResource("LabelSettings_jaxhj") uppercase = true -[node name="Input" type="HBoxContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox" unique_id=428473969] +[node name="Input" type="HBoxContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox" unique_id=428473969] layout_mode = 2 theme_override_constants/separation = 3 -[node name="Value" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input" unique_id=1951852040] +[node name="Value" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input" unique_id=1951852040] custom_minimum_size = Vector2(90, 0) layout_mode = 2 theme_override_constants/margin_left = 10 @@ -365,69 +370,69 @@ BezelSize = 6 Color = Color(0.9098039, 0.87058824, 1, 1) TopRight = false -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Value" unique_id=1642256031] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Value" unique_id=1642256031] layout_mode = 2 text = "Manual" label_settings = SubResource("LabelSettings_rxs5b") horizontal_alignment = 1 uppercase = true -[node name="Buttons" type="VBoxContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input" unique_id=479827277 groups=["OwnerOnlyInputs"]] +[node name="Buttons" type="VBoxContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input" unique_id=479827277 groups=["OwnerOnlyInputs"]] layout_mode = 2 theme_override_constants/separation = 3 -[node name="Plus" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons" unique_id=988242529] +[node name="Plus" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons" unique_id=988242529] layout_mode = 2 script = ExtResource("5_ew8go") BezelSize = 6 Color = Color(0.38431373, 0.34901962, 0.4862745, 1) BottomLeft = false -[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus" unique_id=1182755537] +[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus" unique_id=1182755537] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = -3 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = -3 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus/Margin" unique_id=927603504] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus/Margin" unique_id=927603504] layout_mode = 2 text = "+" label_settings = SubResource("LabelSettings_q0f47") horizontal_alignment = 1 vertical_alignment = 1 -[node name="Button" type="Button" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus" unique_id=1434609656] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus" unique_id=1434609656] layout_mode = 2 flat = true -[node name="Minus" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons" unique_id=526128786] +[node name="Minus" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons" unique_id=526128786] layout_mode = 2 script = ExtResource("5_ew8go") -BezelSize = 0 +BezelSize = 6 Color = Color(0.38431373, 0.34901962, 0.4862745, 1) -TopLeft = true -BottomRight = true +TopRight = false +BottomLeft = false -[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus" unique_id=1494505269] +[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus" unique_id=1494505269] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = -4 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = -2 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus/Margin" unique_id=445933854] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus/Margin" unique_id=445933854] layout_mode = 2 text = "-" label_settings = SubResource("LabelSettings_q0f47") horizontal_alignment = 1 vertical_alignment = 1 -[node name="Button" type="Button" parent="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus" unique_id=1785218277] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus" unique_id=1785218277] layout_mode = 2 flat = true -[node name="Map Selection" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox" unique_id=613194137] +[node name="Map Selection" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox" unique_id=613194137] layout_mode = 2 theme_override_constants/margin_left = 18 theme_override_constants/margin_top = 12 @@ -437,48 +442,48 @@ script = ExtResource("5_ew8go") BezelSize = 15 Color = Color(0.9764706, 0.9764706, 0.9882353, 1) -[node name="HBox" type="HBoxContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection" unique_id=353629475] +[node name="HBox" type="HBoxContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection" unique_id=353629475] layout_mode = 2 theme_override_constants/separation = 30 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox" unique_id=113831294] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox" unique_id=113831294] layout_mode = 2 size_flags_horizontal = 3 text = "Map selection" label_settings = SubResource("LabelSettings_jaxhj") uppercase = true -[node name="Input" type="HBoxContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox" unique_id=907130174] +[node name="Input" type="HBoxContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox" unique_id=907130174] layout_mode = 2 size_flags_horizontal = 8 theme_override_constants/separation = 3 -[node name="Pervious" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input" unique_id=1714691437 groups=["OwnerOnlyInputs"]] +[node name="Pervious" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input" unique_id=1714691437 groups=["OwnerOnlyInputs"]] layout_mode = 2 script = ExtResource("5_ew8go") BezelSize = 6 Color = Color(0.38431373, 0.34901962, 0.4862745, 1) TopRight = false -[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious" unique_id=407758213] +[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious" unique_id=407758213] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = -3 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = -3 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious/Margin" unique_id=1540110644] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious/Margin" unique_id=1540110644] layout_mode = 2 text = "<" label_settings = SubResource("LabelSettings_2dfve") horizontal_alignment = 1 vertical_alignment = 1 -[node name="Button" type="Button" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious" unique_id=1271104718] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious" unique_id=1271104718] layout_mode = 2 flat = true -[node name="Value" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input" unique_id=1237794012] +[node name="Value" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input" unique_id=1237794012] custom_minimum_size = Vector2(90, 0) layout_mode = 2 theme_override_constants/margin_left = 10 @@ -491,60 +496,61 @@ Color = Color(0.9098039, 0.87058824, 1, 1) TopRight = false BottomLeft = false -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Value" unique_id=429990560] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Value" unique_id=429990560] layout_mode = 2 text = "Dungeon" label_settings = SubResource("LabelSettings_rxs5b") horizontal_alignment = 1 uppercase = true -[node name="Next" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input" unique_id=1256633830 groups=["OwnerOnlyInputs"]] +[node name="Next" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input" unique_id=1256633830 groups=["OwnerOnlyInputs"]] layout_mode = 2 script = ExtResource("5_ew8go") BezelSize = 6 Color = Color(0.38431373, 0.34901962, 0.4862745, 1) BottomLeft = false -[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Next" unique_id=142593323] +[node name="Margin" type="MarginContainer" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Next" unique_id=142593323] layout_mode = 2 theme_override_constants/margin_left = 10 theme_override_constants/margin_top = -3 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = -3 -[node name="Label" type="Label" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Next/Margin" unique_id=2069738311] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Next/Margin" unique_id=2069738311] layout_mode = 2 text = ">" label_settings = SubResource("LabelSettings_1pw17") horizontal_alignment = 1 vertical_alignment = 1 -[node name="Button" type="Button" parent="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Next" unique_id=937511265] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Next" unique_id=937511265] layout_mode = 2 flat = true -[node name="Buttons" type="HBoxContainer" parent="UI/HBox/Others" unique_id=1370561775] +[node name="Buttons" type="HBoxContainer" parent="UI/HBox/Others/Column" unique_id=1370561775] layout_mode = 2 size_flags_horizontal = 2 size_flags_vertical = 8 theme_override_constants/separation = -20 alignment = 2 -[node name="Role" type="MarginContainer" parent="UI/HBox/Others/Buttons" unique_id=756680485] +[node name="Role" type="MarginContainer" parent="UI/HBox/Others/Column/Buttons" unique_id=756680485] z_index = 2 layout_mode = 2 script = ExtResource("5_ew8go") BezelSize = 20 Color = Color(0.019607844, 0.105882354, 0.20784314, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Buttons/Role" unique_id=971512279] +[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Column/Buttons/Role" unique_id=971512279] +custom_minimum_size = Vector2(200, 0) layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 15 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 15 -[node name="Label" type="Label" parent="UI/HBox/Others/Buttons/Role/MarginContainer" unique_id=1305627633] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Buttons/Role/MarginContainer" unique_id=1305627633] layout_mode = 2 text = "Be hunter" label_settings = SubResource("LabelSettings_qy7bc") @@ -552,13 +558,13 @@ horizontal_alignment = 1 vertical_alignment = 1 uppercase = true -[node name="Button" type="Button" parent="UI/HBox/Others/Buttons/Role" unique_id=955328954] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Buttons/Role" unique_id=955328954] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 flat = true -[node name="Ready" type="MarginContainer" parent="UI/HBox/Others/Buttons" unique_id=458893213] +[node name="Ready" type="MarginContainer" parent="UI/HBox/Others/Column/Buttons" unique_id=458893213] z_index = 1 layout_mode = 2 theme_override_constants/margin_left = 20 @@ -566,14 +572,15 @@ script = ExtResource("5_ew8go") BezelSize = 20 Color = Color(0.039215688, 0.15686275, 0.32941177, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Buttons/Ready" unique_id=1291586526] +[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Column/Buttons/Ready" unique_id=1291586526] +custom_minimum_size = Vector2(200, 0) layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 15 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 15 -[node name="Label" type="Label" parent="UI/HBox/Others/Buttons/Ready/MarginContainer" unique_id=1430324176] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Buttons/Ready/MarginContainer" unique_id=1430324176] layout_mode = 2 text = "Set ready" label_settings = SubResource("LabelSettings_qy7bc") @@ -581,29 +588,27 @@ horizontal_alignment = 1 vertical_alignment = 1 uppercase = true -[node name="Button" type="Button" parent="UI/HBox/Others/Buttons/Ready" unique_id=308941770] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Buttons/Ready" unique_id=308941770] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 flat = true -[node name="Quit" type="MarginContainer" parent="UI/HBox/Others/Buttons" unique_id=1315296564] +[node name="Quit" type="MarginContainer" parent="UI/HBox/Others/Column/Buttons" unique_id=1315296564] layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 theme_override_constants/margin_left = 20 script = ExtResource("5_ew8go") BezelSize = 20 Color = Color(0.7294118, 0.101960786, 0.101960786, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Buttons/Quit" unique_id=708264660] +[node name="MarginContainer" type="MarginContainer" parent="UI/HBox/Others/Column/Buttons/Quit" unique_id=708264660] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 15 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 15 -[node name="Label" type="Label" parent="UI/HBox/Others/Buttons/Quit/MarginContainer" unique_id=1586408029] +[node name="Label" type="Label" parent="UI/HBox/Others/Column/Buttons/Quit/MarginContainer" unique_id=1586408029] layout_mode = 2 text = "Quit" label_settings = SubResource("LabelSettings_qy7bc") @@ -611,7 +616,7 @@ horizontal_alignment = 1 vertical_alignment = 1 uppercase = true -[node name="Button" type="Button" parent="UI/HBox/Others/Buttons/Quit" unique_id=214824739] +[node name="Button" type="Button" parent="UI/HBox/Others/Column/Buttons/Quit" unique_id=214824739] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -619,10 +624,10 @@ flat = true [node name="Presentation" type="Node3D" parent="." unique_id=36864698] -[connection signal="pressed" from="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus/Button" to="." method="IncreaseHunterCount"] -[connection signal="pressed" from="UI/HBox/Others/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus/Button" to="." method="DecreaseHunterCount"] -[connection signal="pressed" from="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious/Button" to="." method="ChangeMap" binds= [-1]] -[connection signal="pressed" from="UI/HBox/Others/Settings/Margin/VBox/Map Selection/HBox/Input/Next/Button" to="." method="ChangeMap" binds= [1]] -[connection signal="pressed" from="UI/HBox/Others/Buttons/Role/Button" to="." method="RoleButtonPressed"] -[connection signal="pressed" from="UI/HBox/Others/Buttons/Ready/Button" to="." method="ReadyButtonPressed"] -[connection signal="pressed" from="UI/HBox/Others/Buttons/Quit/Button" to="." method="QuitButtonPressed"] +[connection signal="pressed" from="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Plus/Button" to="." method="IncreaseHunterCount"] +[connection signal="pressed" from="UI/HBox/Others/Column/Settings/Margin/VBox/Hunter Selection/HBox/Input/Buttons/Minus/Button" to="." method="DecreaseHunterCount"] +[connection signal="pressed" from="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Pervious/Button" to="." method="ChangeMap" binds= [-1]] +[connection signal="pressed" from="UI/HBox/Others/Column/Settings/Margin/VBox/Map Selection/HBox/Input/Next/Button" to="." method="ChangeMap" binds= [1]] +[connection signal="pressed" from="UI/HBox/Others/Column/Buttons/Role/Button" to="." method="RoleButtonPressed"] +[connection signal="pressed" from="UI/HBox/Others/Column/Buttons/Ready/Button" to="." method="ReadyButtonPressed"] +[connection signal="pressed" from="UI/HBox/Others/Column/Buttons/Quit/Button" to="." method="QuitButtonPressed"] diff --git a/Scenes/PauseMenu/PauseMenu.tscn b/Scenes/PauseMenu/PauseMenu.tscn index 2b39744b..31fc8835 100644 --- a/Scenes/PauseMenu/PauseMenu.tscn +++ b/Scenes/PauseMenu/PauseMenu.tscn @@ -3,6 +3,9 @@ [ext_resource type="Script" uid="uid://bccs3yyeq7del" path="res://Scenes/PauseMenu/PauseMenu.cs" id="1_vd4nb"] [ext_resource type="PackedScene" uid="uid://mvi6mhwtencn" path="res://Scenes/Settings/Settings.tscn" id="2_jpxof"] [ext_resource type="Shader" uid="uid://baf1p55idhp1q" path="res://Scenes/PauseMenu/blur.gdshader" id="2_qu44q"] +[ext_resource type="Script" uid="uid://b287r2c48ldja" path="res://Prefabs/Controls/BezelContainer.cs" id="3_82qyg"] +[ext_resource type="Script" uid="uid://cwnjmwom5p2f4" path="res://Prefabs/Controls/StyleBoxBevel.cs" id="4_ifvnd"] +[ext_resource type="FontVariation" uid="uid://bqpb46gqbs0cm" path="res://Assets/Fonts/Space Grotesk/Space Grotesk Medium.tres" id="5_456hk"] [sub_resource type="Shader" id="Shader_4bayv"] code = "shader_type canvas_item; @@ -87,12 +90,20 @@ shader_parameter/u_blur_intensity = 1.2 shader = ExtResource("2_qu44q") shader_parameter/lod = 4.00000019 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_82qyg"] -bg_color = Color(11.708403, 11.708403, 11.708403, 1) -corner_radius_top_left = 10 -corner_radius_top_right = 10 -corner_radius_bottom_right = 10 -corner_radius_bottom_left = 10 +[sub_resource type="StyleBox" id="StyleBox_lj1ok"] +resource_local_to_scene = false +resource_name = "" +content_margin_left = -1.0 +content_margin_top = -1.0 +content_margin_right = -1.0 +content_margin_bottom = -1.0 +script = ExtResource("4_ifvnd") +BevelSize = 27 +Color = Color(1, 1, 1, 1) +metadata/_custom_type_script = "uid://cwnjmwom5p2f4" + +[sub_resource type="LabelSettings" id="LabelSettings_wq18j"] +font = ExtResource("5_456hk") [node name="Pause Menu" type="Control" unique_id=1490677513] z_index = 10 @@ -109,40 +120,79 @@ material = SubResource("ShaderMaterial_ceia4") layout_mode = 1 anchors_preset = -1 anchor_left = 0.35 -anchor_top = 0.2 -anchor_right = 0.64 -anchor_bottom = 0.2 +anchor_top = 0.33 +anchor_right = 0.65 +anchor_bottom = 0.33 [node name="Background" type="Panel" parent="Pause Menu" unique_id=100627987] material = SubResource("ShaderMaterial_4bayv") layout_mode = 2 -theme_override_styles/panel = SubResource("StyleBoxFlat_82qyg") +theme_override_styles/panel = SubResource("StyleBox_lj1ok") [node name="MarginContainer" type="MarginContainer" parent="Pause Menu" unique_id=1814557344] layout_mode = 2 size_flags_vertical = 0 -theme_override_constants/margin_left = 20 -theme_override_constants/margin_top = 20 -theme_override_constants/margin_right = 20 -theme_override_constants/margin_bottom = 20 +theme_override_constants/margin_left = 30 +theme_override_constants/margin_top = 30 +theme_override_constants/margin_right = 30 +theme_override_constants/margin_bottom = 30 [node name="Buttons" type="VBoxContainer" parent="Pause Menu/MarginContainer" unique_id=107834565] layout_mode = 2 +theme_override_constants/separation = 10 -[node name="Settings" type="Button" parent="Pause Menu/MarginContainer/Buttons" unique_id=1823169428] +[node name="SettingsContainer" type="MarginContainer" parent="Pause Menu/MarginContainer/Buttons" unique_id=2043576730] +layout_mode = 2 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_bottom = 10 +script = ExtResource("3_82qyg") +BezelSize = 15 +Color = Color(0.13333334, 0.34117648, 0.47843137, 1) + +[node name="MarginContainer" type="MarginContainer" parent="Pause Menu/MarginContainer/Buttons/SettingsContainer" unique_id=619183107] +layout_mode = 2 + +[node name="Label" type="Label" parent="Pause Menu/MarginContainer/Buttons/SettingsContainer/MarginContainer" unique_id=1526470535] layout_mode = 2 text = "Settings" +label_settings = SubResource("LabelSettings_wq18j") +horizontal_alignment = 1 +vertical_alignment = 1 +uppercase = true + +[node name="Settings" type="Button" parent="Pause Menu/MarginContainer/Buttons/SettingsContainer" unique_id=1823169428] +layout_mode = 2 +flat = true -[node name="Back" type="Button" parent="Pause Menu/MarginContainer/Buttons" unique_id=1526716928] +[node name="BackContainer" type="MarginContainer" parent="Pause Menu/MarginContainer/Buttons" unique_id=1101279205] +layout_mode = 2 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_bottom = 10 +script = ExtResource("3_82qyg") +BezelSize = 15 +Color = Color(0.039215688, 0.15686275, 0.32941177, 1) + +[node name="MarginContainer" type="MarginContainer" parent="Pause Menu/MarginContainer/Buttons/BackContainer" unique_id=277618591] +layout_mode = 2 + +[node name="Label" type="Label" parent="Pause Menu/MarginContainer/Buttons/BackContainer/MarginContainer" unique_id=688603231] layout_mode = 2 text = "Back" +label_settings = SubResource("LabelSettings_wq18j") +horizontal_alignment = 1 +vertical_alignment = 1 +uppercase = true + +[node name="Back" type="Button" parent="Pause Menu/MarginContainer/Buttons/BackContainer" unique_id=1526716928] +layout_mode = 2 +flat = true [node name="Settings Menu" parent="." unique_id=1584239507 instance=ExtResource("2_jpxof")] visible = false layout_mode = 1 -[connection signal="pressed" from="Pause Menu/MarginContainer/Buttons/Settings" to="." method="SwitchToSettingsMenu"] -[connection signal="pressed" from="Pause Menu/MarginContainer/Buttons/Back" to="." method="ToggleMenu"] +[connection signal="pressed" from="Pause Menu/MarginContainer/Buttons/SettingsContainer/Settings" to="." method="SwitchToSettingsMenu"] +[connection signal="pressed" from="Pause Menu/MarginContainer/Buttons/BackContainer/Back" to="." method="ToggleMenu"] [connection signal="pressed" from="Settings Menu/TabContainer/General/VBox/Back" to="." method="ToggleMenu"] [connection signal="pressed" from="Settings Menu/TabContainer/Controls/VBox/Back" to="." method="ToggleMenu"] [connection signal="pressed" from="Settings Menu/TabContainer/Video/VBox/Back" to="." method="ToggleMenu"] @@ -154,3 +204,4 @@ layout_mode = 1 [editable path="Settings Menu/TabContainer/Controls/VBox/FOV"] [editable path="Settings Menu/TabContainer/Video/VBox/UI Scaling/Slider Setting"] [editable path="Settings Menu/TabContainer/Video/VBox/Render Scale/Slider Setting"] +[editable path="Settings Menu/TabContainer/Video/VBox/Max FPS/Slider Setting"] diff --git a/Scenes/Restaurant/Restaurant.tscn b/Scenes/Restaurant/Restaurant.tscn index 6661109a..9edb290f 100644 --- a/Scenes/Restaurant/Restaurant.tscn +++ b/Scenes/Restaurant/Restaurant.tscn @@ -488,6 +488,7 @@ BehideObjects = NodePath("../BehideObjects") environment = SubResource("Environment_cclfe") [node name="LightmapGI" type="LightmapGI" parent="." unique_id=1173480206] +layers = 7 quality = 2 supersampling = true interior = true @@ -1251,7 +1252,13 @@ transform = Transform3D(1, 0, 0, 0, -1, -8.742278e-08, 0, 8.742278e-08, -1, -14. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1, 0, -0.2) [node name="fridge_a" parent="BehideObjects" unique_id=2116853705 instance=ExtResource("25_vndp1")] -transform = Transform3D(-0.999229, 0, 0.039259903, 0, 1, 0, -0.039259903, 0, -0.999229, 8.199999, 0.5, 4.9) +transform = Transform3D(-0.99922895, 0, 0.039259978, 0, 1, 0, -0.039259978, 0, -0.99922895, 8.199999, 0.5, 4.9) + +[node name="fridge_a" parent="BehideObjects/fridge_a" index="0" unique_id=285069724] +transform = Transform3D(1.0000001, 0, 0, 0, 1, 0, 0, 0, 1.0000001, 0, 0, 0) + +[node name="CollisionShape3D" parent="BehideObjects/fridge_a" index="1" unique_id=2034349733] +transform = Transform3D(1.0000001, 0, 0, 0, 1, 0, 0, 0, 1.0000001, 0, 1.2, 0) [node name="oven" parent="BehideObjects" unique_id=1012418369 instance=ExtResource("26_5mqmp")] transform = Transform3D(-0.99978435, 0, 0.020768011, 0, 1, 0, -0.020768011, 0, -0.99978435, 10.4, 0.5, 4.9) @@ -1504,12 +1511,9 @@ transform = Transform3D(0.81548154, 0, 0.5787831, 0, 1, 0, -0.5787831, 0, 0.8154 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.2633133, -0.6, -23.927341) [node name="drill_structure2" parent="BehideObjects" unique_id=414522038 instance=ExtResource("95_yk75b")] -transform = Transform3D(0.9580929, 0, 0.28645766, 0, 1, 0, -0.28645766, 0, 0.9580929, -8.8, -0.6, -18.599998) - -[node name="drill_structure" parent="BehideObjects/drill_structure2/drill_structure" parent_id_path=PackedInt32Array(414522038, 1065827109) index="0" unique_id=1668541799] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.77742577, 0, -0.0020618439) +transform = Transform3D(0.9580929, 0, 0.28645766, 0, 1, 0, -0.28645766, 0, 0.9580929, -7.9505773, -0.6, -18.740839) -[node name="drill_module" parent="BehideObjects/drill_structure2/drill_structure/drill_structure" index="0" unique_id=1133226769] +[node name="drill_module" parent="BehideObjects/drill_structure2/drill_structure/drill_structure" parent_id_path=PackedInt32Array(414522038, 1065827109, 975956148) index="0" unique_id=1019312915] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.34523964, 0) [node name="solarpanel2" parent="BehideObjects" unique_id=1548592808 instance=ExtResource("96_5qqhn")] @@ -1586,23 +1590,19 @@ CollisionNodes = [NodePath("../candle_triple2/CollisionShape3D")] transform = Transform3D(0.9947388, 0, -0.10244353, 0, 1, 0, 0.10244353, 0, 0.9947388, -11.60951, 0.50000215, 4.396705) [node name="ketchup4" parent="BehideObjects" unique_id=1387326690 instance=ExtResource("55_equyh")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.134607, 0.6225014, 4.9124293) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.463157, 0.6225014, 4.9124293) -[node name="jar_d_small3" parent="BehideObjects" unique_id=2058499529 node_paths=PackedStringArray("CollisionNodes") instance=ExtResource("44_te0bn")] +[node name="jar_d_small3" parent="BehideObjects" unique_id=2058499529 instance=ExtResource("44_te0bn")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.907074, 0.6225021, 4.7151237) -CollisionNodes = [null] -[node name="jar_c_medium" parent="BehideObjects" unique_id=1789025501 node_paths=PackedStringArray("CollisionNodes") instance=ExtResource("96_dpha8")] +[node name="jar_c_medium" parent="BehideObjects" unique_id=1789025501 instance=ExtResource("96_dpha8")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.964246, 0.622502, 4.115289) -CollisionNodes = [null] -[node name="jar_b_small" parent="BehideObjects" unique_id=1285458310 node_paths=PackedStringArray("CollisionNodes") instance=ExtResource("97_ix7vu")] +[node name="jar_b_small" parent="BehideObjects" unique_id=1285458310 instance=ExtResource("97_ix7vu")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.3027115, 0.62250197, 4.178903) -CollisionNodes = [null] -[node name="mustard4" parent="BehideObjects" unique_id=1396576624 node_paths=PackedStringArray("CollisionNodes") instance=ExtResource("56_mnk1p")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.141789, 0.6225021, 4.706554) -CollisionNodes = [null] +[node name="mustard4" parent="BehideObjects" unique_id=1396576624 instance=ExtResource("56_mnk1p")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.285613, 0.6225021, 4.706554) [node name="table_round_a_small" parent="BehideObjects" unique_id=756488518 instance=ExtResource("68_c7v4a")] transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 14.259244, 0.49999982, -23.94365) @@ -2109,6 +2109,8 @@ distance_fade_shadow = 20.0 omni_range = 9.958 omni_attenuation = 0.5 +[editable path="BehideObjects/fridge_a"] +[editable path="BehideObjects/fridge_a/fridge_a"] [editable path="BehideObjects/drill_structure2"] [editable path="BehideObjects/drill_structure2/drill_structure"] [editable path="BehideObjects/candle_thin"] diff --git a/Scenes/Settings/Settings.controls.cs b/Scenes/Settings/Settings.controls.cs index e7a3f2d7..21e306a2 100644 --- a/Scenes/Settings/Settings.controls.cs +++ b/Scenes/Settings/Settings.controls.cs @@ -3,6 +3,8 @@ namespace Behide.Game; +public enum CrouchMode { Push, Toggle } + public partial class Settings { private _SceneTree.__0_TabContainer.__1_Controls.__2_VBox Controls => nodes.TabContainer.Controls.VBox; @@ -10,12 +12,19 @@ public partial class Settings public double HorizontalSensitivity => Controls.HorizontalSensitivity.Value; public double VerticalSensitivity => Controls.VerticalSensitivity.Value; public double Fov => Controls.FOV.Value; + public CrouchMode CrouchMode => Controls.Crouch.OptionButton.Selected switch + { + 0 => CrouchMode.Push, + 1 => CrouchMode.Toggle, + _ => 0 + }; private void ControlsListenSettingsForSaving() { Controls.HorizontalSensitivity.Changed.Subscribe(_ => Changed.OnNext(Unit.Default)); Controls.VerticalSensitivity.Changed.Subscribe(_ => Changed.OnNext(Unit.Default)); Controls.FOV.Changed.Subscribe(_ => Changed.OnNext(Unit.Default)); + Controls.Crouch.OptionButton.ItemSelected += _ => Changed.OnNext(Unit.Default); } private void ControlsApplyFromConfig(ConfigFile config) @@ -23,9 +32,16 @@ private void ControlsApplyFromConfig(ConfigFile config) var hSensi = config.GetValue("Controls", "horizontal-sensitivity", 1).AsDouble(); var vSensi = config.GetValue("Controls", "vertical-sensitivity", 1).AsDouble(); var fov = config.GetValue("Controls", "fov", 110).AsDouble(); + var crouchMode = config.GetValue("Controls", "crouch-mode", "push").AsString(); Controls.HorizontalSensitivity.SetValue(hSensi); Controls.VerticalSensitivity.SetValue(vSensi); Controls.FOV.SetValue(fov); + Controls.Crouch.OptionButton.Select(crouchMode switch + { + "push" => 0, + "toggle" => 1, + _ => 0 + }); } private void ControlsApplyToConfig(ConfigFile config) @@ -33,5 +49,11 @@ private void ControlsApplyToConfig(ConfigFile config) config.SetValue("Controls", "horizontal-sensitivity", HorizontalSensitivity); config.SetValue("Controls", "vertical-sensitivity", VerticalSensitivity); config.SetValue("Controls", "fov", Fov); + config.SetValue("Controls", "crouch-mode", Controls.Crouch.OptionButton.Selected switch + { + 0 => "push", + 1 => "toggle", + _ => "push" + }); } } diff --git a/Scenes/Settings/Settings.cs b/Scenes/Settings/Settings.cs index a099d5e9..1407d599 100644 --- a/Scenes/Settings/Settings.cs +++ b/Scenes/Settings/Settings.cs @@ -14,6 +14,9 @@ public partial class Settings : Control public override void _Ready() { + // Select the first tab + nodes.TabContainer.Get().CurrentTab = 0; + VideoListenSettings(); GraphicsListenSettings(); diff --git a/Scenes/Settings/Settings.general.cs b/Scenes/Settings/Settings.general.cs index c9b2c8b0..75dd9fa2 100644 --- a/Scenes/Settings/Settings.general.cs +++ b/Scenes/Settings/Settings.general.cs @@ -6,6 +6,19 @@ namespace Behide.Game; public partial class Settings { private _SceneTree.__0_TabContainer.__1_General.__2_VBox General => nodes.TabContainer.General.VBox; + private ColorPickerButton ColorPickerButton => General.Color.ColorPickerButton; + + private Color defaultColor = new(1f, 0.8f, 0f); + + public override void _EnterTree() + { + base._EnterTree(); + var colorPicker = ColorPickerButton.GetPicker(); + colorPicker.ColorMode = 0; + colorPicker.PickerShape = ColorPicker.PickerShapeType.HsvWheel; + colorPicker.ColorModesVisible = false; + colorPicker.PresetsVisible = false; + } public string? GetUsername() { @@ -15,9 +28,17 @@ public partial class Settings : lineEditText; } + public Color GetColor() => ColorPickerButton.Color; + private void GeneralListenSettingsForSaving() { General.Username.LineEdit.TextChanged += _ => Changed.OnNext(Unit.Default); + General.Color.ColorPickerButton.ColorChanged += _ => { + Changed.OnNext(Unit.Default); + var color = General.Color.ColorPickerButton.Color; + var room = GameManager.Room.Room; + room?.SetPlayerColor(color); + }; } private void GeneralApplyFromConfig(ConfigFile config) @@ -28,10 +49,19 @@ private void GeneralApplyFromConfig(ConfigFile config) General.Username.LineEdit.Text = username; } catch (Exception) { /* ignored */ } + + try + { + var colorString = config.GetValue("User", "color").AsString(); + var color = Color.FromString(colorString, defaultColor); + ColorPickerButton.Color = color; + } + catch (Exception) { ColorPickerButton.Color = defaultColor; } } private void GeneralApplyToConfig(ConfigFile config) { config.SetValue("User", "username", GetUsername() ?? string.Empty); + config.SetValue("User", "color", GetColor().ToHtml(false)); } } diff --git a/Scenes/Settings/Settings.tscn b/Scenes/Settings/Settings.tscn index c2f6d146..42ddf6c6 100644 --- a/Scenes/Settings/Settings.tscn +++ b/Scenes/Settings/Settings.tscn @@ -59,6 +59,21 @@ text = "Player name" layout_mode = 2 size_flags_horizontal = 3 +[node name="Color" type="HBoxContainer" parent="TabContainer/General/VBox" unique_id=288310400] +layout_mode = 2 + +[node name="Label" type="Label" parent="TabContainer/General/VBox/Color" unique_id=1985173137] +layout_mode = 2 +size_flags_horizontal = 0 +text = "Color" + +[node name="ColorPickerButton" type="ColorPickerButton" parent="TabContainer/General/VBox/Color" unique_id=1827737492] +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +size_flags_horizontal = 10 +edit_alpha = false +edit_intensity = false + [node name="Back" type="Button" parent="TabContainer/General/VBox" unique_id=595488265] layout_mode = 2 size_flags_vertical = 10 @@ -112,6 +127,25 @@ max_value = 179.0 step = 1.0 value = 90.0 +[node name="Crouch" type="HBoxContainer" parent="TabContainer/Controls/VBox" unique_id=1853537923] +layout_mode = 2 + +[node name="Label" type="Label" parent="TabContainer/Controls/VBox/Crouch" unique_id=105899445] +layout_mode = 2 +size_flags_horizontal = 2 +text = "Crouch mode" + +[node name="OptionButton" type="OptionButton" parent="TabContainer/Controls/VBox/Crouch" unique_id=1123010502] +layout_mode = 2 +size_flags_horizontal = 8 +selected = 0 +fit_to_longest_item = false +item_count = 2 +popup/item_0/text = "Push" +popup/item_0/id = 1 +popup/item_1/text = "Toggle" +popup/item_1/id = 0 + [node name="Back" type="Button" parent="TabContainer/Controls/VBox" unique_id=130308000] layout_mode = 2 size_flags_vertical = 10 @@ -266,6 +300,29 @@ popup/item_5/id = 5 popup/item_6/text = "Temporal Anti-aliasing" popup/item_6/id = 6 +[node name="VSync" type="HBoxContainer" parent="TabContainer/Video/VBox" unique_id=883074179] +layout_mode = 2 +theme_override_constants/separation = 15 + +[node name="Label" type="Label" parent="TabContainer/Video/VBox/VSync" unique_id=1841727785] +layout_mode = 2 +size_flags_horizontal = 2 +text = "VSync" + +[node name="OptionButton" type="OptionButton" parent="TabContainer/Video/VBox/VSync" unique_id=1061910895] +layout_mode = 2 +selected = 0 +fit_to_longest_item = false +item_count = 4 +popup/item_0/text = "Disabled" +popup/item_0/id = 0 +popup/item_1/text = "Enabled" +popup/item_1/id = 1 +popup/item_2/text = "Adaptive" +popup/item_2/id = 2 +popup/item_3/text = "Mailbox" +popup/item_3/id = 3 + [node name="FPS" type="HBoxContainer" parent="TabContainer/Video/VBox" unique_id=325118476] layout_mode = 2 theme_override_constants/separation = 15 diff --git a/Scenes/Settings/Settings.video.cs b/Scenes/Settings/Settings.video.cs index fc37785d..bacf82b3 100644 --- a/Scenes/Settings/Settings.video.cs +++ b/Scenes/Settings/Settings.video.cs @@ -1,4 +1,5 @@ using System.Reactive; +using System.Reactive.Subjects; using Godot; namespace Behide.Game; @@ -55,6 +56,18 @@ private void Video_SetAntiAliasing(long mode) GetWindow().UseTaa = mode == 6; } + private void Video_SetVSyncMode(long mode) + { + DisplayServer.WindowSetVsyncMode( + mode switch + { + 1 => DisplayServer.VSyncMode.Enabled, + 2 => DisplayServer.VSyncMode.Adaptive, + 3 => DisplayServer.VSyncMode.Mailbox, + _ => DisplayServer.VSyncMode.Disabled + }); + } + private void Video_SetDriver(long driver) { settingsOverride.Clear(); @@ -112,6 +125,8 @@ private void VideoListenSettings() // Anti-aliasing Video.Anti_aliasing.OptionButton.ItemSelected += Video_SetAntiAliasing; + // VSync + Video.VSync.OptionButton.ItemSelected += Video_SetVSyncMode; // FPS Video.FPS.Enabled.Toggled += GameManager.VisualEffectsLayer.EnableFpsDisplay; @@ -131,6 +146,7 @@ private void VideoListenSettingsForSaving() Video.RenderScale.OptionButton.ItemSelected += _ => Changed.OnNext(Unit.Default); Video.RenderScale.SliderSetting.Changed.Subscribe(_ => Changed.OnNext(Unit.Default)); Video.Anti_aliasing.OptionButton.ItemSelected += _ => Changed.OnNext(Unit.Default); + Video.VSync.OptionButton.ItemSelected += _ => Changed.OnNext(Unit.Default); Video.FPS.Enabled.Toggled += _ => Changed.OnNext(Unit.Default); Video.MaxFPS.SliderSetting.Changed.Subscribe(_ => Changed.OnNext(Unit.Default)); } @@ -146,6 +162,7 @@ renderingMethod is "forward_plus" var renderScale = config.GetValue(nameof(Video), "render-scale", 100).AsInt32(); var antiAliasing = config.GetValue(nameof(Video), "anti-aliasing", "none").AsString(); + var vSync = config.GetValue(nameof(Video), "vsync", "disabled").AsString(); var displayFps = config.GetValue(nameof(Video), "display-fps", false).AsBool(); var maxFps = config.GetValue(nameof(Video), "max-fps", 0).AsInt32(); @@ -187,6 +204,16 @@ renderingMethod is "forward_plus" "taa" => renderingMethod == "forward_plus" ? 6 : 0, _ => 0 }); + + Video.VSync.OptionButton.Select(vSync switch + { + "disabled" => 0, + "enabled" => 1, + "adaptive" => 2, + "mailbox" => 3, + _ => 0 + }); + Video.MaxFPS.SliderSetting.SetValue(maxFps); Video.Driver.OptionButton.SetItemDisabled(1, !OperatingSystem.IsWindows()); @@ -234,6 +261,15 @@ private void VideoApplyToConfig(ConfigFile config) 6 => "taa", _ => "none" }); + config.SetValue(nameof(Video), "vsync", Video.VSync.OptionButton.Selected switch + { + 0 => "disabled", + 1 => "enabled", + 2 => "adaptive", + 3 => "mailbox", + _ => "disabled" + }); + config.SetValue(nameof(Video), "display-fps", Video.FPS.Enabled.ButtonPressed); config.SetValue(nameof(Video), "max-fps", Video.MaxFPS.SliderSetting.Value); } diff --git a/Scripts/Room.cs b/Scripts/Room.cs index ba3ae9d3..5c6be593 100644 --- a/Scripts/Room.cs +++ b/Scripts/Room.cs @@ -197,6 +197,7 @@ public void Leave() /// Update the player state locally and on the other peers public void SetPlayerState(PlayerState newState) => Rpc(nameof(SetPlayerStateRpc), newState); + public void SetPlayerColor(Color newColor) => Rpc(nameof(SetPlayerColorRpc), newColor); [Rpc(MultiplayerApi.RpcMode.AnyPeer, CallLocal = true)] private void RegisterPlayerRpc(Variant playerVariant) @@ -246,4 +247,24 @@ private void SetPlayerStateRpc(Variant newStateVariant) playerStateChanged.OnNext(newPlayer); if (playerId == LocalPlayer.Value.PeerId) LocalPlayer.OnNext(newPlayer); } + + /// Set a player color (the color of the caller) + [Rpc(MultiplayerApi.RpcMode.AnyPeer, CallLocal = true)] + private void SetPlayerColorRpc(Color newColor) + { + var playerId = Multiplayer.GetRemoteSenderId(); + var player = Players.GetValueOrDefault(playerId); + if (player is null) + { + log.Warning("[SetPlayerColorRpc]: Player {PlayerId} not found", playerId); + return; + } + + log.Debug("[RPC] Player {PlayerId} changed color: {Color}", playerId, newColor); + + var newPlayer = player.Value with { Color = newColor }; + player.OnNext(newPlayer); + playerStateChanged.OnNext(newPlayer); + if (playerId == LocalPlayer.Value.PeerId) LocalPlayer.OnNext(newPlayer); + } } diff --git a/Scripts/RoomManager.cs b/Scripts/RoomManager.cs index a869e307..bfeda638 100644 --- a/Scripts/RoomManager.cs +++ b/Scripts/RoomManager.cs @@ -31,7 +31,8 @@ public async Task CreateRoom() Multiplayer.MultiplayerPeer = multiplayer; var username = GameManager.Settings.GetUsername() ?? $"Player: {playerId}"; - var player = new Player(playerId, username, new PlayerStateInLobby(false)); + var color = GameManager.Settings.GetColor(); + var player = new Player(playerId, username, color, new PlayerStateInLobby(false)); Room = new Room(roomId, player); AddChild(Room); @@ -66,7 +67,8 @@ public async Task JoinRoom(RoomId roomId) // Create the room management object var username = GameManager.Settings.GetUsername() ?? $"Player: {playerId}"; - var player = new Player(playerId, username, new PlayerStateInLobby(false)); + var color = GameManager.Settings.GetColor(); + var player = new Player(playerId, username, color, new PlayerStateInLobby(false)); Room = new Room(roomId, player); AddChild(Room); diff --git a/Scripts/Supervisors/PropHunt/PropHuntSupervisor.cs b/Scripts/Supervisors/PropHunt/PropHuntSupervisor.cs index 465cbf76..b5fc8ee4 100644 --- a/Scripts/Supervisors/PropHunt/PropHuntSupervisor.cs +++ b/Scripts/Supervisors/PropHunt/PropHuntSupervisor.cs @@ -33,13 +33,13 @@ private Node PlayersNode private Control InGame => nodes.UI.In_game; private Control EndGame => nodes.UI.End_game; - private Label IsPropLabel => nodes.UI.In_game.IsProp; - private Label IsHunterLabel => nodes.UI.In_game.IsHunter; + private MarginContainer IsPropContainer => nodes.UI.In_game.IsProp; + private MarginContainer IsHunterContainer => nodes.UI.In_game.IsHunter; private Label PropsWonLabel => nodes.UI.End_game.LeftPanel.Winner.PropsWin; private Label HunterWinLabel => nodes.UI.End_game.LeftPanel.Winner.HunterWins; private Control TimedOut => nodes.UI.End_game.TimedOut; - private Control HunterList => nodes.UI.End_game.LeftPanel.Hunters.PlayerList; - private Control PropList => nodes.UI.End_game.LeftPanel.Props.PlayerList; + private Control HunterList => nodes.UI.End_game.LeftPanel.Players.Hunters.PlayerList; + private Control PropList => nodes.UI.End_game.LeftPanel.Players.Props.PlayerList; private Spectator Spectator => nodes.Spectator; diff --git a/Scripts/Supervisors/PropHunt/PropHuntSupervisor.everyone.cs b/Scripts/Supervisors/PropHunt/PropHuntSupervisor.everyone.cs index 816522bd..72a43602 100644 --- a/Scripts/Supervisors/PropHunt/PropHuntSupervisor.everyone.cs +++ b/Scripts/Supervisors/PropHunt/PropHuntSupervisor.everyone.cs @@ -17,7 +17,7 @@ public override void _EnterTree() if (hunters.Contains(Multiplayer.GetUniqueId())) { PreGameHunter.CallDeferred(CanvasItem.MethodName.Show); - IsHunterLabel.CallDeferred(CanvasItem.MethodName.Show); + IsHunterContainer.CallDeferred(CanvasItem.MethodName.Show); } else { @@ -25,7 +25,7 @@ public override void _EnterTree() else Input.MouseMode = Input.MouseModeEnum.Captured; PreGameProp.CallDeferred(CanvasItem.MethodName.Show); - IsPropLabel.CallDeferred(CanvasItem.MethodName.Show); + IsPropContainer.CallDeferred(CanvasItem.MethodName.Show); } }; @@ -116,12 +116,9 @@ private void ShowEndGameUi(bool propsWon, bool timedOut) node.SetPlayerName(player.Value.Username); if (body is null) - { log.Error("Failed to find player body: player = {Player}", player.Value); - node.SetStatus("Error"); - } else - node.SetStatus(body.Alive ? "Survived" : "Died"); + node.SetAlive(body.Alive); if (hunterPeerIds.Contains(player.Value.PeerId)) HunterList.AddChild(node); diff --git a/Scripts/Supervisors/PropHunt/TabMenu.cs b/Scripts/Supervisors/PropHunt/TabMenu.cs index 47ec78b5..a69d8d5a 100644 --- a/Scripts/Supervisors/PropHunt/TabMenu.cs +++ b/Scripts/Supervisors/PropHunt/TabMenu.cs @@ -49,12 +49,7 @@ private void AddPlayersToUi(object? _, int[] hunterIds) player.Subscribe(p => { node.SetPlayerName(player.Value.Username); - node.SetStatus(p.State switch - { - PlayerStateInGame(true) => "Alive", - PlayerStateInGame(false) => "Dead", - _ => "Not in game" - }); + node.SetAlive(p.State is PlayerStateInGame(Alive: true)); }, NodeAliveCt ); diff --git a/Scripts/Types/Types.cs b/Scripts/Types/Types.cs index 7039c94b..3fd3f48e 100644 --- a/Scripts/Types/Types.cs +++ b/Scripts/Types/Types.cs @@ -1,14 +1,16 @@ using System.Diagnostics.CodeAnalysis; using MemoryPack; +using Godot; namespace Behide.Types; [MemoryPackable] [method: SetsRequiredMembers] -public partial record Player(int PeerId, string Username, PlayerState State) +public partial record Player(int PeerId, string Username, Color Color, PlayerState State) { public required int PeerId { get; init; } = PeerId; public required string Username { get; init; } = Username; + public required Color Color { get; init; } = Color; public required PlayerState State { get; init; } = State; } diff --git a/project.godot b/project.godot index 96f3bfc1..b29405ca 100644 --- a/project.godot +++ b/project.godot @@ -138,11 +138,18 @@ kick={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":false,"script":null) ] } +toggle_outline={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":false,"script":null) +] +} [layer_names] 3d_render/layer_1="World" 3d_render/layer_2="Props" +3d_render/layer_4="Outlines" 3d_render/layer_5="Light props" 3d_physics/layer_1="World" 3d_physics/layer_2="Players"