Доработка. Добавлено отображение состояния "на связи" для внешних подключений
This commit is contained in:
@@ -69,17 +69,22 @@ func _ready():
|
||||
pribor_node.set_button_group(group)
|
||||
pribor_node.connect('button_down', Callable(self, 'on_pribor_press').bind(pribor_path, header_text, pribor_node))
|
||||
var conn_node = pribor_node.get_node('connect_pribor')
|
||||
var pribor_meta = pribor_node.get_meta('unit_name', [])
|
||||
var unit_names = pribor_node.get_meta('unit_name', [])
|
||||
var pribor_proc = pribor_node.get_meta('online_proc', '')
|
||||
if pribor_proc == '':
|
||||
continue
|
||||
if pribor_meta.size():
|
||||
for i in pribor_meta.size():
|
||||
var unit_pribor = network.get_unit_instance(pribor_meta[i])
|
||||
unit_pribor.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, pribor_meta))
|
||||
for unit_name in null_units_names:
|
||||
var unit_instance = network.get_unit_instance(unit_name)
|
||||
unit_instance.connect('line_changed', on_line_changed)
|
||||
if not unit_names.size():
|
||||
continue
|
||||
for i in unit_names.size():
|
||||
var unit_instance: = network.get_unit_instance(unit_names[i])
|
||||
unit_instance.connect('line_changed', Callable(self, pribor_proc).bind(conn_node, unit_names))
|
||||
# Пиктограммы приборов, которые отображают состояние подключения только
|
||||
for pribor_node in get_tree().get_nodes_in_group('pribor_pics'):
|
||||
var unit_name = pribor_node.get_meta('unit_name')
|
||||
var unit_instance: = network.get_unit_instance(unit_name)
|
||||
var conn_node: = pribor_node.get_node('connect_pribor')
|
||||
unit_instance.connect('line_changed', on_line_changed.bind(conn_node))
|
||||
|
||||
signaller.conn(signaller.режим_работа, on_mode_changed)
|
||||
signaller.conn(signaller.режим_журнал, on_mode_changed)
|
||||
signaller.conn(signaller.режим_настройки, on_mode_changed)
|
||||
@@ -145,7 +150,7 @@ grow_vertical = 2
|
||||
script = SubResource("GDScript_iqgf5")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="capsrpb" type="TextureRect" parent="."]
|
||||
[node name="capsrpb" type="TextureRect" parent="." groups=["pribor_pics"]]
|
||||
editor_description = "Кнопка для отображения внешних соединений."
|
||||
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
|
||||
layout_mode = 0
|
||||
@@ -159,6 +164,7 @@ size_flags_vertical = 15
|
||||
texture = ExtResource("2_oysma")
|
||||
script = ExtResource("2_8r80x")
|
||||
unit_name = &"уарэп-капсрпб"
|
||||
metadata/unit_name = &"уарэп-капсрпб"
|
||||
|
||||
[node name="label" type="Label" parent="capsrpb"]
|
||||
layout_mode = 0
|
||||
@@ -178,7 +184,7 @@ scale = Vector2(2.6, 2.6)
|
||||
sprite_frames = SubResource("SpriteFrames_foasq")
|
||||
script = ExtResource("11_u7tym")
|
||||
|
||||
[node name="5p28" type="TextureRect" parent="."]
|
||||
[node name="5p28" type="TextureRect" parent="." groups=["pribor_pics"]]
|
||||
editor_description = "Кнопка для отображения внешних соединений."
|
||||
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
|
||||
layout_mode = 0
|
||||
@@ -192,6 +198,7 @@ size_flags_vertical = 15
|
||||
texture = ExtResource("2_oysma")
|
||||
script = ExtResource("2_8r80x")
|
||||
unit_name = &"уарэп-5п28"
|
||||
metadata/unit_name = &"уарэп-5п28"
|
||||
|
||||
[node name="label" type="Label" parent="5p28"]
|
||||
layout_mode = 0
|
||||
@@ -212,7 +219,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
|
||||
frame_progress = 0.72355
|
||||
script = ExtResource("11_u7tym")
|
||||
|
||||
[node name="akng" type="TextureRect" parent="."]
|
||||
[node name="akng" type="TextureRect" parent="." groups=["pribor_pics"]]
|
||||
editor_description = "Кнопка для отображения внешних соединений."
|
||||
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
|
||||
layout_mode = 0
|
||||
@@ -226,6 +233,7 @@ size_flags_vertical = 15
|
||||
texture = ExtResource("2_oysma")
|
||||
script = ExtResource("2_8r80x")
|
||||
unit_name = &"навигация"
|
||||
metadata/unit_name = &"навигация"
|
||||
|
||||
[node name="label" type="Label" parent="akng"]
|
||||
layout_mode = 0
|
||||
@@ -246,7 +254,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
|
||||
frame_progress = 0.72355
|
||||
script = ExtResource("11_u7tym")
|
||||
|
||||
[node name="maps" type="TextureRect" parent="."]
|
||||
[node name="maps" type="TextureRect" parent="." groups=["pribor_pics"]]
|
||||
editor_description = "Кнопка для отображения внешних соединений."
|
||||
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
|
||||
layout_mode = 0
|
||||
@@ -260,6 +268,7 @@ size_flags_vertical = 15
|
||||
texture = ExtResource("2_oysma")
|
||||
script = ExtResource("2_8r80x")
|
||||
unit_name = &"уарэп-карта"
|
||||
metadata/unit_name = &"уарэп-карта"
|
||||
|
||||
[node name="label" type="Label" parent="maps"]
|
||||
layout_mode = 0
|
||||
@@ -280,7 +289,7 @@ sprite_frames = SubResource("SpriteFrames_foasq")
|
||||
frame_progress = 0.72355
|
||||
script = ExtResource("11_u7tym")
|
||||
|
||||
[node name="trassa" type="TextureRect" parent="."]
|
||||
[node name="trassa" type="TextureRect" parent="." groups=["pribor_pics"]]
|
||||
editor_description = "Кнопка для отображения внешних соединений."
|
||||
self_modulate = Color(0.788235, 0.788235, 0.788235, 1)
|
||||
layout_mode = 0
|
||||
@@ -294,6 +303,7 @@ size_flags_vertical = 15
|
||||
texture = ExtResource("2_oysma")
|
||||
script = ExtResource("2_8r80x")
|
||||
unit_name = &"уарэп-трасса"
|
||||
metadata/unit_name = &"уарэп-трасса"
|
||||
|
||||
[node name="label" type="Label" parent="trassa"]
|
||||
layout_mode = 0
|
||||
|
||||
Reference in New Issue
Block a user