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"]