From e261ada3cdc75e37aff0eca75fa7ff8f1fc744cf Mon Sep 17 00:00:00 2001 From: sasha80 Date: Thu, 15 Jan 2026 12:59:39 +0300 Subject: [PATCH 1/9] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f2eb032..e577d935 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ # Сборка исполняемого файла из консоли -- Запустить скрипт `build.sh` +- Запустить скрипт [`build.sh`](build.sh) # Взаимодействие с 5П-28 From d2f4c8017c1968cc35d8e9b80b5511f10c7cef2e Mon Sep 17 00:00:00 2001 From: sasha80 Date: Thu, 15 Jan 2026 13:01:59 +0300 Subject: [PATCH 2/9] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e577d935..1ae13f24 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Разработка -- После клонирования запустить скрипт `git-hooks-config.sh` - - В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash` -- При необходимости обновить `settings.json` +- После клонирования запустить скрипт [`git-hooks-config.sh`](git-hooks-config.sh) + - В среде **Windows** запуск скрипта [`git-hooks-config.sh`](git-hooks-config.sh) производить из оболочки `git bash` +- При необходимости обновить [`settings.json`](settings.json) - Использовать выражения вида `ProjectSettings.set_setting('application/config/%s' % key_name` и `ProjectSettings.get_setting('application/config/%s % key_name)` для доступа к настройкам. - `key_name` брать из таблицы `res://scenes/настройки/настройки.gd/SETTING_TABLE` From 8fccaa0e66c5ac78352697056ff5f7071674350e Mon Sep 17 00:00:00 2001 From: lepshiy Date: Fri, 16 Jan 2026 11:49:47 +0300 Subject: [PATCH 3/9] =?UTF-8?q?=D0=94=D0=B8=D0=BD=D0=B0=D0=BC=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=86=D0=B2=D0=B5=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D1=82?= =?UTF-8?q?=D1=91=D0=BC=D0=BD=D0=BE=D0=B5/=D1=81=D0=B2=D0=B5=D1=82=D0=BB?= =?UTF-8?q?=D0=BE=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/tabs-switch/tab-switch.gd | 18 +++++++++++++++-- scenes/tabs-switch/tab-switch.tscn | 19 ++++-------------- scenes/настройки/настройки.gd | 31 ++++++++++++++++++++++++------ scenes/работа/работа.gd | 12 ++++++++++++ table/editl.gd | 17 ++++++++++++++++ table/editl.gd.uid | 1 + table/editl.tscn | 5 ++++- table/lable.gd | 16 +++++++++++++++ table/lable.gd.uid | 1 + table/lable.tscn | 5 ++++- table/node.gd | 16 +++++++++++++++ table/node.gd.uid | 1 + table/node.tscn | 5 ++++- table/set-toggle.tscn | 8 +++++++- table/set_toggle.gd | 16 +++++++++++++++ table/set_toggle.gd.uid | 1 + table/settings-toggle.tscn | 9 ++++----- table/settings_toggle.gd | 16 +++++++++++++++ table/settings_toggle.gd.uid | 1 + table/ячейка-2.tscn | 5 ++++- table/ячейка-цвет.tscn | 5 ++++- table/ячейка_2.gd | 24 +++++++++++++++++++++++ table/ячейка_2.gd.uid | 1 + table/ячейка_цвет.gd | 16 +++++++++++++++ table/ячейка_цвет.gd.uid | 1 + 25 files changed, 216 insertions(+), 34 deletions(-) create mode 100644 table/editl.gd create mode 100644 table/editl.gd.uid create mode 100644 table/lable.gd create mode 100644 table/lable.gd.uid create mode 100644 table/node.gd create mode 100644 table/node.gd.uid create mode 100644 table/set_toggle.gd create mode 100644 table/set_toggle.gd.uid create mode 100644 table/settings_toggle.gd create mode 100644 table/settings_toggle.gd.uid create mode 100644 table/ячейка_2.gd create mode 100644 table/ячейка_2.gd.uid create mode 100644 table/ячейка_цвет.gd create mode 100644 table/ячейка_цвет.gd.uid diff --git a/scenes/tabs-switch/tab-switch.gd b/scenes/tabs-switch/tab-switch.gd index 6e510749..fe4660f8 100644 --- a/scenes/tabs-switch/tab-switch.gd +++ b/scenes/tabs-switch/tab-switch.gd @@ -7,7 +7,7 @@ const TAB_TOSIGNAL_NAME = { 3: 'режим_эмс', 4: 'режим_эмс2', 5: 'режим_настройки' } - + func on_ems2_hide_pressed(state): set_tab_hidden(4, state) func _on_tab_changed(tab) -> void: signaller.emit_signal(TAB_TOSIGNAL_NAME[tab]) @@ -22,4 +22,18 @@ func _enter_tree() -> void: func on_setting_changed(): var ext_cu = ProjectSettings.get_setting('application/config/Внешнее управление', false) - get_parent().get_node('remote_control').visible = ext_cu + get_parent().get_node('remote_control').visible = ext_cu + apply_colors() + + +func apply_colors(): + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = StyleBoxFlat.new() + if is_light: + style.bg_color = Color.GRAY + add_theme_stylebox_override("tabbar_background", style) + add_theme_stylebox_override("panel", style) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("tabbar_background", style) + add_theme_stylebox_override("panel", style) diff --git a/scenes/tabs-switch/tab-switch.tscn b/scenes/tabs-switch/tab-switch.tscn index 618318ed..c6d5adc6 100644 --- a/scenes/tabs-switch/tab-switch.tscn +++ b/scenes/tabs-switch/tab-switch.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://3slb0i3pvowc"] +[gd_scene load_steps=15 format=3 uid="uid://3slb0i3pvowc"] [ext_resource type="Script" uid="uid://bvo6tcreqyuex" path="res://scenes/tabs-switch/tab-switch.gd" id="1_fg0vd"] [ext_resource type="PackedScene" uid="uid://b276iygic5itk" path="res://scenes/работа/работа.tscn" id="2_u7p16"] @@ -10,15 +10,7 @@ [ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl_ready.gd" id="8_tidwt"] [ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"] -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tidwt"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_41d34"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cw2ss"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nmdfd"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_vap7n"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vap7n"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o1r22"] @@ -33,17 +25,14 @@ bg_color = Color(0, 100, 0, 1) [node name="panel" type="Panel"] offset_right = 1600.0 offset_bottom = 1200.0 -theme_override_styles/panel = SubResource("StyleBoxEmpty_tidwt") [node name="tab_switch" type="TabContainer" parent="."] layout_mode = 0 offset_right = 1600.0 offset_bottom = 1200.0 tooltip_text = "Переключает режимы работы программы" -theme_override_styles/tab_focus = SubResource("StyleBoxEmpty_41d34") -theme_override_styles/tab_disabled = SubResource("StyleBoxEmpty_cw2ss") -theme_override_styles/tabbar_background = SubResource("StyleBoxEmpty_nmdfd") -theme_override_styles/panel = SubResource("StyleBoxEmpty_vap7n") +theme_override_styles/tabbar_background = SubResource("StyleBoxFlat_vap7n") +theme_override_styles/panel = SubResource("StyleBoxFlat_vap7n") current_tab = 0 script = ExtResource("1_fg0vd") diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index 90003c83..a92abf6c 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -65,7 +65,8 @@ const SETTING_TABLE = [ ['Список своих протоколов', TableEdit, TableEdit, 'Список протоколов целей, по которым запрещено работать' ], ['Цвет кнопки \"Подавление\"', TableEdit, TableColorPick, 'Цвет кнопки. Введено по требованию ПЗ' ], ['Цвет фона схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет фона'], - ['Цвет схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет схемы '] ] + ['Цвет схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет схемы '], + ['Цвет темы программы', TableEdit, TableToggle, 'ВЫКЛ - темная тема, ВКЛ - светлая тема']] ## TODO: Придумать как избавиться от индексов @@ -81,6 +82,7 @@ const GOS_BTN = 52 ## Разрешить работу по своим ц const COLOR_BTN_ACT = 54 ## Цвет кнопки "Подавление" const COLOR_WHITE = 55 ## Цвет фона схемы const COLOR_BLACK = 56 ## Цвет схемы +const COLOR_THEME = 57 ## Цвет темы var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки @@ -205,6 +207,7 @@ func setting_tab(): if edit_node: if edit_node is LineEdit: $scroll_set/table.set_node_control(1, i, true) + edit_node.connect("text_submitted", Callable(self, "_on_line_edit_enter_pressed").bind(i)) $scroll_set/table.set_node_editable(1, COMMIT, false) $scroll_set/table.set_columns_min_size([600, 950]) $scroll_set/table.set_columns_alignments(ALIGNMENT) @@ -266,13 +269,22 @@ func button_settings(): var arr_col_b = JSON.parse_string(json_col_b) color_black.color = Color(arr_col_b[0], arr_col_b[1], arr_col_b[2], arr_col_b[3]) if arr_col_b else Color.WHITE_SMOKE color_black.text = JSON.stringify(arr_col_b) + var theme_node = $scroll_set/table.get_node2(1, COLOR_THEME).get_children()[0] + theme_node.connect("pressed", on_theme_toggle_pressed.bind(theme_node)) + theme_node.set_pressed(false) + on_theme_toggle_pressed(theme_node) -func _update_theme_colors(): - var color_white = $scroll_set/table.get_node2(1, COLOR_WHITE) - var color_black = $scroll_set/table.get_node2(1, COLOR_BLACK) - on_color_closed_w(color_white) - on_color_closed_b(color_black) +func on_theme_toggle_pressed(btn: CheckButton) -> void: + var is_light = btn.button_pressed + ProjectSettings.set_setting("application/config/Цвет темы программы", is_light) + + +#func _update_theme_colors(): + #var color_white = $scroll_set/table.get_node2(1, COLOR_WHITE) + #var color_black = $scroll_set/table.get_node2(1, COLOR_BLACK) + #on_color_closed_w(color_white) + #on_color_closed_b(color_black) func on_color_closed_w(color_white: ColorPickerButton): @@ -338,3 +350,10 @@ func _on_btn_save_settings_pressed(): if file.store_string(json_string): log.info('Настройки сохранены в файл \"%s\"' % abs_path) file.close() + + +func _on_line_edit_enter_pressed(new_text: String, row_index: int) -> void: + var parameter = SETTING_TABLE[row_index][0] + ProjectSettings.set_setting("application/config/%s" % parameter, new_text) + _on_btn_save_settings_pressed() + get_viewport().gui_release_focus() diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 195378f2..8c20f147 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -153,6 +153,18 @@ func on_settings_changed(): var json_col = ProjectSettings.get_setting('application/config/%s' % 'Цвет кнопки \"Подавление\"', '[1.0, 1.0, 1.0, 1.0]') var arr_col = JSON.parse_string(json_col) col_btn_act = Color(arr_col[0], arr_col[1], arr_col[2], arr_col[3]) if arr_col else Color.WHITE + apply_colors() + + +func apply_colors(): + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = StyleBoxFlat.new() + if is_light: + style.bg_color = Color.DARK_GRAY + add_theme_stylebox_override("panel", style) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("panel", style) ## Обработчик сигнала изменения списка целей. diff --git a/table/editl.gd b/table/editl.gd new file mode 100644 index 00000000..5c5a73f4 --- /dev/null +++ b/table/editl.gd @@ -0,0 +1,17 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("read_only").duplicate() + if is_light: + style.bg_color = Color.GRAY + add_theme_color_override("font_color_readonly", Color.BLACK) + add_theme_color_override("font_color_placeholder", Color(0, 0, 0, 0.5)) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_color_override("font_color_readonly", Color("#D8731A")) # тёмно-оранжевый + add_theme_color_override("font_color_placeholder", Color(1, 1, 1, 0.5)) + add_theme_stylebox_override("read_only", style) diff --git a/table/editl.gd.uid b/table/editl.gd.uid new file mode 100644 index 00000000..a2f655c3 --- /dev/null +++ b/table/editl.gd.uid @@ -0,0 +1 @@ +uid://bky7xlpaj21sj diff --git a/table/editl.tscn b/table/editl.tscn index e1d02dc1..44fd2976 100644 --- a/table/editl.tscn +++ b/table/editl.tscn @@ -1,7 +1,10 @@ -[gd_scene format=3 uid="uid://bvbvtgwps54yr"] +[gd_scene load_steps=2 format=3 uid="uid://bvbvtgwps54yr"] + +[ext_resource type="Script" uid="uid://bky7xlpaj21sj" path="res://table/editl.gd" id="1_xd53c"] [node name="Editl" type="LineEdit"] offset_right = 59.875 offset_bottom = 33.0 caret_blink = true caret_blink_interval = 0.5 +script = ExtResource("1_xd53c") diff --git a/table/lable.gd b/table/lable.gd new file mode 100644 index 00000000..a44af78e --- /dev/null +++ b/table/lable.gd @@ -0,0 +1,16 @@ +extends Label + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("normal").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("normal", style) diff --git a/table/lable.gd.uid b/table/lable.gd.uid new file mode 100644 index 00000000..2b9e2c3f --- /dev/null +++ b/table/lable.gd.uid @@ -0,0 +1 @@ +uid://bjw0gwcqxx30d diff --git a/table/lable.tscn b/table/lable.tscn index 63372de7..25c38ded 100644 --- a/table/lable.tscn +++ b/table/lable.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=2 format=3 uid="uid://dwphmxstaxn4v"] +[gd_scene load_steps=3 format=3 uid="uid://dwphmxstaxn4v"] + +[ext_resource type="Script" uid="uid://bjw0gwcqxx30d" path="res://table/lable.gd" id="1_xk0u2"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yign5"] bg_color = Color(0.117647, 0.117647, 0.117647, 0.85098) @@ -14,3 +16,4 @@ offset_right = 104.0 offset_bottom = 27.0 theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1) theme_override_styles/normal = SubResource("StyleBoxFlat_yign5") +script = ExtResource("1_xk0u2") diff --git a/table/node.gd b/table/node.gd new file mode 100644 index 00000000..39546d6d --- /dev/null +++ b/table/node.gd @@ -0,0 +1,16 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("read_only").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("read_only", style) diff --git a/table/node.gd.uid b/table/node.gd.uid new file mode 100644 index 00000000..7df355ca --- /dev/null +++ b/table/node.gd.uid @@ -0,0 +1 @@ +uid://c71233c2tqc2u diff --git a/table/node.tscn b/table/node.tscn index 120347d2..5178856f 100644 --- a/table/node.tscn +++ b/table/node.tscn @@ -1,4 +1,6 @@ -[gd_scene format=3 uid="uid://c1i4rwaajq7d5"] +[gd_scene load_steps=2 format=3 uid="uid://c1i4rwaajq7d5"] + +[ext_resource type="Script" uid="uid://c71233c2tqc2u" path="res://table/node.gd" id="1_oh3pj"] [node name="Label" type="LineEdit"] offset_right = 121.0 @@ -8,3 +10,4 @@ editable = false context_menu_enabled = false caret_blink = true caret_blink_interval = 0.1 +script = ExtResource("1_oh3pj") diff --git a/table/set-toggle.tscn b/table/set-toggle.tscn index 39a32422..df0add17 100644 --- a/table/set-toggle.tscn +++ b/table/set-toggle.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=4 format=3 uid="uid://dgidt8lifm7xe"] +[gd_scene load_steps=6 format=3 uid="uid://dgidt8lifm7xe"] + +[ext_resource type="Script" uid="uid://btvrqnnjjum20" path="res://table/set_toggle.gd" id="1_kvru5"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f4oye"] @@ -7,11 +9,14 @@ [sub_resource type="Theme" id="Theme_odxqp"] CheckButton/styles/focus = SubResource("StyleBoxEmpty_t3fqw") +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_kvru5"] + [node name="LineEdit" type="LineEdit"] offset_right = 85.0 offset_bottom = 27.0 theme_override_styles/focus = SubResource("StyleBoxEmpty_f4oye") editable = false +script = ExtResource("1_kvru5") [node name="CheckButton" type="CheckButton" parent="."] layout_mode = 0 @@ -20,3 +25,4 @@ offset_top = 1.0 offset_right = 65.0 offset_bottom = 25.0 theme = SubResource("Theme_odxqp") +theme_override_styles/focus = SubResource("StyleBoxEmpty_kvru5") diff --git a/table/set_toggle.gd b/table/set_toggle.gd new file mode 100644 index 00000000..39546d6d --- /dev/null +++ b/table/set_toggle.gd @@ -0,0 +1,16 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("read_only").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("read_only", style) diff --git a/table/set_toggle.gd.uid b/table/set_toggle.gd.uid new file mode 100644 index 00000000..35ebd964 --- /dev/null +++ b/table/set_toggle.gd.uid @@ -0,0 +1 @@ +uid://btvrqnnjjum20 diff --git a/table/settings-toggle.tscn b/table/settings-toggle.tscn index b0edb12c..4e6dc4ab 100644 --- a/table/settings-toggle.tscn +++ b/table/settings-toggle.tscn @@ -1,26 +1,25 @@ [gd_scene load_steps=5 format=3 uid="uid://5rw652cmnybi"] +[ext_resource type="Script" uid="uid://bh7mb1aeu1uk6" path="res://table/settings_toggle.gd" id="1_8lkgc"] [ext_resource type="Shader" uid="uid://bw5mmbgeycwua" path="res://shaders/color-invers.gdshader" id="1_anyuq"] -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7hsq1"] - [sub_resource type="ShaderMaterial" id="ShaderMaterial_xxfw6"] shader = ExtResource("1_anyuq") -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_y8485"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8lkgc"] [node name="LineEdit" type="LineEdit"] offset_right = 950.0 offset_bottom = 27.0 theme_override_colors/font_uneditable_color = Color(1, 0.596078, 0.4, 1) theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1) -theme_override_styles/focus = SubResource("StyleBoxEmpty_7hsq1") editable = false context_menu_enabled = false shortcut_keys_enabled = false middle_mouse_paste_enabled = false selecting_enabled = false deselect_on_focus_loss_enabled = false +script = ExtResource("1_8lkgc") [node name="CheckButton" type="CheckButton" parent="."] material = SubResource("ShaderMaterial_xxfw6") @@ -29,4 +28,4 @@ offset_left = 453.0 offset_top = 1.5 offset_right = 497.0 offset_bottom = 25.5 -theme_override_styles/focus = SubResource("StyleBoxEmpty_y8485") +theme_override_styles/focus = SubResource("StyleBoxEmpty_8lkgc") diff --git a/table/settings_toggle.gd b/table/settings_toggle.gd new file mode 100644 index 00000000..39546d6d --- /dev/null +++ b/table/settings_toggle.gd @@ -0,0 +1,16 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("read_only").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("read_only", style) diff --git a/table/settings_toggle.gd.uid b/table/settings_toggle.gd.uid new file mode 100644 index 00000000..729538f3 --- /dev/null +++ b/table/settings_toggle.gd.uid @@ -0,0 +1 @@ +uid://bh7mb1aeu1uk6 diff --git a/table/ячейка-2.tscn b/table/ячейка-2.tscn index 2cbfae74..7a6e04bd 100644 --- a/table/ячейка-2.tscn +++ b/table/ячейка-2.tscn @@ -1,4 +1,6 @@ -[gd_scene load_steps=2 format=3 uid="uid://dspa16ufrpanp"] +[gd_scene load_steps=3 format=3 uid="uid://dspa16ufrpanp"] + +[ext_resource type="Script" uid="uid://dqexdg24cp6rq" path="res://table/ячейка_2.gd" id="1_0fmuf"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mla3y"] @@ -16,3 +18,4 @@ selecting_enabled = false deselect_on_focus_loss_enabled = false caret_blink = true caret_blink_interval = 0.1 +script = ExtResource("1_0fmuf") diff --git a/table/ячейка-цвет.tscn b/table/ячейка-цвет.tscn index e239b982..6f61ad57 100644 --- a/table/ячейка-цвет.tscn +++ b/table/ячейка-цвет.tscn @@ -1,4 +1,6 @@ -[gd_scene format=3 uid="uid://cug5xjbfdm7x7"] +[gd_scene load_steps=2 format=3 uid="uid://cug5xjbfdm7x7"] + +[ext_resource type="Script" uid="uid://b36c83manfems" path="res://table/ячейка_цвет.gd" id="1_ce8lu"] [node name="ячейка-цвет" type="ColorPickerButton"] anchors_preset = 15 @@ -6,3 +8,4 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +script = ExtResource("1_ce8lu") diff --git a/table/ячейка_2.gd b/table/ячейка_2.gd new file mode 100644 index 00000000..ffa9151f --- /dev/null +++ b/table/ячейка_2.gd @@ -0,0 +1,24 @@ +extends LineEdit + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("normal").duplicate() + var style_1 = get_theme_stylebox("read_only").duplicate() + if is_light: + style.bg_color = Color.GRAY + style_1.bg_color = Color.GRAY + add_theme_color_override("font_color", Color.BLACK) + add_theme_color_override("font_uneditable_color", Color.BLACK) + else: + style.bg_color = Color(0.12, 0.12, 0.12) + style_1.bg_color = Color(0.12, 0.12, 0.12) + add_theme_color_override("font_color", Color(1.0, 0.596, 0.4)) + add_theme_color_override("font_uneditable_color", Color(1.0, 0.596, 0.4)) + add_theme_stylebox_override("normal", style) + add_theme_stylebox_override("read_only", style_1) diff --git a/table/ячейка_2.gd.uid b/table/ячейка_2.gd.uid new file mode 100644 index 00000000..4917e9d0 --- /dev/null +++ b/table/ячейка_2.gd.uid @@ -0,0 +1 @@ +uid://dqexdg24cp6rq diff --git a/table/ячейка_цвет.gd b/table/ячейка_цвет.gd new file mode 100644 index 00000000..ba8ffa61 --- /dev/null +++ b/table/ячейка_цвет.gd @@ -0,0 +1,16 @@ +extends ColorPickerButton + +func _ready(): + _update_background() + +func _process(_delta): + _update_background() + +func _update_background() -> void: + var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) + var style = get_theme_stylebox("normal").duplicate() + if is_light: + style.bg_color = Color.GRAY + else: + style.bg_color = Color(0.12, 0.12, 0.12) + add_theme_stylebox_override("normal", style) diff --git a/table/ячейка_цвет.gd.uid b/table/ячейка_цвет.gd.uid new file mode 100644 index 00000000..31e07acc --- /dev/null +++ b/table/ячейка_цвет.gd.uid @@ -0,0 +1 @@ +uid://b36c83manfems From 216c5f19609c7386dd879f58b8b8167b3dd9b1d3 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 19 Jan 2026 09:18:36 +0300 Subject: [PATCH 4/9] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80.=20=D0=91=D0=BE=D0=BB=D1=8C=D1=88=D0=BE=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{setting_prd_control.json => setting-prd-control.json} | 0 .../{count_danger_pad.tscn => count-danger-pad.tscn} | 0 scenes/tabs-switch/{lbl_ready.gd => lbl-ready.gd} | 0 scenes/tabs-switch/{lbl_ready.gd.uid => lbl-ready.gd.uid} | 0 scenes/tabs-switch/tab-switch.gd | 4 ++-- scenes/tabs-switch/tab-switch.tscn | 4 ++-- scenes/tabs-switch/{тренаж_режим.gd => тренаж-режим.gd} | 0 .../{тренаж_режим.gd.uid => тренаж-режим.gd.uid} | 0 scenes/tilemap/{ship_mark.tscn => ship-mark.tscn} | 0 scenes/tilemap/tilemap.gd | 2 +- scenes/контроль/{connect_pribor.gd => connect-pribor.gd} | 0 .../{connect_pribor.gd.uid => connect-pribor.gd.uid} | 0 scenes/контроль/{control_prd.gd => control-prd.gd} | 0 scenes/контроль/{control_prd.gd.uid => control-prd.gd.uid} | 0 scenes/контроль/{panel_container.gd => panel-container.gd} | 0 .../{panel_container.gd.uid => panel-container.gd.uid} | 0 scenes/контроль/контроль.tscn | 6 +++--- scenes/работа/работа.tscn | 4 ++-- shaders/{select_tr.gdshader => select-tr.gdshader} | 0 shaders/{select_tr.gdshader.uid => select-tr.gdshader.uid} | 0 table/{set_toggle.gd => set-toggle.gd} | 0 table/{set_toggle.gd.uid => set-toggle.gd.uid} | 0 table/set-toggle.tscn | 2 +- table/{settings_toggle.gd => settings-toggle.gd} | 0 table/{settings_toggle.gd.uid => settings-toggle.gd.uid} | 0 table/settings-toggle.tscn | 2 +- table/{ячейка_2.gd => ячейка-2.gd} | 0 table/{ячейка_2.gd.uid => ячейка-2.gd.uid} | 0 table/ячейка-2.tscn | 2 +- table/{ячейка_цвет.gd => ячейка-цвет.gd} | 0 table/{ячейка_цвет.gd.uid => ячейка-цвет.gd.uid} | 0 table/ячейка-цвет.tscn | 2 +- 32 files changed, 14 insertions(+), 14 deletions(-) rename config/{setting_prd_control.json => setting-prd-control.json} (100%) rename scenes/count-danger/{count_danger_pad.tscn => count-danger-pad.tscn} (100%) rename scenes/tabs-switch/{lbl_ready.gd => lbl-ready.gd} (100%) rename scenes/tabs-switch/{lbl_ready.gd.uid => lbl-ready.gd.uid} (100%) rename scenes/tabs-switch/{тренаж_режим.gd => тренаж-режим.gd} (100%) rename scenes/tabs-switch/{тренаж_режим.gd.uid => тренаж-режим.gd.uid} (100%) rename scenes/tilemap/{ship_mark.tscn => ship-mark.tscn} (100%) rename scenes/контроль/{connect_pribor.gd => connect-pribor.gd} (100%) rename scenes/контроль/{connect_pribor.gd.uid => connect-pribor.gd.uid} (100%) rename scenes/контроль/{control_prd.gd => control-prd.gd} (100%) rename scenes/контроль/{control_prd.gd.uid => control-prd.gd.uid} (100%) rename scenes/контроль/{panel_container.gd => panel-container.gd} (100%) rename scenes/контроль/{panel_container.gd.uid => panel-container.gd.uid} (100%) rename shaders/{select_tr.gdshader => select-tr.gdshader} (100%) rename shaders/{select_tr.gdshader.uid => select-tr.gdshader.uid} (100%) rename table/{set_toggle.gd => set-toggle.gd} (100%) rename table/{set_toggle.gd.uid => set-toggle.gd.uid} (100%) rename table/{settings_toggle.gd => settings-toggle.gd} (100%) rename table/{settings_toggle.gd.uid => settings-toggle.gd.uid} (100%) rename table/{ячейка_2.gd => ячейка-2.gd} (100%) rename table/{ячейка_2.gd.uid => ячейка-2.gd.uid} (100%) rename table/{ячейка_цвет.gd => ячейка-цвет.gd} (100%) rename table/{ячейка_цвет.gd.uid => ячейка-цвет.gd.uid} (100%) diff --git a/config/setting_prd_control.json b/config/setting-prd-control.json similarity index 100% rename from config/setting_prd_control.json rename to config/setting-prd-control.json diff --git a/scenes/count-danger/count_danger_pad.tscn b/scenes/count-danger/count-danger-pad.tscn similarity index 100% rename from scenes/count-danger/count_danger_pad.tscn rename to scenes/count-danger/count-danger-pad.tscn diff --git a/scenes/tabs-switch/lbl_ready.gd b/scenes/tabs-switch/lbl-ready.gd similarity index 100% rename from scenes/tabs-switch/lbl_ready.gd rename to scenes/tabs-switch/lbl-ready.gd diff --git a/scenes/tabs-switch/lbl_ready.gd.uid b/scenes/tabs-switch/lbl-ready.gd.uid similarity index 100% rename from scenes/tabs-switch/lbl_ready.gd.uid rename to scenes/tabs-switch/lbl-ready.gd.uid diff --git a/scenes/tabs-switch/tab-switch.gd b/scenes/tabs-switch/tab-switch.gd index fe4660f8..c25539bd 100644 --- a/scenes/tabs-switch/tab-switch.gd +++ b/scenes/tabs-switch/tab-switch.gd @@ -7,7 +7,7 @@ const TAB_TOSIGNAL_NAME = { 3: 'режим_эмс', 4: 'режим_эмс2', 5: 'режим_настройки' } - + func on_ems2_hide_pressed(state): set_tab_hidden(4, state) func _on_tab_changed(tab) -> void: signaller.emit_signal(TAB_TOSIGNAL_NAME[tab]) @@ -22,7 +22,7 @@ func _enter_tree() -> void: func on_setting_changed(): var ext_cu = ProjectSettings.get_setting('application/config/Внешнее управление', false) - get_parent().get_node('remote_control').visible = ext_cu + get_parent().get_node('remote_control').visible = ext_cu apply_colors() diff --git a/scenes/tabs-switch/tab-switch.tscn b/scenes/tabs-switch/tab-switch.tscn index c6d5adc6..1f9ac378 100644 --- a/scenes/tabs-switch/tab-switch.tscn +++ b/scenes/tabs-switch/tab-switch.tscn @@ -7,8 +7,8 @@ [ext_resource type="PackedScene" uid="uid://dab6loryocc73" path="res://scenes/эмс/эмс.tscn" id="5_u71bh"] [ext_resource type="PackedScene" uid="uid://musb21x2u0xs" path="res://scenes/эмс2/эмс2.tscn" id="6_41d34"] [ext_resource type="PackedScene" uid="uid://bnptm4rlp60dq" path="res://scenes/настройки/настройки.tscn" id="6_i8iv3"] -[ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl_ready.gd" id="8_tidwt"] -[ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"] +[ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl-ready.gd" id="8_tidwt"] +[ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж-режим.gd" id="9_41d34"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vap7n"] diff --git a/scenes/tabs-switch/тренаж_режим.gd b/scenes/tabs-switch/тренаж-режим.gd similarity index 100% rename from scenes/tabs-switch/тренаж_режим.gd rename to scenes/tabs-switch/тренаж-режим.gd diff --git a/scenes/tabs-switch/тренаж_режим.gd.uid b/scenes/tabs-switch/тренаж-режим.gd.uid similarity index 100% rename from scenes/tabs-switch/тренаж_режим.gd.uid rename to scenes/tabs-switch/тренаж-режим.gd.uid diff --git a/scenes/tilemap/ship_mark.tscn b/scenes/tilemap/ship-mark.tscn similarity index 100% rename from scenes/tilemap/ship_mark.tscn rename to scenes/tilemap/ship-mark.tscn diff --git a/scenes/tilemap/tilemap.gd b/scenes/tilemap/tilemap.gd index 39b0e0d3..cd19b3ad 100644 --- a/scenes/tilemap/tilemap.gd +++ b/scenes/tilemap/tilemap.gd @@ -29,7 +29,7 @@ const TILE_REQUEST_NAME: = 'tile_request_%d' @onready var scale_label: String @onready var coordinates_label: String @onready var threat_mark: PackedScene = load("res://scenes/tilemap/threat.tscn") -@onready var ship_mark: PackedScene = load("res://scenes/tilemap/ship_mark.tscn") +@onready var ship_mark: PackedScene = load("res://scenes/tilemap/ship-mark.tscn") var ship_id := 9999 var ship_instance: Node2D = null const default_size: = 400.0 diff --git a/scenes/контроль/connect_pribor.gd b/scenes/контроль/connect-pribor.gd similarity index 100% rename from scenes/контроль/connect_pribor.gd rename to scenes/контроль/connect-pribor.gd diff --git a/scenes/контроль/connect_pribor.gd.uid b/scenes/контроль/connect-pribor.gd.uid similarity index 100% rename from scenes/контроль/connect_pribor.gd.uid rename to scenes/контроль/connect-pribor.gd.uid diff --git a/scenes/контроль/control_prd.gd b/scenes/контроль/control-prd.gd similarity index 100% rename from scenes/контроль/control_prd.gd rename to scenes/контроль/control-prd.gd diff --git a/scenes/контроль/control_prd.gd.uid b/scenes/контроль/control-prd.gd.uid similarity index 100% rename from scenes/контроль/control_prd.gd.uid rename to scenes/контроль/control-prd.gd.uid diff --git a/scenes/контроль/panel_container.gd b/scenes/контроль/panel-container.gd similarity index 100% rename from scenes/контроль/panel_container.gd rename to scenes/контроль/panel-container.gd diff --git a/scenes/контроль/panel_container.gd.uid b/scenes/контроль/panel-container.gd.uid similarity index 100% rename from scenes/контроль/panel_container.gd.uid rename to scenes/контроль/panel-container.gd.uid diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index f94ad3b6..423ecd30 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -18,13 +18,13 @@ [ext_resource type="Texture2D" uid="uid://00871pb6moln" path="res://data/прогресс-фон-1.png" id="9_w6m6a"] [ext_resource type="Texture2D" uid="uid://c1k856fxhrjnh" path="res://data/прогресс-заполнение-1.png" id="10_lbx5w"] [ext_resource type="Texture2D" uid="uid://u7h3l0jjrsnp" path="res://data/У-УФ.png" id="11_gjf0t"] -[ext_resource type="Script" uid="uid://bncy1x53jp73d" path="res://scenes/контроль/connect_pribor.gd" id="11_u7tym"] +[ext_resource type="Script" uid="uid://bncy1x53jp73d" path="res://scenes/контроль/connect-pribor.gd" id="11_u7tym"] [ext_resource type="Texture2D" uid="uid://vdhmga62vjsj" path="res://data/АФСП-РТР.png" id="13_32yvq"] [ext_resource type="Texture2D" uid="uid://dm350ta8noa0v" path="res://data/У-РЭП-РПД-К.png" id="16_32yvq"] [ext_resource type="Texture2D" uid="uid://c3cyog3gy24ft" path="res://data/У-ЭП.png" id="16_gjf0t"] -[ext_resource type="Script" uid="uid://xjs7owe2iexn" path="res://scenes/контроль/control_prd.gd" id="18_lbx5w"] +[ext_resource type="Script" uid="uid://xjs7owe2iexn" path="res://scenes/контроль/control-prd.gd" id="18_lbx5w"] [ext_resource type="Texture2D" uid="uid://b2vf7en1jj8dv" path="res://data/У-РЭП-РПД-В.png" id="20_l5wui"] -[ext_resource type="Script" uid="uid://j16hg3u2uvu5" path="res://scenes/контроль/panel_container.gd" id="21_l5wui"] +[ext_resource type="Script" uid="uid://j16hg3u2uvu5" path="res://scenes/контроль/panel-container.gd" id="21_l5wui"] [ext_resource type="Texture2D" uid="uid://cllxcfa130vqu" path="res://data/УА-РЭП.png" id="22_1s34a"] [sub_resource type="GDScript" id="GDScript_iqgf5"] diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index c08c2b77..eb39078d 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -5,7 +5,7 @@ [ext_resource type="PackedScene" uid="uid://dem3fcec25awh" path="res://scenes/grid-side-panel/grid-side-panel.tscn" id="3_s2j0e"] [ext_resource type="PackedScene" uid="uid://cnkbk53mi7viu" path="res://scenes/grid-buttons-ecm/grid-buttons-ecm.tscn" id="5_2jnbs"] [ext_resource type="PackedScene" uid="uid://dymo732qc2doa" path="res://scenes/count-all/count-all-pad.tscn" id="6_e3re7"] -[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count-danger/count_danger_pad.tscn" id="7_2arls"] +[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count-danger/count-danger-pad.tscn" id="7_2arls"] [ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="8_k0iv2"] [ext_resource type="Texture2D" uid="uid://c1785x8wf1hdg" path="res://data/power-0.png" id="10_cnr1s"] [ext_resource type="PackedScene" uid="uid://ceknxxfu1loo5" path="res://scenes/tilemap/tilemap.tscn" id="10_gtwyg"] @@ -383,8 +383,8 @@ texture_normal = ExtResource("14_ggrwd") [connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] [connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"] [connection signal="button_down" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_down"] -[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"] [connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"] +[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"] [connection signal="button_down" from="zoom_minus" to="tilemap" method="_on_zoom_minus_button_down"] [connection signal="button_up" from="zoom_minus" to="tilemap" method="_on_zoom_button_up"] [connection signal="pressed" from="btn_all_work" to="." method="_on_btn_all_work_pressed"] diff --git a/shaders/select_tr.gdshader b/shaders/select-tr.gdshader similarity index 100% rename from shaders/select_tr.gdshader rename to shaders/select-tr.gdshader diff --git a/shaders/select_tr.gdshader.uid b/shaders/select-tr.gdshader.uid similarity index 100% rename from shaders/select_tr.gdshader.uid rename to shaders/select-tr.gdshader.uid diff --git a/table/set_toggle.gd b/table/set-toggle.gd similarity index 100% rename from table/set_toggle.gd rename to table/set-toggle.gd diff --git a/table/set_toggle.gd.uid b/table/set-toggle.gd.uid similarity index 100% rename from table/set_toggle.gd.uid rename to table/set-toggle.gd.uid diff --git a/table/set-toggle.tscn b/table/set-toggle.tscn index df0add17..93141ff5 100644 --- a/table/set-toggle.tscn +++ b/table/set-toggle.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://dgidt8lifm7xe"] -[ext_resource type="Script" uid="uid://btvrqnnjjum20" path="res://table/set_toggle.gd" id="1_kvru5"] +[ext_resource type="Script" uid="uid://btvrqnnjjum20" path="res://table/set-toggle.gd" id="1_kvru5"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_f4oye"] diff --git a/table/settings_toggle.gd b/table/settings-toggle.gd similarity index 100% rename from table/settings_toggle.gd rename to table/settings-toggle.gd diff --git a/table/settings_toggle.gd.uid b/table/settings-toggle.gd.uid similarity index 100% rename from table/settings_toggle.gd.uid rename to table/settings-toggle.gd.uid diff --git a/table/settings-toggle.tscn b/table/settings-toggle.tscn index 4e6dc4ab..7dd0334b 100644 --- a/table/settings-toggle.tscn +++ b/table/settings-toggle.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://5rw652cmnybi"] -[ext_resource type="Script" uid="uid://bh7mb1aeu1uk6" path="res://table/settings_toggle.gd" id="1_8lkgc"] +[ext_resource type="Script" uid="uid://bh7mb1aeu1uk6" path="res://table/settings-toggle.gd" id="1_8lkgc"] [ext_resource type="Shader" uid="uid://bw5mmbgeycwua" path="res://shaders/color-invers.gdshader" id="1_anyuq"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_xxfw6"] diff --git a/table/ячейка_2.gd b/table/ячейка-2.gd similarity index 100% rename from table/ячейка_2.gd rename to table/ячейка-2.gd diff --git a/table/ячейка_2.gd.uid b/table/ячейка-2.gd.uid similarity index 100% rename from table/ячейка_2.gd.uid rename to table/ячейка-2.gd.uid diff --git a/table/ячейка-2.tscn b/table/ячейка-2.tscn index 7a6e04bd..0c3566e4 100644 --- a/table/ячейка-2.tscn +++ b/table/ячейка-2.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://dspa16ufrpanp"] -[ext_resource type="Script" uid="uid://dqexdg24cp6rq" path="res://table/ячейка_2.gd" id="1_0fmuf"] +[ext_resource type="Script" uid="uid://dqexdg24cp6rq" path="res://table/ячейка-2.gd" id="1_0fmuf"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mla3y"] diff --git a/table/ячейка_цвет.gd b/table/ячейка-цвет.gd similarity index 100% rename from table/ячейка_цвет.gd rename to table/ячейка-цвет.gd diff --git a/table/ячейка_цвет.gd.uid b/table/ячейка-цвет.gd.uid similarity index 100% rename from table/ячейка_цвет.gd.uid rename to table/ячейка-цвет.gd.uid diff --git a/table/ячейка-цвет.tscn b/table/ячейка-цвет.tscn index 6f61ad57..cb77d86d 100644 --- a/table/ячейка-цвет.tscn +++ b/table/ячейка-цвет.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://cug5xjbfdm7x7"] -[ext_resource type="Script" uid="uid://b36c83manfems" path="res://table/ячейка_цвет.gd" id="1_ce8lu"] +[ext_resource type="Script" uid="uid://b36c83manfems" path="res://table/ячейка-цвет.gd" id="1_ce8lu"] [node name="ячейка-цвет" type="ColorPickerButton"] anchors_preset = 15 From aee7e2d5d3ea7278a5300dfa9f3b8cc382152670 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Thu, 15 Jan 2026 13:01:59 +0300 Subject: [PATCH 5/9] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80.=20=D0=91=D0=BE=D0=BB=D1=8C=D1=88=D0=BE=D0=B5=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++--- config/{banned_ranges.json => banned-ranges.json} | 0 config/{service_config.ini => service-config.ini} | 0 .../{setting_prd_control.json => setting-prd-control.json} | 0 .../{count_danger_pad.tscn => count-danger-pad.tscn} | 0 scenes/tabs-switch/tab-switch.tscn | 2 +- scenes/tabs-switch/{тренаж_режим.gd => тренаж-режим.gd} | 0 .../{тренаж_режим.gd.uid => тренаж-режим.gd.uid} | 0 scenes/tilemap/{ship_mark.tscn => ship-mark.tscn} | 0 scenes/tilemap/tilemap.gd | 2 +- scenes/контроль/{panel_container.gd => panel-container.gd} | 0 .../{panel_container.gd.uid => panel-container.gd.uid} | 0 scenes/контроль/контроль.tscn | 2 +- scenes/работа/работа.tscn | 2 +- 14 files changed, 7 insertions(+), 7 deletions(-) rename config/{banned_ranges.json => banned-ranges.json} (100%) rename config/{service_config.ini => service-config.ini} (100%) rename config/{setting_prd_control.json => setting-prd-control.json} (100%) rename scenes/count-danger/{count_danger_pad.tscn => count-danger-pad.tscn} (100%) rename scenes/tabs-switch/{тренаж_режим.gd => тренаж-режим.gd} (100%) rename scenes/tabs-switch/{тренаж_режим.gd.uid => тренаж-режим.gd.uid} (100%) rename scenes/tilemap/{ship_mark.tscn => ship-mark.tscn} (100%) rename scenes/контроль/{panel_container.gd => panel-container.gd} (100%) rename scenes/контроль/{panel_container.gd.uid => panel-container.gd.uid} (100%) diff --git a/README.md b/README.md index e577d935..1ae13f24 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Разработка -- После клонирования запустить скрипт `git-hooks-config.sh` - - В среде **Windows** запуск скрипта `git-hooks-config.sh` производить из оболочки `git bash` -- При необходимости обновить `settings.json` +- После клонирования запустить скрипт [`git-hooks-config.sh`](git-hooks-config.sh) + - В среде **Windows** запуск скрипта [`git-hooks-config.sh`](git-hooks-config.sh) производить из оболочки `git bash` +- При необходимости обновить [`settings.json`](settings.json) - Использовать выражения вида `ProjectSettings.set_setting('application/config/%s' % key_name` и `ProjectSettings.get_setting('application/config/%s % key_name)` для доступа к настройкам. - `key_name` брать из таблицы `res://scenes/настройки/настройки.gd/SETTING_TABLE` diff --git a/config/banned_ranges.json b/config/banned-ranges.json similarity index 100% rename from config/banned_ranges.json rename to config/banned-ranges.json diff --git a/config/service_config.ini b/config/service-config.ini similarity index 100% rename from config/service_config.ini rename to config/service-config.ini diff --git a/config/setting_prd_control.json b/config/setting-prd-control.json similarity index 100% rename from config/setting_prd_control.json rename to config/setting-prd-control.json diff --git a/scenes/count-danger/count_danger_pad.tscn b/scenes/count-danger/count-danger-pad.tscn similarity index 100% rename from scenes/count-danger/count_danger_pad.tscn rename to scenes/count-danger/count-danger-pad.tscn diff --git a/scenes/tabs-switch/tab-switch.tscn b/scenes/tabs-switch/tab-switch.tscn index 01780db4..5c21b615 100644 --- a/scenes/tabs-switch/tab-switch.tscn +++ b/scenes/tabs-switch/tab-switch.tscn @@ -8,7 +8,7 @@ [ext_resource type="PackedScene" uid="uid://musb21x2u0xs" path="res://scenes/эмс2/эмс2.tscn" id="6_41d34"] [ext_resource type="PackedScene" uid="uid://bnptm4rlp60dq" path="res://scenes/настройки/настройки.tscn" id="6_i8iv3"] [ext_resource type="Script" uid="uid://b5ykwyk5vpi6" path="res://scenes/tabs-switch/lbl-ready.gd" id="8_tidwt"] -[ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж_режим.gd" id="9_41d34"] +[ext_resource type="Script" uid="uid://roajn6c6wvc1" path="res://scenes/tabs-switch/тренаж-режим.gd" id="9_41d34"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tidwt"] diff --git a/scenes/tabs-switch/тренаж_режим.gd b/scenes/tabs-switch/тренаж-режим.gd similarity index 100% rename from scenes/tabs-switch/тренаж_режим.gd rename to scenes/tabs-switch/тренаж-режим.gd diff --git a/scenes/tabs-switch/тренаж_режим.gd.uid b/scenes/tabs-switch/тренаж-режим.gd.uid similarity index 100% rename from scenes/tabs-switch/тренаж_режим.gd.uid rename to scenes/tabs-switch/тренаж-режим.gd.uid diff --git a/scenes/tilemap/ship_mark.tscn b/scenes/tilemap/ship-mark.tscn similarity index 100% rename from scenes/tilemap/ship_mark.tscn rename to scenes/tilemap/ship-mark.tscn diff --git a/scenes/tilemap/tilemap.gd b/scenes/tilemap/tilemap.gd index b3ea9577..c12ce22d 100644 --- a/scenes/tilemap/tilemap.gd +++ b/scenes/tilemap/tilemap.gd @@ -29,7 +29,7 @@ const TILE_REQUEST_NAME: = 'tile_request_%d' @onready var scale_label: String @onready var coordinates_label: String @onready var threat_mark: PackedScene = load("res://scenes/tilemap/threat.tscn") -@onready var ship_mark: PackedScene = load("res://scenes/tilemap/ship_mark.tscn") +@onready var ship_mark: PackedScene = load("res://scenes/tilemap/ship-mark.tscn") var ship_id := 9999 var ship_instance: Node2D = null const default_size: = 400.0 diff --git a/scenes/контроль/panel_container.gd b/scenes/контроль/panel-container.gd similarity index 100% rename from scenes/контроль/panel_container.gd rename to scenes/контроль/panel-container.gd diff --git a/scenes/контроль/panel_container.gd.uid b/scenes/контроль/panel-container.gd.uid similarity index 100% rename from scenes/контроль/panel_container.gd.uid rename to scenes/контроль/panel-container.gd.uid diff --git a/scenes/контроль/контроль.tscn b/scenes/контроль/контроль.tscn index 282ed644..92b56843 100644 --- a/scenes/контроль/контроль.tscn +++ b/scenes/контроль/контроль.tscn @@ -24,7 +24,7 @@ [ext_resource type="Texture2D" uid="uid://c3cyog3gy24ft" path="res://data/У-ЭП.png" id="16_gjf0t"] [ext_resource type="Script" uid="uid://xjs7owe2iexn" path="res://scenes/контроль/control_prd.gd" id="18_lbx5w"] [ext_resource type="Texture2D" uid="uid://b2vf7en1jj8dv" path="res://data/У-РЭП-РПД-В.png" id="20_l5wui"] -[ext_resource type="Script" path="res://scenes/контроль/panel_container.gd" id="21_l5wui"] +[ext_resource type="Script" uid="uid://j16hg3u2uvu5" path="res://scenes/контроль/panel-container.gd" id="21_l5wui"] [ext_resource type="Texture2D" uid="uid://cllxcfa130vqu" path="res://data/УА-РЭП.png" id="22_1s34a"] [sub_resource type="GDScript" id="GDScript_iqgf5"] diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 0759e92e..6220c622 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -5,7 +5,7 @@ [ext_resource type="PackedScene" uid="uid://dem3fcec25awh" path="res://scenes/grid-side-panel/grid-side-panel.tscn" id="3_s2j0e"] [ext_resource type="PackedScene" uid="uid://cnkbk53mi7viu" path="res://scenes/grid-buttons-ecm/grid-buttons-ecm.tscn" id="5_2jnbs"] [ext_resource type="PackedScene" uid="uid://dymo732qc2doa" path="res://scenes/count-all/count-all-pad.tscn" id="6_e3re7"] -[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count-danger/count_danger_pad.tscn" id="7_2arls"] +[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count-danger/count-danger-pad.tscn" id="7_2arls"] [ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="8_k0iv2"] [ext_resource type="Texture2D" uid="uid://c1785x8wf1hdg" path="res://data/power-0.png" id="10_cnr1s"] [ext_resource type="PackedScene" uid="uid://ceknxxfu1loo5" path="res://scenes/tilemap/tilemap.tscn" id="10_gtwyg"] From 5407cb0570cca754f5e098c7ef178e4eb8a66820 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 19 Jan 2026 10:54:37 +0300 Subject: [PATCH 6/9] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=80=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D0=B8=D1=8F.=20=D0=90=D1=80=D1=82=D0=B5=D1=84=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=8B=20=D1=81=D0=BB=D0=B8=D1=8F=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/работа/работа.gd | 4 ---- scenes/работа/работа.tscn | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 469f6629..5bb54e64 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -154,10 +154,6 @@ func on_settings_changed(): color_emit_sel *= Color(1.0, 1.0, 1.0, 0.2) color_closed *= Color(1.0, 1.0, 1.0, 0.0) color_closed_emit *= Color(1.0, 1.0, 1.0, 1.0) - - var json_col = ProjectSettings.get_setting('application/config/%s' % 'Цвет кнопки \"Подавление\"', '[1.0, 1.0, 1.0, 1.0]') - var arr_col = JSON.parse_string(json_col) - col_btn_act = Color(arr_col[0], arr_col[1], arr_col[2], arr_col[3]) if arr_col else Color.WHITE apply_colors() diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 63389127..6220c622 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -389,8 +389,8 @@ texture_normal = ExtResource("14_ggrwd") [connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] [connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"] [connection signal="button_down" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_down"] -[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"] [connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"] +[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"] [connection signal="button_down" from="zoom_minus" to="tilemap" method="_on_zoom_minus_button_down"] [connection signal="button_up" from="zoom_minus" to="tilemap" method="_on_zoom_button_up"] [connection signal="pressed" from="btn_all_work" to="." method="_on_btn_all_work_pressed"] From f87cb28e9b824c71755bc58d95f8eb2636e6419b Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 19 Jan 2026 13:05:14 +0300 Subject: [PATCH 7/9] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=80=D0=B5=D1=81=D1=81?= =?UTF-8?q?=D0=B8=D1=8F.=20=D0=90=D1=80=D1=82=D0=B5=D1=84=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=8B=20=D1=81=D0=BB=D0=B8=D1=8F=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/работа/работа.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 5bb54e64..1e3f4c72 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -162,10 +162,10 @@ func apply_colors(): var style = StyleBoxFlat.new() if is_light: style.bg_color = Color.DARK_GRAY - add_theme_stylebox_override("panel", style) + add_theme_stylebox_override('panel', style) else: style.bg_color = Color(0.12, 0.12, 0.12) - add_theme_stylebox_override("panel", style) + add_theme_stylebox_override('panel', style) ## Обработчик сигнала изменения списка целей. From 6d46fb5b4c512a1b248ed48015056d55af5265d7 Mon Sep 17 00:00:00 2001 From: lepshiy Date: Mon, 19 Jan 2026 15:44:40 +0300 Subject: [PATCH 8/9] =?UTF-8?q?=D0=90=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D1=81=D0=BE=D1=85?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=B5=D0=BA,=20=D1=83=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B8=D0=B7=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=BE=D0=B1=D0=B2=D0=BE=D0=B4=D0=BA=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D1=84=D0=BE=D0=BA=D1=83=D1=81=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.godot | 53 +++++++++++++++++---------------- scenes/настройки/настройки.gd | 26 +++++++++------- scenes/настройки/настройки.tscn | 36 ++-------------------- table/settings-toggle.tscn | 5 +++- table/ячейка-цвет.tscn | 5 +++- 5 files changed, 53 insertions(+), 72 deletions(-) diff --git a/project.godot b/project.godot index 90068c9c..5ff17ff5 100644 --- a/project.godot +++ b/project.godot @@ -62,39 +62,40 @@ interfer/closed_sectors=Color(0, 0, 0, 1) "config/Кнопка «СВ-И1»"=false "config/Кнопка «СВ-М2»"=false "config/Ограниченный режим"=false -"config/Отладка контроля"=false +"config/Отладка контроля"=true "config/Период опроса состояния АФСП, секунды"="" "config/Период опроса состояния БПО, секунды"="" "config/Скрыть вкладку ЭМС 2"=true "config/Список своих протоколов"="" "config/Текущая версия ПО УАРЭП"="master 3bff1cd Tue Nov 4 15:33:24 2025 +0300" -"config/Цвет кнопки \"Подавление\""="[0.972549021244049,0.0117647061124444,0.423529416322708,1.0]" -"config/Цвет схемы"="[0.972549021244049,0.0117647061124444,0.0274509806185961,1.0]" -"config/Цвет фона схемы"="[0.0941176488995552,0.149019613862038,1.0,1.0]" +"config/Цвет кнопки \"Подавление\""="[0.905882358551025,0.00392156885936856,0.0,1.0]" +"config/Цвет схемы"="[0.905954480171204,0.921875,0.8714599609375,1.0]" +"config/Цвет фона схемы"="[0.258926391601563,0.274618297815323,0.27734375,1.0]" "config/Шаблон адреса сервера карт"="https://tile.openstreetmap.org/{z}/{x}/{y}.png" -"config/навигация"=["*", 60000, true, true] -"config/уарэп-5п28"=["127.0.0.1", 50777] -"config/уарэп-капсрпб"=["127.0.0.1", "127.0.0.1", 42023, 42022, false, true] -"config/уарэп-спт25-1"=["/home/user/tty0", 0, 19200, "N", 8, 1] -"config/уарэп-спт25-2"=["/home/user/tty1", 0, 19200, "N", 8, 1] -"config/уарэп-трасса"=["192.168.11.34", "192.168.11.105", 50200, 10004, false, true] -"config/уарэп-щ3"=["/home/user/tty3", 7, 19200, "N", 8, 1, 50000] -"config/уарэп-эмс"=["10.1.1.52", 50052, false, false] -"config/уарэп-яу07-1в"=["10.1.1.12", 50012, false, false] -"config/уарэп-яу07-1к"=["10.1.1.13", 50013, false, false] -"config/уарэп-яу07-1н"=["10.1.1.11", 50011, false, false] -"config/уарэп-яу07-2в"=["10.1.1.22", 50022, false, false] -"config/уарэп-яу07-2к"=["10.1.1.23", 50023, false, false] -"config/уарэп-яу07-2н"=["10.1.1.21", 50021, false, false] -"config/уарэп-яу07-3в"=["10.1.1.32", 50032, false, false] -"config/уарэп-яу07-3к"=["10.1.1.33", 50033, false, false] -"config/уарэп-яу07-3н"=["10.1.1.31", 50031, false, false] -"config/уарэп-яу07-4в"=["10.1.1.42", 50042, false, false] -"config/уарэп-яу07-4к"=["10.1.1.43", 50043, false, false] -"config/уарэп-яу07-4н"=["10.1.1.41", 50041, false, false] -"config/уарэп-яу07-общий"=["*", 50000, true, true] -"config/уарэп-яу07-частный"=["10.1.1.253", 50253, false, true] +"config/навигация"=["*", 60000.0, true, true] +"config/уарэп-5п28"=["127.0.0.1", 50777.0] +"config/уарэп-капсрпб"=["127.0.0.1", "127.0.0.1", 42023.0, 42022.0, false, true] +"config/уарэп-спт25-1"=["/home/user/tty0", 0.0, 19200.0, "N", 8.0, 1.0] +"config/уарэп-спт25-2"=["/home/user/tty1", 0.0, 19200.0, "N", 8.0, 1.0] +"config/уарэп-трасса"=["192.168.11.34", "192.168.11.105", 50200.0, 10004.0, false, true] +"config/уарэп-щ3"=["/home/user/tty3", 7.0, 19200.0, "N", 8.0, 1.0, 50000.0] +"config/уарэп-эмс"=["10.1.1.52", 50052.0, false, false] +"config/уарэп-яу07-1в"=["10.1.1.12", 50012.0, false, false] +"config/уарэп-яу07-1к"=["10.1.1.13", 50013.0, false, false] +"config/уарэп-яу07-1н"=["10.1.1.11", 50011.0, false, false] +"config/уарэп-яу07-2в"=["10.1.1.22", 50022.0, false, false] +"config/уарэп-яу07-2к"=["10.1.1.23", 50023.0, false, false] +"config/уарэп-яу07-2н"=["10.1.1.21", 50021.0, false, false] +"config/уарэп-яу07-3в"=["10.1.1.32", 50032.0, false, false] +"config/уарэп-яу07-3к"=["10.1.1.33", 50033.0, false, false] +"config/уарэп-яу07-3н"=["10.1.1.31", 50031.0, false, false] +"config/уарэп-яу07-4в"=["10.1.1.42", 50042.0, false, false] +"config/уарэп-яу07-4к"=["10.1.1.43", 50043.0, false, false] +"config/уарэп-яу07-4н"=["10.1.1.41", 50041.0, false, false] +"config/уарэп-яу07-общий"=["*", 50000.0, true, true] +"config/уарэп-яу07-частный"=["10.1.1.253", 50253.0, false, true] config/="[0.215686276555061,0.976470589637756,1.0,1.0]" +"config/Цвет темы программы"=false [autoload] diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index 8e1db3e1..d02fe1e2 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -90,7 +90,8 @@ const COLOR_THEME = 57 ## Цвет темы var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки var table_color_instance: Node ## Нода цвета кнопки подавления -func on_checkbutton_pressed(i_row: int): on_row_pressed(i_row) +func on_checkbutton_pressed(i_row: int): + on_row_pressed(i_row) ## Вызывается, когда узел впервые попадает в дерево сцены. @@ -107,28 +108,34 @@ func on_external_cu_btn_pressed(btn) -> void: ProjectSettings.set_setting('application/config/Внешнее управление', btn.button_pressed) if btn.button_pressed: signaller.emit_signal('interfer_off_all') + _autosave_now() func on_trassa_btn_pressed(btn) -> void: ProjectSettings.set_setting('application/config/Внешнее указание Трасса', btn.button_pressed) + _autosave_now() func on_vk_pressed(btn) -> void: signaller.emit_signal('kb_pressed', btn.button_pressed) + _autosave_now() func on_gos_pressed(btn) -> void: ProjectSettings.set_setting('application/config/Включить работу по своим целям', btn.button_pressed) + _autosave_now() func on_ems2_pressed(btn) -> void: var state = btn.button_pressed signaller.emit_signal('ems2_hide_pressed', state) + _autosave_now() func on_debag_control_pressed(btn) -> void: var state = btn.button_pressed signaller.emit_signal("debag_control_pressed", state) + _autosave_now() func on_row_pressed(i_row: int): @@ -201,6 +208,7 @@ func setting_tab(): child.connect('pressed', Callable(self, 'on_checkbutton_pressed').bind(i)) var val = ProjectSettings.get_setting('application/config/%s' % param_name, true) child.set_pressed(val) + child.pressed.connect(_autosave_now) else: if settings_data.has(param_name): var val = settings_data[param_name] @@ -209,7 +217,7 @@ func setting_tab(): if edit_node: if edit_node is LineEdit: $scroll_set/table.set_node_control(1, i, true) - edit_node.connect("text_submitted", Callable(self, "_on_line_edit_enter_pressed").bind(i)) + edit_node.focus_exited.connect(_autosave_now) $scroll_set/table.set_node_editable(1, COMMIT, false) $scroll_set/table.set_columns_min_size([600, 950]) $scroll_set/table.set_columns_alignments(ALIGNMENT) @@ -280,6 +288,7 @@ func button_settings(): func on_theme_toggle_pressed(btn: CheckButton) -> void: var is_light = btn.button_pressed ProjectSettings.set_setting("application/config/Цвет темы программы", is_light) + _autosave_now() func _update_theme_colors(): var color_white = $scroll_set/table.get_node2(1, COLOR_WHITE) @@ -292,21 +301,25 @@ func on_color_closed_w(color_white: ColorPickerButton): var col_w = [color_white.color.r, color_white.color.g, color_white.color.b, color_white.color.a] color_white.text = JSON.stringify(col_w) ProjectSettings.set_setting('application/config/%s' % 'Цвет фона схемы', color_white.text) + _autosave_now() func on_color_closed_b(color_black: ColorPickerButton): var col_b = [color_black.color.r, color_black.color.g, color_black.color.b, color_black.color.a] color_black.text = JSON.stringify(col_b) ProjectSettings.set_setting('application/config/%s' % 'Цвет схемы', color_black.text) + _autosave_now() func on_color_closed(color_btn_act: ColorPickerButton): var col = [color_btn_act.color.r, color_btn_act.color.g, color_btn_act.color.b, color_btn_act.color.a] color_btn_act.text = JSON.stringify(col) ProjectSettings.set_setting('application/config/%s' % 'Цвет кнопки \"Подавление\"', color_btn_act.text) + _autosave_now() -func _on_btn_save_settings_pressed(): +func _autosave_now() -> void: + print("AUTOSAVE") var json_data = {} for i in SETTING_TABLE.size(): var parameter = SETTING_TABLE[i][0] @@ -351,10 +364,3 @@ func _on_btn_save_settings_pressed(): if file.store_string(json_string): log.info('Настройки сохранены в файл \"%s\"' % abs_path) file.close() - - -func _on_line_edit_enter_pressed(new_text: String, row_index: int) -> void: - var parameter = SETTING_TABLE[row_index][0] - ProjectSettings.set_setting("application/config/%s" % parameter, new_text) - _on_btn_save_settings_pressed() - get_viewport().gui_release_focus() diff --git a/scenes/настройки/настройки.tscn b/scenes/настройки/настройки.tscn index 950d3e74..88f5604f 100644 --- a/scenes/настройки/настройки.tscn +++ b/scenes/настройки/настройки.tscn @@ -1,21 +1,7 @@ -[gd_scene load_steps=7 format=3 uid="uid://bnptm4rlp60dq"] +[gd_scene load_steps=3 format=3 uid="uid://bnptm4rlp60dq"] [ext_resource type="Script" uid="uid://dabpum5iqxc7y" path="res://scenes/настройки/настройки.gd" id="1_60bya"] [ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="2_6sx73"] -[ext_resource type="Texture2D" uid="uid://csnts8f155sf7" path="res://data/save1.png" id="3_dbpks"] - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_pyq6h"] -texture = ExtResource("3_dbpks") -modulate_color = Color(0.8, 0.533333, 0.27451, 1) - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_l5g3r"] -texture = ExtResource("3_dbpks") -expand_margin_left = 20.0 -expand_margin_top = 20.0 -modulate_color = Color(0.8, 0.533333, 0.27451, 1) - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_tbxk6"] -texture = ExtResource("3_dbpks") [node name="Настройки" type="Panel"] script = ExtResource("1_60bya") @@ -33,26 +19,8 @@ layout_mode = 0 offset_left = 16.0 offset_top = 44.0 offset_right = 1584.0 -offset_bottom = 988.0 +offset_bottom = 1144.0 [node name="table" type="GridContainer" parent="scroll_set"] layout_mode = 2 script = ExtResource("2_6sx73") - -[node name="btn_save" type="Button" parent="."] -layout_mode = 0 -offset_left = 1523.0 -offset_top = 1057.0 -offset_right = 2035.0 -offset_bottom = 1569.0 -scale = Vector2(0.1, 0.1) -tooltip_text = "Сохранить настройки" -focus_mode = 0 -theme_override_styles/focus = SubResource("StyleBoxTexture_pyq6h") -theme_override_styles/disabled = SubResource("StyleBoxTexture_pyq6h") -theme_override_styles/hover_pressed = SubResource("StyleBoxTexture_pyq6h") -theme_override_styles/hover = SubResource("StyleBoxTexture_pyq6h") -theme_override_styles/pressed = SubResource("StyleBoxTexture_l5g3r") -theme_override_styles/normal = SubResource("StyleBoxTexture_tbxk6") - -[connection signal="pressed" from="btn_save" to="." method="_on_btn_save_settings_pressed"] diff --git a/table/settings-toggle.tscn b/table/settings-toggle.tscn index 7dd0334b..1d5be41b 100644 --- a/table/settings-toggle.tscn +++ b/table/settings-toggle.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=5 format=3 uid="uid://5rw652cmnybi"] +[gd_scene load_steps=6 format=3 uid="uid://5rw652cmnybi"] [ext_resource type="Script" uid="uid://bh7mb1aeu1uk6" path="res://table/settings-toggle.gd" id="1_8lkgc"] [ext_resource type="Shader" uid="uid://bw5mmbgeycwua" path="res://shaders/color-invers.gdshader" id="1_anyuq"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_il5wc"] + [sub_resource type="ShaderMaterial" id="ShaderMaterial_xxfw6"] shader = ExtResource("1_anyuq") @@ -13,6 +15,7 @@ offset_right = 950.0 offset_bottom = 27.0 theme_override_colors/font_uneditable_color = Color(1, 0.596078, 0.4, 1) theme_override_colors/font_color = Color(1, 0.596078, 0.4, 1) +theme_override_styles/focus = SubResource("StyleBoxEmpty_il5wc") editable = false context_menu_enabled = false shortcut_keys_enabled = false diff --git a/table/ячейка-цвет.tscn b/table/ячейка-цвет.tscn index cb77d86d..8171867e 100644 --- a/table/ячейка-цвет.tscn +++ b/table/ячейка-цвет.tscn @@ -1,11 +1,14 @@ -[gd_scene load_steps=2 format=3 uid="uid://cug5xjbfdm7x7"] +[gd_scene load_steps=3 format=3 uid="uid://cug5xjbfdm7x7"] [ext_resource type="Script" uid="uid://b36c83manfems" path="res://table/ячейка-цвет.gd" id="1_ce8lu"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ce8lu"] + [node name="ячейка-цвет" type="ColorPickerButton"] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +theme_override_styles/focus = SubResource("StyleBoxEmpty_ce8lu") script = ExtResource("1_ce8lu") From 81ae47a3d9e00568de0481c637f482acc2c2d36c Mon Sep 17 00:00:00 2001 From: lepshiy Date: Mon, 19 Jan 2026 16:17:40 +0300 Subject: [PATCH 9/9] =?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=D1=81=D0=B2=D0=B5=D1=82=D0=BB=D0=B0=D1=8F=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BC=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/tabs-switch/tab-switch.gd | 2 +- scenes/настройки/настройки.gd | 1 - scenes/работа/работа.gd | 6 ------ 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/scenes/tabs-switch/tab-switch.gd b/scenes/tabs-switch/tab-switch.gd index c25539bd..b3f85221 100644 --- a/scenes/tabs-switch/tab-switch.gd +++ b/scenes/tabs-switch/tab-switch.gd @@ -30,7 +30,7 @@ func apply_colors(): var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) var style = StyleBoxFlat.new() if is_light: - style.bg_color = Color.GRAY + style.bg_color = Color.DARK_GRAY add_theme_stylebox_override("tabbar_background", style) add_theme_stylebox_override("panel", style) else: diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index d02fe1e2..2b6c54c2 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -281,7 +281,6 @@ func button_settings(): color_black.text = JSON.stringify(arr_col_b) var theme_node = $scroll_set/table.get_node2(1, COLOR_THEME).get_children()[0] theme_node.connect("pressed", on_theme_toggle_pressed.bind(theme_node)) - theme_node.set_pressed(false) on_theme_toggle_pressed(theme_node) diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 1e3f4c72..641c8f9c 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -160,12 +160,6 @@ func on_settings_changed(): func apply_colors(): var is_light: bool = ProjectSettings.get_setting("application/config/Цвет темы программы", false) var style = StyleBoxFlat.new() - if is_light: - style.bg_color = Color.DARK_GRAY - add_theme_stylebox_override('panel', style) - else: - style.bg_color = Color(0.12, 0.12, 0.12) - add_theme_stylebox_override('panel', style) ## Обработчик сигнала изменения списка целей.