Доработка. Исправления сохранений.

This commit is contained in:
MaD_CaT
2023-08-18 16:03:29 +03:00
parent e7ab703883
commit b49e231563
4 changed files with 21 additions and 20 deletions

View File

@@ -1,14 +1,14 @@
[gd_scene load_steps=7 format=3 uid="uid://87gtvqd7bbje"] [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://main.gd" id="1_cvm0h"]
[ext_resource type="Script" path="res://table/table.gd" id="2_bdb37"] [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_am748"] [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_3jxr4"] [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_73ry2"] [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="5_k2igw"] [ext_resource type="Texture2D" uid="uid://wh7p3t4frxf" path="res://disconnect.png" id="6_2646i"]
[node name="main" type="Node2D"] [node name="main" type="Node2D"]
script = ExtResource("1_d0idv") script = ExtResource("1_cvm0h")
[node name="tabs" type="TabContainer" parent="."] [node name="tabs" type="TabContainer" parent="."]
offset_right = 1594.0 offset_right = 1594.0
@@ -28,7 +28,7 @@ offset_right = 1.0
offset_bottom = 10.0 offset_bottom = 10.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("2_bdb37") script = ExtResource("2_su0xk")
node_type_file = "res://ячейка-1.tscn" node_type_file = "res://ячейка-1.tscn"
[node name="btn_add" type="TextureButton" parent="tabs/threats"] [node name="btn_add" type="TextureButton" parent="tabs/threats"]
@@ -37,8 +37,8 @@ offset_left = 1533.0
offset_top = -2.0 offset_top = -2.0
offset_right = 1581.0 offset_right = 1581.0
offset_bottom = 46.0 offset_bottom = 46.0
texture_normal = ExtResource("3_am748") texture_normal = ExtResource("3_lumft")
texture_pressed = ExtResource("4_3jxr4") texture_pressed = ExtResource("4_gd6ts")
[node name="btn_save" type="TextureButton" parent="tabs/threats"] [node name="btn_save" type="TextureButton" parent="tabs/threats"]
layout_mode = 0 layout_mode = 0
@@ -46,7 +46,7 @@ offset_left = 1442.0
offset_top = -1.0 offset_top = -1.0
offset_right = 1490.0 offset_right = 1490.0
offset_bottom = 47.0 offset_bottom = 47.0
texture_normal = ExtResource("5_73ry2") texture_normal = ExtResource("5_hmvq3")
[node name="btn_del" type="TextureButton" parent="tabs/threats"] [node name="btn_del" type="TextureButton" parent="tabs/threats"]
layout_mode = 0 layout_mode = 0
@@ -55,7 +55,7 @@ offset_top = 1.0
offset_right = 1547.0 offset_right = 1547.0
offset_bottom = 67.0 offset_bottom = 67.0
scale = Vector2(0.62, 0.62) scale = Vector2(0.62, 0.62)
texture_normal = ExtResource("5_k2igw") texture_normal = ExtResource("6_2646i")
[node name="pomehi" type="Panel" parent="tabs"] [node name="pomehi" type="Panel" parent="tabs"]
visible = false visible = false
@@ -66,5 +66,5 @@ layout_mode = 0
offset_top = 100.0 offset_top = 100.0
offset_right = 1587.0 offset_right = 1587.0
offset_bottom = 861.0 offset_bottom = 861.0
script = ExtResource("2_bdb37") script = ExtResource("2_su0xk")
node_type_file = "res://ячейка-1.tscn" node_type_file = "res://ячейка-1.tscn"

View File

@@ -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}]

View File

@@ -283,7 +283,9 @@ func init_treats(table, btn_add, btn_del, btn_save): # Инициализ
func load_treats(table): 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() var read = file.get_as_text()
file.close() file.close()
var json_conv: = JSON.new() var json_conv: = JSON.new()
@@ -307,7 +309,7 @@ func load_treats(table):
func on_btn_save(): 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 var data_to_json : Array
for key in treats: for key in treats:
var treat = treats[key] var treat = treats[key]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://ccxre8mwhndjk"] [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://dag8n0gknjwak" path="res://индикатор-1-0.png" id="1_ha0ig"]
[ext_resource type="Texture2D" uid="uid://b3ext3w4ftgg2" path="res://индикатор-1-1.png" id="2_052gp"] [ext_resource type="Texture2D" uid="uid://b3ext3w4ftgg2" path="res://индикатор-1-1.png" id="2_gmc7h"]
[node name="indicator_1" type="TextureButton"] [node name="indicator_1" type="TextureButton"]
modulate = Color(1, 0.596078, 0.4, 1) modulate = Color(1, 0.596078, 0.4, 1)
@@ -9,5 +9,5 @@ offset_right = 35.0
offset_bottom = 29.0 offset_bottom = 29.0
toggle_mode = true toggle_mode = true
button_mask = 0 button_mask = 0
texture_normal = ExtResource("1_3cvx5") texture_normal = ExtResource("1_ha0ig")
texture_pressed = ExtResource("2_052gp") texture_pressed = ExtResource("2_gmc7h")