feat: add example splash item for inventory testing
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
5
inventory/items/splash_item.tres
Normal file
5
inventory/items/splash_item.tres
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"item_id": "splash",
|
||||
"name": "Splash",
|
||||
"combination_category": "potion"
|
||||
}
|
||||
@@ -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_definition(def)
|
||||
give_item("splash")
|
||||
|
||||
|
||||
func _on_meadow_interacted() -> void:
|
||||
$kq4_002_meadow.default_script(self)
|
||||
|
||||
|
||||
BIN
splash.png
LFS
Normal file
BIN
splash.png
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user