Доработка, добавлен обработчик кнопки отключить всё.
(cherry picked from commit 5740964d09)
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 440 KiB After Width: | Height: | Size: 330 KiB |
@@ -1,20 +1,22 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://7rvw671tlx2i"]
|
[gd_scene load_steps=6 format=3 uid="uid://7rvw671tlx2i"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_i25vj"]
|
[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_6swor"]
|
||||||
[ext_resource type="Script" path="res://scenes/frame-ecm-list/scroll-ecm-list.gd" id="2_qtnok"]
|
[ext_resource type="Script" path="res://scenes/scroll-ecm-list.gd" id="2_3x81o"]
|
||||||
[ext_resource type="Script" path="res://table/table.gd" id="3_pqvqk"]
|
[ext_resource type="Script" path="res://scenes/frm_ecm_list.gd" id="2_mt58v"]
|
||||||
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="4_op11p"]
|
[ext_resource type="Script" path="res://table/table.gd" id="3_4hydx"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="4_7ys3c"]
|
||||||
|
|
||||||
[node name="frm_ecm_list" type="NinePatchRect"]
|
[node name="frm_ecm_list" type="NinePatchRect"]
|
||||||
offset_right = 480.0
|
offset_right = 480.0
|
||||||
offset_bottom = 288.0
|
offset_bottom = 288.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
texture = ExtResource("1_i25vj")
|
texture = ExtResource("1_6swor")
|
||||||
patch_margin_left = 15
|
patch_margin_left = 15
|
||||||
patch_margin_top = 30
|
patch_margin_top = 30
|
||||||
patch_margin_right = 15
|
patch_margin_right = 15
|
||||||
patch_margin_bottom = 10
|
patch_margin_bottom = 10
|
||||||
|
script = ExtResource("2_mt58v")
|
||||||
|
|
||||||
[node name="header" type="Label" parent="."]
|
[node name="header" type="Label" parent="."]
|
||||||
clip_contents = true
|
clip_contents = true
|
||||||
@@ -34,11 +36,11 @@ offset_left = 8.0
|
|||||||
offset_top = 57.0
|
offset_top = 57.0
|
||||||
offset_right = 472.0
|
offset_right = 472.0
|
||||||
offset_bottom = 237.0
|
offset_bottom = 237.0
|
||||||
script = ExtResource("2_qtnok")
|
script = ExtResource("2_3x81o")
|
||||||
|
|
||||||
[node name="table" type="GridContainer" parent="scroll"]
|
[node name="table" type="GridContainer" parent="scroll"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
script = ExtResource("3_pqvqk")
|
script = ExtResource("3_4hydx")
|
||||||
|
|
||||||
[node name="grd_forced" type="GridContainer" parent="."]
|
[node name="grd_forced" type="GridContainer" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
@@ -48,7 +50,7 @@ offset_right = 472.0
|
|||||||
offset_bottom = 281.0
|
offset_bottom = 281.0
|
||||||
columns = 4
|
columns = 4
|
||||||
|
|
||||||
[node name="btn_srn" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_op11p")]
|
[node name="btn_srn" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
@@ -56,7 +58,7 @@ tooltip_text = "Включает принудительную помеху"
|
|||||||
text = "СРН"
|
text = "СРН"
|
||||||
metadata/rfi_name = "ozp1"
|
metadata/rfi_name = "ozp1"
|
||||||
|
|
||||||
[node name="btn_jtids" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_op11p")]
|
[node name="btn_jtids" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||||
editor_description = "Кнопка для принудительного включения группы секторов в режим JTIDS"
|
editor_description = "Кнопка для принудительного включения группы секторов в режим JTIDS"
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
@@ -64,7 +66,7 @@ size_flags_vertical = 3
|
|||||||
text = "JTIDS"
|
text = "JTIDS"
|
||||||
metadata/rfi_name = "ozp1"
|
metadata/rfi_name = "ozp1"
|
||||||
|
|
||||||
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_op11p")]
|
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
@@ -72,10 +74,9 @@ tooltip_text = "Кнопка для принудительного включе
|
|||||||
text = "КУПД"
|
text = "КУПД"
|
||||||
metadata/rfi_name = "ozp1"
|
metadata/rfi_name = "ozp1"
|
||||||
|
|
||||||
[node name="btn_cancel" parent="grd_forced" groups=["прин-секторы-срн"] instance=ExtResource("4_op11p")]
|
[node name="btn_cancel" parent="grd_forced" groups=["прин-секторы-срн"] instance=ExtResource("4_7ys3c")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
text = "Отключить все"
|
text = "Отключить все"
|
||||||
pressed = true
|
|
||||||
metadata/rfi_name = "<off>"
|
metadata/rfi_name = "<off>"
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ func _ready():
|
|||||||
interfer.connect('interfer_update', Callable(self, 'on_interfer_update').bind(table_index))
|
interfer.connect('interfer_update', Callable(self, 'on_interfer_update').bind(table_index))
|
||||||
$table.connect('row_pressed', Callable(self, 'on_row_pressed'))
|
$table.connect('row_pressed', Callable(self, 'on_row_pressed'))
|
||||||
call_deferred('init_table')
|
call_deferred('init_table')
|
||||||
|
#$btn_cancel.button_connect('pressed', Callable(self, 'on_btn_cancel_pressed').bind($btn_cancel))
|
||||||
|
|
||||||
|
|
||||||
func init_table():
|
func init_table():
|
||||||
$table.set_header(TABLE_HEADER)
|
$table.set_header(TABLE_HEADER)
|
||||||
|
|||||||
17
scenes/frm_ecm_list.gd
Normal file
17
scenes/frm_ecm_list.gd
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
extends NinePatchRect
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
$grd_forced/btn_cancel.button_connect('pressed', Callable(self, 'on_btn_cancel_pressed').bind($grd_forced/btn_cancel))
|
||||||
|
|
||||||
|
|
||||||
|
func on_btn_cancel_pressed(btn):
|
||||||
|
signaller.emit_signal('interfer_off_all')
|
||||||
|
await get_tree().create_timer(0.1).timeout
|
||||||
|
btn.pressed = false
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
pass
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://dnuexoef2nnv5"]
|
[gd_scene load_steps=3 format=3 uid="uid://dnuexoef2nnv5"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://b1brrobrh4abl" path="res://data/прд-н-1-мнемо.png" id="1_jlonr"]
|
[ext_resource type="Texture2D" uid="uid://b1brrobrh4abl" path="res://data/прд-н-1-мнемо.png" id="1_jlonr"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ckrunkgwb5cuo" path="res://scenes/контроль/element.tscn" id="2_lpj3d"]
|
||||||
|
|
||||||
[node name="pribor_prd_n_1" type="Control"]
|
[node name="pribor_prd_n_1" type="Control"]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
@@ -12,12 +13,127 @@ offset_bottom = 30.0
|
|||||||
|
|
||||||
[node name="test_label" type="Label" parent="."]
|
[node name="test_label" type="Label" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
text = "Здесь будет схема прибора ПРД-Н 1"
|
text = "Схема контроля прибора ПРД-Н1"
|
||||||
metadata/_edit_use_anchors_ = true
|
metadata/_edit_use_anchors_ = true
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
[node name="подкладка" type="Sprite2D" parent="."]
|
||||||
|
self_modulate = Color(1, 1, 1, 0.345098)
|
||||||
position = Vector2(436, 589)
|
position = Vector2(436, 589)
|
||||||
scale = Vector2(0.13, 0.13)
|
scale = Vector2(0.13, 0.13)
|
||||||
texture = ExtResource("1_jlonr")
|
texture = ExtResource("1_jlonr")
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
|
[node name="ref_A13L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 20.0
|
||||||
|
offset_top = 235.0
|
||||||
|
offset_right = 173.0
|
||||||
|
offset_bottom = 277.0
|
||||||
|
rname = "A13"
|
||||||
|
|
||||||
|
[node name="ref_A13R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 235.0
|
||||||
|
offset_right = 613.0
|
||||||
|
offset_bottom = 277.0
|
||||||
|
rname = "A13"
|
||||||
|
|
||||||
|
[node name="ref_A14L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 20.0
|
||||||
|
offset_top = 320.0
|
||||||
|
offset_right = 173.0
|
||||||
|
offset_bottom = 362.0
|
||||||
|
rname = "A14"
|
||||||
|
|
||||||
|
[node name="ref_A14R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 320.0
|
||||||
|
offset_right = 613.0
|
||||||
|
offset_bottom = 362.0
|
||||||
|
rname = "A14"
|
||||||
|
|
||||||
|
[node name="ref_A15L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 20.0
|
||||||
|
offset_top = 400.0
|
||||||
|
offset_right = 173.0
|
||||||
|
offset_bottom = 442.0
|
||||||
|
rname = "A15"
|
||||||
|
|
||||||
|
[node name="ref_A15R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 400.0
|
||||||
|
offset_right = 613.0
|
||||||
|
offset_bottom = 442.0
|
||||||
|
rname = "A15"
|
||||||
|
|
||||||
|
[node name="ref_A16L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 20.0
|
||||||
|
offset_top = 490.0
|
||||||
|
offset_right = 173.0
|
||||||
|
offset_bottom = 532.0
|
||||||
|
rname = "A16"
|
||||||
|
|
||||||
|
[node name="ref_A16R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 490.0
|
||||||
|
offset_right = 613.0
|
||||||
|
offset_bottom = 532.0
|
||||||
|
rname = "A16"
|
||||||
|
|
||||||
|
[node name="ref_A17L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 20.0
|
||||||
|
offset_top = 580.0
|
||||||
|
offset_right = 173.0
|
||||||
|
offset_bottom = 622.0
|
||||||
|
rname = "A17"
|
||||||
|
|
||||||
|
[node name="ref_A17R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 580.0
|
||||||
|
offset_right = 613.0
|
||||||
|
offset_bottom = 622.0
|
||||||
|
rname = "A17"
|
||||||
|
|
||||||
|
[node name="ref_A18L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 20.0
|
||||||
|
offset_top = 665.0
|
||||||
|
offset_right = 173.0
|
||||||
|
offset_bottom = 707.0
|
||||||
|
rname = "A18"
|
||||||
|
|
||||||
|
[node name="ref_A18R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 665.0
|
||||||
|
offset_right = 613.0
|
||||||
|
offset_bottom = 707.0
|
||||||
|
rname = "A18"
|
||||||
|
|
||||||
|
[node name="ref_A23L" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 15.0
|
||||||
|
offset_top = 740.0
|
||||||
|
offset_right = 169.0
|
||||||
|
offset_bottom = 890.0
|
||||||
|
fname = "MAA2000"
|
||||||
|
rname = "A23"
|
||||||
|
|
||||||
|
[node name="ref_A23R" parent="." instance=ExtResource("2_lpj3d")]
|
||||||
|
layout_mode = 2
|
||||||
|
offset_left = 460.0
|
||||||
|
offset_top = 740.0
|
||||||
|
offset_right = 614.0
|
||||||
|
offset_bottom = 890.0
|
||||||
|
fname = "MAA2000"
|
||||||
|
rname = "A23"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=8 format=3 uid="uid://ckrunkgwb5cuo"]
|
[gd_scene load_steps=9 format=3 uid="uid://ckrunkgwb5cuo"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="1_60d60"]
|
[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="1_60d60"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_mmcxd"]
|
[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_mmcxd"]
|
||||||
@@ -7,19 +7,49 @@
|
|||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"]
|
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"]
|
||||||
|
|
||||||
[sub_resource type="GDScript" id="GDScript_40di8"]
|
[sub_resource type="GDScript" id="GDScript_oj3k3"]
|
||||||
|
script/source = "@tool
|
||||||
|
|
||||||
|
extends PanelContainer
|
||||||
|
|
||||||
|
|
||||||
|
@export var fname: String = ''
|
||||||
|
|
||||||
|
|
||||||
|
@export var rname: String = ''
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
$margin/vbox/grid/fname.text = fname
|
||||||
|
$margin/vbox/grid/rname.text = rname
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_45hqb"]
|
||||||
script/source = "@tool
|
script/source = "@tool
|
||||||
|
|
||||||
extends MarginContainer
|
extends MarginContainer
|
||||||
|
|
||||||
@export var margin_value = 5:
|
|
||||||
set(val):
|
func _enter_tree() -> void:
|
||||||
add_theme_constant_override('margin_top', val)
|
margins = [8, 8, 8, 8]
|
||||||
add_theme_constant_override('margin_left', val)
|
|
||||||
add_theme_constant_override('margin_bottom', val)
|
|
||||||
add_theme_constant_override('margin_right', val)
|
@export var margins: Array:
|
||||||
|
set(vals):
|
||||||
|
add_theme_constant_override('margin_top', vals[0])
|
||||||
|
add_theme_constant_override('margin_left', vals[1])
|
||||||
|
add_theme_constant_override('margin_bottom', vals[2])
|
||||||
|
add_theme_constant_override('margin_right', vals[3])
|
||||||
get:
|
get:
|
||||||
return get_theme_constant('margin_top')
|
var vals = [0, 0, 0, 0]
|
||||||
|
vals[0] = get_theme_constant('margin_top')
|
||||||
|
vals[1] = get_theme_constant('margin_left')
|
||||||
|
vals[2] = get_theme_constant('margin_bottom')
|
||||||
|
vals[3] = get_theme_constant('margin_right')
|
||||||
|
return vals
|
||||||
|
|
||||||
|
|
||||||
"
|
"
|
||||||
|
|
||||||
[sub_resource type="AnimatedTexture" id="AnimatedTexture_p68lh"]
|
[sub_resource type="AnimatedTexture" id="AnimatedTexture_p68lh"]
|
||||||
@@ -32,9 +62,10 @@ frame_2/texture = ExtResource("3_gsgjf")
|
|||||||
frame_2/duration = 1.0
|
frame_2/duration = 1.0
|
||||||
|
|
||||||
[node name="element" type="PanelContainer"]
|
[node name="element" type="PanelContainer"]
|
||||||
offset_right = 231.0
|
offset_right = 209.0
|
||||||
offset_bottom = 206.0
|
offset_bottom = 42.0
|
||||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
|
theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u")
|
||||||
|
script = SubResource("GDScript_oj3k3")
|
||||||
|
|
||||||
[node name="rect" type="NinePatchRect" parent="."]
|
[node name="rect" type="NinePatchRect" parent="."]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -48,35 +79,40 @@ patch_margin_bottom = 15
|
|||||||
|
|
||||||
[node name="margin" type="MarginContainer" parent="."]
|
[node name="margin" type="MarginContainer" parent="."]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
script = SubResource("GDScript_40di8")
|
theme_override_constants/margin_left = 8
|
||||||
|
theme_override_constants/margin_top = 8
|
||||||
|
theme_override_constants/margin_right = 8
|
||||||
|
theme_override_constants/margin_bottom = 8
|
||||||
|
script = SubResource("GDScript_45hqb")
|
||||||
|
margins = [8, 8, 8, 8]
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="margin"]
|
[node name="vbox" type="VBoxContainer" parent="margin"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="grid" type="GridContainer" parent="margin/VBoxContainer"]
|
[node name="grid" type="GridContainer" parent="margin/vbox"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
columns = 3
|
columns = 3
|
||||||
|
|
||||||
[node name="control" type="TextureRect" parent="margin/VBoxContainer/grid"]
|
[node name="control" type="TextureRect" parent="margin/vbox/grid"]
|
||||||
custom_minimum_size = Vector2(32, 32)
|
custom_minimum_size = Vector2(24, 24)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 2
|
size_flags_horizontal = 2
|
||||||
size_flags_vertical = 6
|
size_flags_vertical = 6
|
||||||
texture = SubResource("AnimatedTexture_p68lh")
|
texture = SubResource("AnimatedTexture_p68lh")
|
||||||
expand_mode = 1
|
expand_mode = 1
|
||||||
|
|
||||||
[node name="name" type="Label" parent="margin/VBoxContainer/grid"]
|
[node name="fname" type="Label" parent="margin/vbox/grid"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 6
|
size_flags_vertical = 6
|
||||||
text = "Ячейка"
|
theme_override_colors/font_color = Color(1, 1, 1, 0.588235)
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
vertical_alignment = 1
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="ref" type="Label" parent="margin/VBoxContainer/grid"]
|
[node name="rname" type="Label" parent="margin/vbox/grid"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 6
|
size_flags_vertical = 6
|
||||||
theme_override_font_sizes/font_size = 22
|
theme_override_font_sizes/font_size = 22
|
||||||
text = "A??"
|
|
||||||
horizontal_alignment = 2
|
horizontal_alignment = 2
|
||||||
|
vertical_alignment = 1
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ func _ready():
|
|||||||
signaller.connect('threat_selected', Callable(self, 'on_threat_selected').bind(nodes))
|
signaller.connect('threat_selected', Callable(self, 'on_threat_selected').bind(nodes))
|
||||||
signaller.connect('interfer_selected', Callable(self, 'on_interfer_selected').bind(nodes))
|
signaller.connect('interfer_selected', Callable(self, 'on_interfer_selected').bind(nodes))
|
||||||
signaller.connect('interfer_new', Callable(self, 'on_interfer_new'))
|
signaller.connect('interfer_new', Callable(self, 'on_interfer_new'))
|
||||||
|
signaller.connect('interfer_off_all', Callable(self, 'interfer_off_all'))
|
||||||
interfer.connect('interfer_update', Callable(self, 'on_interfer_new'))
|
interfer.connect('interfer_update', Callable(self, 'on_interfer_new'))
|
||||||
|
|
||||||
func on_enter_tree() -> void:
|
func on_enter_tree() -> void:
|
||||||
@@ -125,10 +126,18 @@ func on_interfer_new(ecm):
|
|||||||
bip.set_ecm_visible(true)
|
bip.set_ecm_visible(true)
|
||||||
else: bip.set_ecm_visible(false)
|
else: bip.set_ecm_visible(false)
|
||||||
else:
|
else:
|
||||||
|
print_debug()
|
||||||
bip.set_ecm_visible(false)
|
bip.set_ecm_visible(false)
|
||||||
bip.set_track_visible(false)
|
bip.set_track_visible(false)
|
||||||
|
|
||||||
|
|
||||||
|
func interfer_off_all():
|
||||||
|
var bips: Array = get_children().filter(func(item): return item.name.is_valid_int())
|
||||||
|
for bip in bips:
|
||||||
|
bip.set_ecm_visible(false)
|
||||||
|
bip.set_track_visible(false)
|
||||||
|
|
||||||
|
|
||||||
## Обработчик сигнала обнаружения цели
|
## Обработчик сигнала обнаружения цели
|
||||||
func on_threat_new(th) -> void:
|
func on_threat_new(th) -> void:
|
||||||
var bip = Bip.instantiate()
|
var bip = Bip.instantiate()
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ func _ready():
|
|||||||
unit.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(ecms))
|
unit.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(ecms))
|
||||||
signaller.connect('interfer_create', Callable(self, 'on_interfer_create').bind(unit, ecms))
|
signaller.connect('interfer_create', Callable(self, 'on_interfer_create').bind(unit, ecms))
|
||||||
signaller.connect('interfer_new', Callable(self, 'send_ecm').bind(unit))
|
signaller.connect('interfer_new', Callable(self, 'send_ecm').bind(unit))
|
||||||
|
signaller.connect('interfer_off_all', Callable(self, 'on_interfer_off_all').bind(unit, ecms))
|
||||||
|
|
||||||
# Проверяет состояние отправки пакета и если не доставлен, повторяет отправку
|
# Проверяет состояние отправки пакета и если не доставлен, повторяет отправку
|
||||||
func on_timer_check_state(unit, ecms, resend_timeout):
|
func on_timer_check_state(unit, ecms, resend_timeout):
|
||||||
@@ -174,6 +175,7 @@ func on_interfer_create(btn, sel_threats, unit, ecms):
|
|||||||
if interfer_name == 'off':
|
if interfer_name == 'off':
|
||||||
signaller.emit_signal('interfer_off', ecm, ecms, thrs)
|
signaller.emit_signal('interfer_off', ecm, ecms, thrs)
|
||||||
push_id(ecm.ispp)
|
push_id(ecm.ispp)
|
||||||
|
thrs.erase(ispp)
|
||||||
ecm.tick_tx = Time.get_ticks_msec()
|
ecm.tick_tx = Time.get_ticks_msec()
|
||||||
|
|
||||||
|
|
||||||
@@ -182,6 +184,14 @@ func send_ecm(ecm, unit):
|
|||||||
unit.tx_stack.append(json_data)
|
unit.tx_stack.append(json_data)
|
||||||
|
|
||||||
|
|
||||||
|
func on_interfer_off_all(unit, ecms):
|
||||||
|
for ecm in ecms.values():
|
||||||
|
ecm.krp = INTERFER_OFF
|
||||||
|
push_id(ecm.ispp)
|
||||||
|
send_ecm(ecm, unit)
|
||||||
|
signaller.emit_signal('interfer_off',ecm, ecms, thrs)
|
||||||
|
|
||||||
|
|
||||||
func pop_id():
|
func pop_id():
|
||||||
var id = 0
|
var id = 0
|
||||||
if len(id_array):
|
if len(id_array):
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ signal interfer_new (ecm: interfer.Interfer)
|
|||||||
signal interfer_off (ecm: interfer.Interfer, ecms: Dictionary, thrs: Dictionary)
|
signal interfer_off (ecm: interfer.Interfer, ecms: Dictionary, thrs: Dictionary)
|
||||||
|
|
||||||
|
|
||||||
|
## Вызывается при нажатии отключить все помехи
|
||||||
|
signal interfer_off_all ()
|
||||||
|
|
||||||
|
|
||||||
## Вызывается, когда отключается действующая помеха
|
## Вызывается, когда отключается действующая помеха
|
||||||
## [param ecm] - Выбранная помеха
|
## [param ecm] - Выбранная помеха
|
||||||
signal interfer_selected (ecm: interfer.Interfer)
|
signal interfer_selected (ecm: interfer.Interfer)
|
||||||
|
|||||||
@@ -75,6 +75,4 @@ void fragment()
|
|||||||
get_line_points(px0, px1, py0, py1, 210.0);
|
get_line_points(px0, px1, py0, py1, 210.0);
|
||||||
COLOR.a += line(vec2(px0, py0), vec2(px1, py1), 15.0, UV);
|
COLOR.a += line(vec2(px0, py0), vec2(px1, py1), 15.0, UV);
|
||||||
COLOR *= smooth_px(length(UV-center), radius, DSS);
|
COLOR *= smooth_px(length(UV-center), radius, DSS);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user