From b49e2315639e48481458e00b5f6253b94f9d50f2 Mon Sep 17 00:00:00 2001 From: MaD_CaT Date: Fri, 18 Aug 2023 16:03:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tscn | 26 +++++++++++++------------- save.json | 1 - threats.gd | 6 ++++-- кнопка-4.tscn | 8 ++++---- 4 files changed, 21 insertions(+), 20 deletions(-) delete mode 100644 save.json diff --git a/main.tscn b/main.tscn index 1c013c8..f6ac35a 100644 --- a/main.tscn +++ b/main.tscn @@ -1,14 +1,14 @@ [gd_scene load_steps=7 format=3 uid="uid://87gtvqd7bbje"] -[ext_resource type="Script" path="res://main.gd" id="1_d0idv"] -[ext_resource type="Script" path="res://table/table.gd" id="2_bdb37"] -[ext_resource type="Texture2D" uid="uid://cex4jiu1pcj3x" path="res://edit-add-0.png" id="3_am748"] -[ext_resource type="Texture2D" uid="uid://cx746np1wexnd" path="res://edit-add-1.png" id="4_3jxr4"] -[ext_resource type="Texture2D" uid="uid://blpkoi7s8qugp" path="res://document-save-0.png" id="5_73ry2"] -[ext_resource type="Texture2D" uid="uid://wh7p3t4frxf" path="res://disconnect.png" id="5_k2igw"] +[ext_resource type="Script" path="res://main.gd" id="1_cvm0h"] +[ext_resource type="Script" path="res://table/table.gd" id="2_su0xk"] +[ext_resource type="Texture2D" uid="uid://cex4jiu1pcj3x" path="res://edit-add-0.png" id="3_lumft"] +[ext_resource type="Texture2D" uid="uid://cx746np1wexnd" path="res://edit-add-1.png" id="4_gd6ts"] +[ext_resource type="Texture2D" uid="uid://blpkoi7s8qugp" path="res://document-save-0.png" id="5_hmvq3"] +[ext_resource type="Texture2D" uid="uid://wh7p3t4frxf" path="res://disconnect.png" id="6_2646i"] [node name="main" type="Node2D"] -script = ExtResource("1_d0idv") +script = ExtResource("1_cvm0h") [node name="tabs" type="TabContainer" parent="."] offset_right = 1594.0 @@ -28,7 +28,7 @@ offset_right = 1.0 offset_bottom = 10.0 grow_horizontal = 2 grow_vertical = 2 -script = ExtResource("2_bdb37") +script = ExtResource("2_su0xk") node_type_file = "res://ячейка-1.tscn" [node name="btn_add" type="TextureButton" parent="tabs/threats"] @@ -37,8 +37,8 @@ offset_left = 1533.0 offset_top = -2.0 offset_right = 1581.0 offset_bottom = 46.0 -texture_normal = ExtResource("3_am748") -texture_pressed = ExtResource("4_3jxr4") +texture_normal = ExtResource("3_lumft") +texture_pressed = ExtResource("4_gd6ts") [node name="btn_save" type="TextureButton" parent="tabs/threats"] layout_mode = 0 @@ -46,7 +46,7 @@ offset_left = 1442.0 offset_top = -1.0 offset_right = 1490.0 offset_bottom = 47.0 -texture_normal = ExtResource("5_73ry2") +texture_normal = ExtResource("5_hmvq3") [node name="btn_del" type="TextureButton" parent="tabs/threats"] layout_mode = 0 @@ -55,7 +55,7 @@ offset_top = 1.0 offset_right = 1547.0 offset_bottom = 67.0 scale = Vector2(0.62, 0.62) -texture_normal = ExtResource("5_k2igw") +texture_normal = ExtResource("6_2646i") [node name="pomehi" type="Panel" parent="tabs"] visible = false @@ -66,5 +66,5 @@ layout_mode = 0 offset_top = 100.0 offset_right = 1587.0 offset_bottom = 861.0 -script = ExtResource("2_bdb37") +script = ExtResource("2_su0xk") node_type_file = "res://ячейка-1.tscn" diff --git a/save.json b/save.json deleted file mode 100644 index e629382..0000000 --- a/save.json +++ /dev/null @@ -1 +0,0 @@ -[{"aoa":10,"freq":2480,"id":1,"power":20,"tick":42438,"tmod":"pi4qpsk","width":20},{"aoa":10,"freq":2480,"freqm":"const","id":2,"power":20,"tick":42438,"width":20},{"aoa":200,"freq":2480,"freqm":"lfm","id":3,"power":20,"proto":"ltm","tick":42438,"width":20},{"aoa":10,"freq":2480,"id":5,"power":20,"proto":"j11","tick":42438,"width":20},{"aoa":10,"freq":2480,"id":4,"power":20,"tick":42438,"width":20},{"aoa":100,"freq":2480,"id":6,"power":20,"proto":"mavlink","tick":42438,"width":20},{"aoa":210,"freq":2480,"id":7,"power":20,"tick":42438,"width":20},{"aoa":360,"freq":2480,"freqm":"lfm","id":8,"power":20,"tick":42438,"tmod":"qam16","width":320},{"aoa":10,"freq":2480,"id":9,"power":20,"tick":42438,"width":20}] \ No newline at end of file diff --git a/threats.gd b/threats.gd index ba2fbae..2847ac1 100644 --- a/threats.gd +++ b/threats.gd @@ -283,7 +283,9 @@ func init_treats(table, btn_add, btn_del, btn_save): # Инициализ func load_treats(table): - var file = FileAccess.open('res://save.json', FileAccess.READ) + var file = FileAccess.open('user://save.json', FileAccess.READ) + if file == null: + return var read = file.get_as_text() file.close() var json_conv: = JSON.new() @@ -307,7 +309,7 @@ func load_treats(table): func on_btn_save(): - var file = FileAccess.open('res://save.json', FileAccess.WRITE) + var file = FileAccess.open('user://save.json', FileAccess.WRITE) var data_to_json : Array for key in treats: var treat = treats[key] diff --git a/кнопка-4.tscn b/кнопка-4.tscn index 0170e0f..afb4789 100644 --- a/кнопка-4.tscn +++ b/кнопка-4.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://ccxre8mwhndjk"] -[ext_resource type="Texture2D" uid="uid://dag8n0gknjwak" path="res://индикатор-1-0.png" id="1_3cvx5"] -[ext_resource type="Texture2D" uid="uid://b3ext3w4ftgg2" path="res://индикатор-1-1.png" id="2_052gp"] +[ext_resource type="Texture2D" uid="uid://dag8n0gknjwak" path="res://индикатор-1-0.png" id="1_ha0ig"] +[ext_resource type="Texture2D" uid="uid://b3ext3w4ftgg2" path="res://индикатор-1-1.png" id="2_gmc7h"] [node name="indicator_1" type="TextureButton"] modulate = Color(1, 0.596078, 0.4, 1) @@ -9,5 +9,5 @@ offset_right = 35.0 offset_bottom = 29.0 toggle_mode = true button_mask = 0 -texture_normal = ExtResource("1_3cvx5") -texture_pressed = ExtResource("2_052gp") +texture_normal = ExtResource("1_ha0ig") +texture_pressed = ExtResource("2_gmc7h")