From e9daf1a8a9b73e2e61f61db5ac5b0e938f5a10f1 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 11 Feb 2024 14:46:58 +0100 Subject: [PATCH] Added item resources --- client/item/Item.gd | 5 ++ client/item/soul/Soul.tscn | 48 +++++++++++++++++++ client/item/soul/soul.tres | 9 ++++ client/ui/UI.tscn | 11 ++++- client/ui/inventory/Inventory.tscn | 65 ++++++++++++++++++++++++++ client/ui/inventory/InventorySlot.tscn | 9 ++++ 6 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 client/item/Item.gd create mode 100644 client/item/soul/Soul.tscn create mode 100644 client/item/soul/soul.tres create mode 100644 client/ui/inventory/Inventory.tscn create mode 100644 client/ui/inventory/InventorySlot.tscn diff --git a/client/item/Item.gd b/client/item/Item.gd new file mode 100644 index 0000000..a487865 --- /dev/null +++ b/client/item/Item.gd @@ -0,0 +1,5 @@ +class_name Item +extends Resource + +@export var name: String +@export var scene: PackedScene \ No newline at end of file diff --git a/client/item/soul/Soul.tscn b/client/item/soul/Soul.tscn new file mode 100644 index 0000000..422ffdd --- /dev/null +++ b/client/item/soul/Soul.tscn @@ -0,0 +1,48 @@ +[gd_scene load_steps=7 format=3 uid="uid://dl4vcp04t8iyr"] + +[ext_resource type="Texture2D" uid="uid://c3wx3cgn8x62m" path="res://assets/particles/particles-single.png" id="1_hhudy"] + +[sub_resource type="Curve" id="Curve_dga57"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -1.66657, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_mxji2"] +curve = SubResource("Curve_dga57") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_uyeuh"] +emission_shape = 1 +emission_sphere_radius = 0.25 +gravity = Vector3(0, 0, 0) +radial_accel_min = -0.5 +radial_accel_max = -0.25 +tangential_accel_min = 0.25 +tangential_accel_max = 0.5 +scale_min = 0.1 +scale_max = 0.2 +color = Color(1, 0.713726, 0.862745, 1) +alpha_curve = SubResource("CurveTexture_mxji2") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gl2xl"] +transparency = 1 +blend_mode = 1 +cull_mode = 2 +shading_mode = 0 +specular_mode = 2 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("1_hhudy") +disable_receive_shadows = true + +[sub_resource type="QuadMesh" id="QuadMesh_6nr8a"] +material = SubResource("StandardMaterial3D_gl2xl") +size = Vector2(0.1, 0.1) + +[node name="Soul" type="Node3D"] + +[node name="GPUParticles3D" type="GPUParticles3D" parent="."] +cast_shadow = 0 +amount = 2000 +lifetime = 0.5 +transform_align = 1 +trail_lifetime = 0.5 +process_material = SubResource("ParticleProcessMaterial_uyeuh") +draw_pass_1 = SubResource("QuadMesh_6nr8a") diff --git a/client/item/soul/soul.tres b/client/item/soul/soul.tres new file mode 100644 index 0000000..4c92065 --- /dev/null +++ b/client/item/soul/soul.tres @@ -0,0 +1,9 @@ +[gd_resource type="Resource" script_class="Item" load_steps=3 format=3 uid="uid://cctcou3pxuxab"] + +[ext_resource type="PackedScene" uid="uid://dl4vcp04t8iyr" path="res://item/soul/Soul.tscn" id="1_bbwtc"] +[ext_resource type="Script" path="res://item/Item.gd" id="1_otojt"] + +[resource] +script = ExtResource("1_otojt") +name = "Soul" +scene = ExtResource("1_bbwtc") diff --git a/client/ui/UI.tscn b/client/ui/UI.tscn index 5531615..c681aea 100644 --- a/client/ui/UI.tscn +++ b/client/ui/UI.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://dagn5bf7ou3sd"] +[gd_scene load_steps=14 format=3 uid="uid://dagn5bf7ou3sd"] [ext_resource type="PackedScene" uid="uid://cch67vqpsmtej" path="res://ui/debug/DebugLabel.tscn" id="1_7s8uu"] [ext_resource type="Script" path="res://ui/UI.gd" id="1_l5b6o"] @@ -12,6 +12,7 @@ [ext_resource type="Script" path="res://ui/debug/DownloadLabel.gd" id="8_ogt38"] [ext_resource type="Script" path="res://ui/connect/ConnectPanel.gd" id="11_cwl0t"] [ext_resource type="PackedScene" uid="uid://bqpbrju7mc7d5" path="res://ui/settings/Settings.tscn" id="11_rt7sl"] +[ext_resource type="PackedScene" uid="uid://y6kdpmp5glv0" path="res://ui/inventory/Inventory.tscn" id="13_1fc2b"] [node name="UI" type="Control"] layout_mode = 3 @@ -131,6 +132,14 @@ text = "Connecting..." [node name="Settings" parent="Canvas" instance=ExtResource("11_rt7sl")] visible = false +[node name="Inventory" parent="Canvas" instance=ExtResource("13_1fc2b")] +visible = false +anchors_preset = -1 +anchor_left = 0.25 +anchor_top = 0.25 +anchor_right = 0.75 +anchor_bottom = 0.75 + [connection signal="focus_entered" from="Canvas/BottomLeft/Chat/ChatInput" to="Canvas/BottomLeft/Chat/ChatInput" method="_on_focus_entered"] [connection signal="focus_exited" from="Canvas/BottomLeft/Chat/ChatInput" to="Canvas/BottomLeft/Chat/ChatInput" method="_on_focus_exited"] [connection signal="text_submitted" from="Canvas/BottomLeft/Chat/ChatInput" to="Canvas/BottomLeft/Chat/ChatInput" method="_on_text_submitted"] diff --git a/client/ui/inventory/Inventory.tscn b/client/ui/inventory/Inventory.tscn new file mode 100644 index 0000000..76ec8b8 --- /dev/null +++ b/client/ui/inventory/Inventory.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=2 format=3 uid="uid://y6kdpmp5glv0"] + +[ext_resource type="PackedScene" uid="uid://bjjxxh6o405ci" path="res://ui/inventory/InventorySlot.tscn" id="1_s830e"] + +[node name="Inventory" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 + +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "Inventory" +horizontal_alignment = 1 + +[node name="GridContainer" type="GridContainer" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +columns = 5 + +[node name="InventorySlot" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot2" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot3" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot4" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot5" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot6" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot7" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot8" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot9" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 + +[node name="InventorySlot10" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_s830e")] +layout_mode = 2 diff --git a/client/ui/inventory/InventorySlot.tscn b/client/ui/inventory/InventorySlot.tscn new file mode 100644 index 0000000..b0a78fc --- /dev/null +++ b/client/ui/inventory/InventorySlot.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://bjjxxh6o405ci"] + +[ext_resource type="Texture2D" uid="uid://biplb56hj51h7" path="res://ui/icon.svg" id="1_0whqe"] + +[node name="InventorySlot" type="PanelContainer"] + +[node name="TextureRect" type="TextureRect" parent="."] +layout_mode = 2 +texture = ExtResource("1_0whqe")