diff --git a/addons/godot-logger/scripts/logger.gd b/addons/godot-logger/scripts/logger.gd index dc6a1f92..1648f794 100644 --- a/addons/godot-logger/scripts/logger.gd +++ b/addons/godot-logger/scripts/logger.gd @@ -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) diff --git a/project.godot b/project.godot index 77779285..e106d342 100644 --- a/project.godot +++ b/project.godot @@ -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 +} diff --git a/scenes/scroll-ecm-list.gd b/scenes/scroll-ecm-list.gd index 94086e60..594f5e4a 100644 --- a/scenes/scroll-ecm-list.gd +++ b/scenes/scroll-ecm-list.gd @@ -20,18 +20,18 @@ const INTERFER_STATE = { 5: 'Передача' } ## Индексы колонок -const COLUMN_NUMBER = 0 -const COLUMN_NAME = 1 -const COLUMN_FREQ = 2 +const COLUMN_NUMBER = 0 +const COLUMN_NAME = 1 +const COLUMN_FREQ = 2 const COLUMN_AOA = 3 -const COLUMN_STATE = 4 +const COLUMN_STATE = 4 # Called when the node enters the scene tree for the first time. func _ready(): var table_index: = Dictionary() signaller.connect('interfer_new', Callable(self, 'on_interfer_new').bind(table_index)) call_deferred('init_table') - + func init_table(): $table.set_header(TABLE_HEADER) @@ -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 diff --git a/scenes/tilemap.gd b/scenes/tilemap.gd index 9a57f195..6138a3e1 100644 --- a/scenes/tilemap.gd +++ b/scenes/tilemap.gd @@ -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: diff --git a/scenes/кнопка-3.tscn b/scenes/кнопка-3.tscn deleted file mode 100644 index df9e3863..00000000 --- a/scenes/кнопка-3.tscn +++ /dev/null @@ -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") diff --git a/scenes/настройки.gd b/scenes/настройки.gd index 446ab498..a510901f 100644 --- a/scenes/настройки.gd +++ b/scenes/настройки.gd @@ -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 + diff --git a/scenes/настройки.tscn b/scenes/настройки.tscn index bb9f1054..4b79291a 100644 --- a/scenes/настройки.tscn +++ b/scenes/настройки.tscn @@ -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"] diff --git a/scenes/работа.gd b/scenes/работа.gd index ae90a2ea..79e8067e 100644 --- a/scenes/работа.gd +++ b/scenes/работа.gd @@ -52,29 +52,42 @@ 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))) - threats.connect('threat_new', Callable(self, 'on_threat_new')) - 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')) + threats.connect('threat_new', Callable(self, 'on_threat_new')) + 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')) + 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( diff --git a/scenes/работа.tscn b/scenes/работа.tscn index 23bebdc2..eaa15858 100644 --- a/scenes/работа.tscn +++ b/scenes/работа.tscn @@ -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 diff --git a/shaders/tracked.gdshader b/shaders/tracked.gdshader index db8e7c8a..a9acbbfc 100644 --- a/shaders/tracked.gdshader +++ b/shaders/tracked.gdshader @@ -53,7 +53,7 @@ vec2 rotateUVmatrinx(vec2 uv, vec2 pivot, float rotation) void vertex() -{ +{ float dir = 0.0; vec2 offset = vec2(0.125, 0.125); dir -= speed * TIME; @@ -75,6 +75,6 @@ void fragment() get_line_points(px0, px1, py0, py1, 210.0); COLOR.a += line(vec2(px0, py0), vec2(px1, py1), 5.0, UV); COLOR *= smooth_px(length(UV-center), radius, DSS); - + }