From 5f2f8bc7346c0fec6bb894bd732d9d21235ca293 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Tue, 25 Mar 2025 16:40:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=A0=D0=B5=D0=B6=D0=B8=D0=BC=20=D0=9A=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8C.=20=D0=9A=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BC=D0=BD=D0=B5=D0=BC=D0=BE=D1=81=D1=85=D0=B5=D0=BC=D1=8B=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B1=D0=BE=D1=80=D0=B0=20=D0=B7=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=91=D0=BD=20=D0=BD=D0=B0=20=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=BF=D0=BF=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/контроль/контроль.gd | 15 ++++++--------- scenes/контроль/контроль.tscn | 34 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/scenes/контроль/контроль.gd b/scenes/контроль/контроль.gd index 50548b3..6a9d815 100644 --- a/scenes/контроль/контроль.gd +++ b/scenes/контроль/контроль.gd @@ -39,7 +39,10 @@ func _ready(): func on_pribor_press(pribor_path, header_text, pribor_node): - clear_obj($mnemo_container) + var items = get_tree().get_nodes_in_group('pribor_items') + for item in items: + remove_child(item) + item.queue_free() var pribor_obj = load(pribor_path) if not pribor_obj: push_error('не загружено: \"%s\" (%s)' % [pribor_path, header_text]) @@ -53,11 +56,5 @@ func on_pribor_press(pribor_path, header_text, pribor_node): if meta_list.find('unit_name') > -1: var unit_name = pribor_node.get_meta('unit_name') pribor.set_meta('unit_name', unit_name) - $mnemo_container.add_child(pribor) - - -func clear_obj(obj: Object): - var items = obj.get_children() - for item in items: - obj.remove_child(item) - item.queue_free() + pribor.add_to_group('pribor_items') + add_child(pribor) diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index d7b9672..c2a781c 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -21,7 +21,7 @@ grow_vertical = 2 script = ExtResource("1_x5d6w") metadata/_edit_lock_ = true -[node name="pribor_uf" type="TextureButton" parent="."] +[node name="pribor_uf" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1194.0 @@ -62,7 +62,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_rtr" type="TextureButton" parent="."] +[node name="pribor_rtr" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1197.0 @@ -102,7 +102,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_afsp_l" type="TextureButton" parent="."] +[node name="pribor_afsp_l" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 996.0 @@ -146,7 +146,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_afsp_r" type="TextureButton" parent="."] +[node name="pribor_afsp_r" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1342.0 @@ -190,7 +190,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_uyep" type="TextureButton" parent="."] +[node name="pribor_uyep" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1194.0 @@ -231,7 +231,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_v_2" type="TextureButton" parent="."] +[node name="pribor_prd_v_2" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 960.0 @@ -272,7 +272,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_n_2" type="TextureButton" parent="."] +[node name="pribor_prd_n_2" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 960.0 @@ -315,7 +315,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_k_2" type="TextureButton" parent="."] +[node name="pribor_prd_k_2" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1077.0 @@ -356,7 +356,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_v_3" type="TextureButton" parent="."] +[node name="pribor_prd_v_3" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1344.0 @@ -399,7 +399,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_n_3" type="TextureButton" parent="."] +[node name="pribor_prd_n_3" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1458.0 @@ -441,7 +441,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_k_3" type="TextureButton" parent="."] +[node name="pribor_prd_k_3" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1343.0 @@ -484,7 +484,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_v_1" type="TextureButton" parent="."] +[node name="pribor_prd_v_1" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1457.0 @@ -526,7 +526,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_n_1" type="TextureButton" parent="."] +[node name="pribor_prd_n_1" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1455.0 @@ -568,7 +568,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_k_1" type="TextureButton" parent="."] +[node name="pribor_prd_k_1" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1344.0 @@ -610,7 +610,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_v_4" type="TextureButton" parent="."] +[node name="pribor_prd_v_4" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1077.0 @@ -652,7 +652,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_n_4" type="TextureButton" parent="."] +[node name="pribor_prd_n_4" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 961.0 @@ -693,7 +693,7 @@ patch_margin_top = 16 patch_margin_right = 16 patch_margin_bottom = 16 -[node name="pribor_prd_k_4" type="TextureButton" parent="."] +[node name="pribor_prd_k_4" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 offset_left = 1077.0