diff --git a/scenes/контроль/внешний.gd b/scenes/контроль/внешний.gd new file mode 100644 index 00000000..0596fd29 --- /dev/null +++ b/scenes/контроль/внешний.gd @@ -0,0 +1,12 @@ +extends TextureRect + +@export var unit_name: StringName = '' + + +func _ready() -> void: + var unit_instance = network.get_unit_instance(unit_name) + unit_instance.connect('line_changed', on_line_changed) + + +func on_line_changed(unit_instance: unit.Unit): + $connect_pribor.set_val(unit_instance.online) diff --git a/scenes/контроль/внешний.gd.uid b/scenes/контроль/внешний.gd.uid new file mode 100644 index 00000000..dff0cace --- /dev/null +++ b/scenes/контроль/внешний.gd.uid @@ -0,0 +1 @@ +uid://q3gmpsqspjfp diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index 18cbb08a..b62b8584 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=17 format=3 uid="uid://lwmw4egynmd1"] +[gd_scene load_steps=18 format=3 uid="uid://lwmw4egynmd1"] [ext_resource type="Texture2D" uid="uid://bar8k5qef7kch" path="res://data/УФ.png" id="2_0nvm1"] +[ext_resource type="Script" uid="uid://q3gmpsqspjfp" path="res://scenes/контроль/внешний.gd" id="2_8r80x"] [ext_resource type="Texture2D" uid="uid://bb80aigvv648i" path="res://data/кнопка-внешние-0.png" id="2_oysma"] [ext_resource type="Script" uid="uid://bj4nndrurbunl" path="res://scenes/контроль/кнопка-прибора.gd" id="3_4pt7j"] [ext_resource type="Texture2D" uid="uid://dkqlvd750pplc" path="res://data/СПТ.png" id="3_hhadv"] @@ -125,14 +126,16 @@ metadata/_edit_lock_ = true editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 -offset_left = 941.0 +offset_left = 959.0 offset_top = 1021.0 -offset_right = 1197.0 +offset_right = 1215.0 offset_bottom = 1277.0 scale = Vector2(0.25, 0.25) size_flags_horizontal = 15 size_flags_vertical = 15 texture = ExtResource("2_oysma") +script = ExtResource("2_8r80x") +unit_name = &"уарэп-капсрпб" [node name="label" type="Label" parent="capsrpb"] layout_mode = 0 @@ -150,21 +153,22 @@ light_mask = 3 position = Vector2(56, -4) scale = Vector2(2.6, 2.6) sprite_frames = SubResource("SpriteFrames_foasq") -frame_progress = 0.72355 script = ExtResource("11_u7tym") [node name="5p28" type="TextureRect" parent="."] editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 -offset_left = 1123.0 +offset_left = 1088.0 offset_top = 1021.0 -offset_right = 1379.0 +offset_right = 1344.0 offset_bottom = 1277.0 scale = Vector2(0.25, 0.25) size_flags_horizontal = 15 size_flags_vertical = 15 texture = ExtResource("2_oysma") +script = ExtResource("2_8r80x") +unit_name = &"уарэп-5п28" [node name="label" type="Label" parent="5p28"] layout_mode = 0 @@ -189,14 +193,16 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 -offset_left = 1299.0 +offset_left = 1216.0 offset_top = 1021.0 -offset_right = 1555.0 +offset_right = 1472.0 offset_bottom = 1277.0 scale = Vector2(0.25, 0.25) size_flags_horizontal = 15 size_flags_vertical = 15 texture = ExtResource("2_oysma") +script = ExtResource("2_8r80x") +unit_name = &"навигация" [node name="label" type="Label" parent="akng"] layout_mode = 0 @@ -221,14 +227,16 @@ script = ExtResource("11_u7tym") editor_description = "Кнопка для отображения внешних соединений." self_modulate = Color(0.788235, 0.788235, 0.788235, 1) layout_mode = 0 -offset_left = 1458.0 +offset_left = 1344.0 offset_top = 1021.0 -offset_right = 1714.0 +offset_right = 1600.0 offset_bottom = 1277.0 scale = Vector2(0.25, 0.25) size_flags_horizontal = 15 size_flags_vertical = 15 texture = ExtResource("2_oysma") +script = ExtResource("2_8r80x") +unit_name = &"навигация" [node name="label" type="Label" parent="maps"] layout_mode = 0 @@ -249,6 +257,40 @@ sprite_frames = SubResource("SpriteFrames_foasq") frame_progress = 0.72355 script = ExtResource("11_u7tym") +[node name="trassa" type="TextureRect" parent="."] +editor_description = "Кнопка для отображения внешних соединений." +self_modulate = Color(0.788235, 0.788235, 0.788235, 1) +layout_mode = 0 +offset_left = 1472.0 +offset_top = 1021.0 +offset_right = 1728.0 +offset_bottom = 1277.0 +scale = Vector2(0.25, 0.25) +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture = ExtResource("2_oysma") +script = ExtResource("2_8r80x") +unit_name = &"уарэп-трасса" + +[node name="label" type="Label" parent="trassa"] +layout_mode = 0 +offset_left = 4.0 +offset_top = -128.0 +offset_right = 53.0 +offset_bottom = -109.0 +scale = Vector2(4, 4) +text = "Трасса" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="connect_pribor" type="AnimatedSprite2D" parent="trassa"] +light_mask = 3 +position = Vector2(47.9999, -4) +scale = Vector2(2.6, 2.6) +sprite_frames = SubResource("SpriteFrames_foasq") +frame_progress = 0.72355 +script = ExtResource("11_u7tym") + [node name="pribor_uf" type="TextureButton" parent="." groups=["pribor_buttons"]] editor_description = "Кнопка для выбора прибора." layout_mode = 0 @@ -1266,7 +1308,7 @@ text = "На связи" metadata/_edit_use_anchors_ = true [node name="line0" type="Line2D" parent="."] -position = Vector2(936, 936) +position = Vector2(936, 950) points = PackedVector2Array(-8, 0, 608, 0) width = 2.0 default_color = Color(1, 1, 1, 0.352941)