diff --git a/scenes/button-flat/button-flat.tscn b/scenes/button-flat/button-flat.tscn index 35c9aa87..a296bbe1 100644 --- a/scenes/button-flat/button-flat.tscn +++ b/scenes/button-flat/button-flat.tscn @@ -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="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="Texture2D" uid="uid://cl8h2vaibabyi" path="res://data/кнопка-квадрат-1.png" id="3_tbv1w"] [sub_resource type="StyleBoxEmpty" id="1"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_hhdyc"] resource_local_to_scene = true 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/width = 3.0 shader_parameter/speed = 0.0 @@ -56,6 +57,9 @@ offset_right = 20.0 offset_bottom = 20.0 theme_override_styles/panel = SubResource("1") script = ExtResource("1_ui6sg") +texture_state0 = ExtResource("2_0cn5u") +texture_state1 = ExtResource("3_tbv1w") +strips_rotation = 45.0 [node name="recommend" type="ReferenceRect" parent="."] visible = false @@ -72,6 +76,7 @@ texture = SubResource("PlaceholderTexture2D_6nup5") centered = false script = SubResource("GDScript_uyl5d") speed = 0.0 +strips_rotation = 0.785398 [node name="state" type="NinePatchRect" parent="."] layout_mode = 2 diff --git a/scenes/button-flat/nine-patch-button.gd b/scenes/button-flat/nine-patch-button.gd index e47b96f7..f1787550 100644 --- a/scenes/button-flat/nine-patch-button.gd +++ b/scenes/button-flat/nine-patch-button.gd @@ -12,35 +12,35 @@ func is_toggle_mode(): return $button.is_toggle_mode() var _pressed: = false -@export var texture_state0: Texture2D = preload('res://data/кнопка-квадрат-0.png'): +@export var texture_state0: Texture2D: set(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): texture_state1 = val - if is_inside_tree(): - $state.set_texture(val) @export var strips_rotation: float = 0.0: set(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 = '': set(val): text = val - $button.set_text(val) + if is_inside_tree(): + $button.set_text(val) @export var btn_tooltip: String = '': set(val): btn_tooltip = val - $button.set_tooltip_text(val) + if is_inside_tree(): + $button.set_tooltip_text(val) @export var disabled: bool = false: @@ -70,7 +70,9 @@ var _pressed: = false @export var font_size: int = 15: 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): @@ -92,7 +94,15 @@ func _enter_tree() -> void: $back.scale = size $back.material.set('shader_parameter/scale', size / Vector2(20.0, 20.0)) $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 + $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(): diff --git a/scenes/frame-ecm-list/frm-ecm-list.tscn b/scenes/frame-ecm-list/frm-ecm-list.tscn index 4084f8d1..512dd865 100644 --- a/scenes/frame-ecm-list/frm-ecm-list.tscn +++ b/scenes/frame-ecm-list/frm-ecm-list.tscn @@ -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="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://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="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"] offset_right = 480.0 @@ -55,6 +57,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Включает принудительную помеху" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "СРН" btn_tooltip = "Включает подавление радионавигации" @@ -66,6 +70,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Включает подавление каналов связи типа JTIDS" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "JTIDS" btn_tooltip = "Включает подавление радиосвязи типа JTIDS" @@ -76,6 +82,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "КУПД" btn_tooltip = "Включает подавление каналов управления передачи данных" @@ -86,6 +94,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для принудительного включения группы секторов в режим КУПД" +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "Паника" btn_tooltip = "Включает подавление JTIDS и КУПД" @@ -95,6 +105,8 @@ metadata/rfi_name = "" layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 +texture_state0 = ExtResource("6_ucntq") +texture_state1 = ExtResource("7_x08dr") strips_rotation = 15.0 text = "Очистить" btn_tooltip = "Выключает все сеансы помех" diff --git a/scenes/работа/работа.tscn b/scenes/работа/работа.tscn index 96f87bf0..5713a544 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=21 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"] @@ -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://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="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="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="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"] @@ -182,6 +184,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Строб" metadata/state = 0 @@ -191,6 +195,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Цель" metadata/state = 1 @@ -200,6 +206,8 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Сектор" pressed = true @@ -354,6 +362,8 @@ offset_bottom = 937.0 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Сек. запрета" metadata/state = 0 @@ -367,6 +377,8 @@ offset_bottom = 910.0 size_flags_horizontal = 3 size_flags_vertical = 3 tooltip_text = "Кнопка для выбора сектора при помощи клика мышкой" +texture_state0 = ExtResource("10_bkuib") +texture_state1 = ExtResource("11_1yrik") strips_rotation = 25.0 text = "Сек. работы" metadata/state = 0 diff --git a/scenes/эмс/кнопка-эмс.tscn b/scenes/эмс/кнопка-эмс.tscn index 93979030..10299380 100644 --- a/scenes/эмс/кнопка-эмс.tscn +++ b/scenes/эмс/кнопка-эмс.tscn @@ -17,8 +17,8 @@ [sub_resource type="StyleBoxEmpty" id="6"] [node name="container" type="PanelContainer"] -offset_right = 30.0 -offset_bottom = 30.0 +offset_right = 23.0 +offset_bottom = 19.0 theme_override_styles/panel = SubResource("1") script = ExtResource("1_pmsh3") texture_state0 = ExtResource("2_0o537") @@ -29,13 +29,7 @@ toggle_mode = true show_behind_parent = true layout_mode = 2 texture = ExtResource("3_okiyh") -region_rect = Rect2(-1.60803, -1.94625, 31.9305, 25.9868) -patch_margin_left = 6 -patch_margin_top = 5 -patch_margin_right = 7 -patch_margin_bottom = 5 -axis_stretch_horizontal = 2 -axis_stretch_vertical = 2 +region_rect = Rect2(3, 2, 22, 18) [node name="button" type="Button" parent="."] layout_mode = 2 diff --git a/scenes/эмс/эмс.tscn b/scenes/эмс/эмс.tscn index 4ed74639..9f729cb1 100644 --- a/scenes/эмс/эмс.tscn +++ b/scenes/эмс/эмс.tscn @@ -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="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="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="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"] texture = ExtResource("3_onafb") @@ -96,6 +98,8 @@ offset_left = 1446.0 offset_top = 55.0 offset_right = 1583.0 offset_bottom = 85.0 +texture_state0 = ExtResource("11_g8xrc") +texture_state1 = ExtResource("12_4mue7") strips_rotation = 10.0 text = "Прочитать" @@ -105,6 +109,8 @@ offset_left = 1446.0 offset_top = 99.0 offset_right = 1583.0 offset_bottom = 129.0 +texture_state0 = ExtResource("11_g8xrc") +texture_state1 = ExtResource("12_4mue7") strips_rotation = 10.0 text = "Записать" diff --git a/table/set-toggle.gd b/table/set-toggle.gd index 6f3d2a9a..7484d2c6 100644 --- a/table/set-toggle.gd +++ b/table/set-toggle.gd @@ -1,6 +1,6 @@ extends LineEdit -static var styles = [null, null] +static var styles: = [null, null] static var init_done: = false var checkbutton_material: Material diff --git a/table/settings-toggle.gd b/table/settings-toggle.gd index bcc25e16..03a02293 100644 --- a/table/settings-toggle.gd +++ b/table/settings-toggle.gd @@ -1,6 +1,6 @@ extends LineEdit -static var styles = [null, null] +static var styles: = [null, null] static var init_done: = false var checkbutton_material: Material