From 1cee5e0ace70982f5307cb5d1b6071859726e40c Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Mon, 22 Apr 2024 10:48:07 +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=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=D0=B2?= =?UTF-8?q?=D0=BD=D0=B5=D1=88=D0=BD=D0=B5=D0=B3=D0=BE=20=D1=86=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D1=83=D0=BA=D0=B0=D0=B7=D0=B0=D0=BD=D0=B8=D1=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.godot | 2 ++ scenes/настройки/настройки.gd | 6 ++++++ scenes/настройки/настройки.tscn | 17 +++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/project.godot b/project.godot index eeac9e4f..76bbd1e6 100644 --- a/project.godot +++ b/project.godot @@ -38,6 +38,7 @@ config/mod_bus_interpreter="python" config/mod_bus_serial_baud="9600" config/mod_bus_serial_port="/dev/pts/3" interfer/resend_timeout=1000.0 +config/external_cu=false [autoload] @@ -94,6 +95,7 @@ enabled=PackedStringArray() map_server_addr=false center_offset=Vector2(0, 0) +external_cu=false [gui] diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index a510901f..1df773bb 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -8,3 +8,9 @@ func _ready() -> void: for node in $GridContainer.get_children().filter(func(b): return b is Button): node.disabled = true + +func _on_external_cu_btn_pressed() -> void: + var state = $GridContainer2/external_cu_btn.button_pressed + ProjectSettings.set_setting('application/config/external_cu', state) + if state: + signaller.emit_signal('interfer_off_all') diff --git a/scenes/настройки/настройки.tscn b/scenes/настройки/настройки.tscn index 6293a8c8..2f966577 100644 --- a/scenes/настройки/настройки.tscn +++ b/scenes/настройки/настройки.tscn @@ -267,4 +267,21 @@ text = "Адрес сервера карт" horizontal_alignment = 1 vertical_alignment = 1 +[node name="GridContainer2" type="GridContainer" parent="."] +layout_mode = 0 +offset_left = 900.0 +offset_top = 87.0 +offset_right = 1192.0 +offset_bottom = 193.0 +columns = 2 + +[node name="external_cu_lbl" type="Label" parent="GridContainer2"] +layout_mode = 2 +text = "Внешнее целеуказание" +vertical_alignment = 1 + +[node name="external_cu_btn" type="CheckButton" parent="GridContainer2"] +layout_mode = 2 + [connection signal="text_changed" from="edt_mapaddr" to="edt_mapaddr" method="_on_text_changed"] +[connection signal="pressed" from="GridContainer2/external_cu_btn" to="." method="_on_external_cu_btn_pressed"]