From a54fe6652f15ff66384c794bcb4721842048f57f Mon Sep 17 00:00:00 2001 From: Bryce Date: Sun, 26 Apr 2026 22:17:37 -0700 Subject: [PATCH] feat: add example splash item for inventory testing --- Game.tscn | 8 +++- .../inventory_backpack/InventoryBackpack.gd | 10 ++--- inventory/items/splash_item.tres | 5 +++ .../kq4_003_fountain_pool.gd | 10 +++++ splash.png | 3 ++ splash.png.import | 40 +++++++++++++++++++ 6 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 inventory/items/splash_item.tres create mode 100644 splash.png create mode 100644 splash.png.import diff --git a/Game.tscn b/Game.tscn index b232f3c..06b5bc1 100644 --- a/Game.tscn +++ b/Game.tscn @@ -190,11 +190,17 @@ autowrap_mode = 3 layer = 5 [node name="InventoryBackpack" parent="HUD" unique_id=-294967294 instance=ExtResource("9_backpack")] +anchors_preset = 0 +anchor_top = 0.0 +anchor_bottom = 0.0 +offset_top = 0.0 +offset_bottom = 70.0 +grow_vertical = 1 [node name="InventoryOverlayLayer" type="CanvasLayer" parent="." unique_id=-294967293] layer = 10 [node name="InventoryOverlay" parent="InventoryOverlayLayer" unique_id=-294967292 instance=ExtResource("a_overlay")] -[connection signal="overlay_show_requested" from="HUD/InventoryBackpack" to="." method="_on_backpack_show_overlay"] [connection signal="overlay_hide_requested" from="HUD/InventoryBackpack" to="." method="_on_backpack_hide_overlay"] +[connection signal="overlay_show_requested" from="HUD/InventoryBackpack" to="." method="_on_backpack_show_overlay"] diff --git a/inventory/inventory_backpack/InventoryBackpack.gd b/inventory/inventory_backpack/InventoryBackpack.gd index b54fdd8..8f091d9 100644 --- a/inventory/inventory_backpack/InventoryBackpack.gd +++ b/inventory/inventory_backpack/InventoryBackpack.gd @@ -9,11 +9,11 @@ signal skip_action_requested enum State { IDLE, OPEN, SELECTED, ACQUIRE, REMOVE } - var _state: State = State.IDLE - var _animating: bool = false - var _active_tween: Tween = null - var _floating_item_color: Color = Color(1, 1, 1, 0) - var _home_position: Vector2 = Vector2(0, 0) +var _state: State = State.IDLE +var _animating: bool = false +var _active_tween: Tween = null +var _floating_item_color: Color = Color(1, 1, 1, 0) +var _home_position: Vector2 = Vector2(0, 0) @onready var backpack_icon: ColorRect = $BackpackIcon @onready var floating_item: ColorRect = $FloatingItem diff --git a/inventory/items/splash_item.tres b/inventory/items/splash_item.tres new file mode 100644 index 0000000..76439f5 --- /dev/null +++ b/inventory/items/splash_item.tres @@ -0,0 +1,5 @@ +{ + "item_id": "splash", + "name": "Splash", + "combination_category": "potion" +} diff --git a/scenes/kq4_003_fountain_pool/kq4_003_fountain_pool.gd b/scenes/kq4_003_fountain_pool/kq4_003_fountain_pool.gd index 670b8af..04934c0 100644 --- a/scenes/kq4_003_fountain_pool/kq4_003_fountain_pool.gd +++ b/scenes/kq4_003_fountain_pool/kq4_003_fountain_pool.gd @@ -1,6 +1,16 @@ extends Scene +func _ready() -> void: + super._ready() + var def = ItemDefinition.new() + def.id = "splash" + def.name = "Splash" + def.combination_category = "potion" + InventoryManager.register_item(def) + give_item("splash") + + func _on_meadow_interacted() -> void: $kq4_002_meadow.default_script(self) diff --git a/splash.png b/splash.png new file mode 100644 index 0000000..0a7c5e0 --- /dev/null +++ b/splash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1f66a4950146f2127b1e1c306a7034a155f64cbdc77bddc1810928e4d9de164 +size 208 diff --git a/splash.png.import b/splash.png.import new file mode 100644 index 0000000..21cb73e --- /dev/null +++ b/splash.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cxu3klicoldpv" +path="res://.godot/imported/splash.png-929ed8a00b89ba36c51789452f874c77.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://splash.png" +dest_files=["res://.godot/imported/splash.png-929ed8a00b89ba36c51789452f874c77.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