[PATCH] Доработка. Счётчик опасных целей не считает свои, если опция работать по своим отключена.

This commit is contained in:
MaD_CaT
2025-11-13 14:06:32 +03:00
committed by sasha80
parent 9aeacea4d7
commit ae96a8aa97

View File

@@ -31,7 +31,8 @@ var strob_band_begin: float ## Ширина строба в моме
var strob_dir_begin: float ## Направление антенны в момент начала перетаскивания.
var strob_width_begin: float ## Ширина строба по углу в момент начала перетаскивания.
var view_mode: MapViewMode ## Режим отображения карты
var thrs_dict: Dictionary ## Ссылка на словарь целей
var thrs_dict: Dictionary ## Ссылка на словарь целей
var gos_flag = true ## Флаг работать по своим целям
var color_ecm: Color
var color_select: Color
var color_emit: Color
@@ -92,6 +93,7 @@ func on_enter_tree() -> void: call_deferred('on_button_strobe_pressed')
func on_settings_changed():
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_select = ProjectSettings.get_setting('application/interfer/select_color', Color(1.0, 1.0, 1.0, 1.0))
@@ -109,9 +111,7 @@ func on_settings_changed():
## Обработчик сигнала изменения списка целей.
func on_threats_resized(ths: Dictionary):
$count_all_pad/count_all.text = '%02d' % ths.size()
var c: int = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
$count_danger_pad/count_danger.text = '%02d' % c
count_threats(ths)
thrs_dict = ths
@@ -624,6 +624,14 @@ func _on_btn_all_work_pressed() -> void:
func on_th_aoa_update(ths):
count_threats(ths)
func count_threats(ths):
$count_all_pad/count_all.text = '%02d' % ths.size()
var c: int = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
var c: int = 0
if gos_flag:
c = ths.values().filter(func(th: threats.Threat): return th.proto != '').size()
else:
c = ths.values().filter(func(th: threats.Threat): return ((th.proto != '') and th.proto not in interfer.gos_protocols)).size()
$count_danger_pad/count_danger.text = '%02d' % c