Merge remote-tracking branch 'MaD_CaT/master-prd'
# Conflicts: # scenes/frame-ecm-list/scroll-ecm-list.gd # scenes/настройки/настройки.gd # scenes/работа/работа.gd # scenes/эмс2/эмс2.tscn
This commit is contained in:
@@ -289,10 +289,10 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
|
||||
var ecm_active = true
|
||||
if not gos_flag:
|
||||
if ecm.nmfs in gos_nmfs:
|
||||
interfer_off(ecm, unit_instance)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
ecm_active = false
|
||||
if ecm_active and (prd.fs_caps_id[ecm.nmfs] in fs_closed):
|
||||
interfer_off(ecm, unit_instance)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
|
||||
var th_id = thr.id
|
||||
for ecm_i in thrs.keys():
|
||||
@@ -302,9 +302,9 @@ func on_th_aoa_update(threats: Dictionary, ecms: Dictionary, unit_instance) -> v
|
||||
ecm.kni = fposmod(thr.aoa - course, 360)
|
||||
call_ecm_proc(ecm)
|
||||
if ecm.nmfs in gos_nmfs:
|
||||
interfer_off(ecm, unit_instance)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
elif prd.fs_caps_id[ecm.nmfs] in fs_closed:
|
||||
interfer_off(ecm, unit_instance)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
else:
|
||||
send_ecm(ecm, unit_instance)
|
||||
signaller.emit_signal('fs_update_color', ecms)
|
||||
@@ -394,7 +394,7 @@ func on_interfer_create(interfer_name, sel_threats, fs_arr, power, u, ecms) -> v
|
||||
for ecm in ecms.values():
|
||||
if ecm.nmfs == item.nmfs:
|
||||
if item.priority > ecm.priority:
|
||||
interfer_off(ecm, u)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
elif item.priority < ecm.priority:
|
||||
need_continue = true
|
||||
break
|
||||
@@ -508,7 +508,6 @@ func interfer_create(u, interfer_name, ecms, param, kni, id, dict, source_interf
|
||||
func send_ecm(ecm, unit0) -> void:
|
||||
if ecm.krp != INTERFER_OFF:
|
||||
if not ecm.modulation:
|
||||
ecm.svk = 0
|
||||
call_deferred('emit_signal', 'interfer_update', ecm)
|
||||
return
|
||||
msg6_num += 1
|
||||
@@ -516,17 +515,17 @@ func send_ecm(ecm, unit0) -> void:
|
||||
unit0.tx_stack.append(json_data)
|
||||
|
||||
|
||||
func on_interfer_off_all(unit0, ecms: Dictionary) -> void:
|
||||
func on_interfer_off_all(_unit0, ecms: Dictionary) -> void:
|
||||
for ecm in ecms.values():
|
||||
interfer_off(ecm, unit0)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
|
||||
|
||||
func on_threats_lost(th, ecms, unit0) -> void:
|
||||
func on_threats_lost(th, ecms, _unit0) -> void:
|
||||
for key in interfer.thrs:
|
||||
if interfer.thrs[key] == th.id:
|
||||
var ecm_id = key
|
||||
var ecm = ecms[ecm_id]
|
||||
interfer_off(ecm, unit0)
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
|
||||
|
||||
func pop_id() -> int:
|
||||
@@ -653,19 +652,36 @@ func get_krp(threat: threats.Threat):
|
||||
for key in ITERFER_MODE.keys():
|
||||
var ecm_params = ITERFER_MODE[key][1]
|
||||
if not ecm_params.has('files'): continue
|
||||
if ecm_params['files'] == threat.rparams['filename']:
|
||||
krp = key
|
||||
return krp
|
||||
if typeof(ecm_params['files']) == TYPE_DICTIONARY:
|
||||
for value in ecm_params['files'].values():
|
||||
if typeof(value) == TYPE_STRING:
|
||||
if value == threat.rparams['filename']:
|
||||
krp = key
|
||||
return krp
|
||||
elif typeof(value) == TYPE_ARRAY:
|
||||
if value[0] == threat.rparams['filename']:
|
||||
krp = key
|
||||
return krp
|
||||
elif typeof(ecm_params['files']) == TYPE_STRING:
|
||||
if ecm_params['files'] == threat.rparams['filename']:
|
||||
krp = key
|
||||
return krp
|
||||
return krp
|
||||
|
||||
|
||||
func on_interfer_off(ecm: Interfer, _ecms, unit_caps):
|
||||
func on_interfer_off(ecm: Interfer, ecms, unit_caps):
|
||||
ecm.krp = INTERFER_OFF
|
||||
send_ecm(ecm, unit_caps)
|
||||
|
||||
|
||||
func interfer_off(ecm, _unit_caps):
|
||||
signaller.emit_signal('interfer_off', ecm)
|
||||
if not unit_caps.online:
|
||||
var sz = ecms.size()
|
||||
signaller.emit_signal('on_prog_ecm_off', ecm)
|
||||
ecms.erase(ecm.ispp)
|
||||
thrs.erase(ecm.ispp)
|
||||
cu.erase(ecm.ispp)
|
||||
fs.erase(ecm.ispp)
|
||||
push_id(ecm.ispp)
|
||||
if sz != ecms.size():
|
||||
interfer.call_deferred('emit_signal', 'interfer_resized', ecms)
|
||||
|
||||
|
||||
func on_interfer_new(ecm, unit_caps):
|
||||
|
||||
Reference in New Issue
Block a user