Interactions

This commit is contained in:
Rendo 2025-12-26 01:31:21 +05:00
commit 4f6c151e25
31 changed files with 498 additions and 12 deletions

View file

@ -1,13 +1,15 @@
[gd_scene load_steps=8 format=3 uid="uid://cw6v8kbi76qak"]
[gd_scene load_steps=9 format=3 uid="uid://cw6v8kbi76qak"]
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_o7vug"]
[ext_resource type="ArrayMesh" uid="uid://dddqboph2ygmw" path="res://assets/meshes/jar.res" id="2_o7vug"]
[ext_resource type="Script" uid="uid://bl0ojhc0thk1p" path="res://src/interactible/interactible.gd" id="5_o7vug"]
[ext_resource type="Script" uid="uid://bhnptwotw5bs8" path="res://src/interactible/substance_jar_interaction.gd" id="6_00jpx"]
[ext_resource type="ArrayMesh" uid="uid://dxeseuqcwne1m" path="res://assets/meshes/jar_fill.res" id="6_kfk5m"]
[ext_resource type="Script" uid="uid://c8epd7gguvyop" path="res://src/substance_holder.gd" id="7_ymvgp"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pcpcb"]
resource_local_to_scene = true
transparency = 1
[sub_resource type="CylinderShape3D" id="CylinderShape3D_kfk5m"]
height = 0.5024414
@ -17,6 +19,7 @@ radius = 0.22460938
collision_layer = 5
script = ExtResource("1_o7vug")
interactible = NodePath("Interaction")
mask = PackedStringArray("flask")
[node name="Jar" type="MeshInstance3D" parent="."]
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0)
@ -35,4 +38,28 @@ shape = SubResource("CylinderShape3D_kfk5m")
script = ExtResource("7_ymvgp")
[node name="Interaction" type="ConfirmationDialog" parent="."]
title = "Добавить вещество?"
ok_button_text = "Добавить"
cancel_button_text = "Не добавлять"
script = ExtResource("5_o7vug")
[node name="HBoxContainer" type="HBoxContainer" parent="Interaction"]
offset_right = 40.0
offset_bottom = 40.0
[node name="ProgressBar" type="HSlider" parent="Interaction/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
allow_greater = true
[node name="SpinBox" type="SpinBox" parent="Interaction/HBoxContainer"]
layout_mode = 2
allow_greater = true
suffix = "мг."
[node name="Interaction" type="Node" parent="Interaction"]
script = ExtResource("6_00jpx")
[connection signal="interacted" from="Interaction" to="Interaction/Interaction" method="_on_interaction_interacted"]
[connection signal="value_changed" from="Interaction/HBoxContainer/ProgressBar" to="Interaction/Interaction" method="_on_progress_bar_value_changed"]
[connection signal="value_changed" from="Interaction/HBoxContainer/SpinBox" to="Interaction/Interaction" method="_on_spin_box_value_changed"]