cleaned Inventory ui
This commit is contained in:
@@ -7,3 +7,6 @@
|
||||
**/*.tmp
|
||||
**/*.translation
|
||||
**/*~lock~
|
||||
|
||||
# override config can be used by developers to override the settings without pushing changes to the repository
|
||||
override.cfg
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
[ext_resource type="Resource" uid="uid://datee0flk1e84" path="res://resources/items/pickaxe.tres" id="4_5fdxq"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7wqla0mbu3np" path="res://art/ui/babushka_ui_tmp_inventory_select.png" id="4_tiss4"]
|
||||
|
||||
[node name="Inventory" type="Control"]
|
||||
[node name="CanvasLayer" type="CanvasLayer"]
|
||||
layer = 90
|
||||
|
||||
[node name="Inventory" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -13,8 +16,9 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_6wusm")
|
||||
_inventoryOpenedOffset = -300.0
|
||||
|
||||
[node name="SlotsContainer" type="Control" parent="."]
|
||||
[node name="SlotsContainer" type="Control" parent="Inventory"]
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = 13
|
||||
@@ -24,22 +28,7 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Slots" type="GridContainer" parent="SlotsContainer"]
|
||||
custom_minimum_size = Vector2(1000, 200)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_bottom = 200.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme_override_constants/h_separation = 0
|
||||
theme_override_constants/v_separation = 0
|
||||
columns = 10
|
||||
|
||||
[node name="SlotSelectContainer" type="Control" parent="SlotsContainer"]
|
||||
[node name="SlotSelectContainer" type="Control" parent="Inventory/SlotsContainer"]
|
||||
custom_minimum_size = Vector2(1000, 100)
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
@@ -50,7 +39,7 @@ anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="Selector" type="TextureRect" parent="SlotsContainer/SlotSelectContainer"]
|
||||
[node name="Selector" type="TextureRect" parent="Inventory/SlotsContainer/SlotSelectContainer"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 0
|
||||
offset_left = 1.0
|
||||
@@ -59,10 +48,32 @@ offset_bottom = 100.0
|
||||
texture = ExtResource("4_tiss4")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="InventoryTester" type="Node" parent="."]
|
||||
[node name="SlotsMover" type="Control" parent="Inventory/SlotsContainer"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Slots" type="GridContainer" parent="Inventory/SlotsContainer/SlotsMover"]
|
||||
custom_minimum_size = Vector2(1000, 300)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -500.0
|
||||
offset_top = -100.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 200.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme_override_constants/h_separation = 0
|
||||
theme_override_constants/v_separation = 0
|
||||
columns = 10
|
||||
|
||||
[node name="InventoryTester" type="Node" parent="Inventory"]
|
||||
script = ExtResource("3_exrk4")
|
||||
_testItemToCreate = ExtResource("4_5fdxq")
|
||||
|
||||
[node name="BabushkaUiTmpInventorySelect" type="Sprite2D" parent="."]
|
||||
position = Vector2(-648, 1020)
|
||||
texture = ExtResource("4_tiss4")
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="Babushka"
|
||||
run/main_scene="uid://gigb28qk8t12"
|
||||
run/main_scene="uid://dee2hgv85mdak"
|
||||
config/features=PackedStringArray("4.4", "C#", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
||||
@@ -6,4 +6,5 @@
|
||||
script = ExtResource("1_07aya")
|
||||
name = "Pick Axe"
|
||||
color = Color(0.589014, 0.823353, 0.998475, 1)
|
||||
maxStack = 1
|
||||
metadata/_custom_type_script = "uid://cbskymrxs6ksu"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=51 format=3 uid="uid://gigb28qk8t12"]
|
||||
[gd_scene load_steps=52 format=3 uid="uid://gigb28qk8t12"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/Player2D.tscn" id="1_7wfwe"]
|
||||
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
|
||||
@@ -26,9 +26,10 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dg7rlugnq0t45" path="res://art/farm/farming/farmobjekte/brünnen.png" id="21_ualyd"]
|
||||
[ext_resource type="Script" uid="uid://dhxtdhfqx3bte" path="res://scripts/CSharp/Common/Farming/FieldService2D.cs" id="25_0qu0h"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1d2e7ely6hyw" path="res://prefabs/farm/base_field_2d.tscn" id="26_vbdb2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interaction_area_2d.tscn" id="27_klb81"]
|
||||
[ext_resource type="PackedScene" uid="uid://ce0mc0ddijmyi" path="res://prefabs/interactions/sprite_switcher_2d.tscn" id="28_p6n74"]
|
||||
[ext_resource type="PackedScene" uid="uid://bo6pgwyep3glx" path="res://prefabs/interaction_area_2d.tscn" id="27_klb81"]
|
||||
[ext_resource type="PackedScene" path="res://prefabs/interactions/sprite_switcher_2d.tscn" id="28_p6n74"]
|
||||
[ext_resource type="Texture2D" uid="uid://x8hr8287ff2n" path="res://art/farm/farming/farmobjekte/tools atlas.png" id="29_p6n74"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="30_kxdmn"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xy0kg"]
|
||||
shader = ExtResource("13_7p0hq")
|
||||
@@ -779,6 +780,8 @@ region_rect = Rect2(-2, 1135, 421, 292)
|
||||
texture = ExtResource("29_p6n74")
|
||||
region_rect = Rect2(1, 1138, 418, 288)
|
||||
|
||||
[node name="Inventory" parent="." instance=ExtResource("30_kxdmn")]
|
||||
|
||||
[connection signal="mouse_entered" from="Farm visuals/FieldParent/Area2D" to="Farm visuals/FieldParent" method="MouseEnteredAllowedArea"]
|
||||
[connection signal="mouse_exited" from="Farm visuals/FieldParent/Area2D" to="Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
|
||||
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Hoe Pickup" method="SetSpriteActiveState"]
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Babushka.scripts.CSharp.Common.Inventory;
|
||||
public partial class InventoryUi : Control
|
||||
{
|
||||
private GridContainer _slots;
|
||||
private Control _slotsMover;
|
||||
private InventoryInstance _playerInventory;
|
||||
private Control _slotSelect;
|
||||
|
||||
@@ -16,10 +17,17 @@ public partial class InventoryUi : Control
|
||||
private bool _inventoryExtended = false;
|
||||
private Tween? _inventoryExtensionTween;
|
||||
|
||||
[Export]
|
||||
private float _inventoryClosedOffset = 0f;
|
||||
|
||||
[Export]
|
||||
private float _inventoryOpenedOffset = 200f;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
GD.Print("Ready inventory ui");
|
||||
_slots = GetNode<GridContainer>("SlotsContainer/Slots");
|
||||
_slots = GetNode<GridContainer>("SlotsContainer/SlotsMover/Slots");
|
||||
_slotsMover = GetNode<Control>("SlotsContainer/SlotsMover");
|
||||
_playerInventory = InventoryManager.Instance.playerInventory;
|
||||
_slotSelect = GetNode<Control>("SlotsContainer/SlotSelectContainer/Selector");
|
||||
PopulateSlots();
|
||||
@@ -134,7 +142,7 @@ public partial class InventoryUi : Control
|
||||
_inventoryExtensionTween = GetTree().CreateTween();
|
||||
_slotSelect.Hide();
|
||||
_inventoryExtensionTween
|
||||
.TweenProperty(_slots, "offset_bottom", -100, 0.4)
|
||||
.TweenProperty(_slotsMover, "offset_bottom", _inventoryOpenedOffset, 0.4)
|
||||
.SetTrans(Tween.TransitionType.Quad)
|
||||
.SetEase(Tween.EaseType.Out);
|
||||
}
|
||||
@@ -144,7 +152,7 @@ public partial class InventoryUi : Control
|
||||
_inventoryExtensionTween = GetTree().CreateTween();
|
||||
_slotSelect.Show();
|
||||
_inventoryExtensionTween
|
||||
.TweenProperty(_slots, "offset_bottom", 200, 0.4)
|
||||
.TweenProperty(_slotsMover, "offset_bottom", _inventoryClosedOffset, 0.4)
|
||||
.SetTrans(Tween.TransitionType.Quad)
|
||||
.SetEase(Tween.EaseType.Out);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user