Доработка. Изменение цвета индикаторов излучения через настройку "Цвет кнопки подавления"
This commit is contained in:
@@ -5,7 +5,7 @@ class_name scroll_threats extends ScrollContainer
|
||||
|
||||
const CellLineEdit = preload('res://table/ячейка-2.tscn') ## Ячейка таблицы.
|
||||
const TableHeader = preload('res://table/header.tscn') ## Ячейка заголовок таблицы.
|
||||
const EmitLed = preload('res://scenes/frame-threats/emit-led.tscn') ## Ячейка заголовок таблицы.
|
||||
const EmitLed = preload('res://scenes/frame-threats/emit-led.tscn') ## Ячейка символа излучения
|
||||
|
||||
const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader, TableHeader , TableHeader ] ## Описание ряда заголовка.
|
||||
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit, CellLineEdit, EmitLed ] ## Описание ряда.
|
||||
@@ -16,6 +16,8 @@ const TABLE_COLUMN_SIZE = [ 65, 70, 110, 140,
|
||||
const TABLE_TEXT_ROWS = 4
|
||||
const EMIT_STATE_COL = 4
|
||||
|
||||
var color_emit: Color
|
||||
|
||||
## Снимает выделение цели.
|
||||
func on_rto_threat_unsel(_th_id): $table.clear_rows_selected()
|
||||
|
||||
@@ -49,6 +51,7 @@ func _ready() -> void:
|
||||
signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel').bind($table))
|
||||
signaller.connect('rto_threat_unsel', Callable(self, 'on_rto_threat_unsel'))
|
||||
$table.connect('row_pressed', Callable(self, 'on_row_pressed'))
|
||||
ProjectSettings.connect('settings_changed', on_settings_changed)
|
||||
call_deferred('init_table')
|
||||
|
||||
|
||||
@@ -74,7 +77,7 @@ func on_threat_update(th, table_index: Dictionary):
|
||||
emit_txr.self_modulate = Color.ORANGE
|
||||
elif th.emit_state == 2:
|
||||
emit_txr.visible = true
|
||||
emit_txr.self_modulate = Color.RED
|
||||
emit_txr.self_modulate = color_emit
|
||||
|
||||
|
||||
|
||||
@@ -128,3 +131,9 @@ func disable_edit(tbl, num_col: int, i_row: int):
|
||||
for col in num_col:
|
||||
var node: LineEdit = tbl.get_node2(col, i_row)
|
||||
node.editable = false
|
||||
|
||||
|
||||
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)
|
||||
color_emit = Color(arr_col[0], arr_col[1], arr_col[2], arr_col[3])
|
||||
|
||||
@@ -135,9 +135,13 @@ func on_user_panning(): $btn_center.button_pressed = false
|
||||
|
||||
|
||||
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
|
||||
|
||||
gos_flag = ProjectSettings.get_setting('application/config/Включить работу по своим целям', true)
|
||||
color_emit = ProjectSettings.get_setting('application/interfer/emit_color', Color(0.58, 0.47, 0.51, 1.0))
|
||||
color_ecm = ProjectSettings.get_setting('application/interfer/interfer_color', Color(0.58, 0.47, 0.51, 1.0))
|
||||
color_emit = Color(arr_col[0], arr_col[1], arr_col[2], 1.0)
|
||||
color_ecm = Color(arr_col[0], arr_col[1], arr_col[2], 1.0)
|
||||
color_select = ProjectSettings.get_setting('application/interfer/select_color', Color(1.0, 1.0, 1.0, 1.0))
|
||||
color_closed = ProjectSettings.get_setting('application/interfer/closed_sectors', Color(0.0, 0.0, 0.0, 1.0))
|
||||
min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5)
|
||||
|
||||
Reference in New Issue
Block a user