Доработка. Теперь пути загрузки сцен управляются редактором

This commit is contained in:
sasha80
2026-01-30 09:50:53 +03:00
parent 416e93c4e4
commit 5e9ef98301
8 changed files with 64 additions and 25 deletions

View File

@@ -1,15 +1,16 @@
[gd_scene load_steps=13 format=3 uid="uid://da7w3vkhadfwe"] [gd_scene load_steps=14 format=3 uid="uid://da7w3vkhadfwe"]
[ext_resource type="Script" uid="uid://damy6n4u215pu" path="res://scenes/button-flat/nine-patch-button.gd" id="1_ui6sg"] [ext_resource type="Script" uid="uid://damy6n4u215pu" path="res://scenes/button-flat/nine-patch-button.gd" id="1_ui6sg"]
[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="2_0cn5u"] [ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="2_0cn5u"]
[ext_resource type="Shader" uid="uid://cdmmsf161l6yw" path="res://shaders/strips.gdshader" id="2_5ngiq"] [ext_resource type="Shader" uid="uid://cdmmsf161l6yw" path="res://shaders/strips.gdshader" id="2_5ngiq"]
[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="3_tbv1w"]
[sub_resource type="StyleBoxEmpty" id="1"] [sub_resource type="StyleBoxEmpty" id="1"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hhdyc"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_hhdyc"]
resource_local_to_scene = true resource_local_to_scene = true
shader = ExtResource("2_5ngiq") shader = ExtResource("2_5ngiq")
shader_parameter/rotation = 0.0 shader_parameter/rotation = 0.785398
shader_parameter/color = Vector4(1, 1, 1, 0.1) shader_parameter/color = Vector4(1, 1, 1, 0.1)
shader_parameter/width = 3.0 shader_parameter/width = 3.0
shader_parameter/speed = 0.0 shader_parameter/speed = 0.0
@@ -56,6 +57,9 @@ 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")
texture_state0 = ExtResource("2_0cn5u")
texture_state1 = ExtResource("3_tbv1w")
strips_rotation = 45.0
[node name="recommend" type="ReferenceRect" parent="."] [node name="recommend" type="ReferenceRect" parent="."]
visible = false visible = false
@@ -72,6 +76,7 @@ texture = SubResource("PlaceholderTexture2D_6nup5")
centered = false centered = false
script = SubResource("GDScript_uyl5d") script = SubResource("GDScript_uyl5d")
speed = 0.0 speed = 0.0
strips_rotation = 0.785398
[node name="state" type="NinePatchRect" parent="."] [node name="state" type="NinePatchRect" parent="."]
layout_mode = 2 layout_mode = 2

View File

@@ -12,35 +12,35 @@ func is_toggle_mode(): return $button.is_toggle_mode()
var _pressed: = false var _pressed: = false
@export var texture_state0: Texture2D = preload('res://data/кнопка-квадрат-0.png'): @export var texture_state0: Texture2D:
set(val): set(val):
texture_state0 = val texture_state0 = val
$state.set_texture(val)
@export var texture_state1: Texture2D = preload('res://data/кнопка-квадрат-1.png'): @export var texture_state1: Texture2D:
set(val): set(val):
texture_state1 = val texture_state1 = val
if is_inside_tree():
$state.set_texture(val)
@export var strips_rotation: float = 0.0: @export var strips_rotation: float = 0.0:
set(val): set(val):
strips_rotation = val strips_rotation = val
$back.strips_rotation = deg_to_rad(val) if is_inside_tree():
$back.strips_rotation = deg_to_rad(val)
@export var text: String = '': @export var text: String = '':
set(val): set(val):
text = val text = val
$button.set_text(val) if is_inside_tree():
$button.set_text(val)
@export var btn_tooltip: String = '': @export var btn_tooltip: String = '':
set(val): set(val):
btn_tooltip = val btn_tooltip = val
$button.set_tooltip_text(val) if is_inside_tree():
$button.set_tooltip_text(val)
@export var disabled: bool = false: @export var disabled: bool = false:
@@ -70,7 +70,9 @@ var _pressed: = false
@export var font_size: int = 15: @export var font_size: int = 15:
set(val): set(val):
$button.add_theme_font_size_override('theme_override_font_sizes/font_size', val) font_size = val
if is_inside_tree():
$button.add_theme_font_size_override('theme_override_font_sizes/font_size', val)
func set_pressed(val: bool): func set_pressed(val: bool):
@@ -92,7 +94,15 @@ func _enter_tree() -> void:
$back.scale = size $back.scale = size
$back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0)) $back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0))
$button.connect('toggled', _on_button_toggled) $button.connect('toggled', _on_button_toggled)
$button.set_toggle_mode(toggle_mode)
$button.add_theme_font_size_override('theme_override_font_sizes/font_size', font_size)
pressed = _pressed pressed = _pressed
$button.set_pressed(pressed)
$button.set_disabled(disabled)
$back.disabled = disabled
$state.modulate.a = 0.5 if disabled else 1.0
$button.set_tooltip_text(btn_tooltip)
$button.set_text(text)
func _on_settings_changed(): func _on_settings_changed():

