В процессе. Исправлены предупреждения редактора при загрузке проекта

This commit is contained in:
sasha80
2023-11-17 10:44:41 +03:00
parent c0d5f5d20d
commit 25cfc5191f
10 changed files with 61 additions and 45 deletions

View File

@@ -226,7 +226,6 @@ func _open_file() -> void:
err = _file.get_error()
if err:
return print_debug(error_string(err))
var read = _file.get_as_text()
_file.seek_end(0)

View File

@@ -19,13 +19,13 @@ boot_splash/show_image=false
boot_splash/fullsize=false
boot_splash/use_filter=false
config/icon="res://data/icon.png"
config/map_server_addr="https://a.tile.openstreetmap.org"
config/map_bcs=Vector3(0.5, 1.5, 0.3)
config/map_tile_size=256
config/map_image_hight=512
config/map_image_width=512
config/map_minimum_zoom=5
config/map_maximum_zoom=19
config/map_server_addr="https://b.tile.openstreetmap.org"
[autoload]
@@ -113,3 +113,10 @@ shader_compiler/shader_cache/strip_debug=true
textures/default_filters/anisotropic_filtering_level=0
anti_aliasing/screen_space_roughness_limiter/enabled=false
quality/driver/fallback_to_gles2=true
[shader_globals]
tools={
"type": "bool",
"value": true
}

View File

@@ -43,7 +43,3 @@ func init_table():
func on_interfer_new(ecm, table_index):
print_debug()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

View File

@@ -84,7 +84,7 @@ func img_tile_to_map_image(image: Image, dst_pos: Vector2i, tile: mercator.Tile)
map_rects.append(Rect2i(dst_pos.x, dst_pos.y, tile.x, tile.y)) # сохранить корневую плитку
func _process(delta: float):
func _process(_delta: float):
if (map_tile_state == TASK_STATE.DONE) and map_tile_stack.size():
var tile: mercator.Tile = map_tile_stack[-1]
if request_tile(tile, map_server_addr) == OK:

View File

@@ -1,13 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://b37dpuas0emkc"]
[ext_resource type="Texture2D" uid="uid://bgekehgbqyddu" path="res://кнопка-3-1.png" id="1"]
[ext_resource type="Texture2D" uid="uid://caj3qxh8fo025" path="res://кнопка-3-0.png" id="2"]
[node name="TextureButton" type="TextureButton"]
modulate = Color(1.5, 1.5, 1.5, 1)
offset_right = 140.0
offset_bottom = 34.0
toggle_mode = true
action_mode = 0
texture_normal = ExtResource("2")
texture_pressed = ExtResource("1")

View File

@@ -7,3 +7,4 @@ func _ready() -> void:
$Label2.text = 'Текущий режим доступа: ограниченный'
for node in $GridContainer.get_children().filter(func(b): return b is Button):
node.disabled = true

View File

@@ -1,7 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://bnptm4rlp60dq"]
[gd_scene load_steps=3 format=3 uid="uid://bnptm4rlp60dq"]
[ext_resource type="Script" path="res://scenes/настройки.gd" id="1_2l3rd"]
[sub_resource type="GDScript" id="GDScript_anjmx"]
script/source = "extends LineEdit
func _ready() -> void: text = ProjectSettings.get('application/config/map_server_addr')
func _on_text_changed(new_text: String) -> void:
ProjectSettings.set('application/config/map_server_addr', new_text)
ProjectSettings.save_custom('override.cfg')
"
[node name="Настройки" type="Panel"]
script = ExtResource("1_2l3rd")
@@ -241,11 +252,11 @@ text = "Текущий режим доступа: полный"
[node name="edt_mapaddr" type="LineEdit" parent="."]
layout_mode = 0
offset_left = 536.0
offset_top = 60.0
offset_right = 908.0
offset_bottom = 87.0
text = "https://a.tile.openstreetmap.org"
offset_left = 477.0
offset_top = 85.0
offset_right = 849.0
offset_bottom = 112.0
script = SubResource("GDScript_anjmx")
[node name="Label" type="Label" parent="edt_mapaddr"]
layout_mode = 0
@@ -255,3 +266,5 @@ offset_bottom = -8.0
text = "Адрес сервера карт"
horizontal_alignment = 1
vertical_alignment = 1
[connection signal="text_changed" from="edt_mapaddr" to="edt_mapaddr" method="_on_text_changed"]

