This commit is contained in:
Rendo 2026-02-12 23:50:53 +05:00
commit e1e7c70147
39 changed files with 279 additions and 60 deletions

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://vhn8h4mhb6nh"]
[gd_scene format=3 uid="uid://vhn8h4mhb6nh"]
[ext_resource type="Script" uid="uid://ds5u02jdtxyd4" path="res://src/ui/drag_and_drop.gd" id="1_33df7"]
[node name="DragAndDrop" type="Button"]
[node name="DragAndDrop" type="Button" unique_id=1396027085]
anchors_preset = -1
anchor_right = 0.043
anchor_bottom = 0.07700001

View file

@ -157,6 +157,11 @@ transform = Transform3D(0, 0.81564164, 7.79495e-08, 1.7832766, -1.5584348e-15, 7
mesh = SubResource("ArrayMesh_0gv3x")
skeleton = NodePath("")
[node name="RemoteTransform3D" type="RemoteTransform3D" parent="Holder/Cylinder_001" unique_id=47310226]
transform = Transform3D(-4.2336617e-07, 5.607655, 1.12113185e-07, 3.8971154e-07, 2.4511846e-07, -12.260285, 5.607655, 4.2336617e-07, 1.7824777e-07, -3.2521849, -0.6642422, -4.1857553)
remote_path = NodePath("../../../FlaskHoldArea")
update_scale = false
[node name="Cylinder_003" type="MeshInstance3D" parent="Holder/Cylinder_001" unique_id=1374051037]
transform = Transform3D(3.1641225e-08, 0.7428574, 7.2952147e-09, -0.3648906, -3.103231e-15, 1.5826247, -0.72386676, 3.247133e-08, -0.16689502, -3.113039, -0.4727633, -4.1781373)
mesh = SubResource("ArrayMesh_ifupq")
@ -180,4 +185,4 @@ shape = SubResource("BoxShape3D_yplmy")
script = ExtResource("3_yplmy")
[node name="FlaskHoldArea" parent="." unique_id=1519161328 instance=ExtResource("4_ig37s")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0.010895464, 0.5656636, -0.7496213)
transform = Transform3D(7.5497894e-08, 1.9992886e-08, -0.99999994, -3.178651e-08, 1, 1.9992886e-08, 1, 3.178651e-08, 7.549791e-08, 3.2653322e-08, 0, -0.74702096)

42
scenes/questions.tscn Normal file
View file

@ -0,0 +1,42 @@
[gd_scene format=3 uid="uid://be746nxgkc5ay"]
[ext_resource type="Script" uid="uid://bosx1bhaka185" path="res://src/ui/questions_generator.gd" id="1_rdw2t"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_faf07"]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.1, 0.1, 0.1, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[node name="Questions" type="Panel" unique_id=2060279649]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_faf07")
[node name="CloseButton" type="Button" parent="." unique_id=728079508]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -31.0
offset_bottom = 31.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 16
text = "X"
[node name="Questions" type="Control" parent="." unique_id=975580098]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_rdw2t")
[connection signal="pressed" from="CloseButton" to="Questions" method="_on_close_button_pressed"]

12
scenes/tool_generator.gd Normal file
View file

@ -0,0 +1,12 @@
extends Node
const dnd_button = preload("res://scenes/drag_and_drop.tscn")
func _ready() -> void:
for tool in ReactionRegistry.current_lab.tools:
var button = dnd_button.instantiate()
button.draggable = tool
button.text = tool.text
get_parent().add_element.call_deferred(button)

View file

@ -0,0 +1 @@
uid://cfl3n0ihnpd2v

View file

@ -3,13 +3,11 @@
[ext_resource type="Script" uid="uid://cqdtgvrotvjhb" path="res://src/ui/logger.gd" id="1_8dubc"]
[ext_resource type="Script" uid="uid://457xdl1tsmde" path="res://src/ui/control_buttons_holder.gd" id="1_ktti3"]
[ext_resource type="PackedScene" uid="uid://bcj0mesdlfsfj" path="res://scenes/popup_container.tscn" id="1_nt7q6"]
[ext_resource type="Script" uid="uid://14snb0pu3b1t" path="res://src/ui/lab_tabs.gd" id="1_p7vwb"]
[ext_resource type="PackedScene" uid="uid://opfal5aq2p5e" path="res://scenes/worktabs.tscn" id="2_p7vwb"]
[ext_resource type="Script" uid="uid://c5pv2idedy1oy" path="res://src/ui/reagents_gen.gd" id="2_x4jx1"]
[ext_resource type="PackedScene" uid="uid://vhn8h4mhb6nh" path="res://scenes/drag_and_drop.tscn" id="3_yev5y"]
[ext_resource type="Resource" uid="uid://cay05wpketmny" path="res://assets/draggables/flask.tres" id="4_gdt2y"]
[ext_resource type="Resource" uid="uid://6vpr6n7yruie" path="res://assets/draggables/spoon.tres" id="5_wm3ai"]
[ext_resource type="Resource" uid="uid://kg34c4105ssp" path="res://assets/draggables/burner.tres" id="6_p7vwb"]
[ext_resource type="Resource" uid="uid://dnxpw2metn0oq" path="res://assets/draggables/stand.tres" id="8_7dvkv"]
[ext_resource type="Resource" uid="uid://cm2is1qooywkf" path="res://assets/draggables/holder.tres" id="9_vdcm2"]
[ext_resource type="PackedScene" uid="uid://be746nxgkc5ay" path="res://scenes/questions.tscn" id="3_ktti3"]
[ext_resource type="Script" uid="uid://cfl3n0ihnpd2v" path="res://scenes/tool_generator.gd" id="11_vdcm2"]
[node name="UserInterface" type="Control" unique_id=1780432093]
layout_mode = 3
@ -40,6 +38,17 @@ tab_0/title = "Ход работы"
tab_1/title = "Вопросы для самопроверки"
tab_2/title = "Отчёт"
tab_3/title = "Очистить"
script = ExtResource("1_p7vwb")
[node name="Worktabs" parent="HSplitContainer/TabBar" unique_id=468314618 instance=ExtResource("2_p7vwb")]
visible = false
top_level = true
layout_mode = 1
[node name="Questions" parent="HSplitContainer/TabBar" unique_id=2060279649 instance=ExtResource("3_ktti3")]
visible = false
top_level = true
layout_mode = 1
[node name="InspectorPanel" type="PanelContainer" parent="HSplitContainer" unique_id=918152974]
layout_mode = 2
@ -101,32 +110,6 @@ metadata/_edit_use_anchors_ = true
[node name="ScrollContainer" parent="Intruments" index="0"]
offset_right = -20.904999
[node name="Flask" parent="Intruments/ScrollContainer/VBoxContainer" index="0" unique_id=852024836 instance=ExtResource("3_yev5y")]
layout_mode = 2
text = "Пробирка"
draggable = ExtResource("4_gdt2y")
[node name="Burner" parent="Intruments/ScrollContainer/VBoxContainer" index="1" unique_id=1243872558 instance=ExtResource("3_yev5y")]
layout_mode = 2
text = "Спиртовка"
draggable = ExtResource("6_p7vwb")
[node name="Stand" parent="Intruments/ScrollContainer/VBoxContainer" index="2" unique_id=653836695 instance=ExtResource("3_yev5y")]
layout_mode = 2
text = "Штатив"
draggable = ExtResource("8_7dvkv")
[node name="Holder" parent="Intruments/ScrollContainer/VBoxContainer" index="3" unique_id=878085834 instance=ExtResource("3_yev5y")]
layout_mode = 2
text = "Держатель пробирок"
autowrap_mode = 2
draggable = ExtResource("9_vdcm2")
[node name="Spoon" parent="Intruments/ScrollContainer/VBoxContainer" index="4" unique_id=1377215067 instance=ExtResource("3_yev5y")]
layout_mode = 2
text = "Ложка"
draggable = ExtResource("5_wm3ai")
[node name="Label" parent="Intruments" index="1"]
anchor_left = 0.8717948
anchor_top = 0.040587522
@ -137,5 +120,10 @@ offset_top = 199.64479
offset_right = 175.22977
offset_bottom = 49.03595
[node name="Generator" type="Node" parent="Intruments" unique_id=1693437228]
script = ExtResource("11_vdcm2")
[connection signal="tab_clicked" from="HSplitContainer/TabBar" to="HSplitContainer/TabBar" method="_on_tab_clicked"]
[editable path="Reagents"]
[editable path="Intruments"]

14
scenes/worktab.tscn Normal file
View file

@ -0,0 +1,14 @@
[gd_scene format=3 uid="uid://ce4a3scprw3c7"]
[node name="Worktab" type="ScrollContainer" unique_id=1421870413]
offset_right = 40.0
offset_bottom = 40.0
size_flags_horizontal = 3
size_flags_vertical = 3
horizontal_scroll_mode = 0
[node name="Text" type="Label" parent="." unique_id=1337050557]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
autowrap_mode = 2

View file

@ -1,8 +1,45 @@
[gd_scene format=3 uid="uid://baqryu8dqil1x"]
[gd_scene format=3 uid="uid://opfal5aq2p5e"]
[ext_resource type="Script" uid="uid://dxtijlyrv0q57" path="res://src/ui/worktabs.gd" id="1_xfim1"]
[node name="Worktabs" type="TabContainer" unique_id=468314618]
offset_right = 8.0
offset_bottom = 40.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xfim1"]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0.1, 0.1, 0.1, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[node name="Worktabs" type="Panel" unique_id=666307058]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_xfim1")
[node name="TabContainer" type="TabContainer" parent="." unique_id=513419076]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_xfim1")
[node name="CloseButton" type="Button" parent="." unique_id=1683733206]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -31.0
offset_bottom = 31.0
grow_horizontal = 0
theme_override_font_sizes/font_size = 16
text = "X"
[connection signal="pressed" from="CloseButton" to="TabContainer" method="_on_close_button_pressed"]