Improved Inventory UI (more in the middle, adapt to viewport size, new selector image)

This commit is contained in:
2025-07-05 12:18:28 +02:00
parent ba429d7b84
commit 4a0b2cd550
4 changed files with 59 additions and 54 deletions
+34 -33
View File
@@ -2,12 +2,12 @@
[ext_resource type="Script" uid="uid://hg7jay2kt441" path="res://scripts/CSharp/Common/Inventory/InventoryUi.cs" id="1_6wusm"]
[ext_resource type="Texture2D" uid="uid://3ln8aleyxgp1" path="res://art/ui/UI/UI_bag_export_01.png" id="3_vvo7l"]
[ext_resource type="Texture2D" uid="uid://c7wqla0mbu3np" path="res://art/ui/babushka_ui_tmp_inventory_select.png" id="4_tiss4"]
[ext_resource type="Texture2D" uid="uid://u0dku75l17re" path="res://art/ui/UI/UI_bag_export_highlight_01.png" id="5_df8i8"]
[ext_resource type="PackedScene" uid="uid://c0kmdjeqkqrwv" path="res://prefabs/UI/Inventory/Slot.tscn" id="5_u7kje"]
[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="6_n5apg"]
[ext_resource type="Texture2D" uid="uid://bag1xalfh731d" path="res://art/ui/UI/UI_bag_export_highlight_02.png" id="6_u7kje"]
[ext_resource type="Texture2D" uid="uid://cxptule8n38ph" path="res://art/ui/UI/UI_bag_export_highlight_03.png" id="7_l3npx"]
[ext_resource type="Texture2D" uid="uid://qwia360i1ir1" path="res://art/ui/UI/inventory_active.png" id="8_df8i8"]
[node name="CanvasLayer" type="CanvasLayer"]
layer = 90
@@ -18,7 +18,7 @@ scale = Vector2(0.7, 0.7)
script = ExtResource("6_n5apg")
itemToToggle = NodePath("../Inventory")
[node name="Inventory" type="Control" parent="."]
[node name="Inventory" type="Control" parent="." node_paths=PackedStringArray("_slotsParent", "_slotsMover", "_headerSlots", "_slotSelect")]
layout_mode = 3
anchors_preset = 8
anchor_left = 0.5
@@ -30,7 +30,10 @@ grow_vertical = 2
scale = Vector2(0.7, 0.7)
size_flags_vertical = 8
script = ExtResource("1_6wusm")
_inventoryOpenedOffset = -700.0
_slotsParent = NodePath("SlotsContainer/SlotsMover/Slots")
_slotsMover = NodePath("SlotsContainer/SlotsMover")
_headerSlots = [NodePath("SlotsContainer/SlotsMover/Slots/Slot"), NodePath("SlotsContainer/SlotsMover/Slots/Slot2"), NodePath("SlotsContainer/SlotsMover/Slots/Slot3"), NodePath("SlotsContainer/SlotsMover/Slots/Slot4"), NodePath("SlotsContainer/SlotsMover/Slots/Slot5"), NodePath("SlotsContainer/SlotsMover/Slots/Slot6"), NodePath("SlotsContainer/SlotsMover/Slots/Slot7"), NodePath("SlotsContainer/SlotsMover/Slots/Slot8"), NodePath("SlotsContainer/SlotsMover/Slots/Slot9")]
_slotSelect = NodePath("SlotsContainer/SlotsMover/SlotSelectContainer/Selector")
[node name="SlotsContainer" type="Control" parent="Inventory"]
custom_minimum_size = Vector2(500, 0)
@@ -45,32 +48,6 @@ offset_right = 250.0
grow_horizontal = 2
grow_vertical = 2
[node name="SlotSelectContainer" type="Control" parent="Inventory/SlotsContainer"]
custom_minimum_size = Vector2(900, 100)
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -450.0
offset_top = -115.0
offset_right = 450.0
offset_bottom = -15.0
grow_horizontal = 2
grow_vertical = 0
[node name="Selector" type="TextureRect" parent="Inventory/SlotsContainer/SlotSelectContainer"]
z_index = 10
custom_minimum_size = Vector2(100, 100)
layout_mode = 0
offset_left = -45.7143
offset_top = -49.2857
offset_right = 54.2857
offset_bottom = 50.7143
texture = ExtResource("4_tiss4")
expand_mode = 1
[node name="SlotsMover" type="Control" parent="Inventory/SlotsContainer"]
custom_minimum_size = Vector2(900, 610)
layout_mode = 1
@@ -99,8 +76,8 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 350.0
offset_right = 254.0
offset_left = 437.0
offset_right = 341.0
offset_bottom = 30.0
grow_horizontal = 2
grow_vertical = 2
@@ -113,8 +90,8 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -350.0
offset_right = -446.0
offset_left = -357.0
offset_right = -453.0
offset_bottom = 30.0
grow_horizontal = 2
grow_vertical = 2
@@ -448,3 +425,27 @@ offset_left = 703.0
offset_top = 512.0
offset_right = 803.0
offset_bottom = 612.0
[node name="SlotSelectContainer" type="Control" parent="Inventory/SlotsContainer/SlotsMover"]
custom_minimum_size = Vector2(900, 100)
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -497.0
offset_top = -164.0
offset_right = 403.0
offset_bottom = -64.0
grow_horizontal = 2
grow_vertical = 0
[node name="Selector" type="TextureRect" parent="Inventory/SlotsContainer/SlotsMover/SlotSelectContainer"]
z_index = 10
custom_minimum_size = Vector2(100, 100)
layout_mode = 0
offset_right = 100.0
offset_bottom = 100.0
texture = ExtResource("8_df8i8")
expand_mode = 1