very simple prototype
This commit is contained in:
parent
aee93b8d10
commit
76c957236b
11 changed files with 261 additions and 190 deletions
313
test.tscn
313
test.tscn
|
|
@ -1,26 +1,45 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://dsfal3m4siap2"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dsfal3m4siap2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="1_6uqi0"]
|
||||
[ext_resource type="Script" uid="uid://cpd04flfh5nlc" path="res://inv_system/item_slot.gd" id="1_8uh7m"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7jp850fqpa0j" path="res://icon.svg" id="1_37kl0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dj487wauiay6i" path="res://assets/ewase bins.png" id="1_g14j6"]
|
||||
[ext_resource type="Script" uid="uid://dal8g1ce37r3w" path="res://demo_scene.gd" id="1_vbegm"]
|
||||
[ext_resource type="Script" uid="uid://dccraom7a7e8d" path="res://inv_system/item_data.gd" id="2_ehkex"]
|
||||
[ext_resource type="Resource" uid="uid://bepkdyf7dn1y0" path="res://items/hdd_item.tres" id="3_ykrsh"]
|
||||
[ext_resource type="Resource" uid="uid://c2wbqelme8vy1" path="res://items/ram_item.tres" id="5_g14j6"]
|
||||
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="7_xersf"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
[node name="Control" type="Control" node_paths=PackedStringArray("bin_inventory", "loot_button")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_vbegm")
|
||||
bin_inventory = NodePath("BinPanel")
|
||||
loot_button = NodePath("LootButton")
|
||||
loot_pool = Array[ExtResource("2_ehkex")]([ExtResource("3_ykrsh"), ExtResource("5_g14j6")])
|
||||
|
||||
[node name="InventoryPanel" type="PanelContainer" parent="."]
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_g14j6")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="InventoryPanel" type="PanelContainer" parent="." node_paths=PackedStringArray("grid", "inv_label")]
|
||||
layout_mode = 0
|
||||
offset_left = 51.0
|
||||
offset_top = 67.0
|
||||
offset_right = 403.0
|
||||
offset_bottom = 549.0
|
||||
script = ExtResource("1_6uqi0")
|
||||
inventory_name = "Your Items"
|
||||
grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/GridContainer")
|
||||
inv_label = NodePath("MarginContainer/VBoxContainer/Label")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="InventoryPanel"]
|
||||
layout_mode = 2
|
||||
|
|
@ -45,215 +64,129 @@ layout_mode = 2
|
|||
size_flags_vertical = 3
|
||||
columns = 5
|
||||
|
||||
[node name="ItemSlot" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
item = ExtResource("3_ykrsh")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_37kl0")
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot11" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot2" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
item = ExtResource("5_g14j6")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot11"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_37kl0")
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot2" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot3" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot2"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot3" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot4" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot3"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot4" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot5" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot4"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot5" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot6" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot5"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot6" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot7" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot6"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot7" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot8" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot7"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot8" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot9" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot8"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
|
||||
[node name="ItemSlot9" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="ItemSlot10" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot9"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
[node name="BinPanel" type="PanelContainer" parent="." node_paths=PackedStringArray("grid", "inv_label")]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_left = 714.0
|
||||
offset_top = 386.0
|
||||
offset_right = 1066.0
|
||||
offset_bottom = 563.0
|
||||
script = ExtResource("1_6uqi0")
|
||||
inventory_name = "E-waste Recycling Bin"
|
||||
grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/GridContainer")
|
||||
inv_label = NodePath("MarginContainer/VBoxContainer/Label")
|
||||
|
||||
[node name="ItemSlot10" type="Panel" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" node_paths=PackedStringArray("icon")]
|
||||
custom_minimum_size = Vector2(64, 64)
|
||||
[node name="MarginContainer" type="MarginContainer" parent="BinPanel"]
|
||||
layout_mode = 2
|
||||
script = ExtResource("1_8uh7m")
|
||||
icon = NodePath("Icon")
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer/ItemSlot10"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="BinPanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="BinPanel/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Inventory 1"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="BinPanel/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
columns = 5
|
||||
|
||||
[node name="ItemSlot12" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot13" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot14" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot15" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot16" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot17" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot18" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot19" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot20" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot21" parent="BinPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="LootButton" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.1
|
||||
anchor_top = 0.1
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.9
|
||||
offset_right = 6.4000015
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -74.0
|
||||
offset_top = -15.5
|
||||
offset_right = 74.0
|
||||
offset_bottom = 15.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
expand_mode = 3
|
||||
stretch_mode = 4
|
||||
text = "Loot E-waste bins!"
|
||||
|
||||
[node name="ReturnButton" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -81.0
|
||||
offset_top = -31.0
|
||||
offset_right = 81.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "Return to workshop"
|
||||
|
||||
[connection signal="pressed" from="LootButton" to="." method="_on_loot_button_pressed"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue