Merge branch 'master-lepshiy'
# Conflicts: # scenes/настройки/настройки.gd
This commit is contained in:
@@ -23,3 +23,17 @@ 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
|
||||
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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
[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="Texture2D" uid="uid://cllxcfa130vqu" path="res://data/УА-РЭП.png" id="22_1s34a"]
|
||||
|
||||
@@ -66,8 +66,9 @@ const SETTING_TABLE = [
|
||||
['Цвет кнопки \"Подавление\"', TableEdit, TableColorPick, 'Цвет кнопки. Введено по требованию ПЗ' ], # 54
|
||||
['Цвет фона схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет фона'], # 55
|
||||
['Цвет схемы', TableEdit, TableColorPick, 'Схема прибора Э2. Изменение цвет схемы '], # 56
|
||||
['Коэффициент ширины полосы излучения', TableEdit, TableEdit, 'Изменение ширины полосы излучения помехи в зависимости от цели'], # 57
|
||||
['Время повторной отправки помехи', TableEdit, TableEdit, 'Изменение времени повторной отправки помехи'] ] # 58
|
||||
['Цвет темы программы', TableEdit, TableToggle, 'ВЫКЛ - темная тема, ВКЛ - светлая тема'], # 57
|
||||
['Коэффициент ширины полосы излучения', TableEdit, TableEdit, 'Изменение ширины полосы излучения помехи в зависимости от цели'], # 58
|
||||
['Время повторной отправки помехи', TableEdit, TableEdit, 'Изменение времени повторной отправки помехи'] ] # 59
|
||||
|
||||
|
||||
## TODO: Придумать как избавиться от индексов
|
||||
@@ -83,6 +84,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: = {} ## Для преобразования названия параметра в номер строки
|
||||
@@ -207,6 +209,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)
|
||||
@@ -268,8 +271,16 @@ 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 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)
|
||||
@@ -340,3 +351,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()
|
||||
|
||||
@@ -154,6 +154,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)
|
||||
|
||||
|
||||
## Обработчик сигнала изменения списка целей.
|
||||
|
||||
@@ -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_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"]
|
||||
|
||||
Reference in New Issue
Block a user