View File

@@ -1,10 +1,12 @@
[gd_scene load_steps=6 format=3 uid="uid://7rvw671tlx2i"] [gd_scene load_steps=8 format=3 uid="uid://7rvw671tlx2i"]
[ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_6swor"] [ext_resource type="Texture2D" uid="uid://cs6i1xwx0pmdk" path="res://data/рамка-панели.png" id="1_6swor"]
[ext_resource type="Script" uid="uid://14bc8gil81n7" path="res://scenes/frame-ecm-list/scroll-ecm-list.gd" id="2_3x81o"] [ext_resource type="Script" uid="uid://14bc8gil81n7" path="res://scenes/frame-ecm-list/scroll-ecm-list.gd" id="2_3x81o"]
[ext_resource type="Script" uid="uid://b23n7v1xjdurw" path="res://scenes/frame-ecm-list/frm-ecm-list.gd" id="2_mt58v"] [ext_resource type="Script" uid="uid://b23n7v1xjdurw" path="res://scenes/frame-ecm-list/frm-ecm-list.gd" id="2_mt58v"]
[ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="3_4hydx"] [ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="3_4hydx"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="4_7ys3c"] [ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="4_7ys3c"]
[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="6_ucntq"]
[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="7_x08dr"]
[node name="frm_ecm_list" type="NinePatchRect"] [node name="frm_ecm_list" type="NinePatchRect"]
offset_right = 480.0 offset_right = 480.0
@@ -55,6 +57,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Включает принудительную помеху" tooltip_text = "Включает принудительную помеху"
texture_state0 = ExtResource("6_ucntq")
texture_state1 = ExtResource("7_x08dr")
strips_rotation = 15.0 strips_rotation = 15.0
text = "СРН" text = "СРН"
btn_tooltip = "Включает подавление радионавигации" btn_tooltip = "Включает подавление радионавигации"
@@ -66,6 +70,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Включает подавление каналов связи типа JTIDS" tooltip_text = "Включает подавление каналов связи типа JTIDS"
texture_state0 = ExtResource("6_ucntq")
texture_state1 = ExtResource("7_x08dr")
strips_rotation = 15.0 strips_rotation = 15.0
text = "JTIDS" text = "JTIDS"
btn_tooltip = "Включает подавление радиосвязи типа JTIDS" btn_tooltip = "Включает подавление радиосвязи типа JTIDS"
@@ -76,6 +82,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД" tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
texture_state0 = ExtResource("6_ucntq")
texture_state1 = ExtResource("7_x08dr")
strips_rotation = 15.0 strips_rotation = 15.0
text = "КУПД" text = "КУПД"
btn_tooltip = "Включает подавление каналов управления передачи данных" btn_tooltip = "Включает подавление каналов управления передачи данных"
@@ -86,6 +94,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД" tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД"
texture_state0 = ExtResource("6_ucntq")
texture_state1 = ExtResource("7_x08dr")
strips_rotation = 15.0 strips_rotation = 15.0
text = "Паника" text = "Паника"
btn_tooltip = "Включает подавление JTIDS и КУПД" btn_tooltip = "Включает подавление JTIDS и КУПД"
@@ -95,6 +105,8 @@ metadata/rfi_name = "<off>"
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
texture_state0 = ExtResource("6_ucntq")
texture_state1 = ExtResource("7_x08dr")
strips_rotation = 15.0 strips_rotation = 15.0
text = "Очистить" text = "Очистить"
btn_tooltip = "Выключает все сеансы помех" btn_tooltip = "Выключает все сеансы помех"

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://b276iygic5itk"] [gd_scene load_steps=21 format=3 uid="uid://b276iygic5itk"]
[ext_resource type="Script" uid="uid://daudc0s3oox3i" path="res://scenes/работа/работа.gd" id="1_niok4"] [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"] [ext_resource type="PackedScene" uid="uid://nl1vklubr5kr" path="res://scenes/bip/bip.tscn" id="2_br3s6"]
@@ -7,8 +7,10 @@
[ext_resource type="PackedScene" uid="uid://dymo732qc2doa" path="res://scenes/count-all/count-all-pad.tscn" id="6_e3re7"] [ext_resource type="PackedScene" uid="uid://dymo732qc2doa" path="res://scenes/count-all/count-all-pad.tscn" id="6_e3re7"]
[ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count-danger/count-danger-pad.tscn" id="7_2arls"] [ext_resource type="PackedScene" uid="uid://bwti82byphl68" path="res://scenes/count-danger/count-danger-pad.tscn" id="7_2arls"]
[ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="8_k0iv2"] [ext_resource type="PackedScene" uid="uid://da7w3vkhadfwe" path="res://scenes/button-flat/button-flat.tscn" id="8_k0iv2"]
[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="10_bkuib"]
[ext_resource type="Texture2D" uid="uid://c1785x8wf1hdg" path="res://data/power-0.png" id="10_cnr1s"] [ext_resource type="Texture2D" uid="uid://c1785x8wf1hdg" path="res://data/power-0.png" id="10_cnr1s"]
[ext_resource type="PackedScene" uid="uid://ceknxxfu1loo5" path="res://scenes/tilemap/tilemap.tscn" id="10_gtwyg"] [ext_resource type="PackedScene" uid="uid://ceknxxfu1loo5" path="res://scenes/tilemap/tilemap.tscn" id="10_gtwyg"]
[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="11_1yrik"]
[ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/diagram/diagram.tscn" id="11_b6su4"] [ext_resource type="PackedScene" uid="uid://b5kjdyxuwsot5" path="res://scenes/diagram/diagram.tscn" id="11_b6su4"]
[ext_resource type="Texture2D" uid="uid://csdw3q5dtvu4w" path="res://data/power-1.png" id="11_xp4y6"] [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://0sk43ticjaxk" path="res://data/navi-center-0.png" id="12_5ffal"]
@@ -182,6 +184,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
texture_state0 = ExtResource("10_bkuib")
texture_state1 = ExtResource("11_1yrik")
strips_rotation = 25.0 strips_rotation = 25.0
text = "Строб" text = "Строб"
metadata/state = 0 metadata/state = 0
@@ -191,6 +195,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
texture_state0 = ExtResource("10_bkuib")
texture_state1 = ExtResource("11_1yrik")
strips_rotation = 25.0 strips_rotation = 25.0
text = "Цель" text = "Цель"
metadata/state = 1 metadata/state = 1
@@ -200,6 +206,8 @@ layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
texture_state0 = ExtResource("10_bkuib")
texture_state1 = ExtResource("11_1yrik")
strips_rotation = 25.0 strips_rotation = 25.0
text = "Сектор" text = "Сектор"
pressed = true pressed = true
@@ -354,6 +362,8 @@ offset_bottom = 937.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
texture_state0 = ExtResource("10_bkuib")
texture_state1 = ExtResource("11_1yrik")
strips_rotation = 25.0 strips_rotation = 25.0
text = "Сек. запрета" text = "Сек. запрета"
metadata/state = 0 metadata/state = 0
@@ -367,6 +377,8 @@ offset_bottom = 910.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой"
texture_state0 = ExtResource("10_bkuib")
texture_state1 = ExtResource("11_1yrik")
strips_rotation = 25.0 strips_rotation = 25.0
text = "Сек. работы" text = "Сек. работы"
metadata/state = 0 metadata/state = 0

View File

@@ -17,8 +17,8 @@
[sub_resource type="StyleBoxEmpty" id="6"] [sub_resource type="StyleBoxEmpty" id="6"]
[node name="container" type="PanelContainer"] [node name="container" type="PanelContainer"]
offset_right = 30.0 offset_right = 23.0
offset_bottom = 30.0 offset_bottom = 19.0
theme_override_styles/panel = SubResource("1") theme_override_styles/panel = SubResource("1")
script = ExtResource("1_pmsh3") script = ExtResource("1_pmsh3")
texture_state0 = ExtResource("2_0o537") texture_state0 = ExtResource("2_0o537")
@@ -29,13 +29,7 @@ toggle_mode = true
show_behind_parent = true show_behind_parent = true
layout_mode = 2 layout_mode = 2
texture = ExtResource("3_okiyh") texture = ExtResource("3_okiyh")
region_rect = Rect2(-1.60803, -1.94625, 31.9305, 25.9868) region_rect = Rect2(3, 2, 22, 18)
patch_margin_left = 6
patch_margin_top = 5
patch_margin_right = 7
patch_margin_bottom = 5
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
[node name="button" type="Button" parent="."] [node name="button" type="Button" parent="."]
layout_mode = 2 layout_mode = 2

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=28 format=3 uid="uid://dab6loryocc73"] [gd_scene load_steps=30 format=3 uid="uid://dab6loryocc73"]
[ext_resource type="Script" uid="uid://do1s7qg4bmxqy" path="res://scenes/эмс/эмс.gd" id="1_mk57x"] [ext_resource type="Script" uid="uid://do1s7qg4bmxqy" path="res://scenes/эмс/эмс.gd" id="1_mk57x"]
[ext_resource type="PackedScene" uid="uid://ch14g46swx74h" path="res://table/header.tscn" id="2_1fbmy"] [ext_resource type="PackedScene" uid="uid://ch14g46swx74h" path="res://table/header.tscn" id="2_1fbmy"]
@@ -15,6 +15,8 @@
[ext_resource type="PackedScene" uid="uid://bccr42bckei41" path="res://scenes/cell/cell-front.tscn" id="8_k30d1"] [ext_resource type="PackedScene" uid="uid://bccr42bckei41" path="res://scenes/cell/cell-front.tscn" id="8_k30d1"]
[ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="8_qcl30"] [ext_resource type="Script" uid="uid://c5pq0hbrij34d" path="res://table/table.gd" id="8_qcl30"]
[ext_resource type="PackedScene" uid="uid://b8txs4xi722wt" path="res://scenes/cell/cell-front-rear.tscn" id="9_js36y"] [ext_resource type="PackedScene" uid="uid://b8txs4xi722wt" path="res://scenes/cell/cell-front-rear.tscn" id="9_js36y"]
[ext_resource type="Texture2D" uid="uid://ct0ajcwno03h7" path="res://data/кнопка-квадрат-0.png" id="11_g8xrc"]
[ext_resource type="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="12_4mue7"]
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mu34x"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_mu34x"]
texture = ExtResource("3_onafb") texture = ExtResource("3_onafb")
@@ -96,6 +98,8 @@ offset_left = 1446.0
offset_top = 55.0 offset_top = 55.0
offset_right = 1583.0 offset_right = 1583.0
offset_bottom = 85.0 offset_bottom = 85.0
texture_state0 = ExtResource("11_g8xrc")
texture_state1 = ExtResource("12_4mue7")
strips_rotation = 10.0 strips_rotation = 10.0
text = "Прочитать" text = "Прочитать"
@@ -105,6 +109,8 @@ offset_left = 1446.0
offset_top = 99.0 offset_top = 99.0
offset_right = 1583.0 offset_right = 1583.0
offset_bottom = 129.0 offset_bottom = 129.0
texture_state0 = ExtResource("11_g8xrc")
texture_state1 = ExtResource("12_4mue7")
strips_rotation = 10.0 strips_rotation = 10.0
text = "Записать" text = "Записать"

View File

@@ -1,6 +1,6 @@
extends LineEdit extends LineEdit
static var styles = [null, null] static var styles: = [null, null]
static var init_done: = false static var init_done: = false
var checkbutton_material: Material var checkbutton_material: Material

View File

@@ -1,6 +1,6 @@
extends LineEdit extends LineEdit
static var styles = [null, null] static var styles: = [null, null]
static var init_done: = false static var init_done: = false
var checkbutton_material: Material var checkbutton_material: Material