From ba429d7b84f8fa5b5b0026a54f58e24630c6dd82 Mon Sep 17 00:00:00 2001 From: kziolkowski Date: Fri, 4 Jul 2025 23:41:15 +0200 Subject: [PATCH] wip improving inventory layout --- prefabs/UI/Inventory/Inventory.tscn | 83 +++++++++++++++------- scenes/Babushka_scene_farm_outside_2d.tscn | 15 ++-- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/prefabs/UI/Inventory/Inventory.tscn b/prefabs/UI/Inventory/Inventory.tscn index d644804..26ff779 100644 --- a/prefabs/UI/Inventory/Inventory.tscn +++ b/prefabs/UI/Inventory/Inventory.tscn @@ -20,22 +20,28 @@ itemToToggle = NodePath("../Inventory") [node name="Inventory" type="Control" parent="."] layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 grow_horizontal = 2 grow_vertical = 2 scale = Vector2(0.7, 0.7) +size_flags_vertical = 8 script = ExtResource("1_6wusm") -metadata/_edit_use_anchors_ = true +_inventoryOpenedOffset = -700.0 [node name="SlotsContainer" type="Control" parent="Inventory"] custom_minimum_size = Vector2(500, 0) layout_mode = 1 -anchors_preset = 13 +anchors_preset = 8 anchor_left = 0.5 +anchor_top = 0.5 anchor_right = 0.5 -anchor_bottom = 1.0 +anchor_bottom = 0.5 +offset_left = -250.0 +offset_right = 250.0 grow_horizontal = 2 grow_vertical = 2 @@ -58,9 +64,10 @@ grow_vertical = 0 z_index = 10 custom_minimum_size = Vector2(100, 100) layout_mode = 0 -offset_left = 1.0 -offset_right = 101.0 -offset_bottom = 100.0 +offset_left = -45.7143 +offset_top = -49.2857 +offset_right = 54.2857 +offset_bottom = 50.7143 texture = ExtResource("4_tiss4") expand_mode = 1 @@ -176,53 +183,75 @@ layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = 496.0 -offset_bottom = 496.0 +offset_left = -48.5714 +offset_top = 501.0 +offset_right = -48.5714 +offset_bottom = 501.0 grow_horizontal = 2 grow_vertical = 2 [node name="Slot" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 +offset_left = 2.85714 +offset_top = -54.2857 +offset_right = 102.857 +offset_bottom = 45.7143 [node name="Slot2" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 100.0 -offset_right = 200.0 +offset_left = 102.857 +offset_top = -54.2857 +offset_right = 202.857 +offset_bottom = 45.7143 [node name="Slot3" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 201.0 -offset_right = 301.0 +offset_left = 203.857 +offset_top = -54.2857 +offset_right = 303.857 +offset_bottom = 45.7143 [node name="Slot4" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 301.0 -offset_right = 401.0 +offset_left = 303.857 +offset_top = -54.2857 +offset_right = 403.857 +offset_bottom = 45.7143 [node name="Slot5" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 401.0 -offset_right = 501.0 +offset_left = 403.857 +offset_top = -54.2857 +offset_right = 503.857 +offset_bottom = 45.7143 [node name="Slot6" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 501.0 -offset_right = 601.0 +offset_left = 503.857 +offset_top = -54.2857 +offset_right = 603.857 +offset_bottom = 45.7143 [node name="Slot7" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 601.0 -offset_right = 701.0 +offset_left = 603.857 +offset_top = -54.2857 +offset_right = 703.857 +offset_bottom = 45.7143 [node name="Slot8" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 702.0 -offset_right = 802.0 +offset_left = 704.857 +offset_top = -54.2857 +offset_right = 804.857 +offset_bottom = 45.7143 [node name="Slot9" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 -offset_left = 802.0 -offset_right = 902.0 +offset_left = 804.857 +offset_top = -54.2857 +offset_right = 904.857 +offset_bottom = 45.7143 [node name="Slot10" parent="Inventory/SlotsContainer/SlotsMover/Slots" instance=ExtResource("5_u7kje")] layout_mode = 1 diff --git a/scenes/Babushka_scene_farm_outside_2d.tscn b/scenes/Babushka_scene_farm_outside_2d.tscn index e7ea1ca..beb84ec 100644 --- a/scenes/Babushka_scene_farm_outside_2d.tscn +++ b/scenes/Babushka_scene_farm_outside_2d.tscn @@ -989,16 +989,15 @@ follow_viewport_enabled = false [node name="Inventory" parent="CanvasLayer" index="1"] anchors_preset = 7 -anchor_left = 0.5 anchor_top = 1.0 -anchor_right = 0.5 -offset_left = -172.8 -offset_top = -194.4 -offset_right = 172.8 +anchor_bottom = 1.0 +offset_left = -126.0 +offset_top = -48.0 +offset_right = 221.82 +offset_bottom = 146.4 grow_vertical = 0 -size_flags_horizontal = 4 -size_flags_vertical = 8 -_inventoryOpenedOffset = -600.0 +size_flags_horizontal = 6 +size_flags_vertical = 10 [node name="Audio" type="Node" parent="."]