Compare commits

...

4 Commits

Author SHA1 Message Date
kziolkowski 60928c520c Inventory implemented 2025-05-20 18:27:50 +02:00
kziolkowski f3ed5e0ad0 Changes to ItemOnGround 2025-05-20 18:27:40 +02:00
kziolkowski ee897db52b added swaying plants shader 2025-05-20 18:27:20 +02:00
kziolkowski 41201d7406 Indoor room sprites added 2025-05-20 18:27:09 +02:00
37 changed files with 640 additions and 32 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://404glx32r1w8"
path="res://.godot/imported/Room_01_bench.png-328b3f3028551ff0043ac2fb97b022f3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_bench.png"
dest_files=["res://.godot/imported/Room_01_bench.png-328b3f3028551ff0043ac2fb97b022f3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://blg50is4kuh2f"
path="res://.godot/imported/Room_01_chair.png-328452a0d99e488b5786d8b154b52b3a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_chair.png"
dest_files=["res://.godot/imported/Room_01_chair.png-328452a0d99e488b5786d8b154b52b3a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://n4ivgiclkuky"
path="res://.godot/imported/Room_01_chair_01.png-03613fca748ab538fadbb0fb7e655232.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_chair_01.png"
dest_files=["res://.godot/imported/Room_01_chair_01.png-03613fca748ab538fadbb0fb7e655232.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://tyypifpte0pb"
path="res://.godot/imported/Room_01_chugun.png-75f7d81015311859218a8728a2ee7104.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_chugun.png"
dest_files=["res://.godot/imported/Room_01_chugun.png-75f7d81015311859218a8728a2ee7104.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://vyk63d0pgqm5"
path="res://.godot/imported/Room_01_dioor L.png-22c4a879c116d8655624265e2ada0e2f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_dioor L.png"
dest_files=["res://.godot/imported/Room_01_dioor L.png-22c4a879c116d8655624265e2ada0e2f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bqwhptcgg5ons"
path="res://.godot/imported/Room_01_dorr_R.png-f424a690ec85b9441794c737fce17aac.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_dorr_R.png"
dest_files=["res://.godot/imported/Room_01_dorr_R.png-f424a690ec85b9441794c737fce17aac.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b2rj7wkyu6ehy"
path="res://.godot/imported/Room_01_pechka.png-0d09fb1bcae3565b3750d1b80e53d9b0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_pechka.png"
dest_files=["res://.godot/imported/Room_01_pechka.png-0d09fb1bcae3565b3750d1b80e53d9b0.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bpi35nxbhput8"
path="res://.godot/imported/Room_01_pechkaDoor.png-d4fe6861f3e62b3badfcdeaf023100d9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_pechkaDoor.png"
dest_files=["res://.godot/imported/Room_01_pechkaDoor.png-d4fe6861f3e62b3badfcdeaf023100d9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dujucy41nlh4o"
path="res://.godot/imported/Room_01_preview.png-63fb80abdbae2594d004baf9b260ae27.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_preview.png"
dest_files=["res://.godot/imported/Room_01_preview.png-63fb80abdbae2594d004baf9b260ae27.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cop1vjvhwlsec"
path="res://.godot/imported/Room_01_shelf.png-a4062eca05d3a3e4f662c296a58f454e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_shelf.png"
dest_files=["res://.godot/imported/Room_01_shelf.png-a4062eca05d3a3e4f662c296a58f454e.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnhsxxps2cw5"
path="res://.godot/imported/Room_01_table.png-fbaae555b63a5e38a4b2fdb537cc7f6a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_table.png"
dest_files=["res://.godot/imported/Room_01_table.png-fbaae555b63a5e38a4b2fdb537cc7f6a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 852 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://waqmjrxduxfq"
path="res://.godot/imported/Room_01_walls.png-0b88a0e392242bbee1de1c8f54d2638a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_walls.png"
dest_files=["res://.godot/imported/Room_01_walls.png-0b88a0e392242bbee1de1c8f54d2638a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dhvi5404cqioa"
path="res://.godot/imported/Room_01_window.png-e1fa0df237c633ec8bc96ab7003ac8c2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/room export/Room_01_window.png"
dest_files=["res://.godot/imported/Room_01_window.png-e1fa0df237c633ec8bc96ab7003ac8c2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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
+2 -5
View File
@@ -10,21 +10,18 @@
[node name="CanvasLayer" type="CanvasLayer"]
layer = 90
follow_viewport_enabled = true
[node name="Inventory" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 174.0
offset_top = 191.0
offset_right = 174.0
offset_bottom = 191.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(0.7, 0.7)
script = ExtResource("1_6wusm")
_inventoryOpenedOffset = -700.0
metadata/_edit_use_anchors_ = true
[node name="SlotsContainer" type="Control" parent="Inventory"]
custom_minimum_size = Vector2(500, 0)
+43
View File
@@ -0,0 +1,43 @@
// original wind shader from https://github.com/Maujoe/godot-simple-wind-shader-2d/tree/master/assets/maujoe.simple_wind_shader_2d
// original script modified by HungryProton so that the assets are moving differently : https://pastebin.com/VL3AfV8D
//
// speed - The speed of the wind movement.
// minStrength - The minimal strength of the wind movement.
// maxStrength - The maximal strength of the wind movement.
// strengthScale - Scalefactor for the wind strength.
// interval - The time between minimal and maximal strength changes.
// detail - The detail (number of waves) of the wind movement.
// distortion - The strength of geometry distortion.
// heightOffset - The height where the wind begins to move. By default 0.0.
shader_type canvas_item;
render_mode blend_mix;
// Wind settings.
uniform float speed = 1.0;
uniform float minStrength : hint_range(0.0, 1.0) = 0.05;
uniform float maxStrength : hint_range(0.0, 1.0) = 0.01;
uniform float strengthScale = 100.0;
uniform float interval = 3.5;
uniform float detail = 1.0;
uniform float distortion : hint_range(0.0, 1.0);
uniform float heightOffset : hint_range(0.0, 1.0);
// With the offset value, you can if you want different moves for each asset. Just put a random value (1, 2, 3) in the editor. Don't forget to mark the material as unique if you use this
uniform float offset = 0;
float getWind(vec2 vertex, vec2 uv, float time){
float diff = pow(maxStrength - minStrength, 2.0);
float strength = clamp(minStrength + diff + sin(time / interval) * diff, minStrength, maxStrength) * strengthScale;
float wind = (sin(time) + cos(time * detail)) * strength * max(0.0, (1.0-uv.y) - heightOffset);
return wind;
}
void vertex() {
vec4 pos = MODEL_MATRIX * vec4(0.0, 0.0, 0.0, 1.0);
float time = TIME * speed + offset;
//float time = TIME * speed + pos.x * pos.y ; not working when moving...
VERTEX.x += getWind(VERTEX.xy, UV, time);
}
+1
View File
@@ -0,0 +1 @@
uid://braevmqauoek7
+1 -1
View File
@@ -11,7 +11,7 @@ config_version=5
[application]
config/name="Babushka"
run/main_scene="uid://dee2hgv85mdak"
run/main_scene="uid://gigb28qk8t12"
config/features=PackedStringArray("4.4", "C#", "Forward Plus")
config/icon="uid://b2smanpdo1y5e"
+3 -13
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=55 format=3 uid="uid://gigb28qk8t12"]
[gd_scene load_steps=52 format=3 uid="uid://gigb28qk8t12"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/Player2D.tscn" id="1_7wfwe"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
@@ -27,10 +27,7 @@
[ext_resource type="Script" uid="uid://dhxtdhfqx3bte" path="res://scripts/CSharp/Common/Farming/FieldService2D.cs" id="25_0qu0h"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interaction_area_2d.tscn" id="27_klb81"]
[ext_resource type="PackedScene" uid="uid://ce0mc0ddijmyi" path="res://prefabs/interactions/sprite_switcher_2d.tscn" id="28_p6n74"]
[ext_resource type="Script" uid="uid://btusf04xnywhm" path="res://scripts/CSharp/Common/Inventory/ItemOnGround2D.cs" id="29_hukxv"]
[ext_resource type="Texture2D" uid="uid://x8hr8287ff2n" path="res://art/farm/farming/farmobjekte/tools atlas.png" id="29_p6n74"]
[ext_resource type="Script" uid="uid://bdsel2amlbnuq" path="res://scripts/CSharp/Common/Inventory/ItemOnGroundSpawnWith2D.cs" id="30_2nee2"]
[ext_resource type="Resource" uid="uid://c5yg3lx756v4v" path="res://resources/items/hoe.tres" id="31_r0vdg"]
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="32_2nee2"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xy0kg"]
@@ -750,13 +747,6 @@ shape = SubResource("CircleShape2D_kxdmn")
[node name="SpriteSwitcher2d" parent="Hoe Pickup" instance=ExtResource("28_p6n74")]
scale = Vector2(0.5, 0.5)
[node name="ItemOnGround" type="Node" parent="Hoe Pickup"]
script = ExtResource("29_hukxv")
[node name="Node" type="Node" parent="Hoe Pickup/ItemOnGround"]
script = ExtResource("30_2nee2")
_blueprint = ExtResource("31_r0vdg")
[node name="Watercan Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
position = Vector2(8400, 2024)
_sprites = NodePath("ActiveInactive")
@@ -782,7 +772,7 @@ texture = ExtResource("29_p6n74")
region_rect = Rect2(1, 1138, 418, 288)
[node name="CanvasLayer" parent="." instance=ExtResource("32_2nee2")]
visible = false
follow_viewport_enabled = false
[node name="Inventory" parent="CanvasLayer" index="0"]
anchors_preset = 7
@@ -795,13 +785,13 @@ offset_right = 172.8
grow_vertical = 0
size_flags_horizontal = 4
size_flags_vertical = 8
_inventoryOpenedOffset = -600.0
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Hoe Pickup" method="SetSpriteActiveState"]
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Watercan Pickup" method="SetSpriteActiveState"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Player2d" method="TryFillWateringCan"]
[connection signal="mouse_entered" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseEnteredAllowedArea"]
[connection signal="mouse_exited" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
[connection signal="Interacted" from="Hoe Pickup" to="Hoe Pickup/ItemOnGround" method="TryPickUp"]
[connection signal="InteractedTool" from="Hoe Pickup" to="YSorted/Player2d" method="ActivateTool"]
[connection signal="InteractedTool" from="Watercan Pickup" to="YSorted/Player2d" method="ActivateTool"]
+78 -10
View File
@@ -1,27 +1,95 @@
[gd_scene load_steps=4 format=3 uid="uid://bm21nqepnwaik"]
[gd_scene load_steps=13 format=3 uid="uid://bm21nqepnwaik"]
[ext_resource type="Texture2D" uid="uid://c02unlmw2y6vv" path="res://art/indoor/misfortune_perspective_test.png" id="1_wvosl"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/Player2D.tscn" id="2_a2ood"]
[ext_resource type="Texture2D" uid="uid://waqmjrxduxfq" path="res://art/indoor/room export/Room_01_walls.png" id="3_a2ood"]
[ext_resource type="Texture2D" uid="uid://cnhsxxps2cw5" path="res://art/indoor/room export/Room_01_table.png" id="3_je1cl"]
[ext_resource type="Texture2D" uid="uid://blg50is4kuh2f" path="res://art/indoor/room export/Room_01_chair.png" id="4_hjjhl"]
[ext_resource type="Texture2D" uid="uid://bqwhptcgg5ons" path="res://art/indoor/room export/Room_01_dorr_R.png" id="5_8o6or"]
[ext_resource type="Texture2D" uid="uid://dhvi5404cqioa" path="res://art/indoor/room export/Room_01_window.png" id="6_j5d18"]
[ext_resource type="Texture2D" uid="uid://404glx32r1w8" path="res://art/indoor/room export/Room_01_bench.png" id="7_ciwvv"]
[ext_resource type="Texture2D" uid="uid://vyk63d0pgqm5" path="res://art/indoor/room export/Room_01_dioor L.png" id="8_wuntg"]
[ext_resource type="Texture2D" uid="uid://b2rj7wkyu6ehy" path="res://art/indoor/room export/Room_01_pechka.png" id="9_aivb2"]
[ext_resource type="Texture2D" uid="uid://bpi35nxbhput8" path="res://art/indoor/room export/Room_01_pechkaDoor.png" id="10_835kg"]
[ext_resource type="Texture2D" uid="uid://tyypifpte0pb" path="res://art/indoor/room export/Room_01_chugun.png" id="11_atjbs"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_a2ood"]
size = Vector2(1241.67, 409.333)
resource_local_to_scene = true
size = Vector2(7680, 1336)
[node name="IndoorTest" type="Node2D"]
y_sort_enabled = true
[node name="background" type="Sprite2D" parent="."]
scale = Vector2(3, 3)
texture = ExtResource("1_wvosl")
texture = ExtResource("3_a2ood")
flip_h = true
region_rect = Rect2(111, 292, 3323, 2160)
[node name="StaticBody2D" type="StaticBody2D" parent="background"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="background/StaticBody2D"]
position = Vector2(2.5, -129.667)
position = Vector2(-1912, -396)
shape = SubResource("RectangleShape2D_a2ood")
[node name="Player2d" parent="." instance=ExtResource("2_a2ood")]
position = Vector2(-3, 509)
position = Vector2(-3312, 112)
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2(100, 0)
zoom = Vector2(0.325, 0.325)
[node name="Room01Walls2" type="Sprite2D" parent="."]
position = Vector2(-3840, 0)
texture = ExtResource("3_a2ood")
[node name="Room01Table" type="Sprite2D" parent="."]
y_sort_enabled = true
position = Vector2(-2056, 888)
texture = ExtResource("3_je1cl")
offset = Vector2(192, -848)
[node name="Room01Chair" type="Sprite2D" parent="."]
position = Vector2(-2792, 1096)
texture = ExtResource("4_hjjhl")
offset = Vector2(216, -1064)
[node name="Room01Chair2" type="Sprite2D" parent="."]
position = Vector2(-1304, 1080)
texture = ExtResource("4_hjjhl")
offset = Vector2(184, -1056)
[node name="Room01DorrR" type="Sprite2D" parent="."]
position = Vector2(-216, 8)
texture = ExtResource("5_8o6or")
[node name="Room01Window4" type="Sprite2D" parent="."]
position = Vector2(-352, 8)
texture = ExtResource("6_j5d18")
[node name="Room01Bench" type="Sprite2D" parent="."]
position = Vector2(-3280, 24)
texture = ExtResource("7_ciwvv")
[node name="Room01DioorL" type="Sprite2D" parent="."]
position = Vector2(-3400, 8)
texture = ExtResource("8_wuntg")
[node name="Room01Pechka" type="Sprite2D" parent="."]
position = Vector2(-752, 0)
texture = ExtResource("9_aivb2")
[node name="Room01PechkaDoor" type="Sprite2D" parent="."]
position = Vector2(-704, 0)
texture = ExtResource("10_835kg")
[node name="Room01Chugun" type="Sprite2D" parent="."]
position = Vector2(-736, 8)
texture = ExtResource("11_atjbs")
[node name="Room01Window2" type="Sprite2D" parent="."]
position = Vector2(-2952, 16)
texture = ExtResource("6_j5d18")
[node name="Room01Window3" type="Sprite2D" parent="."]
position = Vector2(-1720, 16)
texture = ExtResource("6_j5d18")
[node name="Room01Bench2" type="Sprite2D" parent="."]
position = Vector2(-1160, 40)
texture = ExtResource("7_ciwvv")
flip_h = true
@@ -82,7 +82,6 @@ public partial class InventoryUi : Control
var slotInstance = _slots.GetChild<SlotUi>(index);
slotInstance.index = index;
slotInstance.Clicked += SlotClicked;
_slots.AddChild(slotInstance);
}
}
@@ -147,7 +146,7 @@ public partial class InventoryUi : Control
_inventoryExtended = !_inventoryExtended;
if (_inventoryExtended)
{
//GD.Print("Open inventory");
GD.Print("Open inventory");
_inventoryExtensionTween = GetTree().CreateTween();
_slotSelect.Hide();
_inventoryExtensionTween
@@ -157,7 +156,7 @@ public partial class InventoryUi : Control
}
else
{
//GD.Print("Close inventory");
GD.Print("Close inventory");
_inventoryExtensionTween = GetTree().CreateTween();
_slotSelect.Show();
_inventoryExtensionTween
@@ -0,0 +1,50 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Inventory;
public partial class ItemOnGround2D : Node
{
private ItemInstance _itemInstance;
[Export]
private bool _infiniteSupply = false;
private Label _itemLabel => GetNode<Label>("ItemLabel");
private Label _pickupErrorLabel => GetNode<Label>("PickupErrorLabel");
public ItemInstance itemInstance
{
get => _itemInstance;
set
{
_itemInstance = value;
UpdateVisuals();
}
}
public void TryPickUp()
{
GD.Print("Trying to pick up item");
var result = InventoryManager.Instance.CollectItem(itemInstance.Clone());
if (result == InventoryActionResult.Success)
{
if (!_infiniteSupply)
{
QueueFree();
}
}
else
{
_pickupErrorLabel.Text = "Inventory Full";
var tween = GetTree().CreateTween();
tween.TweenInterval(2);
tween.TweenCallback(Callable.From(() => _pickupErrorLabel.Text = ""));
}
}
public void UpdateVisuals()
{
_itemLabel.Text = itemInstance.blueprint?.name ?? "Error Item";
}
}
@@ -0,0 +1 @@
uid://btusf04xnywhm
@@ -0,0 +1,16 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Inventory;
public partial class ItemOnGroundSpawnWith2D : Node
{
[Export] private ItemResource? _blueprint = null;
public override void _EnterTree()
{
if(_blueprint == null) return;
var parent = GetParent<ItemOnGround2D>();
parent.itemInstance = new ItemInstance { blueprint = _blueprint };
}
}
@@ -0,0 +1 @@
uid://bdsel2amlbnuq