From 9eb9873c649b6e858dc7172267d02e193ef8f5f8 Mon Sep 17 00:00:00 2001 From: lepshiy Date: Thu, 22 Jan 2026 10:57:06 +0300 Subject: [PATCH 01/15] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0.=20=D0=A1=D0=B2=D0=B5=D1=82=D0=BB=D0=B0?= =?UTF-8?q?=D1=8F=20=D1=82=D0=B5=D0=BC=D0=B0,=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=80=D0=B0=D1=81=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=BE=D0=B2=20=D0=B2=20table.gd.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- table/table.gd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/table/table.gd b/table/table.gd index 972acd64..22f36b9f 100644 --- a/table/table.gd +++ b/table/table.gd @@ -400,6 +400,7 @@ func add_row(row_types: Array) -> void: var conn = Callable(self, '_on_focus_entered').bind(node) node.connect('focus_entered', conn) set_node_meta(i_col, i_row, 'callable_focus_entered', conn) + call_deferred("apply_theme") func _set_size_x_defered(node: Control, val: Vector2): @@ -410,6 +411,7 @@ func _set_size_x_defered(node: Control, val: Vector2): func _on_focus_entered(node): var indexes = get_key_indexes(node.name) emit_signal('row_pressed', indexes[1]) + ProjectSettings.connect('settings_changed', apply_theme) ## @@ -519,6 +521,7 @@ func rehash(): next_index(i_slct) nodes.clear() nodes.merge(nodes_copy) + call_deferred('apply_theme') ## Удаляет все строки таблицы @@ -714,3 +717,9 @@ func get_row_rect(i_row: int, rect: Array, key_format: String = NODE_KEY_FORMAT) rect[1] = cell0.position.y + scroll_adj.y rect[2] = (cell1.position.x - cell0.position.x) + cell1.size.x rect[3] = cell0.size.y + + +func apply_theme(): + for node in nodes.values(): + if node is LineEdit and node.has_method('apply_colors'): + node.apply_colors() From 54eb0df9cc394da6b135bd1a1c2364859f22811a Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 12:36:56 +0300 Subject: [PATCH 02/15] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D1=81=D0=B8=D1=8F.=20=D0=9D=D0=B5=D0=B2=D0=B5=D1=80=D0=BD?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/{banned-ranges.json => banned_ranges.json} | 0 config/{service-config.ini => service_config.ini} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename config/{banned-ranges.json => banned_ranges.json} (100%) rename config/{service-config.ini => service_config.ini} (100%) 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 From 36999bf3c1da687cea872f2662c24ca618b51f83 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 14:09:48 +0300 Subject: [PATCH 03/15] =?UTF-8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- table/editl.gd | 19 ------------------- table/editl.gd.uid | 1 - table/editl.tscn | 10 ---------- 3 files changed, 30 deletions(-) delete mode 100644 table/editl.gd delete mode 100644 table/editl.gd.uid delete mode 100644 table/editl.tscn diff --git a/table/editl.gd b/table/editl.gd deleted file mode 100644 index 42721bce..00000000 --- a/table/editl.gd +++ /dev/null @@ -1,19 +0,0 @@ -extends LineEdit - - -func _enter_tree() -> void: - ProjectSettings.connect('settings_changed', apply_colors) - - -func apply_colors(): - 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 deleted file mode 100644 index a2f655c3..00000000 --- a/table/editl.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bky7xlpaj21sj diff --git a/table/editl.tscn b/table/editl.tscn deleted file mode 100644 index 44fd2976..00000000 --- a/table/editl.tscn +++ /dev/null @@ -1,10 +0,0 @@ -[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") From 484ca3f3209548f944daab210b3852c99385122b Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 14:14:54 +0300 Subject: [PATCH 04/15] =?UTF-8?q?WIP=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5.=20=D0=9F=D1=80=D0=BE?= =?UTF-8?q?=D0=B8=D0=B7=D0=B2=D0=BE=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/настройки/настройки.gd | 10 +++++----- table/lable.gd | 4 ++++ table/node.gd | 4 ++++ table/set-toggle.gd | 4 ++++ table/settings-toggle.gd | 4 ++++ table/table.gd | 11 ++--------- table/ячейка-2.gd | 7 ++++--- table/ячейка-цвет.gd | 4 ++++ 8 files changed, 31 insertions(+), 17 deletions(-) diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index be29b475..c7fa496e 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -97,11 +97,11 @@ func on_checkbutton_pressed(i_row: int): ## Вызывается, когда узел впервые попадает в дерево сцены. func _ready() -> void: setting_tab() - if not OS.get_cmdline_args().has('++ограниченный'): - return - $Label2.text = 'Текущий режим доступа: ограниченный' - for node in $GridContainer.get_children().filter(func(b): return b is Button): - node.disabled = true + if OS.get_cmdline_args().has('++ограниченный'): + $Label2.text = 'Текущий режим доступа: ограниченный' + for node in $GridContainer.get_children().filter(func(b): return b is Button): + node.disabled = true + ProjectSettings.emit_signal('settings_changed') func on_external_cu_btn_pressed(btn) -> void: diff --git a/table/lable.gd b/table/lable.gd index b71183bd..4d8c7696 100644 --- a/table/lable.gd +++ b/table/lable.gd @@ -5,6 +5,10 @@ func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) +func _exit_tree() -> void: + ProjectSettings.disconnect('settings_changed', apply_colors) + + func apply_colors(): var is_light: bool = ProjectSettings.get_setting('application/config/Цвет темы программы', false) var style = get_theme_stylebox('normal').duplicate() diff --git a/table/node.gd b/table/node.gd index 42721bce..e0a9c2da 100644 --- a/table/node.gd +++ b/table/node.gd @@ -5,6 +5,10 @@ func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) +func _exit_tree() -> void: + ProjectSettings.disconnect('settings_changed', apply_colors) + + func apply_colors(): var is_light: bool = ProjectSettings.get_setting('application/config/Цвет темы программы', false) var style = get_theme_stylebox('read_only').duplicate() diff --git a/table/set-toggle.gd b/table/set-toggle.gd index ae96dd00..ce6c8e2b 100644 --- a/table/set-toggle.gd +++ b/table/set-toggle.gd @@ -7,6 +7,10 @@ func _enter_tree() -> void: ProjectSettings.connect('settings_changed', on_setting_changed) +func _exit_tree() -> void: + ProjectSettings.disconnect('settings_changed', on_setting_changed) + + func on_setting_changed(): var cb = $CheckButton checkbutton_material = cb.material diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd index ae96dd00..53db3e5c 100644 --- a/table/settings-toggle.gd +++ b/table/settings-toggle.gd @@ -7,6 +7,10 @@ func _enter_tree() -> void: ProjectSettings.connect('settings_changed', on_setting_changed) +func _exit_tree() -> void: + ProjectSettings.disconnect('settings_changed', apply_colors) + + func on_setting_changed(): var cb = $CheckButton checkbutton_material = cb.material diff --git a/table/table.gd b/table/table.gd index 22f36b9f..ce2019c4 100644 --- a/table/table.gd +++ b/table/table.gd @@ -392,6 +392,8 @@ func add_row(row_types: Array) -> void: _assert(node.get('name') is StringName, 'экземпляр не имеет поля \"name\"') var node_key: String = NODE_KEY_FORMAT % [i_row, i_col] node.name = node_key + if node.has_method('apply_colors'): + node.apply_colors() add_child(node) if allow_set_size: node.custom_minimum_size.x = columns_min_size[i_col] @@ -400,7 +402,6 @@ func add_row(row_types: Array) -> void: var conn = Callable(self, '_on_focus_entered').bind(node) node.connect('focus_entered', conn) set_node_meta(i_col, i_row, 'callable_focus_entered', conn) - call_deferred("apply_theme") func _set_size_x_defered(node: Control, val: Vector2): @@ -411,7 +412,6 @@ func _set_size_x_defered(node: Control, val: Vector2): func _on_focus_entered(node): var indexes = get_key_indexes(node.name) emit_signal('row_pressed', indexes[1]) - ProjectSettings.connect('settings_changed', apply_theme) ## @@ -521,7 +521,6 @@ func rehash(): next_index(i_slct) nodes.clear() nodes.merge(nodes_copy) - call_deferred('apply_theme') ## Удаляет все строки таблицы @@ -717,9 +716,3 @@ func get_row_rect(i_row: int, rect: Array, key_format: String = NODE_KEY_FORMAT) rect[1] = cell0.position.y + scroll_adj.y rect[2] = (cell1.position.x - cell0.position.x) + cell1.size.x rect[3] = cell0.size.y - - -func apply_theme(): - for node in nodes.values(): - if node is LineEdit and node.has_method('apply_colors'): - node.apply_colors() diff --git a/table/ячейка-2.gd b/table/ячейка-2.gd index 9fd16e9f..75345cef 100644 --- a/table/ячейка-2.gd +++ b/table/ячейка-2.gd @@ -1,8 +1,9 @@ extends LineEdit - -func _enter_tree() -> void: - ProjectSettings.connect('settings_changed', apply_colors) +# Вызывается +func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) +func _exit_tree() -> void: ProjectSettings.disconnect('settings_changed', apply_colors) +func _ready() -> void: print_debug() func apply_colors(): diff --git a/table/ячейка-цвет.gd b/table/ячейка-цвет.gd index ce7ddaed..ee345528 100644 --- a/table/ячейка-цвет.gd +++ b/table/ячейка-цвет.gd @@ -3,6 +3,10 @@ extends ColorPickerButton func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) + + +func _exit_tree() -> void: + ProjectSettings.disconnect('settings_changed', apply_colors) func apply_colors(): From 1bac9dc496400177a1ba811aa54d7716b99575bf Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 15:10:06 +0300 Subject: [PATCH 05/15] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/настройки/настройки.gd | 1 + 1 file changed, 1 insertion(+) diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index c7fa496e..d6ade08a 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -289,6 +289,7 @@ func on_theme_toggle_pressed(btn: CheckButton) -> void: ProjectSettings.set_setting('application/config/Цвет темы программы', is_light) _autosave_now() + 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) From 043646a4a8b464c52dbcc3e8ad718ac05d221db5 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 15:38:28 +0300 Subject: [PATCH 06/15] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5.=20E=200:00:05:248=20=20=20setti?= =?UTF-8?q?ngs-toggle.gd:11=20@=20=5Fexit=5Ftree():=20Attempt=20to=20disco?= =?UTF-8?q?nnect=20a=20nonexistent=20connection=20from=20''.=20Signal:=20'settings=5Fchanged',=20callable:=20'?= =?UTF-8?q?LineEdit(settings-toggle.gd)::apply=5Fcolors'.=20=20=20<=D0=9E?= =?UTF-8?q?=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20C++>=20=20Condition=20"!s->slo?= =?UTF-8?q?t=5Fmap.has(*p=5Fcallable.get=5Fbase=5Fcomparator())"=20is=20tr?= =?UTF-8?q?ue.=20Returning:=20false=20=20=20<=D0=98=D1=81=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=B4=20C++>core/object?= =?UTF-8?q?/object.cpp:1529=20@=20=5Fdisconnect()=20=20=20<=D0=A2=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D1=81=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D1=81?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D0=B0>settings-toggle.gd:11=20@=20=5Fexit=5F?= =?UTF-8?q?tree()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- table/settings-toggle.gd | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd index 53db3e5c..ed32cbdb 100644 --- a/table/settings-toggle.gd +++ b/table/settings-toggle.gd @@ -3,14 +3,10 @@ extends LineEdit var checkbutton_material: Material -func _enter_tree() -> void: +func _ready() -> void: ProjectSettings.connect('settings_changed', on_setting_changed) -func _exit_tree() -> void: - ProjectSettings.disconnect('settings_changed', apply_colors) - - func on_setting_changed(): var cb = $CheckButton checkbutton_material = cb.material From ea4e464e9d2f2e188d49f15054827351ab684e75 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 15:39:04 +0300 Subject: [PATCH 07/15] =?UTF-8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- table/ячейка-2.gd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/table/ячейка-2.gd b/table/ячейка-2.gd index 75345cef..a475c4e0 100644 --- a/table/ячейка-2.gd +++ b/table/ячейка-2.gd @@ -1,9 +1,8 @@ extends LineEdit -# Вызывается + func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) func _exit_tree() -> void: ProjectSettings.disconnect('settings_changed', apply_colors) -func _ready() -> void: print_debug() func apply_colors(): From 6bcaf2561ccf2ae31901d0032a8ff5ec929a7c22 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 26 Jan 2026 16:01:19 +0300 Subject: [PATCH 08/15] =?UTF-8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/prd-ctl-config.gd | 16 ++++++++-------- table/settings-toggle.gd | 3 +-- table/ячейка-цвет.gd | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/scripts/prd-ctl-config.gd b/scripts/prd-ctl-config.gd index b5851062..c21ca4c8 100644 --- a/scripts/prd-ctl-config.gd +++ b/scripts/prd-ctl-config.gd @@ -154,7 +154,7 @@ func _ensure_config_exists() -> bool: # Проверяем, нужно ли обновить конфигурацию if _should_update_config(): return _update_config() - + # Если файл уже существует - все ок if FileAccess.file_exists(CONFIG_PATH): return true @@ -172,13 +172,13 @@ func _should_update_config() -> bool: # Если файла конфигурации нет - нужно создать if not FileAccess.file_exists(CONFIG_PATH): return true - + # Проверяем версию существующей конфигурации var config_file = FileAccess.open(CONFIG_PATH, FileAccess.READ) if config_file: var json_text = config_file.get_as_text() config_file.close() - + var json = JSON.new() if json.parse(json_text) == OK: var existing_version = json.data.get("config_version", "0.0.0") @@ -187,7 +187,7 @@ func _should_update_config() -> bool: else: # Если ошибка парсинга - нужно обновить return true - + return false @@ -196,16 +196,16 @@ func _should_update_config() -> bool: static func _compare_versions(version1: String, version2: String) -> int: var v1_parts = version1.split(".") var v2_parts = version2.split(".") - + for i in range(max(v1_parts.size(), v2_parts.size())): var v1_part = int(v1_parts[i]) if i < v1_parts.size() else 0 var v2_part = int(v2_parts[i]) if i < v2_parts.size() else 0 - + if v1_part < v2_part: return -1 elif v1_part > v2_part: return 1 - + return 0 @@ -216,7 +216,7 @@ func _update_config() -> bool: var backup_path = CONFIG_PATH + ".backup_v" + _current_version DirAccess.copy_absolute(CONFIG_PATH, backup_path) print("Создана резервная копия: ", backup_path) - + # Копируем актуальную конфигурацию return _copy_default_config() diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd index ed32cbdb..f1fe8077 100644 --- a/table/settings-toggle.gd +++ b/table/settings-toggle.gd @@ -8,8 +8,7 @@ func _ready() -> void: func on_setting_changed(): - var cb = $CheckButton - checkbutton_material = cb.material + checkbutton_material = $CheckButton.material apply_colors() diff --git a/table/ячейка-цвет.gd b/table/ячейка-цвет.gd index ee345528..03e60cc5 100644 --- a/table/ячейка-цвет.gd +++ b/table/ячейка-цвет.gd @@ -3,7 +3,7 @@ extends ColorPickerButton func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) - + func _exit_tree() -> void: ProjectSettings.disconnect('settings_changed', apply_colors) From aae9bc6795f2c949a73f19ae5a11897c82a120b1 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Tue, 27 Jan 2026 16:40:14 +0300 Subject: [PATCH 09/15] =?UTF-8?q?=D0=A7=D0=B8=D1=81=D1=82=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/button-flat/nine-patch-button.gd | 19 +------------------ scenes/эмс2/эмс-тг.gd | 4 ++-- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/scenes/button-flat/nine-patch-button.gd b/scenes/button-flat/nine-patch-button.gd index 6fe49ab2..e47b96f7 100644 --- a/scenes/button-flat/nine-patch-button.gd +++ b/scenes/button-flat/nine-patch-button.gd @@ -92,12 +92,11 @@ func _enter_tree() -> void: $back.scale = size $back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0)) $button.connect('toggled', _on_button_toggled) - ProjectSettings.connect("settings_changed", _on_settings_changed) pressed = _pressed func _on_settings_changed(): - apply_colors(ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false )) + pass func _exit_tree() -> void: @@ -111,19 +110,3 @@ func set_toggle_mode(val: bool): func _on_button_toggled(val: bool): if val: $state.set_texture(texture_state1) else: $state.set_texture(texture_state0) - - -func apply_colors(is_light: bool): - pass - #if is_light: - #$button.add_theme_color_override("font_color", Color.WHITE) - #$button.add_theme_color_override("font_hover_color", Color.WHITE) - #$button.add_theme_color_override("font_pressed_color", Color.WHITE) - #$button.add_theme_color_override("font_focus_color", Color.BLACK) - #$button.add_theme_color_override("font_disabled_color", Color.WHITE) - #$button.add_theme_color_override("font_shadow_color", Color.LIGHT_GOLDENROD) - #else: - #$button.remove_theme_color_override("font_color") - #$button.remove_theme_color_override("font_hover_color") - #$button.remove_theme_color_override("font_pressed_color") - #$button.remove_theme_color_override("font_disabled_color") diff --git a/scenes/эмс2/эмс-тг.gd b/scenes/эмс2/эмс-тг.gd index 1bb69d43..0a6354ea 100644 --- a/scenes/эмс2/эмс-тг.gd +++ b/scenes/эмс2/эмс-тг.gd @@ -7,9 +7,9 @@ func _ready() -> void: signaller.connect('sector_klaster', Callable(self, 'on_sector_klaster').bind(unit_trassa)) -func on_trassa_line_changed(unit_trassa): +func on_trassa_line_changed(_unit_trassa): pass -func on_sector_klaster(_data, unit_trassa): +func on_sector_klaster(_data, _unit_trassa): pass From ef5cffe0937038eab42f843d9122f02b0fea42a5 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Tue, 27 Jan 2026 16:42:18 +0300 Subject: [PATCH 10/15] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=80=D0=B5=D1=81?= =?UTF-8?q?=D1=81=D0=B8=D1=8F.=20=D0=9F=D1=80=D0=BE=D0=B8=D0=B7=D0=B2?= =?UTF-8?q?=D0=BE=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C.=20=D0=9E=D0=B1=D1=80=D0=B0=D1=89=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BA=20=D0=BF=D0=BE=D0=BB=D1=8E=20Control.bg?= =?UTF-8?q?=5Fcolor=20=D0=B7=D0=B0=D0=BD=D0=B8=D0=BC=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?=D0=BE=D1=87=D0=B5=D0=BD=D1=8C=20=D0=BC=D0=BD=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/работа/работа.gd | 3 ++- table/lable.gd | 27 ++++++++++++++++----------- table/node.gd | 27 ++++++++++++++++----------- table/set-toggle.gd | 33 ++++++++++++++++++--------------- table/settings-toggle.gd | 28 +++++++++++++++++----------- table/ячейка-2.gd | 39 +++++++++++++++++++++++++++------------ table/ячейка-цвет.gd | 26 +++++++++++++++----------- 7 files changed, 111 insertions(+), 72 deletions(-) diff --git a/scenes/работа/работа.gd b/scenes/работа/работа.gd index 5d199846..e582d31a 100644 --- a/scenes/работа/работа.gd +++ b/scenes/работа/работа.gd @@ -698,7 +698,8 @@ func on_th_aoa_update(ths): func count_threats(ths): - $count_all_pad/count_all.text = '%02d' % ths.size() if ths.size() < 100 else 99 + var c0: int = ths.size() if ths.size() < 100 else 99 + $count_all_pad/count_all.text = '%02d' % c0 var c: int = 0 if gos_flag: c = ths.values().filter(func(th: threats.Threat): return th.proto != '').size() diff --git a/table/lable.gd b/table/lable.gd index 4d8c7696..ccf4a45e 100644 --- a/table/lable.gd +++ b/table/lable.gd @@ -1,19 +1,24 @@ extends Label +static var styles: = [null, null] +static var init_done: = false -func _enter_tree() -> void: + +func _init() -> void: + if init_done: + init_done = true + var style_light: = get_theme_stylebox('normal') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark ProjectSettings.connect('settings_changed', apply_colors) - - -func _exit_tree() -> void: - ProjectSettings.disconnect('settings_changed', apply_colors) + apply_colors() func apply_colors(): - 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 + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): + add_theme_stylebox_override('normal', styles[1]) else: - style.bg_color = Color(0.12, 0.12, 0.12) - add_theme_stylebox_override('normal', style) + add_theme_stylebox_override('normal', styles[0]) diff --git a/table/node.gd b/table/node.gd index e0a9c2da..2e2d23b9 100644 --- a/table/node.gd +++ b/table/node.gd @@ -1,23 +1,28 @@ extends LineEdit -func _enter_tree() -> void: +static var styles: = [null, null] +static var init_done: = false + +func _init() -> void: + if not init_done: + init_done = true + var style_light: = get_theme_stylebox('read_only') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark ProjectSettings.connect('settings_changed', apply_colors) - - -func _exit_tree() -> void: - ProjectSettings.disconnect('settings_changed', apply_colors) + apply_colors() func apply_colors(): - 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 + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): add_theme_color_override('font_color_readonly', Color.BLACK) add_theme_color_override('font_color_placeholder', Color(0, 0, 0, 0.5)) + add_theme_stylebox_override('read_only', styles[1]) 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) + add_theme_stylebox_override('read_only', styles[0]) diff --git a/table/set-toggle.gd b/table/set-toggle.gd index ce6c8e2b..5419f0ef 100644 --- a/table/set-toggle.gd +++ b/table/set-toggle.gd @@ -1,10 +1,20 @@ extends LineEdit +static var styles = [null, null] +static var init_done: = false + var checkbutton_material: Material -func _enter_tree() -> void: - ProjectSettings.connect('settings_changed', on_setting_changed) +func _init() -> void: + if not init_done: + init_done = true + var style_light: = get_theme_stylebox('read_only') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark func _exit_tree() -> void: @@ -12,21 +22,14 @@ func _exit_tree() -> void: func on_setting_changed(): - var cb = $CheckButton - checkbutton_material = cb.material + checkbutton_material = $CheckButton.material apply_colors() func apply_colors(): - 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 + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): + add_theme_stylebox_override('read_only', styles[1]) + $CheckButton.material = null else: - style.bg_color = Color(0.12, 0.12, 0.12) - add_theme_stylebox_override('read_only', style) - var cb = $CheckButton - if is_light: - cb.material = null - else: - cb.material = checkbutton_material + add_theme_stylebox_override('read_only', styles[0]) + $CheckButton.material = checkbutton_material diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd index f1fe8077..bcc25e16 100644 --- a/table/settings-toggle.gd +++ b/table/settings-toggle.gd @@ -1,10 +1,21 @@ extends LineEdit +static var styles = [null, null] +static var init_done: = false + var checkbutton_material: Material -func _ready() -> void: +func _init() -> void: ProjectSettings.connect('settings_changed', on_setting_changed) + if not init_done: + init_done = true + var style_light: = get_theme_stylebox('read_only') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark func on_setting_changed(): @@ -13,15 +24,10 @@ func on_setting_changed(): func apply_colors(): - var is_light: bool = ProjectSettings.get_setting('application/config/Цвет темы программы', false) - var style = get_theme_stylebox('read_only').duplicate() + var is_light: bool = ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false) if is_light: - style.bg_color = Color.GRAY + add_theme_stylebox_override('read_only', styles[1]) + $CheckButton.material = null else: - style.bg_color = Color(0.12, 0.12, 0.12) - add_theme_stylebox_override('read_only', style) - var cb = $CheckButton - if is_light: - cb.material = null - else: - cb.material = checkbutton_material + add_theme_stylebox_override('read_only', styles[0]) + $CheckButton.material = checkbutton_material diff --git a/table/ячейка-2.gd b/table/ячейка-2.gd index a475c4e0..b2cdbbf2 100644 --- a/table/ячейка-2.gd +++ b/table/ячейка-2.gd @@ -1,23 +1,38 @@ extends LineEdit +static var styles = [[null, null], [null, null]] +static var init_done: = false -func _enter_tree() -> void: ProjectSettings.connect('settings_changed', apply_colors) -func _exit_tree() -> void: ProjectSettings.disconnect('settings_changed', apply_colors) + +func _init() -> void: + ProjectSettings.connect('settings_changed', apply_colors) + if not init_done: + init_done = true + var style_0_light = get_theme_stylebox('normal') + var style_1_light = get_theme_stylebox('read_only') + + style_0_light.bg_color = Color(0.12, 0.12, 0.12) + style_1_light.bg_color = Color(0.12, 0.12, 0.12) + styles[1][0] = style_0_light + styles[1][1] = style_1_light + + var style_0_dark = style_0_light.duplicate(true) + var style_1_dark = style_1_light.duplicate(true) + + style_0_light.bg_color = Color.GRAY + style_1_light.bg_color = Color.GRAY + styles[0][0] = style_0_dark + styles[0][1] = style_1_dark func apply_colors(): - 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 + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): add_theme_color_override('font_color', Color.BLACK) add_theme_color_override('font_uneditable_color', Color.BLACK) + add_theme_stylebox_override('normal', styles[1][0]) + add_theme_stylebox_override('read_only', styles[1][1]) 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) + add_theme_stylebox_override('normal', styles[0][0]) + add_theme_stylebox_override('read_only', styles[0][1]) diff --git a/table/ячейка-цвет.gd b/table/ячейка-цвет.gd index 03e60cc5..19b38ea8 100644 --- a/table/ячейка-цвет.gd +++ b/table/ячейка-цвет.gd @@ -1,19 +1,23 @@ extends ColorPickerButton +static var styles = [null, null] +static var init_done: = false -func _enter_tree() -> void: + +func _init() -> void: ProjectSettings.connect('settings_changed', apply_colors) - - -func _exit_tree() -> void: - ProjectSettings.disconnect('settings_changed', apply_colors) + if not init_done: + init_done = true + var style_light: = get_theme_stylebox('normal') + style_light.bg_color = Color.GRAY + styles[1] = style_light + var style_dark: = style_light.duplicate(true) + style_dark.bg_color = Color(0.12, 0.12, 0.12) + styles[0] = style_dark func apply_colors(): - 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 + if ProjectSettings.get_setting('application/config/%s' % 'Цвет темы программы', false): + add_theme_stylebox_override('normal', styles[1]) else: - style.bg_color = Color(0.12, 0.12, 0.12) - add_theme_stylebox_override('normal', style) + add_theme_stylebox_override('normal', styles[0]) From 3c0fa8be821c24c16cdbb26a0ec392c67b54d854 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Wed, 28 Jan 2026 10:16:19 +0300 Subject: [PATCH 11/15] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D1=86=D0=B2=D0=B5=D1=82=D0=BE=D0=B2=D0=B0=D1=8F=20=D1=81=D1=85?= =?UTF-8?q?=D0=B5=D0=BC=D0=B0=20=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B8=D1=80=D1=83=D0=B5=D1=82=D1=81=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D0=B8?= =?UTF-8?q?=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- table/set-toggle.gd | 6 ++---- table/table.gd | 2 -- table/ячейка-2.gd | 3 ++- table/ячейка-цвет.gd | 3 ++- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/table/set-toggle.gd b/table/set-toggle.gd index 5419f0ef..6f3d2a9a 100644 --- a/table/set-toggle.gd +++ b/table/set-toggle.gd @@ -15,10 +15,8 @@ func _init() -> void: var style_dark: = style_light.duplicate(true) style_dark.bg_color = Color(0.12, 0.12, 0.12) styles[0] = style_dark - - -func _exit_tree() -> void: - ProjectSettings.disconnect('settings_changed', on_setting_changed) + ProjectSettings.connect('settings_changed', on_setting_changed) + call_deferred('on_setting_changed') func on_setting_changed(): diff --git a/table/table.gd b/table/table.gd index ce2019c4..972acd64 100644 --- a/table/table.gd +++ b/table/table.gd @@ -392,8 +392,6 @@ func add_row(row_types: Array) -> void: _assert(node.get('name') is StringName, 'экземпляр не имеет поля \"name\"') var node_key: String = NODE_KEY_FORMAT % [i_row, i_col] node.name = node_key - if node.has_method('apply_colors'): - node.apply_colors() add_child(node) if allow_set_size: node.custom_minimum_size.x = columns_min_size[i_col] diff --git a/table/ячейка-2.gd b/table/ячейка-2.gd index b2cdbbf2..42adbafc 100644 --- a/table/ячейка-2.gd +++ b/table/ячейка-2.gd @@ -5,7 +5,6 @@ static var init_done: = false func _init() -> void: - ProjectSettings.connect('settings_changed', apply_colors) if not init_done: init_done = true var style_0_light = get_theme_stylebox('normal') @@ -23,6 +22,8 @@ func _init() -> void: style_1_light.bg_color = Color.GRAY styles[0][0] = style_0_dark styles[0][1] = style_1_dark + ProjectSettings.connect('settings_changed', apply_colors) + apply_colors() func apply_colors(): diff --git a/table/ячейка-цвет.gd b/table/ячейка-цвет.gd index 19b38ea8..5635b9c1 100644 --- a/table/ячейка-цвет.gd +++ b/table/ячейка-цвет.gd @@ -5,7 +5,6 @@ static var init_done: = false func _init() -> void: - ProjectSettings.connect('settings_changed', apply_colors) if not init_done: init_done = true var style_light: = get_theme_stylebox('normal') @@ -14,6 +13,8 @@ func _init() -> void: var style_dark: = style_light.duplicate(true) style_dark.bg_color = Color(0.12, 0.12, 0.12) styles[0] = style_dark + ProjectSettings.connect('settings_changed', apply_colors) + apply_colors() func apply_colors(): From 23acb2703eeda4ad853eec148e348b73e290e5de Mon Sep 17 00:00:00 2001 From: sasha80 Date: Wed, 28 Jan 2026 12:03:43 +0300 Subject: [PATCH 12/15] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=83=D1=82=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=81=D1=86=D0=B5=D0=BD=20=D1=83=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/эмс/эмс.gd | 27 +++++++++++++++------------ scenes/эмс/эмс.tscn | 19 ++++++++++++++++++- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/scenes/эмс/эмс.gd b/scenes/эмс/эмс.gd index ebb6d212..79fa1077 100644 --- a/scenes/эмс/эмс.gd +++ b/scenes/эмс/эмс.gd @@ -1,24 +1,24 @@ class_name ems extends Panel ## Предзагрузка ячеек таблиц. -const TableHeader = preload('res://table/header.tscn') -const TableLabel = preload('res://table/lable.tscn') -const CellYemsButton = preload('res://scenes/эмс/кнопка-эмс.tscn') -const CellLineEdit = preload('res://table/ячейка-2.tscn') -const CellState = preload('res://scenes/эмс/состояния-эмс.tscn') -const CellOptBtn = preload('res://scenes/эмс/кнопка-5.tscn') -const CellLEEmpty = preload('res://scenes/эмс/line-edit-empty.tscn') -const CellFront = preload('res://scenes/cell/cell-front.tscn') -const CellFrontRear = preload('res://scenes/cell/cell-front-rear.tscn') +@export var TableHeader: PackedScene +@export var TableLabel: PackedScene +@export var CellYemsButton: PackedScene +@export var CellLineEdit: PackedScene +@export var CellState: PackedScene +@export var CellOptBtn: PackedScene +@export var CellLEEmpty: PackedScene +@export var CellFront: PackedScene +@export var CellFrontRear: PackedScene ## Режимы работы выходов. const OUT_MODE: Array = ['Работа', 'Контроль', '0', '1'] # const COLUMN_OPTS_BTN: Array = [5] const TABLE_ENTRY_COLUMNS: Array = [2,3] -const OUT_SET_ROW: Array = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty] -const IN_SET_ROW: Array = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty] +var OUT_SET_ROW: Array +var IN_SET_ROW: Array -var FILES_ROWS_TYPES = [CellLineEdit, CellLineEdit, CellLineEdit ] +var FILES_ROWS_TYPES: Array var g_boards: Dictionary ## Словарь плат ЭМС. var active_board = null ## Активная плата ЭМС @@ -32,6 +32,9 @@ func _ready() -> void: ## Инициализация основных элементов экрана ЭМС. func init_boards(): + OUT_SET_ROW = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty] + IN_SET_ROW = [CellLineEdit, CellLEEmpty, CellLEEmpty, CellLEEmpty, CellLEEmpty] + FILES_ROWS_TYPES = [CellLineEdit, CellLineEdit, CellLineEdit ] var unit_ems = network.get_unit_instance('уарэп-эмс') # Выставление позиций элементов ЭМС на экране diff --git a/scenes/эмс/эмс.tscn b/scenes/эмс/эмс.tscn index d88aa9a8..4ed74639 100644 --- a/scenes/эмс/эмс.tscn +++ b/scenes/эмс/эмс.tscn @@ -1,12 +1,20 @@ -[gd_scene load_steps=20 format=3 uid="uid://dab6loryocc73"] +[gd_scene load_steps=28 format=3 uid="uid://dab6loryocc73"] [ext_resource type="Script" uid="uid://do1s7qg4bmxqy" path="res://scenes/эмс/эмс.gd" id="1_mk57x"] +[ext_resource type="PackedScene" uid="uid://ch14g46swx74h" path="res://table/header.tscn" id="2_1fbmy"] [ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="2_eju8r"] +[ext_resource type="PackedScene" uid="uid://dwphmxstaxn4v" path="res://table/lable.tscn" id="3_31xk8"] [ext_resource type="Texture2D" uid="uid://csnts8f155sf7" path="res://data/save1.png" id="3_onafb"] [ext_resource type="Texture2D" uid="uid://o8mam0a060d8" path="res://data/load1.png" id="4_afjfs"] +[ext_resource type="PackedScene" uid="uid://dspa16ufrpanp" path="res://table/ячейка-2.tscn" id="4_o3av6"] +[ext_resource type="PackedScene" uid="uid://by22sta8tt8dn" path="res://scenes/эмс/состояния-эмс.tscn" id="5_owc4r"] [ext_resource type="Texture2D" uid="uid://bdlbqs88bki8x" path="res://data/connect-a.png" id="5_wk8og"] [ext_resource type="Texture2D" uid="uid://u3tnejvpm8it" path="res://data/disconnect-a.png" id="6_1fbmy"] +[ext_resource type="PackedScene" uid="uid://dwcol6jg2syof" path="res://scenes/эмс/кнопка-5.tscn" id="6_k0fjr"] +[ext_resource type="PackedScene" uid="uid://c480ipkjckkdn" path="res://scenes/эмс/line-edit-empty.tscn" id="7_k0fjr"] +[ext_resource type="PackedScene" uid="uid://bccr42bckei41" path="res://scenes/cell/cell-front.tscn" id="8_k30d1"] [ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="8_qcl30"] +[ext_resource type="PackedScene" uid="uid://b8txs4xi722wt" path="res://scenes/cell/cell-front-rear.tscn" id="9_js36y"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mu34x"] texture = ExtResource("3_onafb") @@ -64,6 +72,15 @@ texture = ExtResource("6_1fbmy") offset_right = 1598.0 offset_bottom = 1201.0 script = ExtResource("1_mk57x") +TableHeader = ExtResource("2_1fbmy") +TableLabel = ExtResource("3_31xk8") +CellYemsButton = ExtResource("4_o3av6") +CellLineEdit = ExtResource("4_o3av6") +CellState = ExtResource("5_owc4r") +CellOptBtn = ExtResource("6_k0fjr") +CellLEEmpty = ExtResource("7_k0fjr") +CellFront = ExtResource("8_k30d1") +CellFrontRear = ExtResource("9_js36y") [node name="lbl_online" type="Label" parent="."] layout_mode = 0 From 416e93c4e42627e234f4e3bf6710f56414225ae2 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Wed, 28 Jan 2026 13:53:50 +0300 Subject: [PATCH 13/15] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=83=D1=82=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=81=D1=86=D0=B5=D0=BD=20=D1=83=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/настройки/настройки.gd | 70 ++++++++++++++++++--------------- scenes/настройки/настройки.tscn | 10 ++++- scenes/работа/работа.tscn | 1 - scenes/эмс/кнопка-эмс.gd | 32 ++++++++++++--- scenes/эмс/кнопка-эмс.tscn | 7 +++- scripts/prd-ctl-config.gd | 69 ++++++++++++++++---------------- 6 files changed, 112 insertions(+), 77 deletions(-) diff --git a/scenes/настройки/настройки.gd b/scenes/настройки/настройки.gd index d6ade08a..dd1ba51d 100644 --- a/scenes/настройки/настройки.gd +++ b/scenes/настройки/настройки.gd @@ -1,14 +1,42 @@ class_name configure extends Panel -const TableHeader = preload('res://table/header.tscn') -const TableToggle = preload('res://table/settings-toggle.tscn') -const TableEdit = preload('res://table/ячейка-2.tscn') -const TableColorPick = preload('res://table/ячейка-цвет.tscn') +@export var TableHeader: PackedScene +@export var TableToggle: PackedScene +@export var TableEdit: PackedScene +@export var TableColorPick: PackedScene const ALIGNMENT = [HORIZONTAL_ALIGNMENT_CENTER, HORIZONTAL_ALIGNMENT_CENTER] -const HEADER_ROW = [TableHeader, TableHeader] -const HEADER_ROW_TEXT = ['Параметр', 'Значение'] -const SETTING_TABLE = [ +const HEADER_ROW_TEXT: = ['Параметр', 'Значение'] + +var HEADER_ROW: Array + +## TODO: Придумать как избавиться от индексов +## Индексы строк таблицы. +const EXTERNAL_CU = 16 ## Внешнее целеуказание +const TRASSA = 17 ## Строка - Трасса +const SUPPRESS = 18 ## Строка - Подавление +const KEYBOARD = 19 ## Строка - Виртуальная клавиатура +const HIDE_EMS2 = 20 ## Строка - Скрыть вкладку ЭМС 2 +const DEBAG_CONTROL = 21 ## Строка - Отладка контроля +const COMMIT = 22 ## Строка - Версия УАРЭП +const GOS_BTN = 52 ## Разрешить работу по своим целям +const COLOR_BTN_ACT = 54 ## Цвет кнопки "Подавление" +const COLOR_WHITE = 55 ## Цвет фона схемы +const COLOR_BLACK = 56 ## Цвет схемы +const COLOR_THEME = 57 ## Цвет темы + +var SETTING_TABLE: Array + +var name_to_line_index: = {} ## Для преобразования названия параметра в номер строки +var table_color_instance: Node ## Нода цвета кнопки подавления + +func on_checkbutton_pressed(i_row: int): + on_row_pressed(i_row) + + +func _init_scene_arrays(): + HEADER_ROW = [TableHeader, TableHeader] + SETTING_TABLE = [ ['Ограниченный режим', TableEdit, TableToggle, 'Ограничть возможности по постановке помех'], # 0 ['Кнопка «ПД-М4»', TableEdit, TableToggle, 'Разрешить отображение кнопки'], # 1 ['Кнопка «ПД-М2»', TableEdit, TableToggle, 'Разрешить отображение кнопки'], # 2 @@ -71,29 +99,6 @@ const SETTING_TABLE = [ ['Время повторной отправки помехи', TableEdit, TableEdit, 'Изменение времени повторной отправки помехи'] ] # 59 -## TODO: Придумать как избавиться от индексов -## Индексы строк таблицы. -const EXTERNAL_CU = 16 ## Внешнее целеуказание -const TRASSA = 17 ## Строка - Трасса -const SUPPRESS = 18 ## Строка - Подавление -const KEYBOARD = 19 ## Строка - Виртуальная клавиатура -const HIDE_EMS2 = 20 ## Строка - Скрыть вкладку ЭМС 2 -const DEBAG_CONTROL = 21 ## Строка - Отладка контроля -const COMMIT = 22 ## Строка - Версия УАРЭП -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: = {} ## Для преобразования названия параметра в номер строки -var table_color_instance: Node ## Нода цвета кнопки подавления - -func on_checkbutton_pressed(i_row: int): - on_row_pressed(i_row) - - ## Вызывается, когда узел впервые попадает в дерево сцены. func _ready() -> void: setting_tab() @@ -105,14 +110,14 @@ func _ready() -> void: func on_external_cu_btn_pressed(btn) -> void: - ProjectSettings.set_setting('application/config/Внешнее управление', btn.button_pressed) + ProjectSettings.set_setting('application/config/%s' % 'Внешнее управление', 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) + ProjectSettings.set_setting('application/config/%s' % 'Внешнее указание Трасса', btn.button_pressed) _autosave_now() @@ -180,6 +185,7 @@ func parse_cmd_line_args(settings_data: Dictionary): func setting_tab(): + _init_scene_arrays() $heard_table.set_header(HEADER_ROW) $heard_table.set_header_text(HEADER_ROW_TEXT) $heard_table.set_columns_min_size([600, 950]) diff --git a/scenes/настройки/настройки.tscn b/scenes/настройки/настройки.tscn index 88f5604f..586733e5 100644 --- a/scenes/настройки/настройки.tscn +++ b/scenes/настройки/настройки.tscn @@ -1,10 +1,18 @@ -[gd_scene load_steps=3 format=3 uid="uid://bnptm4rlp60dq"] +[gd_scene load_steps=7 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="PackedScene" uid="uid://ch14g46swx74h" path="res://table/header.tscn" id="2_l8r7w"] +[ext_resource type="PackedScene" uid="uid://5rw652cmnybi" path="res://table/settings-toggle.tscn" id="3_6e5sv"] +[ext_resource type="PackedScene" uid="uid://dspa16ufrpanp" path="res://table/ячейка-2.tscn" id="4_i0f0r"] +[ext_resource type="PackedScene" uid="uid://cug5xjbfdm7x7" path="res://table/ячейка-цвет.tscn" id="5_h2mq4"] [node name="Настройки" type="Panel"] script = ExtResource("1_60bya") +TableHeader = ExtResource("2_l8r7w") +TableToggle = ExtResource("3_6e5sv") +TableEdit = ExtResource("4_i0f0r") +TableColorPick = ExtResource("5_h2mq4") [node name="heard_table" type="GridContainer" parent="."] layout_mode = 0 diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 6220c622..96f87bf0 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -96,7 +96,6 @@ text = "Обзорная карта" self_modulate = Color(1, 1, 1, 0.415686) position = Vector2(360, 360) min_zoom_level = 3 -max_zoom_level_server = 11 ship_radius_km = 3.0 az = 3.0 diff --git a/scenes/эмс/кнопка-эмс.gd b/scenes/эмс/кнопка-эмс.gd index 4937b7de..511d4e40 100644 --- a/scenes/эмс/кнопка-эмс.gd +++ b/scenes/эмс/кнопка-эмс.gd @@ -3,21 +3,33 @@ extends PanelContainer -@export var texture_state0: Texture2D = preload('res://data/кнопка-эмс-1.png'): - set(val): $state.set_texture(val) +@export var texture_state0: Texture2D: + set(val): + texture_state0 = val + if is_inside_tree(): + $state.set_texture(val) -@export var texture_state1: Texture2D = preload('res://data/кнопка-эмс-0.png'): - set(val): $state.set_texture(val) +@export var texture_state1: Texture2D: + set(val): + texture_state1 = val + if is_inside_tree(): + $state.set_texture(val) @export var text: String = '': - set(val): $button.set_text(val) + set(val): + text = val + if is_inside_tree(): + $button.set_text(val) get: return $button.get_text() @export var pressed: bool = false: - set(val): $button.set_pressed(val) + set(val): + pressed = val + if is_inside_tree(): + $button.set_pressed(val) get: return $button.is_pressed() @@ -28,6 +40,14 @@ extends PanelContainer get: return $button.is_toggle_mode() +func _enter_tree() -> void: + var tst = texture_state1 if $button.pressed else texture_state0 + $state.set_texture(tst) + $button.set_text(text) + $button.set_pressed(pressed) + $button.set_toggle_mode(toggle_mode) + + func set_text (val: String): $button.set_text(val) func set_pressed (val: bool): $button.set_pressed(val) diff --git a/scenes/эмс/кнопка-эмс.tscn b/scenes/эмс/кнопка-эмс.tscn index 3b55dc2d..93979030 100644 --- a/scenes/эмс/кнопка-эмс.tscn +++ b/scenes/эмс/кнопка-эмс.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=9 format=3 uid="uid://gh3wqymu7cub"] +[gd_scene load_steps=10 format=3 uid="uid://gh3wqymu7cub"] [ext_resource type="Script" uid="uid://dhqqyf2pd1scs" path="res://scenes/эмс/кнопка-эмс.gd" id="1_pmsh3"] [ext_resource type="Texture2D" uid="uid://nfpish471rjj" path="res://data/кнопка-эмс-1.png" id="2_0o537"] +[ext_resource type="Texture2D" uid="uid://bvxv33noium2h" path="res://data/кнопка-эмс-0.png" id="3_okiyh"] [sub_resource type="StyleBoxEmpty" id="1"] @@ -20,12 +21,14 @@ offset_right = 30.0 offset_bottom = 30.0 theme_override_styles/panel = SubResource("1") script = ExtResource("1_pmsh3") +texture_state0 = ExtResource("2_0o537") +texture_state1 = ExtResource("3_okiyh") toggle_mode = true [node name="state" type="NinePatchRect" parent="."] show_behind_parent = true layout_mode = 2 -texture = ExtResource("2_0o537") +texture = ExtResource("3_okiyh") region_rect = Rect2(-1.60803, -1.94625, 31.9305, 25.9868) patch_margin_left = 6 patch_margin_top = 5 diff --git a/scripts/prd-ctl-config.gd b/scripts/prd-ctl-config.gd index c21ca4c8..fb886959 100644 --- a/scripts/prd-ctl-config.gd +++ b/scripts/prd-ctl-config.gd @@ -1,28 +1,28 @@ class_name PRDConfigManager extends RefCounted -## Менеджер конфигурации для системы контроля ПРД -## Загружает и управляет настройками из JSON-конфигурации +## Менеджер конфигурации для системы контроля ПРД. +## Загружает и управляет настройками из JSON-конфигурации. #region CONSTANTS -const CONFIG_PATH = "user://config/setting_prd_control.json" -const DEFAULT_CONFIG_PATH = "res://config/setting_prd_control.json" -const CONFIG_VERSION = "1.0.0" # Версия конфигурации - увеличивать при изменениях +const CONFIG_PATH = 'user://config/setting_prd_control.json' +const DEFAULT_CONFIG_PATH = 'res://config/setting_prd_control.json' +const CONFIG_VERSION = '1.0.0' # Версия конфигурации - увеличивать при изменениях #endregion #region PRIVATE_VARIABLES -var _config_data: Dictionary # Все данные конфигурации -var _device_constants: Dictionary # Константы устройств -var _base_configs: Dictionary # Базовые конфигурации -var _device_configs: Dictionary # Конфигурации устройств -var _data_indices: Dictionary # Индексы данных -var _fs_keys: Dictionary # Ключи ФС (функциональных систем) -var _temperature_constants: Dictionary # Константы температуры -var _ems_input_bits_config: Dictionary # Конфигурация битов ввода ЭМС -var _fs_rules: Array # Правила ФС +var _config_data: Dictionary ## Все данные конфигурации +var _device_constants: Dictionary ## Константы устройств +var _base_configs: Dictionary ## Базовые конфигурации +var _device_configs: Dictionary ## Конфигурации устройств +var _data_indices: Dictionary ## Индексы данных +var _fs_keys: Dictionary ## Ключи ФС (функциональных систем) +var _temperature_constants: Dictionary ## Константы температуры +var _ems_input_bits_config: Dictionary ## Конфигурация битов ввода ЭМС +var _fs_rules: Array ## Правила ФС -var _is_loaded: bool = false # Флаг успешной загрузки -var _current_version: String = "" # Текущая версия загруженной конфигурации +var _is_loaded: bool = false ## Флаг успешной загрузки +var _current_version: String ## Текущая версия загруженной конфигурации #endregion #region INITIALIZATION @@ -101,27 +101,27 @@ func _load_configuration() -> void: var parse_result = json.parse(json_text) if parse_result == OK: _config_data = json.data - _current_version = _config_data.get("config_version", "0.0.0") + _current_version = _config_data.get('config_version', '0.0.0') _parse_config_data() _is_loaded = true else: - push_error("Ошибка разбора JSON конфигурации: " + json.get_error_message()) + push_error('Ошибка разбора JSON конфигурации: ' + json.get_error_message()) _is_loaded = false else: - push_error("Ошибка загрузки файла конфигурации: " + CONFIG_PATH) + push_error('Ошибка загрузки файла конфигурации: ' + CONFIG_PATH) _is_loaded = false ## Парсит данные конфигурации по секциям func _parse_config_data() -> void: - _device_constants = _convert_numbers(_config_data.get("device_constants", {})) - _base_configs = _convert_numbers(_config_data.get("base_configs", {})) - _device_configs = _convert_numbers(_config_data.get("device_configs", {})) - _data_indices = _convert_numbers(_config_data.get("data_indices", {})) - _fs_keys = _convert_numbers(_config_data.get("fs_keys", {})) - _temperature_constants = _convert_numbers(_config_data.get("temperature_constants", {})) - _ems_input_bits_config = _convert_numbers(_config_data.get("ems_input_bits_config", {})) - _fs_rules = _convert_numbers(_config_data.get("fs_rules", [])) + _device_constants = _convert_numbers(_config_data.get('device_constants', {})) + _base_configs = _convert_numbers(_config_data.get('base_configs', {})) + _device_configs = _convert_numbers(_config_data.get('device_configs', {})) + _data_indices = _convert_numbers(_config_data.get('data_indices', {})) + _fs_keys = _convert_numbers(_config_data.get('fs_keys', {})) + _temperature_constants = _convert_numbers(_config_data.get('temperature_constants', {})) + _ems_input_bits_config = _convert_numbers(_config_data.get('ems_input_bits_config', {})) + _fs_rules = _convert_numbers(_config_data.get('fs_rules', [])) ## Конвертирует числовые значения в правильные типы (float -> int если возможно) @@ -149,7 +149,7 @@ static func _convert_numbers(value): ## Создает папку и копирует дефолтный файл если нужно func _ensure_config_exists() -> bool: # Создаем папку конфигурации если не существует - DirAccess.make_dir_recursive_absolute("user://config") + DirAccess.make_dir_recursive_absolute('user://config') # Проверяем, нужно ли обновить конфигурацию if _should_update_config(): @@ -181,7 +181,7 @@ func _should_update_config() -> bool: var json = JSON.new() if json.parse(json_text) == OK: - var existing_version = json.data.get("config_version", "0.0.0") + var existing_version = json.data.get('config_version', '0.0.0') # Сравниваем версии return _compare_versions(existing_version, CONFIG_VERSION) < 0 else: @@ -194,8 +194,8 @@ func _should_update_config() -> bool: ## Сравнивает две версии (semantic versioning) ## Возвращает -1 если version1 < version2, 0 если равны, 1 если version1 > version2 static func _compare_versions(version1: String, version2: String) -> int: - var v1_parts = version1.split(".") - var v2_parts = version2.split(".") + var v1_parts = version1.split('.') + var v2_parts = version2.split('.') for i in range(max(v1_parts.size(), v2_parts.size())): var v1_part = int(v1_parts[i]) if i < v1_parts.size() else 0 @@ -213,9 +213,8 @@ static func _compare_versions(version1: String, version2: String) -> int: func _update_config() -> bool: # Создаем резервную копию старой конфигурации if FileAccess.file_exists(CONFIG_PATH): - var backup_path = CONFIG_PATH + ".backup_v" + _current_version + var backup_path = CONFIG_PATH + '.backup_v' + _current_version DirAccess.copy_absolute(CONFIG_PATH, backup_path) - print("Создана резервная копия: ", backup_path) # Копируем актуальную конфигурацию return _copy_default_config() @@ -224,13 +223,13 @@ func _update_config() -> bool: ## Копирует дефолтную конфигурацию в user директорию func _copy_default_config() -> bool: if not FileAccess.file_exists(DEFAULT_CONFIG_PATH): - push_error("Дефолтный файл конфигурации не найден: " + DEFAULT_CONFIG_PATH) + push_error('Файл конфигурации не найден: ' + DEFAULT_CONFIG_PATH) return false var src := FileAccess.open(DEFAULT_CONFIG_PATH, FileAccess.READ) var dst := FileAccess.open(CONFIG_PATH, FileAccess.WRITE) if src == null or dst == null: - push_error("Ошибка копирования конфигурации") + push_error('Ошибка копирования конфигурации') return false dst.store_string(src.get_as_text()) From 5e9ef983016e856373fb716543b26c460f085537 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Fri, 30 Jan 2026 09:50:53 +0300 Subject: [PATCH 14/15] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D0=B0.=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D0=BF=D1=83=D1=82=D0=B8=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=81=D1=86=D0=B5=D0=BD=20=D1=83=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/button-flat/button-flat.tscn | 9 ++++++-- scenes/button-flat/nine-patch-button.gd | 28 +++++++++++++++++-------- scenes/frame-ecm-list/frm-ecm-list.tscn | 14 ++++++++++++- scenes/работа/работа.tscn | 14 ++++++++++++- scenes/эмс/кнопка-эмс.tscn | 12 +++-------- scenes/эмс/эмс.tscn | 8 ++++++- table/set-toggle.gd | 2 +- table/settings-toggle.gd | 2 +- 8 files changed, 64 insertions(+), 25 deletions(-) diff --git a/scenes/button-flat/button-flat.tscn b/scenes/button-flat/button-flat.tscn index 35c9aa87..a296bbe1 100644 --- a/scenes/button-flat/button-flat.tscn +++ b/scenes/button-flat/button-flat.tscn @@ -1,15 +1,16 @@ -[gd_scene load_steps=13 format=3 uid="uid://da7w3vkhadfwe"] +[gd_scene load_steps=14 format=3 uid="uid://da7w3vkhadfwe"] [ext_resource type="Script" uid="uid://damy6n4u215pu" path="res://scenes/button-flat/nine-patch-button.gd" id="1_ui6sg"] [ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="2_0cn5u"] [ext_resource type="Shader" uid="uid://cdmmsf161l6yw" path="res://shaders/strips.gdshader" id="2_5ngiq"] +[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="3_tbv1w"] [sub_resource type="StyleBoxEmpty" id="1"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_hhdyc"] resource_local_to_scene = true shader = ExtResource("2_5ngiq") -shader_parameter/rotation = 0.0 +shader_parameter/rotation = 0.785398 shader_parameter/color = Vector4(1, 1, 1, 0.1) shader_parameter/width = 3.0 shader_parameter/speed = 0.0 @@ -56,6 +57,9 @@ offset_right = 20.0 offset_bottom = 20.0 theme_override_styles/panel = SubResource("1") script = ExtResource("1_ui6sg") +texture_state0 = ExtResource("2_0cn5u") +texture_state1 = ExtResource("3_tbv1w") +strips_rotation = 45.0 [node name="recommend" type="ReferenceRect" parent="."] visible = false @@ -72,6 +76,7 @@ texture = SubResource("PlaceholderTexture2D_6nup5") centered = false script = SubResource("GDScript_uyl5d") speed = 0.0 +strips_rotation = 0.785398 [node name="state" type="NinePatchRect" parent="."] layout_mode = 2 diff --git a/scenes/button-flat/nine-patch-button.gd b/scenes/button-flat/nine-patch-button.gd index e47b96f7..f1787550 100644 --- a/scenes/button-flat/nine-patch-button.gd +++ b/scenes/button-flat/nine-patch-button.gd @@ -12,35 +12,35 @@ func is_toggle_mode(): return $button.is_toggle_mode() var _pressed: = false -@export var texture_state0: Texture2D = preload('res://data/кнопка-квадрат-0.png'): +@export var texture_state0: Texture2D: set(val): texture_state0 = val - $state.set_texture(val) -@export var texture_state1: Texture2D = preload('res://data/кнопка-квадрат-1.png'): +@export var texture_state1: Texture2D: set(val): texture_state1 = val - if is_inside_tree(): - $state.set_texture(val) @export var strips_rotation: float = 0.0: set(val): strips_rotation = val - $back.strips_rotation = deg_to_rad(val) + if is_inside_tree(): + $back.strips_rotation = deg_to_rad(val) @export var text: String = '': set(val): text = val - $button.set_text(val) + if is_inside_tree(): + $button.set_text(val) @export var btn_tooltip: String = '': set(val): btn_tooltip = val - $button.set_tooltip_text(val) + if is_inside_tree(): + $button.set_tooltip_text(val) @export var disabled: bool = false: @@ -70,7 +70,9 @@ var _pressed: = false @export var font_size: int = 15: set(val): - $button.add_theme_font_size_override('theme_override_font_sizes/font_size', val) + font_size = val + if is_inside_tree(): + $button.add_theme_font_size_override('theme_override_font_sizes/font_size', val) func set_pressed(val: bool): @@ -92,7 +94,15 @@ func _enter_tree() -> void: $back.scale = size $back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0)) $button.connect('toggled', _on_button_toggled) + $button.set_toggle_mode(toggle_mode) + $button.add_theme_font_size_override('theme_override_font_sizes/font_size', font_size) pressed = _pressed + $button.set_pressed(pressed) + $button.set_disabled(disabled) + $back.disabled = disabled + $state.modulate.a = 0.5 if disabled else 1.0 + $button.set_tooltip_text(btn_tooltip) + $button.set_text(text) func _on_settings_changed(): diff --git a/scenes/frame-ecm-list/frm-ecm-list.tscn b/scenes/frame-ecm-list/frm-ecm-list.tscn index 4084f8d1..512dd865 100644 --- a/scenes/frame-ecm-list/frm-ecm-list.tscn +++ b/scenes/frame-ecm-list/frm-ecm-list.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=6 format=3 uid="uid://7rvw671tlx2i"] +[gd_scene load_steps=8 format=3 uid="uid://7rvw671tlx2i"] [ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_6swor"] [ext_resource type="Script" uid="uid://14bc8gil81n7" path="res://scenes/frame-ecm-list/scroll-ecm-list.gd" id="2_3x81o"] [ext_resource type="Script" uid="uid://b23n7v1xjdurw" path="res://scenes/frame-ecm-list/frm-ecm-list.gd" id="2_mt58v"] [ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="3_4hydx"] [ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="4_7ys3c"] +[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="6_ucntq"] +[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="7_x08dr"] [node name="frm_ecm_list" type="NinePatchRect"] offset_right = 480.0 @@ -55,6 +57,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Включает принудительную помеху" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "СРН" btn_tooltip = "Включает подавление радионавигации" @@ -66,6 +70,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Включает подавление каналов связи типа JTIDS" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "JTIDS" btn_tooltip = "Включает подавление радиосвязи типа JTIDS" @@ -76,6 +82,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "КУПД" btn_tooltip = "Включает подавление каналов управления передачи данных" @@ -86,6 +94,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "Паника" btn_tooltip = "Включает подавление JTIDS и КУПД" @@ -95,6 +105,8 @@ metadata/rfi_name = "" layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "Очистить" btn_tooltip = "Выключает все сеансы помех" diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 96f87bf0..5713a544 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://b276iygic5itk"] +[gd_scene load_steps=21 format=3 uid="uid://b276iygic5itk"] [ext_resource type="Script" uid="uid://daudc0s3oox3i" path="res://scenes/работа/работа.gd" id="1_niok4"] [ext_resource type="PackedScene" uid="uid://nl1vklubr5kr" path="res://scenes/bip/bip.tscn" id="2_br3s6"] @@ -7,8 +7,10 @@ [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://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="8_k0iv2"] +[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="10_bkuib"] [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"] +[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="11_1yrik"] [ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/diagram/diagram.tscn" id="11_b6su4"] [ext_resource type="Texture2D" uid="uid://csdw3q5dtvu4w" path="res://data/power-1.png" id="11_xp4y6"] [ext_resource type="Texture2D" uid="uid://0sk43ticjaxk" path="res://data/navi-center-0.png" id="12_5ffal"] @@ -182,6 +184,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Строб" metadata/state = 0 @@ -191,6 +195,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Цель" metadata/state = 1 @@ -200,6 +206,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Сектор" pressed = true @@ -354,6 +362,8 @@ offset_bottom = 937.0 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Сек. запрета" metadata/state = 0 @@ -367,6 +377,8 @@ offset_bottom = 910.0 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Сек. работы" metadata/state = 0 diff --git a/scenes/эмс/кнопка-эмс.tscn b/scenes/эмс/кнопка-эмс.tscn index 93979030..10299380 100644 --- a/scenes/эмс/кнопка-эмс.tscn +++ b/scenes/эмс/кнопка-эмс.tscn @@ -17,8 +17,8 @@ [sub_resource type="StyleBoxEmpty" id="6"] [node name="container" type="PanelContainer"] -offset_right = 30.0 -offset_bottom = 30.0 +offset_right = 23.0 +offset_bottom = 19.0 theme_override_styles/panel = SubResource("1") script = ExtResource("1_pmsh3") texture_state0 = ExtResource("2_0o537") @@ -29,13 +29,7 @@ toggle_mode = true show_behind_parent = true layout_mode = 2 texture = ExtResource("3_okiyh") -region_rect = Rect2(-1.60803, -1.94625, 31.9305, 25.9868) -patch_margin_left = 6 -patch_margin_top = 5 -patch_margin_right = 7 -patch_margin_bottom = 5 -axis_stretch_horizontal = 2 -axis_stretch_vertical = 2 +region_rect = Rect2(3, 2, 22, 18) [node name="button" type="Button" parent="."] layout_mode = 2 diff --git a/scenes/эмс/эмс.tscn b/scenes/эмс/эмс.tscn index 4ed74639..9f729cb1 100644 --- a/scenes/эмс/эмс.tscn +++ b/scenes/эмс/эмс.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=28 format=3 uid="uid://dab6loryocc73"] +[gd_scene load_steps=30 format=3 uid="uid://dab6loryocc73"] [ext_resource type="Script" uid="uid://do1s7qg4bmxqy" path="res://scenes/эмс/эмс.gd" id="1_mk57x"] [ext_resource type="PackedScene" uid="uid://ch14g46swx74h" path="res://table/header.tscn" id="2_1fbmy"] @@ -15,6 +15,8 @@ [ext_resource type="PackedScene" uid="uid://bccr42bckei41" path="res://scenes/cell/cell-front.tscn" id="8_k30d1"] [ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="8_qcl30"] [ext_resource type="PackedScene" uid="uid://b8txs4xi722wt" path="res://scenes/cell/cell-front-rear.tscn" id="9_js36y"] +[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="11_g8xrc"] +[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="12_4mue7"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mu34x"] texture = ExtResource("3_onafb") @@ -96,6 +98,8 @@ offset_left = 1446.0 offset_top = 55.0 offset_right = 1583.0 offset_bottom = 85.0 +texture_state0 = ExtResource("11_g8xrc") +texture_state1 = ExtResource("12_4mue7") strips_rotation = 10.0 text = "Прочитать" @@ -105,6 +109,8 @@ offset_left = 1446.0 offset_top = 99.0 offset_right = 1583.0 offset_bottom = 129.0 +texture_state0 = ExtResource("11_g8xrc") +texture_state1 = ExtResource("12_4mue7") strips_rotation = 10.0 text = "Записать" diff --git a/table/set-toggle.gd b/table/set-toggle.gd index 6f3d2a9a..7484d2c6 100644 --- a/table/set-toggle.gd +++ b/table/set-toggle.gd @@ -1,6 +1,6 @@ extends LineEdit -static var styles = [null, null] +static var styles: = [null, null] static var init_done: = false var checkbutton_material: Material diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd index bcc25e16..03a02293 100644 --- a/table/settings-toggle.gd +++ b/table/settings-toggle.gd @@ -1,6 +1,6 @@ extends LineEdit -static var styles = [null, null] +static var styles: = [null, null] static var init_done: = false var checkbutton_material: Material From 15245b458611754f86edb0141fa2f8fd0b1c9156 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Fri, 30 Jan 2026 10:59:21 +0300 Subject: [PATCH 15/15] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5.=20=D0=92=D0=BE=D0=B7=D0=BC?= =?UTF-8?q?=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=BE=D0=B1=D1=80=D0=B0=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=20=D0=BD=D0=B5=D1=81=D1=83=D1=89?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B5=D0=BC=D1=83=20?= =?UTF-8?q?=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/tilemap/tilemap.gd | 2 +- settings.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scenes/tilemap/tilemap.gd b/scenes/tilemap/tilemap.gd index 82e96996..7b32060c 100644 --- a/scenes/tilemap/tilemap.gd +++ b/scenes/tilemap/tilemap.gd @@ -746,7 +746,7 @@ func _on_threat_update(th) -> void: func _on_threat_lost(th) -> void: - var target = get_parent().get_node(str(th.id)) + var target = get_parent().get_node_or_null(str(th.id)) if target: target.queue_free() diff --git a/settings.json b/settings.json index daf3d721..1a2c5c09 100644 --- a/settings.json +++ b/settings.json @@ -173,4 +173,4 @@ false, true ] -} \ No newline at end of file +}