Доработка. Режим Контроль. Контейнер для мнемосхемы прибора заменён на группу

This commit is contained in:
sasha80
2025-03-25 16:40:09 +03:00
parent bcfb3bea86
commit 5f2f8bc734
2 changed files with 23 additions and 26 deletions

View File

@@ -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)

View File

@@ -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