diff --git a/assets/reactions/agcl_p_na2s.tres b/assets/reactions/agcl_p_na2s.tres index 20794bd..ea8efd4 100644 --- a/assets/reactions/agcl_p_na2s.tres +++ b/assets/reactions/agcl_p_na2s.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" script_class="Reaction" format=3 uid="uid://b84essimpfmee"] +[gd_resource type="Resource" script_class="Reaction" load_steps=11 format=3 uid="uid://b84essimpfmee"] [ext_resource type="Script" uid="uid://bb8o8l6u6fiai" path="res://src/resources/reaction_substance.gd" id="1_rvq0y"] [ext_resource type="Script" uid="uid://dwks86y6383p4" path="res://src/resources/reaction.gd" id="2_oqih4"] diff --git a/assets/reagents/HCl.tres b/assets/reagents/HCl.tres index c8ae847..af6703e 100644 --- a/assets/reagents/HCl.tres +++ b/assets/reagents/HCl.tres @@ -1,7 +1,6 @@ -[gd_resource type="Resource" script_class="Reagent" format=3 uid="uid://cxpovcqviqurr"] +[gd_resource type="Resource" script_class="Reagent" load_steps=3 format=3 uid="uid://cxpovcqviqurr"] [ext_resource type="Script" uid="uid://bditqax8ibmxw" path="res://src/resources/reagent.gd" id="1_5si53"] -[ext_resource type="PackedScene" uid="uid://cw6v8kbi76qak" path="res://scenes/substance_jar.tscn" id="2_dby88"] [ext_resource type="Resource" uid="uid://bj3cdfwvgksee" path="res://assets/substances/HCl.tres" id="2_no7s4"] [resource] diff --git a/assets/textures/bubble.png b/assets/textures/bubble.png deleted file mode 100644 index b26fda2..0000000 Binary files a/assets/textures/bubble.png and /dev/null differ diff --git a/assets/textures/bubble.png.import b/assets/textures/bubble.png.import deleted file mode 100644 index 07769dc..0000000 --- a/assets/textures/bubble.png.import +++ /dev/null @@ -1,40 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bkuxwtxum1r4x" -path="res://.godot/imported/bubble.png-a4e9df5e78917cd4475ee7b84b1534f0.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/textures/bubble.png" -dest_files=["res://.godot/imported/bubble.png-a4e9df5e78917cd4475ee7b84b1534f0.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/uastc_level=0 -compress/rdo_quality_loss=0.0 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/channel_remap/red=0 -process/channel_remap/green=1 -process/channel_remap/blue=2 -process/channel_remap/alpha=3 -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/export_presets.cfg b/export_presets.cfg index e8b2929..dfee77a 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -3,6 +3,7 @@ name="Windows Desktop" platform="Windows Desktop" runnable=true +advanced_options=false dedicated_server=false custom_features="" export_filter="all_resources" @@ -10,11 +11,6 @@ include_filter="" exclude_filter="" export_path="exports/lab-electrolyte.exe" patches=PackedStringArray() -patch_delta_encoding=false -patch_delta_compression_level_zstd=19 -patch_delta_min_reduction=0.1 -patch_delta_include_filters="*" -patch_delta_exclude_filters="" encryption_include_filters="" encryption_exclude_filters="" seed=0 @@ -69,50 +65,3 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue Remove-Item -Recurse -Force '{temp_dir}'" - -[preset.1] - -name="Linux" -platform="Linux" -runnable=true -dedicated_server=false -custom_features="" -export_filter="all_resources" -include_filter="" -exclude_filter="" -export_path="" -patches=PackedStringArray() -patch_delta_encoding=false -patch_delta_compression_level_zstd=19 -patch_delta_min_reduction=0.1 -patch_delta_include_filters="*" -patch_delta_exclude_filters="" -encryption_include_filters="" -encryption_exclude_filters="" -seed=0 -encrypt_pck=false -encrypt_directory=false -script_export_mode=2 - -[preset.1.options] - -custom_template/debug="" -custom_template/release="" -debug/export_console_wrapper=1 -binary_format/embed_pck=false -texture_format/s3tc_bptc=true -texture_format/etc2_astc=false -shader_baker/enabled=false -binary_format/architecture="x86_64" -ssh_remote_deploy/enabled=false -ssh_remote_deploy/host="user@host_ip" -ssh_remote_deploy/port="22" -ssh_remote_deploy/extra_args_ssh="" -ssh_remote_deploy/extra_args_scp="" -ssh_remote_deploy/run_script="#!/usr/bin/env bash -export DISPLAY=:0 -unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" -\"{temp_dir}/{exe_name}\" {cmd_args}" -ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash -pkill -x -f \"{temp_dir}/{exe_name} {cmd_args}\" -rm -rf \"{temp_dir}\"" diff --git a/labs/lab-8-electrolyte.tres b/labs/lab-8-electrolyte.tres index a410604..5c42382 100644 --- a/labs/lab-8-electrolyte.tres +++ b/labs/lab-8-electrolyte.tres @@ -18,7 +18,7 @@ [ext_resource type="Resource" uid="uid://drcsxqrfgtklt" path="res://assets/reagents/CuSO4.tres" id="7_x21in"] [ext_resource type="Resource" uid="uid://pofsgpx0irdn" path="res://assets/reagents/FeSO4.tres" id="8_54yhc"] [ext_resource type="Resource" uid="uid://dy6b5n8gadtf0" path="res://labs/lab-electrolyte/experiment-7.tres" id="8_cpwlt"] -[ext_resource type="Resource" uid="uid://bbbrxgvfp4jvg" path="res://assets/reagents/H2O.tres" id="9_0vi5e"] +[ext_resource type="Resource" path="res://assets/reagents/H2O.tres" id="9_0vi5e"] [ext_resource type="Resource" uid="uid://cxpovcqviqurr" path="res://assets/reagents/HCl.tres" id="10_nk7ls"] [ext_resource type="Resource" uid="uid://ic4x25e5j8o" path="res://assets/reagents/KCl.tres" id="11_gdam5"] [ext_resource type="Resource" uid="uid://gn654lim8gy6" path="res://assets/reagents/KI.tres" id="12_187c3"] @@ -40,11 +40,6 @@ [ext_resource type="Resource" uid="uid://ignwsng3bt4e" path="res://labs/lab-electrolyte/test-3.tres" id="32_anse4"] [ext_resource type="Resource" uid="uid://ber4xlsqegke0" path="res://labs/lab-electrolyte/test-4.tres" id="33_vgv2h"] [ext_resource type="Resource" uid="uid://d13fl2bs8o6oa" path="res://labs/lab-electrolyte/test-5.tres" id="34_eolar"] -[ext_resource type="Resource" uid="uid://q37mwgdlirfb" path="res://labs/lab-electrolyte/test-6.tres" id="35_t3lvx"] -[ext_resource type="Resource" uid="uid://bpdrfoq88tteh" path="res://labs/lab-electrolyte/test-7.tres" id="36_axgl6"] -[ext_resource type="Resource" uid="uid://jdv2rvp868p4" path="res://labs/lab-electrolyte/test-8.tres" id="37_t1gxe"] -[ext_resource type="Resource" uid="uid://dh7itd4q5xh7p" path="res://labs/lab-electrolyte/test-9.tres" id="38_gcv8s"] -[ext_resource type="Resource" uid="uid://clhgdwkshm3b0" path="res://labs/lab-electrolyte/test-10.tres" id="39_jof8k"] [resource] script = ExtResource("3_pogou") @@ -52,6 +47,6 @@ lab_name = "Лабораторная работа №8 - Растворы эле tasks = "Ознакомиться с методами получения слабых кислот и оснований. Изучить влияние введения одноименного иона на смещение равновесия диссоциации слабого электролита. Ознакомиться с различными типами реакций обмена в водных растворах электролитов." equipment = "Пробирки. Кислоты, основания, соли, индикаторы." experiments = Array[ExtResource("1_28qla")]([ExtResource("2_nk7ls"), ExtResource("3_gdam5"), ExtResource("4_187c3"), ExtResource("5_ujot4"), ExtResource("6_w3d37"), ExtResource("7_je2gp"), ExtResource("8_cpwlt")]) -tests = Array[ExtResource("4_6s74a")]([ExtResource("30_je2gp"), ExtResource("31_cpwlt"), ExtResource("32_anse4"), ExtResource("33_vgv2h"), ExtResource("34_eolar"), ExtResource("30_je2gp"), ExtResource("31_cpwlt"), ExtResource("32_anse4"), ExtResource("33_vgv2h"), ExtResource("34_eolar"), ExtResource("35_t3lvx"), ExtResource("36_axgl6"), ExtResource("37_t1gxe"), ExtResource("38_gcv8s"), ExtResource("39_jof8k")]) +tests = Array[ExtResource("4_6s74a")]([ExtResource("30_je2gp"), ExtResource("31_cpwlt"), ExtResource("32_anse4"), ExtResource("33_vgv2h"), ExtResource("34_eolar")]) reagents = Array[ExtResource("2_mabxg")]([ExtResource("3_nu2d0"), ExtResource("4_83o17"), ExtResource("5_4xn0j"), ExtResource("6_fg475"), ExtResource("7_x21in"), ExtResource("8_54yhc"), ExtResource("9_0vi5e"), ExtResource("10_nk7ls"), ExtResource("11_gdam5"), ExtResource("12_187c3"), ExtResource("13_ujot4"), ExtResource("14_w3d37"), ExtResource("15_je2gp"), ExtResource("16_cpwlt"), ExtResource("17_anse4"), ExtResource("18_vgv2h"), ExtResource("19_eolar"), ExtResource("20_eh3kp")]) tools = Array[ExtResource("5_v8c5p")]([ExtResource("24_530yt"), ExtResource("25_nk60r"), ExtResource("26_lp3qm"), ExtResource("27_ytmy7"), ExtResource("28_fsm27")]) diff --git a/labs/lab-electrolyte/test-1.tres b/labs/lab-electrolyte/test-1.tres index 577a8da..bd21497 100644 --- a/labs/lab-electrolyte/test-1.tres +++ b/labs/lab-electrolyte/test-1.tres @@ -4,6 +4,6 @@ [resource] script = ExtResource("1_mujbh") -question = "Сильными электролитами в водных растворах являются все вещества группы…" -options = Array[String](["KOH, HNO3, H2SO4;", "H2S, H2SO3, H2SO4;", "MgCl2, CH3COOH, NaOH;", "H2S, CH3COOH, H2SO3"]) +question = "Что такое сильные и слабые электролиты?" +options = Array[String](["Сильные электролиты полностью диссоциируют на ионы в растворе, слабые — частично.", "Сильные электролиты не растворяются в воде, слабые — растворяются хорошо.", "Сильные электролиты проводят ток только в твёрдом состоянии, слабые — в растворе.", "Сильные электролиты образуют осадок, слабые — газ."]) metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-10.tres b/labs/lab-electrolyte/test-10.tres deleted file mode 100644 index ffe2516..0000000 --- a/labs/lab-electrolyte/test-10.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" script_class="LabTest" format=3 uid="uid://clhgdwkshm3b0"] - -[ext_resource type="Script" uid="uid://dpacehourck22" path="res://src/resources/lab/test.gd" id="1_evbhk"] - -[resource] -script = ExtResource("1_evbhk") -question = "Уравнению химической реакции:CuCl2 + 2NaOH ↔ Cu(OH)2 + 2NaCl соответствует сокращенное ионно-молекулярное уравнение:" -options = Array[String](["Cu 2+ + 2OH– ↔ Cu(OH)2↓;", "Cu 2+ + NaOH ↔ Cu(OH)2↓ + Na+;", "2Сl + 2Na+ ↔ 2NaCl;", "CuCl2 + 2ОН– ↔ Сu2+ + 2ОН– + 2Сl– "]) -metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-2.tres b/labs/lab-electrolyte/test-2.tres index 44d0c8d..59212a7 100644 --- a/labs/lab-electrolyte/test-2.tres +++ b/labs/lab-electrolyte/test-2.tres @@ -4,6 +4,6 @@ [resource] script = ExtResource("1_tocw5") -question = "Какая из приведенных реакций является обратимой:" -options = Array[String](["NH4OH + HNO3 = NH4NO3 + Н2O;", "FeCl3 + 3NaOH = Fe(OH)3 + 3NaCl;", "Na2S + HC1 = H2S + 2NaCl;", "НNО3 + КОН = КNО3 + Н2O"]) +question = "Какая величина характеризует силу электролита?" +options = Array[String](["Степень электролитической диссоциации.", "Массовая доля вещества в растворе.", "Молярная масса вещества.", "Плотность раствора."]) metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-3.tres b/labs/lab-electrolyte/test-3.tres index 76b2f8a..1ad5036 100644 --- a/labs/lab-electrolyte/test-3.tres +++ b/labs/lab-electrolyte/test-3.tres @@ -4,7 +4,6 @@ [resource] script = ExtResource("1_o8p71") -question = "Среди веществ: H2CO3, ZnSO4, KOH, HCl, HNO2, NH4Cl число сильных электролитов равно… " -options = Array[String](["1", "2", "3", "4"]) -correct_anwser = 3 +question = "Что такое произведение растворимости?" +options = Array[String](["Произведение концентраций ионов малорастворимого электролита в насыщенном растворе, возведённых в степени их коэффициентов.", "Произведение массы растворённого вещества на объём раствора.", "Отношение растворимости вещества к температуре.", "Сумма концентраций всех ионов в растворе."]) metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-4.tres b/labs/lab-electrolyte/test-4.tres index c461f64..5421618 100644 --- a/labs/lab-electrolyte/test-4.tres +++ b/labs/lab-electrolyte/test-4.tres @@ -4,7 +4,6 @@ [resource] script = ExtResource("1_5d6hp") -question = "Выберите уравнение реакции электролитической диссоциации H3ASO4 по первой ступени:" -options = Array[String](["(HAsО4)2– ↔ H+ + (AsО4)3–;", "H3ASO4 ↔ Н+ + (H2ASO4)–;", "(H2AsО4) ↔ Н+ + (HAsО4)2–;", "(HAsО4) ↔ Н + (ASO4) "]) -correct_anwser = 1 +question = "Что такое водородный показатель?" +options = Array[String](["Отрицательный десятичный логарифм концентрации ионов водорода в растворе.", "Концентрация молекул воды в растворе.", "Количество гидроксид-ионов в щелочи.", "Массовая доля кислоты в растворе."]) metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-5.tres b/labs/lab-electrolyte/test-5.tres index 1a2113d..c3807ea 100644 --- a/labs/lab-electrolyte/test-5.tres +++ b/labs/lab-electrolyte/test-5.tres @@ -4,7 +4,6 @@ [resource] script = ExtResource("1_3bllg") -question = "Количество ступеней диссоциации азотной кислоты (НNO3) равно:" -options = Array[String](["две;", "три;", "четыре;", "одна"]) -correct_anwser = 3 +question = "Какие реакции обмена в растворах электролитов относятся к братимым и необратимым реакциям?" +options = Array[String](["Обратимые — протекают не до конца и устанавливают равновесие; необратимые — идут до конца с образованием осадка, газа или слабого электролита.", "Обратимые — идут только при нагревании, необратимые — только при охлаждении.", "Обратимые — протекают без изменения цвета, необратимые — с изменением цвета.", "Обратимые — идут только в щелочной среде, необратимые — только в кислой среде."]) metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-6.tres b/labs/lab-electrolyte/test-6.tres deleted file mode 100644 index afbb952..0000000 --- a/labs/lab-electrolyte/test-6.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="Resource" script_class="LabTest" format=3 uid="uid://q37mwgdlirfb"] - -[ext_resource type="Script" uid="uid://dpacehourck22" path="res://src/resources/lab/test.gd" id="1_31rvo"] - -[resource] -script = ExtResource("1_31rvo") -question = "Схема реакции, соответствующая сокращенному молекулярно-ионному уравнению 2H+ + CO32− = H2O +CO2↑, имеет вид…" -options = Array[String](["NaHCO3 +H2SO4 →", "Na2CO3 +H2SO4 →", "CH3COOH + Na2CO3 →", "Na2CO3 +H2SiO3 →"]) -metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-7.tres b/labs/lab-electrolyte/test-7.tres deleted file mode 100644 index 846ecc0..0000000 --- a/labs/lab-electrolyte/test-7.tres +++ /dev/null @@ -1,10 +0,0 @@ -[gd_resource type="Resource" script_class="LabTest" format=3 uid="uid://bpdrfoq88tteh"] - -[ext_resource type="Script" uid="uid://dpacehourck22" path="res://src/resources/lab/test.gd" id="1_vpmu4"] - -[resource] -script = ExtResource("1_vpmu4") -question = "Молекулярное уравнение соответствует ионному: HS– + ОН– = S2– + Н2О" -options = Array[String](["3S + КОН = 2K2S +K2SO4 + 3H2О;", "H2S + 2NaOH = Na2S + Н2О;", "NaHS + NaOH = Na2S + H2О;", "NaOH + H2S = NaНS + Н2О"]) -correct_anwser = 2 -metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-8.tres b/labs/lab-electrolyte/test-8.tres deleted file mode 100644 index df01f27..0000000 --- a/labs/lab-electrolyte/test-8.tres +++ /dev/null @@ -1,10 +0,0 @@ -[gd_resource type="Resource" script_class="LabTest" format=3 uid="uid://jdv2rvp868p4"] - -[ext_resource type="Script" uid="uid://dpacehourck22" path="res://src/resources/lab/test.gd" id="1_d8xn1"] - -[resource] -script = ExtResource("1_d8xn1") -question = "К сильным основаниям относится…" -options = Array[String](["NH4OH;", "NaOH;", "Cu(OH)2;", "Fe(OH)2"]) -correct_anwser = 1 -metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/labs/lab-electrolyte/test-9.tres b/labs/lab-electrolyte/test-9.tres deleted file mode 100644 index a4e8015..0000000 --- a/labs/lab-electrolyte/test-9.tres +++ /dev/null @@ -1,10 +0,0 @@ -[gd_resource type="Resource" script_class="LabTest" format=3 uid="uid://dh7itd4q5xh7p"] - -[ext_resource type="Script" uid="uid://dpacehourck22" path="res://src/resources/lab/test.gd" id="1_1iwn6"] - -[resource] -script = ExtResource("1_1iwn6") -question = "Укажите, какая из нижеприведенных реакций является необратимой:" -options = Array[String](["NH4OH+HCl =NH4Cl+H2O;", "NaOH + HNO3 = NaNO3 +H2O;", "[CuOH]2SO4 + H2SO4 = 2 CuSO4 +2H2O;", "NH4OH + HNO3 = NH4NO3+H2O"]) -correct_anwser = 1 -metadata/_custom_type_script = "uid://dpacehourck22" diff --git a/note b/note deleted file mode 100644 index cc1efd1..0000000 --- a/note +++ /dev/null @@ -1,4 +0,0 @@ -Каждый опыт должен быть изолирован, иметь свой логгер, свою рабочую зону -Добавить зону для текста с (возможно) зоной/кнопками для формул -Тесты должны быть вначале и пропускать студента - diff --git a/project.godot b/project.godot index a030462..e7c25d1 100644 --- a/project.godot +++ b/project.godot @@ -24,7 +24,6 @@ config/icon="res://icon.svg" GuiSignalBus="*res://src/gui_signal_bus.gd" ReactionRegistry="*res://src/reaction_registry.gd" LabRuntime="*uid://b00hrs2a68cpp" -Tooltip="*uid://dtpy85f2ycbur" [global_group] diff --git a/scenes/flask.tscn b/scenes/flask.tscn index 441b56e..a5d0a5d 100644 --- a/scenes/flask.tscn +++ b/scenes/flask.tscn @@ -3,7 +3,6 @@ [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="Shader" uid="uid://djb4t6pw03tow" path="res://shaders/fluid.gdshader" id="4_ailwx"] [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"] @@ -47,13 +46,9 @@ _surfaces = [{ blend_shape_mode = 0 shadow_mesh = SubResource("ArrayMesh_1ouf4") -[sub_resource type="ShaderMaterial" id="ShaderMaterial_ailwx"] +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ailwx"] resource_local_to_scene = true -render_priority = 0 -shader = ExtResource("4_ailwx") -shader_parameter/albedo_color = Color(0, 0, 0, 1) -shader_parameter/fill = 0.8999999798832 -shader_parameter/wave_intensity = 0.0 +transparency = 1 [sub_resource type="CylinderMesh" id="CylinderMesh_h7awq"] top_radius = 0.772 @@ -90,7 +85,8 @@ skeleton = NodePath("") [node name="FillLiquid" type="MeshInstance3D" parent="Flash" unique_id=439339804] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.8061247, 0) -material_override = SubResource("ShaderMaterial_ailwx") +visible = false +material_override = SubResource("StandardMaterial3D_ailwx") mesh = SubResource("CylinderMesh_h7awq") skeleton = NodePath("") script = ExtResource("3_0xufn") diff --git a/scenes/questions.tscn b/scenes/questions.tscn index ac2a480..1898fb1 100644 --- a/scenes/questions.tscn +++ b/scenes/questions.tscn @@ -1,7 +1,6 @@ [gd_scene format=3 uid="uid://be746nxgkc5ay"] [ext_resource type="Script" uid="uid://bosx1bhaka185" path="res://src/ui/questions_generator.gd" id="1_rdw2t"] -[ext_resource type="Script" uid="uid://ckhrj43lyvorv" path="res://ui/questions_result.gd" id="2_8omho"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_faf07"] content_margin_left = 0.0 @@ -40,44 +39,4 @@ offset_right = 40.0 offset_bottom = 40.0 script = ExtResource("1_rdw2t") -[node name="Result" type="Control" parent="." unique_id=717890506] -visible = false -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 -script = ExtResource("2_8omho") - -[node name="Label" type="Label" parent="Result" unique_id=979512538] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -20.0 -offset_top = -11.5 -offset_right = 20.0 -offset_bottom = 11.5 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="TryAgain" type="Button" parent="Result" unique_id=472218266] -layout_mode = 1 -anchors_preset = 7 -anchor_left = 0.5 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -offset_left = -73.0 -offset_top = -31.0 -offset_right = 73.0 -grow_horizontal = 2 -grow_vertical = 0 -text = "Перепройти тест" - [connection signal="pressed" from="CloseButton" to="Questions" method="_on_close_button_pressed"] -[connection signal="pressed" from="Result/TryAgain" to="Result" method="_on_try_again_pressed"] diff --git a/scenes/spoon.tscn b/scenes/spoon.tscn index 4364eaf..e388eef 100644 --- a/scenes/spoon.tscn +++ b/scenes/spoon.tscn @@ -1,4 +1,4 @@ -[gd_scene format=3 uid="uid://emm545mj0kba"] +[gd_scene load_steps=10 format=3 uid="uid://emm545mj0kba"] [ext_resource type="ArrayMesh" uid="uid://cdvben7q8oxgf" path="res://assets/meshes/spoon.res" id="1_l12hh"] [ext_resource type="Script" uid="uid://bjnv2g1ni0525" path="res://src/drag/draggable_object.gd" id="1_r8mox"] @@ -14,17 +14,17 @@ albedo_texture = ExtResource("3_ckduo") [sub_resource type="BoxShape3D" id="BoxShape3D_r8mox"] size = Vector3(0.26538086, 0.1484375, 1.6950684) -[node name="Spoon" type="Area3D" unique_id=926622416 node_paths=PackedStringArray("interactible")] +[node name="Spoon" type="Area3D" node_paths=PackedStringArray("interactible")] collision_layer = 6 script = ExtResource("1_r8mox") interactible = NodePath("Interactible") mask = PackedStringArray("flask", "solid_source") -[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=608330635] +[node name="MeshInstance3D" type="MeshInstance3D" parent="."] transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.07224345, 0) mesh = ExtResource("1_l12hh") -[node name="SpoonFill" type="MeshInstance3D" parent="." unique_id=209337706] +[node name="SpoonFill" type="MeshInstance3D" parent="."] transform = Transform3D(0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 0.07224345, -0.66295564) visible = false material_override = SubResource("StandardMaterial3D_1r65c") @@ -32,11 +32,11 @@ mesh = ExtResource("4_5mau7") script = ExtResource("5_33jiv") display_type = 1 -[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=537844857] +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.07224345, 0) shape = SubResource("BoxShape3D_r8mox") -[node name="Interactible" type="ConfirmationDialog" parent="." unique_id=706618502] +[node name="Interactible" type="ConfirmationDialog" parent="."] title = "" ok_button_text = "Подтвердить" cancel_button_text = "Отменить" @@ -44,7 +44,7 @@ script = ExtResource("3_r8ydw") instant = true metadata/_custom_type_script = "uid://bl0ojhc0thk1p" -[node name="Interaction" type="Node" parent="Interactible" unique_id=463123349] +[node name="Interaction" type="Node" parent="Interactible"] script = ExtResource("4_fyayl") [connection signal="interacted" from="Interactible" to="Interactible/Interaction" method="_on_interactible_interacted"] diff --git a/scenes/substance_jar.tscn b/scenes/substance_jar.tscn index 50f8f9a..5cc4214 100644 --- a/scenes/substance_jar.tscn +++ b/scenes/substance_jar.tscn @@ -1,4 +1,4 @@ -[gd_scene 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"] @@ -15,49 +15,49 @@ transparency = 1 height = 0.5024414 radius = 0.22460938 -[node name="SubstanceJar" type="Area3D" unique_id=904812958 node_paths=PackedStringArray("interactible")] +[node name="SubstanceJar" type="Area3D" node_paths=PackedStringArray("interactible")] collision_layer = 5 script = ExtResource("1_o7vug") interactible = NodePath("Interaction") mask = PackedStringArray("flask") -[node name="Jar" type="MeshInstance3D" parent="." unique_id=985146813] +[node name="Jar" type="MeshInstance3D" parent="."] transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0) mesh = ExtResource("2_o7vug") -[node name="JarFill" type="MeshInstance3D" parent="." unique_id=1364277535] +[node name="JarFill" type="MeshInstance3D" parent="."] transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0) material_override = SubResource("StandardMaterial3D_pcpcb") mesh = ExtResource("6_kfk5m") -[node name="DragArea" type="CollisionShape3D" parent="." unique_id=960002167] +[node name="DragArea" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0) shape = SubResource("CylinderShape3D_kfk5m") -[node name="SubstanceData" type="Node" parent="." unique_id=1379108671] +[node name="SubstanceData" type="Node" parent="."] script = ExtResource("7_ymvgp") -[node name="Interaction" type="ConfirmationDialog" parent="." unique_id=1225848265] +[node name="Interaction" type="ConfirmationDialog" parent="."] title = "Добавить вещество?" ok_button_text = "Добавить" cancel_button_text = "Не добавлять" script = ExtResource("5_o7vug") -[node name="HBoxContainer" type="HBoxContainer" parent="Interaction" unique_id=1504866588] +[node name="HBoxContainer" type="HBoxContainer" parent="Interaction"] offset_right = 40.0 offset_bottom = 40.0 -[node name="ProgressBar" type="HSlider" parent="Interaction/HBoxContainer" unique_id=1037338095] +[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" unique_id=194740698] +[node name="SpinBox" type="SpinBox" parent="Interaction/HBoxContainer"] layout_mode = 2 allow_greater = true suffix = "мг." -[node name="Interaction" type="Node" parent="Interaction" unique_id=729724369] +[node name="Interaction" type="Node" parent="Interaction"] script = ExtResource("6_00jpx") [connection signal="interacted" from="Interaction" to="Interaction/Interaction" method="_on_interaction_interacted"] diff --git a/scenes/worktabs.tscn b/scenes/worktabs.tscn index 2519d1f..883da42 100644 --- a/scenes/worktabs.tscn +++ b/scenes/worktabs.tscn @@ -30,3 +30,16 @@ 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"] diff --git a/shaders/fluid.gdshader b/shaders/fluid.gdshader deleted file mode 100644 index 4bca778..0000000 --- a/shaders/fluid.gdshader +++ /dev/null @@ -1,28 +0,0 @@ -shader_type spatial; - -render_mode cull_back, blend_mix; - -uniform vec4 albedo_color: source_color; -uniform float fill: hint_range(0.0, 1.0, 0.01) = 0.; -uniform float wave_intensity: hint_range(0.0, 1.0, 0.01) = 0.; - -const float MAX_AMPLITUDE = 0.1; -const float MAX_SPEED = 2.; - -void vertex() { - if (VERTEX.y > 0.) { - VERTEX.y *= (fill - 0.5) * 2.; - VERTEX.y += sin((TIME+VERTEX.x+VERTEX.z)*wave_intensity*MAX_SPEED) * MAX_AMPLITUDE * wave_intensity; - } -} - -void fragment() { - // Called for every pixel the material is visible on. - ALBEDO = albedo_color.rgb; - ALPHA = albedo_color.a; -} - -//void light() { -// // Called for every pixel for every light affecting the material. -// // Uncomment to replace the default light processing function with this one. -//} diff --git a/shaders/fluid.gdshader.uid b/shaders/fluid.gdshader.uid deleted file mode 100644 index 7aca443..0000000 --- a/shaders/fluid.gdshader.uid +++ /dev/null @@ -1 +0,0 @@ -uid://djb4t6pw03tow diff --git a/src/drag/draggable_object.gd b/src/drag/draggable_object.gd index ebfc92f..dc70afe 100644 --- a/src/drag/draggable_object.gd +++ b/src/drag/draggable_object.gd @@ -26,8 +26,6 @@ var dragged: bool = false: @export var interactible: Interactible @export var button_generator: ButtonGenerator -@export var display_text: String - @export var mask: PackedStringArray var contacted_draggables: Array[DraggableObject] var filtered_draggables: Array[DraggableObject] @@ -39,18 +37,9 @@ func _ready() -> void: func _mouse_enter() -> void: mouse_in = true - var text: String - if has_node("Inventory") and len($Inventory.inventory) != 0: - text = $Inventory.get_text() - else: - text = display_text - if text == "": - return - Tooltip.set_text(text) func _mouse_exit() -> void: mouse_in = false - Tooltip.clear() func set_mask(new_mask: PackedStringArray) -> void: mask.clear() diff --git a/src/interactible/spoon_interaction.gd b/src/interactible/spoon_interaction.gd index 9b251d1..6b08e3a 100644 --- a/src/interactible/spoon_interaction.gd +++ b/src/interactible/spoon_interaction.gd @@ -29,9 +29,3 @@ func _on_interactible_interacted(with: DraggableObject) -> void: log_message += "%s мг. %s, " % [str(sub.amount),sub.substance.get_formula()] GuiSignalBus.push(log_message) inventory_updated.emit(mini_inventory) - -func _process(_delta: float) -> void: - var result = "" - for key in mini_inventory: - result += key.substance.scientific_name + "+" - $"../..".display_text = result.left(len(result)-1) diff --git a/src/interactible/substance_jar_interaction.gd b/src/interactible/substance_jar_interaction.gd index 24aea76..80761e1 100644 --- a/src/interactible/substance_jar_interaction.gd +++ b/src/interactible/substance_jar_interaction.gd @@ -3,7 +3,7 @@ extends Node var add_amount: float func _on_interaction_interacted(with: DraggableObject) -> void: - if with.is_in_group("flask") and add_amount > 0: + if with.is_in_group("flask"): var subs: RuntimeSubstanceData = RuntimeSubstanceData.new() subs.amount = add_amount subs.substance = $"../../SubstanceData".substance diff --git a/src/inventory.gd b/src/inventory.gd index 70c109b..2274311 100644 --- a/src/inventory.gd +++ b/src/inventory.gd @@ -3,7 +3,6 @@ extends Node class_name Inventory @export var open_on_top: bool -@export var capacity: float = 10. var inventory: Dictionary[StringName,RuntimeSubstanceData] var mean_temperature: float: @@ -25,9 +24,6 @@ var total_amount: float: signal inventory_changed(substances: Array[RuntimeSubstanceData]) signal temperature_changed(to: float) -func _ready() -> void: - inventory_changed.emit(inventory.values()) - func update_solutions(): var has_water = inventory.has("Вода") if has_water: @@ -181,23 +177,4 @@ func check_for_reactions() -> void: recalculate_temperature() update_solutions() inventory_changed.emit(inventory.values()) - GuiSignalBus.push("Произошла реакция") - if len(find_odor()) > 0: - GuiSignalBus.push("Появился запах") - -#func find_gases() -> Array[RuntimeSubstanceData]: -# for key in inventory: -# if inventory[key].substance in [preload("H")] - -func find_odor() -> Array[RuntimeSubstanceData]: - var result = [] - for key in inventory: - if inventory[key].substance in [preload("res://assets/substances/CH3COOH.tres")]: - result.push_back(inventory[key]) - return result - -func get_text() -> String: - var result = "" - for key in inventory: - result += key + "+" - return result.left(len(result)-1) + GuiSignalBus.push("Произошла реакция: " + found_reaction.formula()) diff --git a/src/lab_runtime.gd b/src/lab_runtime.gd index 74c71bb..ceaa539 100644 --- a/src/lab_runtime.gd +++ b/src/lab_runtime.gd @@ -6,13 +6,6 @@ const MENU_PREFAB: PackedScene = preload("uid://c2ciwyjf7au6l") var current_lab: Labwork var anwsers: Array[int] var correctness: Array[bool] -var tries: int - -func questions_anwsered() -> bool: - return float(correctness.count(true))/len(correctness) >= 0.6 - -func test_failed() -> bool: - return float(correctness.count(true))/len(correctness) < 0.6 func save(): var path: String = OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP) + "/" + current_lab.lab_name + "-" + Time.get_datetime_string_from_system() + ".txt" @@ -33,8 +26,6 @@ func save(): else: file.store_string(("+" if correctness[i] else "-").lpad(10)) file.store_line("") - file.store_line("Попыток: " + str(tries)) - file.store_line("") file.store_line("Ход работы:") file.store_string(LabLogger.instance.text) diff --git a/src/substance_display.gd b/src/substance_display.gd index 5ef296f..81dc92c 100644 --- a/src/substance_display.gd +++ b/src/substance_display.gd @@ -1,4 +1,3 @@ -@tool extends MeshInstance3D enum DisplayType{ @@ -7,53 +6,8 @@ enum DisplayType{ } @export var display_type: DisplayType -@export_tool_button("Wiggle") var wiggle = func() -> void: - var tween = create_tween() - material_override.set_shader_parameter("wave_intensity",1.) - tween.tween_property(material_override,"shader_parameter/wave_intensity",0.0,2.0) -func update_fluid_material(substances: Array[RuntimeSubstanceData]) -> void: - var mat: ShaderMaterial = material_override - if len(substances) == 0: - visible = false - return - else: - visible = true - - var total_weight = 0 - var total_color = 0 - - for sub in substances: - total_weight += sub.amount - total_color += sub.substance.color_influence - - var pH: float = 0 - var color: Color = Color(0,0,0,0) - - for sub: RuntimeSubstanceData in substances: - var weight: float = sub.amount/total_weight - pH += sub.substance.get_ph_runtime(substances) * weight - - for sub: RuntimeSubstanceData in substances: - var color_to_add: Color - if sub.substance.pHColor != null: - color_to_add = sub.substance.pHColor.sample(pH/14.0) - else: - color_to_add = sub.substance.color - - if display_type == DisplayType.Fluid and sub.is_solution: - color_to_add.a = 0.5 - - #if color == Color(0,0,0,0): - # color = color_to_add - #else: - # color = color.lerp(color_to_add,sub.substance.color_influence) - color += color_to_add * sub.substance.color_influence - - - mat.set_shader_parameter("albedo_color", color / total_color) - -func update_solid_material(substances: Array[RuntimeSubstanceData]) -> void: +func update_material(substances: Array[RuntimeSubstanceData]) -> void: var mat: StandardMaterial3D = material_override if len(substances) == 0: visible = false @@ -98,10 +52,10 @@ func update_material_unfiltered(substances: Array[RuntimeSubstanceData]): match display_type: DisplayType.Fluid: var fluids = substances.filter(filter_liquids) - update_fluid_material(fluids) + update_material(fluids) DisplayType.Solid: var solids = substances.filter(filter_solids) - update_solid_material(solids) + update_material(solids) func filter_liquids(sub: RuntimeSubstanceData): return sub.substance.melting_point < sub.temperature or sub.is_solution func filter_solids(sub: RuntimeSubstanceData): return sub.substance.melting_point > sub.temperature and not sub.is_solution diff --git a/src/substance_holder.gd b/src/substance_holder.gd index cbf539b..131ebf9 100644 --- a/src/substance_holder.gd +++ b/src/substance_holder.gd @@ -15,4 +15,3 @@ func _ready() -> void: if substance.is_solution: jar_fill_material.albedo_color.a = 0.5 get_parent().add_to_group("fluid_source") - get_parent().display_text = substance.scientific_name diff --git a/src/ui/lab_tabs.gd b/src/ui/lab_tabs.gd index d21ab8c..da3154b 100644 --- a/src/ui/lab_tabs.gd +++ b/src/ui/lab_tabs.gd @@ -5,23 +5,12 @@ func _ready() -> void: $ConfirmationDialog.confirmed.connect(LabRuntime.end_lab) func _on_tab_clicked(tab: int) -> void: - if tab == 1: - $Questions.visible = true - elif LabRuntime.questions_anwsered(): - match tab: - 0: - $Worktabs.visible = true - 2: - $ConfirmationDialog.popup_centered() - 3: - GuiSignalBus.clear_table.emit() - -func _process(_delta: float) -> void: - var anwsered = LabRuntime.test_failed() - set_tab_disabled(0,anwsered) - set_tab_disabled(2,anwsered) - set_tab_disabled(3,anwsered) - - -func _on_worktabs_close_requested() -> void: - $Worktabs.visible = false + match tab: + 0: + $Worktabs.visible = true + 1: + $Questions.visible = true + 2: + $ConfirmationDialog.popup_centered() + 3: + GuiSignalBus.clear_table.emit() diff --git a/src/ui/questions_generator.gd b/src/ui/questions_generator.gd index 5f20472..65049a8 100644 --- a/src/ui/questions_generator.gd +++ b/src/ui/questions_generator.gd @@ -3,13 +3,7 @@ extends Control var current: int = -1 func _ready() -> void: - shuffle_questions() - -func shuffle_questions() -> void: - var questions = LabRuntime.current_lab.tests.duplicate() - questions.shuffle() - questions.resize(5) - for question in questions: + for question in LabRuntime.current_lab.tests: var options = question.options.duplicate() options.shuffle() var vbox = VBoxContainer.new() @@ -26,6 +20,7 @@ func shuffle_questions() -> void: add_child(vbox) next() + func _on_close_button_pressed() -> void: get_parent().visible = false @@ -35,10 +30,9 @@ func next() -> void: current += 1 get_child(current).visible = true else: - visible = false - $"../Result".visible = true - LabRuntime.tries += 1 + get_parent().visible = false func anwser(option_number: int,correctness: bool): LabRuntime.anwsers.append(option_number) - LabRuntime.correctness.append(correctness) + LabRuntime.correctness.append(correctness) + diff --git a/ui/questions_result.gd b/ui/questions_result.gd deleted file mode 100644 index 68e27a0..0000000 --- a/ui/questions_result.gd +++ /dev/null @@ -1,14 +0,0 @@ -extends Control - - -func _process(delta: float) -> void: - $Label.text = str(LabRuntime.correctness.count(true))+"/5 Верно\n"+str(LabRuntime.tries)+" попыток" - $TryAgain.visible = LabRuntime.test_failed() - - -func _on_try_again_pressed() -> void: - $"../Questions".shuffle_questions() - $"../Questions".visible = true - visible = false - LabRuntime.anwsers.clear() - LabRuntime.correctness.clear() diff --git a/ui/questions_result.gd.uid b/ui/questions_result.gd.uid deleted file mode 100644 index 55026d6..0000000 --- a/ui/questions_result.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ckhrj43lyvorv diff --git a/ui/tab_bar.tscn b/ui/tab_bar.tscn index 1eec75c..2d3f7a1 100644 --- a/ui/tab_bar.tscn +++ b/ui/tab_bar.tscn @@ -16,6 +16,11 @@ tab_2/title = "Отчёт" tab_3/title = "Очистить" script = ExtResource("1_ieq68") +[node name="Worktabs" parent="." unique_id=666307058 instance=ExtResource("2_hyo0h")] +visible = false +top_level = true +layout_mode = 1 + [node name="Questions" parent="." unique_id=2060279649 instance=ExtResource("3_lhsfi")] visible = false top_level = true @@ -28,14 +33,4 @@ ok_button_text = "Составить отчёт" dialog_text = "Вы уверены, что хотите закончить лабораторную работу и составить отчёт? Отчёт будет отправлен на ваш рабочий стол" cancel_button_text = "Отменить" -[node name="Worktabs" type="Window" parent="." unique_id=1368905224] -oversampling_override = 1.0 -position = Vector2i(0, 36) -size = Vector2i(768, 512) -visible = false - -[node name="Worktabs" parent="Worktabs" unique_id=666307058 instance=ExtResource("2_hyo0h")] -top_level = true - [connection signal="tab_clicked" from="." to="." method="_on_tab_clicked"] -[connection signal="close_requested" from="Worktabs" to="." method="_on_worktabs_close_requested"] diff --git a/ui/tooltip.gd b/ui/tooltip.gd deleted file mode 100644 index 149af6e..0000000 --- a/ui/tooltip.gd +++ /dev/null @@ -1,12 +0,0 @@ -extends Control - -func _process(delta: float) -> void: - global_position = get_global_mouse_position() - -func set_text(text: String): - $Label.text = text - visible = true - -func clear(): - $Label.text = "" - visible = false diff --git a/ui/tooltip.gd.uid b/ui/tooltip.gd.uid deleted file mode 100644 index d3dd636..0000000 --- a/ui/tooltip.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bu3exvpul8jhk diff --git a/ui/tooltip.tscn b/ui/tooltip.tscn deleted file mode 100644 index eac1947..0000000 --- a/ui/tooltip.tscn +++ /dev/null @@ -1,15 +0,0 @@ -[gd_scene format=3 uid="uid://dtpy85f2ycbur"] - -[ext_resource type="Script" uid="uid://bu3exvpul8jhk" path="res://ui/tooltip.gd" id="1_np3dp"] - -[node name="Tooltip" type="PanelContainer" unique_id=246590363] -visible = false -offset_right = 1.0 -offset_bottom = 23.0 -size_flags_horizontal = 0 -size_flags_vertical = 0 -script = ExtResource("1_np3dp") - -[node name="Label" type="Label" parent="." unique_id=1174493236] -layout_mode = 2 -size_flags_horizontal = 0