feat: implement InventoryBackpack FSM and InventoryOverlay

- InventoryBackpack: Control-based FSM with IDLE/OPEN/SELECTED/ACQUIRE/REMOVE
  states, Tween-based animations, guard condition checks, signal connections
  to InventoryManager for item_acquired/item_removed reactions
- InventoryOverlay: Full-screen overlay with fade-in/out, item grid via
  GridContainer, drag-and-drop item selection, combination via drag-to-slot,
  hover labels, right-click inspect
- InventorySlot: Individual slot with colored box placeholder, hover highlight,
  click/right-click/hover signals
This commit is contained in:
2026-04-26 21:09:50 -07:00
parent dee6216873
commit afcf92dbfd
12 changed files with 629 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
[gd_scene format=3 uid="uid://1p46uzngsih9o"]
[ext_resource type="Script" uid="uid://3mkdj9s1oe1jz" path="res://inventory/inventory_overlay/InventoryOverlay.gd" id="1"]
[sub_resource type="LabelSettings" id="LabelSettings_inv"]
font_size = 20
outline_size = 3
outline_color = Color(0, 0, 0, 1)
[node name="InventoryOverlay" type="Control" unique_id=3000000001]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource("1")
[node name="Background" type="ColorRect" parent="." unique_id=3000000002]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
color = Color(0, 0, 0, 0.7)
[node name="InventoryPanel" type="Control" parent="." unique_id=3000000003]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -350.0
offset_top = -150.0
offset_right = 350.0
offset_bottom = 150.0
grow_horizontal = 2
grow_vertical = 2
[node name="Frame" type="ColorRect" parent="InventoryPanel" unique_id=3000000004]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
color = Color(0.15, 0.15, 0.2, 1)
[node name="ItemGrid" type="GridContainer" parent="InventoryPanel" unique_id=3000000005]
layout_mode = 1
anchors_preset = 0
offset_left = 10.0
offset_top = 10.0
offset_right = -10.0
offset_bottom = -50.0
[node name="HoverLabel" type="Label" parent="InventoryPanel" unique_id=3000000006]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = -10.0
grow_horizontal = 2
horizontal_alignment = 1
label_settings = SubResource("LabelSettings_inv")