View File

@@ -52,16 +52,23 @@ func on_button_view_toggled(toggled: bool): $canvas.set_view_mode(int(toggled))
func on_threats_resized(threats: Dictionary): $count_all_pad/count_all.text = '%02d' % threats.size()
##
func _init() -> void:
var timer1 = Timer.new()
add_child(timer1)
timer1.one_shot = true
timer1.wait_time = 2000
timer1.connect('timeout', Callable(self, 'on_enter_tree'))
## Производит инициализацию
func _ready():
min_zoom = ProjectSettings.get_setting('application/config/map_minimum_zoom', 5)
max_zoom = ProjectSettings.get_setting('application/config/map_maximum_zoom', 19)
$btn_zoom.set_meta('zoom', min_zoom - 1)
$tilemap.position = $canvas.get_strob_center()
$btn_strob.button_connect('pressed', Callable(self, 'on_button_strobe_pressed'))
$btn_view.button_connect('toggled', Callable(self, 'on_button_view_toggled'))
$grd_btns/btn_off.set_pressed(true)
on_button_strobe_pressed()
drag_fsm = DragFSM.OFF
var nodes: Array = get_tree().get_nodes_in_group('группа-режим-помехи')
nodes.any(func(btn): btn.button_connect('pressed', Callable(self, 'on_button_pressed').bind(btn, nodes)))
@@ -69,12 +76,18 @@ func _ready():
threats.connect('threat_lost', Callable(self, 'on_threat_lost'))
threats.connect('threats_resized', Callable(self, 'on_threats_resized'))
threats.connect('threat_update', Callable(self, 'on_threat_update'))
call_deferred('_on_btn_scale_pressed')
signaller.connect('zoom_complete', Callable(self, '_on_zoom_complete'))
signaller.connect('rto_threat_sel', Callable(self, 'on_rto_threat_sel'))
signaller.connect('threat_selected', Callable(self, 'on_threat_selected'))
func on_enter_tree() -> void:
call_deferred('_on_btn_scale_pressed')
call_deferred('on_button_strobe_pressed')
$tilemap.position = $canvas.get_strob_center()
$canvas.position = Vector2i(600, 600)
## Производит отображение цели на диаграмму
func map_threat_to_bip(th: threats.Threat, bip: Control):
bip.position = tools.pos_calc(

View File

@@ -8,11 +8,11 @@
[ext_resource type="PackedScene" uid="uid://dymo732qc2doa" path="res://scenes/count_all_pad.tscn" id="6_e3re7"]
[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count_danger_pad.tscn" id="7_2arls"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat.tscn" id="8_k0iv2"]
[ext_resource type="PackedScene" uid="uid://0uqi1ghf7sma" path="res://scenes/btn_zoom.tscn" id="9_oey3x"]
[ext_resource type="PackedScene" uid="uid://0uqi1ghf7sma" path="res://scenes/btn_scale.tscn" id="9_oey3x"]
[ext_resource type="PackedScene" uid="uid://bbq6nklh36yij" path="res://scenes/tilemap.tscn" id="10_gtwyg"]
[ext_resource type="Shader" path="res://shaders/tilemap.gdshader" id="11_ekapd"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_idugi"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ryewg"]
resource_local_to_scene = true
shader = ExtResource("11_ekapd")
shader_parameter/radius = 0.39
@@ -45,7 +45,7 @@ offset_bottom = 1170.0
metadata/_edit_lock_ = true
[node name="tilemap" parent="." instance=ExtResource("10_gtwyg")]
material = SubResource("ShaderMaterial_idugi")
material = SubResource("ShaderMaterial_ryewg")
[node name="canvas" parent="." instance=ExtResource("4_lryxs")]
metadata/_edit_lock_ = true