Merge remote-tracking branch 'lepshiy/master'
This commit is contained in:
@@ -56,6 +56,7 @@ offset_right = 20.0
|
|||||||
offset_bottom = 20.0
|
offset_bottom = 20.0
|
||||||
theme_override_styles/panel = SubResource("1")
|
theme_override_styles/panel = SubResource("1")
|
||||||
script = ExtResource("1_ui6sg")
|
script = ExtResource("1_ui6sg")
|
||||||
|
font_size = null
|
||||||
|
|
||||||
[node name="back" type="Sprite2D" parent="."]
|
[node name="back" type="Sprite2D" parent="."]
|
||||||
material = SubResource("ShaderMaterial_hhdyc")
|
material = SubResource("ShaderMaterial_hhdyc")
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ size_flags_vertical = 3
|
|||||||
tooltip_text = "Включает принудительную помеху"
|
tooltip_text = "Включает принудительную помеху"
|
||||||
strips_rotation = 15.0
|
strips_rotation = 15.0
|
||||||
text = "СРН"
|
text = "СРН"
|
||||||
|
font_size = 1
|
||||||
metadata/rfi_name = "srn"
|
metadata/rfi_name = "srn"
|
||||||
|
|
||||||
[node name="btn_jtids" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
[node name="btn_jtids" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||||
@@ -66,6 +67,7 @@ size_flags_horizontal = 3
|
|||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
strips_rotation = 15.0
|
strips_rotation = 15.0
|
||||||
text = "СПРС"
|
text = "СПРС"
|
||||||
|
font_size = 1
|
||||||
metadata/rfi_name = "sprs"
|
metadata/rfi_name = "sprs"
|
||||||
|
|
||||||
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
[node name="btn_kupd" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||||
@@ -75,6 +77,7 @@ size_flags_vertical = 3
|
|||||||
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
|
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
|
||||||
strips_rotation = 15.0
|
strips_rotation = 15.0
|
||||||
text = "КУПД"
|
text = "КУПД"
|
||||||
|
font_size = 1
|
||||||
metadata/rfi_name = "kupd"
|
metadata/rfi_name = "kupd"
|
||||||
|
|
||||||
[node name="btn_panika" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
[node name="btn_panika" parent="grd_forced" groups=["группа-принудительно"] instance=ExtResource("4_7ys3c")]
|
||||||
@@ -84,6 +87,7 @@ size_flags_vertical = 3
|
|||||||
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
|
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
|
||||||
strips_rotation = 15.0
|
strips_rotation = 15.0
|
||||||
text = "Паника"
|
text = "Паника"
|
||||||
|
font_size = 1
|
||||||
metadata/rfi_name = "<off>"
|
metadata/rfi_name = "<off>"
|
||||||
|
|
||||||
[node name="btn_cancel" parent="grd_forced" groups=["прин-секторы-срн"] instance=ExtResource("4_7ys3c")]
|
[node name="btn_cancel" parent="grd_forced" groups=["прин-секторы-срн"] instance=ExtResource("4_7ys3c")]
|
||||||
@@ -92,4 +96,5 @@ size_flags_horizontal = 3
|
|||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
strips_rotation = 15.0
|
strips_rotation = 15.0
|
||||||
text = "Очистить"
|
text = "Очистить"
|
||||||
|
font_size = 1
|
||||||
metadata/rfi_name = "<off>"
|
metadata/rfi_name = "<off>"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://cj1f2uy6qfvki" path="res://scenes/tilemap/23900.png" id="1_v0nwa"]
|
[ext_resource type="Texture2D" uid="uid://cj1f2uy6qfvki" path="res://scenes/tilemap/23900.png" id="1_v0nwa"]
|
||||||
|
|
||||||
[node name="23900" type="Sprite2D"]
|
[node name="23900" type="Sprite2D"]
|
||||||
position = Vector2(0.0, 0.0)
|
|
||||||
rotation = 4.71239
|
rotation = 4.71239
|
||||||
scale = Vector2(0.496934, 0.496934)
|
scale = Vector2(0.496934, 0.496934)
|
||||||
texture = ExtResource("1_v0nwa")
|
texture = ExtResource("1_v0nwa")
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class_name MercatorTileMap
|
|||||||
## Отображение карт WEB Mercator
|
## Отображение карт WEB Mercator
|
||||||
|
|
||||||
#http://10.1.1.220/osm_tiles/0/0/0.png
|
#http://10.1.1.220/osm_tiles/0/0/0.png
|
||||||
|
#http://169.254.27.71:8001/osm_tiles/{z}/{x}/{y}.png
|
||||||
#https://tile.openstreetmap.org/{z}/{x}/{y}.png
|
#https://tile.openstreetmap.org/{z}/{x}/{y}.png
|
||||||
@export var base_url: String = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png':
|
@export var base_url: String = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png':
|
||||||
set(v):
|
set(v):
|
||||||
@@ -146,11 +147,12 @@ func _ready() -> void:
|
|||||||
signaller.connect('map_centered', on_map_centered)
|
signaller.connect('map_centered', on_map_centered)
|
||||||
if not Engine.is_editor_hint():
|
if not Engine.is_editor_hint():
|
||||||
var unit_nav = network.get_unit_instance('навигация')
|
var unit_nav = network.get_unit_instance('навигация')
|
||||||
unit_nav.connect('data_received', on_data_received)
|
unit_nav.connect('data_received', Callable(self, 'on_data_received'))
|
||||||
ProjectSettings.connect('settings_changed', _settings_changed)
|
ProjectSettings.connect('settings_changed', _settings_changed)
|
||||||
threats.connect('threat_new', Callable(self, '_on_threat_new'))
|
threats.connect('threat_new', Callable(self, '_on_threat_new'))
|
||||||
threats.connect('threat_lost', Callable(self, '_on_threat_lost'))
|
threats.connect('threat_lost', Callable(self, '_on_threat_lost'))
|
||||||
threats.connect('threat_update', Callable(self, '_on_threat_update'))
|
threats.connect('threat_update', Callable(self, '_on_threat_update'))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _settings_changed():
|
func _settings_changed():
|
||||||
@@ -194,7 +196,7 @@ func add_mark_from_lon_lat(id: int, lon: float, lat: float, mark: Node, gap_size
|
|||||||
if _marks.has(id):
|
if _marks.has(id):
|
||||||
return false
|
return false
|
||||||
var wrld_pos: Vector2 = lonlat_to_world(lon, lat)
|
var wrld_pos: Vector2 = lonlat_to_world(lon, lat)
|
||||||
_marks[id] = {'position': wrld_pos, 'mark': mark, 'gap_size': gap_size}
|
_marks[id] = {'id': id, 'position': wrld_pos, 'mark': mark, 'gap_size': gap_size} # Добавляем ID
|
||||||
add_child(mark)
|
add_child(mark)
|
||||||
queue_redraw()
|
queue_redraw()
|
||||||
return true
|
return true
|
||||||
@@ -292,20 +294,15 @@ func _draw() -> void:
|
|||||||
for tx in range(t1.x, t2.x):
|
for tx in range(t1.x, t2.x):
|
||||||
for ty in range(t1.y, t2.y):
|
for ty in range(t1.y, t2.y):
|
||||||
_draw_tile(tx, ty, z)
|
_draw_tile(tx, ty, z)
|
||||||
# Рисование отметок
|
|
||||||
var n: = pow(2, z)
|
|
||||||
var dx: = n * tile_width
|
|
||||||
var c: Vector2 = $canvas.size / 2.0
|
var c: Vector2 = $canvas.size / 2.0
|
||||||
var r: float = c.length()
|
var r: float = c.length()
|
||||||
visible_marks_count = 0
|
visible_marks_count = 0
|
||||||
for dot in _marks.values():
|
for dot in _marks.values():
|
||||||
var scr_pos: Vector2 = world_to_screen(dot.position)
|
var screen_pos = world_to_screen(dot.position)
|
||||||
scr_pos.x = posmod(int(scr_pos.x), int(dx))
|
dot.mark.position = screen_pos
|
||||||
dot.mark.position = scr_pos
|
|
||||||
dot.mark.visible = is_mark_visible(dot)
|
dot.mark.visible = is_mark_visible(dot)
|
||||||
dot.mark.visible = c.distance_to(scr_pos) < (r - dot.gap_size)
|
dot.mark.visible = c.distance_to(screen_pos) < (r - dot.gap_size)
|
||||||
visible_marks_count += int(dot.mark.visible)
|
visible_marks_count += int(dot.mark.visible)
|
||||||
# Рисование границ
|
|
||||||
var p1: Vector2 = $canvas.position
|
var p1: Vector2 = $canvas.position
|
||||||
var p2: Vector2 = $canvas.size / Vector2(1, 20)
|
var p2: Vector2 = $canvas.size / Vector2(1, 20)
|
||||||
if is_out_border1 and _dragging:
|
if is_out_border1 and _dragging:
|
||||||
@@ -313,7 +310,6 @@ func _draw() -> void:
|
|||||||
p1.y = p1.y + $canvas.size.y - p2.y
|
p1.y = p1.y + $canvas.size.y - p2.y
|
||||||
if is_out_border2 and _dragging:
|
if is_out_border2 and _dragging:
|
||||||
draw_texture_rect(border2, Rect2(p1, p2), false, Color.WHITE, false)
|
draw_texture_rect(border2, Rect2(p1, p2), false, Color.WHITE, false)
|
||||||
|
|
||||||
if should_draw_ship_radius():
|
if should_draw_ship_radius():
|
||||||
draw_ship_radius()
|
draw_ship_radius()
|
||||||
|
|
||||||
@@ -710,8 +706,9 @@ func set_coordinates(lon: float, lat: float, course: float) -> void:
|
|||||||
ship_instance = ship_mark.instantiate()
|
ship_instance = ship_mark.instantiate()
|
||||||
add_mark_from_lon_lat(ship_id, lon, lat, ship_instance, 0.0)
|
add_mark_from_lon_lat(ship_id, lon, lat, ship_instance, 0.0)
|
||||||
else:
|
else:
|
||||||
ship_instance.position = lonlat_to_world(lon, lat)
|
_marks[ship_id].position = lonlat_to_world(lon, lat)
|
||||||
ship_instance.rotation_degrees = course - 90
|
ship_instance.rotation_degrees = course
|
||||||
|
queue_redraw()
|
||||||
|
|
||||||
|
|
||||||
func blend_mask(val: bool) -> void:
|
func blend_mask(val: bool) -> void:
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ size_flags_vertical = 3
|
|||||||
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
|
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
|
||||||
strips_rotation = 25.0
|
strips_rotation = 25.0
|
||||||
text = "Строб"
|
text = "Строб"
|
||||||
|
font_size = 15
|
||||||
metadata/state = 0
|
metadata/state = 0
|
||||||
|
|
||||||
[node name="btn_threats" parent="btns_select" groups=["группа-режим-выбора"] instance=ExtResource("8_k0iv2")]
|
[node name="btn_threats" parent="btns_select" groups=["группа-режим-выбора"] instance=ExtResource("8_k0iv2")]
|
||||||
@@ -187,6 +188,7 @@ size_flags_vertical = 3
|
|||||||
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
|
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
|
||||||
strips_rotation = 25.0
|
strips_rotation = 25.0
|
||||||
text = "Цель"
|
text = "Цель"
|
||||||
|
font_size = 15
|
||||||
metadata/state = 1
|
metadata/state = 1
|
||||||
|
|
||||||
[node name="btn_fs_sector" parent="btns_select" groups=["группа-режим-выбора"] instance=ExtResource("8_k0iv2")]
|
[node name="btn_fs_sector" parent="btns_select" groups=["группа-режим-выбора"] instance=ExtResource("8_k0iv2")]
|
||||||
@@ -196,6 +198,7 @@ size_flags_vertical = 3
|
|||||||
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
|
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
|
||||||
strips_rotation = 25.0
|
strips_rotation = 25.0
|
||||||
text = "Сектор"
|
text = "Сектор"
|
||||||
|
font_size = 15
|
||||||
metadata/state = 2
|
metadata/state = 2
|
||||||
|
|
||||||
[node name="chk_auto" type="CheckBox" parent="."]
|
[node name="chk_auto" type="CheckBox" parent="."]
|
||||||
@@ -342,8 +345,8 @@ text = "−"
|
|||||||
[connection signal="drag_continue" from="." to="." method="_on_drag_continue"]
|
[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="btn_view" to="." method="on_button_view_toggled"]
|
||||||
[connection signal="toggled" from="chk_auto" to="." method="on_value_changed"]
|
[connection signal="toggled" from="chk_auto" to="." method="on_value_changed"]
|
||||||
[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_activate" to="." method="on_btn_activate"]
|
||||||
|
[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"]
|
||||||
[connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"]
|
[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_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_plus_button_up"]
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ offset_right = 1583.0
|
|||||||
offset_bottom = 85.0
|
offset_bottom = 85.0
|
||||||
strips_rotation = 10.0
|
strips_rotation = 10.0
|
||||||
text = "Прочитать"
|
text = "Прочитать"
|
||||||
|
font_size = null
|
||||||
|
|
||||||
[node name="btn_flash_write" parent="." instance=ExtResource("2_eju8r")]
|
[node name="btn_flash_write" parent="." instance=ExtResource("2_eju8r")]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
@@ -90,6 +91,7 @@ offset_right = 1583.0
|
|||||||
offset_bottom = 129.0
|
offset_bottom = 129.0
|
||||||
strips_rotation = 10.0
|
strips_rotation = 10.0
|
||||||
text = "Записать"
|
text = "Записать"
|
||||||
|
font_size = null
|
||||||
|
|
||||||
[node name="btn_save" type="Button" parent="."]
|
[node name="btn_save" type="Button" parent="."]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user