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,8 +1,11 @@
[gd_scene load_steps=8 format=4 uid="uid://bjxjcx2qu16q5"]
[gd_scene load_steps=15 format=4 uid="uid://bjxjcx2qu16q5"]
[ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_0xufn"]
[ext_resource type="Material" uid="uid://64m17act0kwu" path="res://assets/materials/mat_glass.tres" id="2_dbm1u"]
[ext_resource type="Script" uid="uid://dig825r70a0sn" path="res://src/substance_display.gd" id="3_0xufn"]
[ext_resource type="Script" uid="uid://bl0ojhc0thk1p" path="res://src/interactible/interactible.gd" id="4_dbm1u"]
[ext_resource type="Texture2D" uid="uid://cw3jw8qbvj3fv" path="res://assets/textures/solid.png" id="4_h7awq"]
[ext_resource type="Script" uid="uid://duirfi4j26g2i" path="res://src/interactible/flask_interaction.gd" id="5_pmegg"]
[ext_resource type="Script" uid="uid://82ettbegollp" path="res://src/inventory.gd" id="7_h7awq"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_vcwhe"]
@ -43,6 +46,28 @@ _surfaces = [{
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_1ouf4")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ailwx"]
resource_local_to_scene = true
transparency = 1
[sub_resource type="CylinderMesh" id="CylinderMesh_h7awq"]
top_radius = 0.772
bottom_radius = 0.772
height = 8.0
radial_segments = 16
rings = 0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_kkw7a"]
resource_local_to_scene = true
albedo_texture = ExtResource("4_h7awq")
uv1_scale = Vector3(1, 3.07, 1)
[sub_resource type="CylinderMesh" id="CylinderMesh_pmegg"]
top_radius = 0.772
bottom_radius = 0.772
radial_segments = 16
rings = 0
[node name="Flask" type="Area3D" node_paths=PackedStringArray("interactible") groups=["flask"]]
collision_layer = 5
script = ExtResource("1_0xufn")
@ -58,6 +83,23 @@ transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.1, 0)
mesh = SubResource("ArrayMesh_nvewc")
skeleton = NodePath("")
[node name="FillLiquid" type="MeshInstance3D" parent="Flash"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.8061247, 0)
visible = false
material_override = SubResource("StandardMaterial3D_ailwx")
mesh = SubResource("CylinderMesh_h7awq")
skeleton = NodePath("")
script = ExtResource("3_0xufn")
[node name="FillSolid" type="MeshInstance3D" parent="Flash"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8061155, 0)
visible = false
material_override = SubResource("StandardMaterial3D_kkw7a")
mesh = SubResource("CylinderMesh_pmegg")
skeleton = NodePath("")
script = ExtResource("3_0xufn")
display_type = 1
[node name="Inventory" type="Node" parent="."]
unique_name_in_owner = true
script = ExtResource("7_h7awq")
@ -65,5 +107,35 @@ open_on_top = true
metadata/_custom_type_script = "uid://82ettbegollp"
[node name="Interactible" type="ConfirmationDialog" parent="."]
cancel_button_text = "I WANNA MAKE YOU HATE ME"
oversampling_override = 1.0
title = "Перелить вещество в колбе?"
position = Vector2i(0, 36)
size = Vector2i(301, 100)
ok_button_text = "Перелить"
cancel_button_text = "Нет"
script = ExtResource("4_dbm1u")
[node name="HBoxContainer" type="HBoxContainer" parent="Interactible"]
offset_left = 8.0
offset_top = 8.0
offset_right = 293.0
offset_bottom = 51.0
[node name="Label" type="Label" parent="Interactible/HBoxContainer"]
layout_mode = 2
text = "000%"
[node name="HSlider" type="HSlider" parent="Interactible/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
max_value = 1.0
step = 0.01
value = 1.0
[node name="Interaction" type="Node" parent="Interactible"]
script = ExtResource("5_pmegg")
[connection signal="inventory_changed" from="Inventory" to="Flash/FillLiquid" method="update_material_unfiltered"]
[connection signal="inventory_changed" from="Inventory" to="Flash/FillSolid" method="update_material_unfiltered"]
[connection signal="interacted" from="Interactible" to="Interactible/Interaction" method="_on_interactible_interacted"]
[connection signal="value_changed" from="Interactible/HBoxContainer/HSlider" to="Interactible/Interaction" method="_on_h_slider_value_changed"]