diff --git a/Control.tscn b/Control.tscn index bc1c57c1..f08c189a 100644 --- a/Control.tscn +++ b/Control.tscn @@ -1,9 +1,13 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=11 format=2] +[ext_resource path="res://data/СПТ.png" type="Texture" id=1] [ext_resource path="res://data/мп550-работа-эскиз.png" type="Texture" id=2] [ext_resource path="res://main.gd" type="Script" id=3] [ext_resource path="res://data/УФ.png" type="Texture" id=4] [ext_resource path="res://Контроль.gd" type="Script" id=5] +[ext_resource path="res://data/Грани22.png" type="Texture" id=6] +[ext_resource path="res://data/Щ3.png" type="Texture" id=7] +[ext_resource path="res://data/ПРД.png" type="Texture" id=8] [sub_resource type="DynamicFont" id=2] @@ -12,8 +16,8 @@ resource_local_to_scene = true default_font = SubResource( 2 ) [node name="TabContainer" type="TabContainer"] -anchor_right = 1.0 -anchor_bottom = 1.0 +margin_right = 1600.0 +margin_bottom = 1200.0 rect_pivot_offset = Vector2( 800, 600 ) tab_align = 0 script = ExtResource( 3 ) @@ -45,20 +49,221 @@ margin_right = -4.0 margin_bottom = -4.0 script = ExtResource( 5 ) -[node name="pribor_UF" type="TextureButton" parent="Контроль"] -margin_left = 1048.0 -margin_top = 542.0 -margin_right = 1100.0 -margin_bottom = 658.0 +[node name="pribor_uf" type="TextureButton" parent="Контроль"] +margin_left = 1077.0 +margin_top = 411.0 +margin_right = 1129.0 +margin_bottom = 527.0 size_flags_horizontal = 15 size_flags_vertical = 15 texture_normal = ExtResource( 4 ) expand = true stretch_mode = 4 -[node name="Button" type="Button" parent="Контроль"] -margin_left = 480.0 -margin_top = 440.0 +[node name="pribor_rtr" type="TextureButton" parent="Контроль"] +margin_left = 1065.0 +margin_top = 113.0 +margin_right = 1117.0 +margin_bottom = 200.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 1 ) +expand = true +stretch_mode = 4 + +[node name="pribor_afsp_l" type="TextureButton" parent="Контроль"] +margin_left = 877.0 +margin_top = 112.0 +margin_right = 994.0 +margin_bottom = 199.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 6 ) +expand = true +stretch_mode = 4 + +[node name="pribor_afsp_r" type="TextureButton" parent="Контроль"] +margin_left = 1187.0 +margin_top = 116.0 +margin_right = 1304.0 +margin_bottom = 203.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 6 ) +expand = true +stretch_mode = 4 + +[node name="pribor_sch3" type="TextureButton" parent="Контроль"] +margin_left = 1068.0 +margin_top = 760.0 +margin_right = 1124.0 +margin_bottom = 869.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 7 ) +expand = true +stretch_mode = 4 + +[node name="pribor_spt_l" type="TextureButton" parent="Контроль"] +margin_left = 923.0 +margin_top = 774.0 margin_right = 975.0 -margin_bottom = 620.0 -text = "ЖЫШЦЙБЮ" +margin_bottom = 861.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 1 ) +expand = true +stretch_mode = 4 + +[node name="pribor_spt_r" type="TextureButton" parent="Контроль"] +margin_left = 1214.0 +margin_top = 774.0 +margin_right = 1266.0 +margin_bottom = 861.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 1 ) +expand = true +stretch_mode = 4 + +[node name="pribor_prd_v_2" type="TextureButton" parent="Контроль"] +margin_left = 784.0 +margin_top = 155.0 +margin_right = 845.0 +margin_bottom = 246.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 + +[node name="pribor_prd_n_2" type="TextureButton" parent="Контроль"] +margin_left = 782.0 +margin_top = 256.0 +margin_right = 843.0 +margin_bottom = 347.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 + +[node name="pribor_prd_k_2" type="TextureButton" parent="Контроль"] +margin_left = 781.0 +margin_top = 356.0 +margin_right = 842.0 +margin_bottom = 447.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 + +[node name="pribor_prd_v_3" type="TextureButton" parent="Контроль"] +margin_left = 1342.0 +margin_top = 494.0 +margin_right = 1403.0 +margin_bottom = 585.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 +flip_h = true + +[node name="pribor_prd_n_3" type="TextureButton" parent="Контроль"] +margin_left = 1340.0 +margin_top = 595.0 +margin_right = 1401.0 +margin_bottom = 686.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 +flip_h = true + +[node name="pribor_prd_k_3" type="TextureButton" parent="Контроль"] +margin_left = 1342.0 +margin_top = 705.0 +margin_right = 1403.0 +margin_bottom = 796.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 +flip_h = true + +[node name="pribor_prd_v_1" type="TextureButton" parent="Контроль"] +margin_left = 1342.0 +margin_top = 149.0 +margin_right = 1403.0 +margin_bottom = 240.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 +flip_h = true + +[node name="pribor_prd_n_1" type="TextureButton" parent="Контроль"] +margin_left = 1340.0 +margin_top = 250.0 +margin_right = 1401.0 +margin_bottom = 341.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 +flip_h = true + +[node name="pribor_prd_k_1" type="TextureButton" parent="Контроль"] +margin_left = 1339.0 +margin_top = 350.0 +margin_right = 1400.0 +margin_bottom = 441.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 +flip_h = true + +[node name="pribor_prd_v_4" type="TextureButton" parent="Контроль"] +margin_left = 784.0 +margin_top = 511.0 +margin_right = 845.0 +margin_bottom = 602.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 + +[node name="pribor_prd_n_4" type="TextureButton" parent="Контроль"] +margin_left = 782.0 +margin_top = 612.0 +margin_right = 843.0 +margin_bottom = 703.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 + +[node name="pribor_prd_k_4" type="TextureButton" parent="Контроль"] +margin_left = 781.0 +margin_top = 712.0 +margin_right = 842.0 +margin_bottom = 803.0 +size_flags_horizontal = 15 +size_flags_vertical = 15 +texture_normal = ExtResource( 8 ) +expand = true +stretch_mode = 4 + +[node name="scene" type="Panel" parent="Контроль"] +margin_right = 533.0 +margin_bottom = 781.0 diff --git a/consts.gd b/consts.gd new file mode 100644 index 00000000..eaab45fe --- /dev/null +++ b/consts.gd @@ -0,0 +1,21 @@ +extends Node + +const PRIBOR_UF = 'res://pribor_uf.tscn' +const PRIBOR_RTR = 'res://pribor_rtr.tscn' +const PRIBOR_AFSP_L = 'res://pribor_afsp_l.tscn' +const PRIBOR_AFSP_R = 'res://pribor_afsp_r.tscn' +const PRIBOR_SCH3 = 'res://pribor_sch3.tscn' +const PRIBOR_SPT_L = 'res://pribor_spt_l.tscn' +const PRIBOR_SPT_R = 'res://pribor_spt_r.tscn' +const PRIBOR_PRD_V_1 = 'res://pribor_prd_v_1.tscn' +const PRIBOR_PRD_N_1 = 'res://pribor_prd_n_1.tscn' +const PRIBOR_PRD_K_1 = 'res://pribor_prd_k_1.tscn' +const PRIBOR_PRD_V_2 = 'res://pribor_prd_v_2.tscn' +const PRIBOR_PRD_N_2 = 'res://pribor_prd_n_2.tscn' +const PRIBOR_PRD_K_2 = 'res://pribor_prd_k_2.tscn' +const PRIBOR_PRD_V_3 = 'res://pribor_prd_v_3.tscn' +const PRIBOR_PRD_N_3 = 'res://pribor_prd_n_3.tscn' +const PRIBOR_PRD_K_3 = 'res://pribor_prd_k_3.tscn' +const PRIBOR_PRD_V_4 = 'res://pribor_prd_v_4.tscn' +const PRIBOR_PRD_N_4 = 'res://pribor_prd_n_4.tscn' +const PRIBOR_PRD_K_4 = 'res://pribor_prd_k_4.tscn' diff --git a/pribor_afsp_l.tscn b/pribor_afsp_l.tscn new file mode 100644 index 00000000..3b6850a2 --- /dev/null +++ b/pribor_afsp_l.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора АФСП Левый" diff --git a/pribor_afsp_r.tscn b/pribor_afsp_r.tscn new file mode 100644 index 00000000..b3559eae --- /dev/null +++ b/pribor_afsp_r.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора АФСП Правый" diff --git a/pribor_UF.tscn b/pribor_afsp_sch3.tscn similarity index 75% rename from pribor_UF.tscn rename to pribor_afsp_sch3.tscn index 84571f69..4a16ab1d 100644 --- a/pribor_UF.tscn +++ b/pribor_afsp_sch3.tscn @@ -7,4 +7,4 @@ margin_left = 12.0 margin_top = 8.0 margin_right = 154.0 margin_bottom = 22.0 -text = "Тестовый lbl1" +text = "Здесь будет схема прибора Щ3" diff --git a/pribor_prd_k_1.tscn b/pribor_prd_k_1.tscn new file mode 100644 index 00000000..7c8ec537 --- /dev/null +++ b/pribor_prd_k_1.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-К 1" diff --git a/pribor_prd_k_2.tscn b/pribor_prd_k_2.tscn new file mode 100644 index 00000000..825a9502 --- /dev/null +++ b/pribor_prd_k_2.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-К 2" diff --git a/pribor_prd_k_3.tscn b/pribor_prd_k_3.tscn new file mode 100644 index 00000000..69566e11 --- /dev/null +++ b/pribor_prd_k_3.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-К 3" diff --git a/pribor_prd_k_4.tscn b/pribor_prd_k_4.tscn new file mode 100644 index 00000000..c9e3c4cc --- /dev/null +++ b/pribor_prd_k_4.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-К 4" diff --git a/pribor_prd_n_1.tscn b/pribor_prd_n_1.tscn new file mode 100644 index 00000000..cc681670 --- /dev/null +++ b/pribor_prd_n_1.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-Н 1" diff --git a/pribor_prd_n_2.tscn b/pribor_prd_n_2.tscn new file mode 100644 index 00000000..4f8efdc3 --- /dev/null +++ b/pribor_prd_n_2.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-Н 2" diff --git a/pribor_prd_n_3.tscn b/pribor_prd_n_3.tscn new file mode 100644 index 00000000..157f5c9d --- /dev/null +++ b/pribor_prd_n_3.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-Н 3" diff --git a/pribor_prd_n_4.tscn b/pribor_prd_n_4.tscn new file mode 100644 index 00000000..3896f0a8 --- /dev/null +++ b/pribor_prd_n_4.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-Н 4" diff --git a/pribor_prd_v_1.tscn b/pribor_prd_v_1.tscn new file mode 100644 index 00000000..6f6c53bf --- /dev/null +++ b/pribor_prd_v_1.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-В 1" diff --git a/pribor_prd_v_2.tscn b/pribor_prd_v_2.tscn new file mode 100644 index 00000000..50ec6b98 --- /dev/null +++ b/pribor_prd_v_2.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-В 2" diff --git a/pribor_prd_v_3.tscn b/pribor_prd_v_3.tscn new file mode 100644 index 00000000..54cf5a80 --- /dev/null +++ b/pribor_prd_v_3.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-В 3" diff --git a/pribor_prd_v_4.tscn b/pribor_prd_v_4.tscn new file mode 100644 index 00000000..6f6c53bf --- /dev/null +++ b/pribor_prd_v_4.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора ПРД-В 1" diff --git a/pribor_rtr.tscn b/pribor_rtr.tscn new file mode 100644 index 00000000..368aea35 --- /dev/null +++ b/pribor_rtr.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора РТР" diff --git a/pribor_sch3.tscn b/pribor_sch3.tscn new file mode 100644 index 00000000..4a16ab1d --- /dev/null +++ b/pribor_sch3.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора Щ3" diff --git a/pribor_spt_l.tscn b/pribor_spt_l.tscn new file mode 100644 index 00000000..0c9066f8 --- /dev/null +++ b/pribor_spt_l.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора СПТ Левый" diff --git a/pribor_spt_r.tscn b/pribor_spt_r.tscn new file mode 100644 index 00000000..62c03371 --- /dev/null +++ b/pribor_spt_r.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора СПТ Правый" diff --git a/pribor_uf.tscn b/pribor_uf.tscn new file mode 100644 index 00000000..a00ecf88 --- /dev/null +++ b/pribor_uf.tscn @@ -0,0 +1,10 @@ +[gd_scene format=2] + +[node name="pribor_UF" type="Node2D"] + +[node name="test_label" type="Label" parent="."] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 154.0 +margin_bottom = 22.0 +text = "Здесь будет схема прибора УФ" diff --git a/project.godot b/project.godot index f1112d0b..b22348de 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,10 @@ config/name="uarep-ctl" run/main_scene="res://Control.tscn" config/icon="res://data/icon.png" +[autoload] + +Consts="*res://consts.gd" + [display] window/size/width=1600 diff --git a/Контроль.gd b/Контроль.gd index c6e210a7..9f439308 100644 --- a/Контроль.gd +++ b/Контроль.gd @@ -1,20 +1,42 @@ extends Panel -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - - # Called when the node enters the scene tree for the first time. func _ready(): - $pribor_UF.connect('button_up', self, 'on_pribor_press', ['111']) + $pribor_uf.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_UF]) + $pribor_rtr.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_RTR]) + $pribor_afsp_l.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_AFSP_L]) + $pribor_afsp_r.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_AFSP_R]) + $pribor_sch3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_SCH3]) + $pribor_spt_l.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_SPT_L]) + $pribor_spt_r.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_SPT_R]) + $pribor_prd_v_1.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_1]) + $pribor_prd_n_1.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_1]) + $pribor_prd_k_1.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_1]) + $pribor_prd_v_2.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_2]) + $pribor_prd_n_2.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_2]) + $pribor_prd_k_2.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_2]) + $pribor_prd_v_3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_3]) + $pribor_prd_n_3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_3]) + $pribor_prd_k_3.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_3]) + $pribor_prd_v_4.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_V_4]) + $pribor_prd_n_4.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_N_4]) + $pribor_prd_k_4.connect('button_up', self, 'on_pribor_press', [Consts.PRIBOR_PRD_K_4]) -func on_pribor_press(text: String): - prints(text) + +func on_pribor_press(text): + clear_obj($scene) + var scen = load(text).instance() + $scene.add_child(scen) + - +func clear_obj(obj : Object): + var items = $scene.get_children() + for item in items: + $scene.remove_child(item) + item.free() + # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta): # pass