From 8f95859a3310e90c8dd7959625ae5a96a8a05fd2 Mon Sep 17 00:00:00 2001 From: lepshiy Date: Sat, 1 Nov 2025 12:46:25 +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[PATCH]=20=D0=94=D0=B2=D0=B8=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BA=D0=BE=D1=80=D0=B0=D0=B1=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=20=D0=BA=D0=BE=D0=BE=D1=80=D0=B4=D0=B8?= =?UTF-8?q?=D0=BD=D0=B0=D1=82=D0=B0=D0=BC.=20=D0=AD=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=20=D0=AD=D0=9C=D0=A1=20=D0=A2=D0=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/tilemap/tilemap.gd | 16 +++++++++------ scenes/работа/работа.tscn | 42 ++------------------------------------- scenes/эмс2/эмс2.tscn | 10 +++++++++- 3 files changed, 21 insertions(+), 47 deletions(-) diff --git a/scenes/tilemap/tilemap.gd b/scenes/tilemap/tilemap.gd index 78e0437c..f74e116c 100644 --- a/scenes/tilemap/tilemap.gd +++ b/scenes/tilemap/tilemap.gd @@ -147,14 +147,13 @@ func _ready() -> void: signaller.connect('map_centered', on_map_centered) if not Engine.is_editor_hint(): var unit_nav = network.get_unit_instance('навигация') - unit_nav.connect('data_received', Callable(self, 'on_data_received')) + unit_nav.connect('data_received', on_data_received) ProjectSettings.connect('settings_changed', _settings_changed) threats.connect('threat_new', Callable(self, '_on_threat_new')) threats.connect('threat_lost', Callable(self, '_on_threat_lost')) threats.connect('threat_update', Callable(self, '_on_threat_update')) - func _settings_changed(): base_url = ProjectSettings.get_setting('application/config/Шаблон адреса сервера карт', base_url) @@ -196,7 +195,7 @@ func add_mark_from_lon_lat(id: int, lon: float, lat: float, mark: Node, gap_size if _marks.has(id): return false var wrld_pos: Vector2 = lonlat_to_world(lon, lat) - _marks[id] = {'id': id, 'position': wrld_pos, 'mark': mark, 'gap_size': gap_size} # Добавляем ID + _marks[id] = {'position': wrld_pos, 'mark': mark, 'gap_size': gap_size} add_child(mark) queue_redraw() return true @@ -294,15 +293,20 @@ func _draw() -> void: for tx in range(t1.x, t2.x): for ty in range(t1.y, t2.y): _draw_tile(tx, ty, z) + # Рисование отметок + var n: = pow(2, z) + var dx: = n * tile_width var c: Vector2 = $canvas.size / 2.0 var r: float = c.length() visible_marks_count = 0 for dot in _marks.values(): - var screen_pos = world_to_screen(dot.position) - dot.mark.position = screen_pos + var scr_pos: Vector2 = world_to_screen(dot.position) + scr_pos.x = posmod(int(scr_pos.x), int(dx)) + dot.mark.position = scr_pos dot.mark.visible = is_mark_visible(dot) - dot.mark.visible = c.distance_to(screen_pos) < (r - dot.gap_size) + dot.mark.visible = c.distance_to(scr_pos) < (r - dot.gap_size) visible_marks_count += int(dot.mark.visible) + # Рисование границ var p1: Vector2 = $canvas.position var p2: Vector2 = $canvas.size / Vector2(1, 20) if is_out_border1 and _dragging: diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 8313ec3b..f7485c34 100644 --- a/scenes/работа/работа.tscn +++ b/scenes/работа/работа.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=19 format=3 uid="uid://b276iygic5itk"] +[gd_scene load_steps=18 format=3 uid="uid://b276iygic5itk"] [ext_resource type="Script" uid="uid://daudc0s3oox3i" path="res://scenes/работа/работа.gd" id="1_niok4"] [ext_resource type="PackedScene" uid="uid://nl1vklubr5kr" path="res://scenes/bip/bip.tscn" id="2_br3s6"] @@ -13,7 +13,6 @@ [ext_resource type="Texture2D" uid="uid://csdw3q5dtvu4w" path="res://data/power-1.png" id="11_xp4y6"] [ext_resource type="Texture2D" uid="uid://0sk43ticjaxk" path="res://data/navi-center-0.png" id="12_5ffal"] [ext_resource type="Texture2D" uid="uid://bk4ssfho1murp" path="res://data/navi-center-1.png" id="13_ggrwd"] -[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="14_ggrwd"] [sub_resource type="Animation" id="Animation_5ffal"] resource_name = "goto" @@ -339,52 +338,15 @@ offset_bottom = 302.0 theme_override_font_sizes/font_size = 20 text = "−" -[node name="btn_close" parent="." instance=ExtResource("8_k0iv2")] -layout_mode = 0 -offset_left = 10.0 -offset_top = 917.0 -offset_right = 109.0 -offset_bottom = 937.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" -strips_rotation = 25.0 -text = "Сек. запрета" -metadata/state = 0 - -[node name="btn_work" parent="." instance=ExtResource("8_k0iv2")] -layout_mode = 2 -offset_left = 10.0 -offset_top = 890.0 -offset_right = 109.0 -offset_bottom = 910.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 -tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" -strips_rotation = 25.0 -text = "Сек. работы" -metadata/state = 0 - -[node name="btn_all_work" type="TextureButton" parent="."] -modulate = Color(1, 1, 1, 0.356863) -layout_mode = 0 -offset_left = 112.0 -offset_top = 920.0 -offset_right = 336.0 -offset_bottom = 1144.0 -scale = Vector2(0.06, 0.06) -texture_normal = ExtResource("14_ggrwd") - [connection signal="drag_begin" from="." to="." method="_on_drag_begin"] [connection signal="drag_continue" from="." to="." method="_on_drag_continue"] [connection signal="toggled" from="btn_view" to="." method="on_button_view_toggled"] [connection signal="toggled" from="chk_auto" to="." method="on_value_changed"] -[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate"] [connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"] +[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate"] [connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"] [connection signal="button_down" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_down"] [connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"] [connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"] [connection signal="button_down" from="zoom_minus" to="tilemap" method="_on_zoom_minus_button_down"] [connection signal="button_up" from="zoom_minus" to="tilemap" method="_on_zoom_button_up"] -[connection signal="pressed" from="btn_all_work" to="." method="_on_btn_all_work_pressed"] diff --git a/scenes/эмс2/эмс2.tscn b/scenes/эмс2/эмс2.tscn index 55ccd986..ae3232bd 100644 --- a/scenes/эмс2/эмс2.tscn +++ b/scenes/эмс2/эмс2.tscn @@ -403,7 +403,6 @@ theme_override_font_sizes/font_size = 16 text = "Излучение" [node name="Label2" type="Label" parent="."] -layout_mode = 0 offset_left = 813.0 offset_top = 503.0 offset_right = 861.0 @@ -419,38 +418,47 @@ texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный4" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(660, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный5" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(774, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный6" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(546, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный7" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(468, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный8" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(390, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный9" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(312, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный10" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(234, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный11" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(156, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="СкруглённыйПрямоугСалатный12" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"] position = Vector2(78, 0) +scale = Vector2(1, 1) texture = ExtResource("29_5u4bk") [node name="Приём" type="Sprite2D" parent="СкруглённыйПрямоугСалатный"]