From deca432b7ba6013d2ac7fec6bb32a4da1fb0fa04 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Wed, 20 Dec 2023 11:51:00 +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=D0=A0=D0=B5=D0=B6=D0=B8=D0=BC=20=D0=9A=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D1=80=D0=BE=D0=BB=D1=8C.=20=D0=9F=D1=80=D0=B8?= =?UTF-8?q?=D0=B1=D0=BE=D1=80=20=D0=9F=D0=A0=D0=94-=D0=9D-1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/прогресс-заполнение-1.png | Bin 0 -> 197 bytes data/прогресс-заполнение-1.png.import | 34 + data/прогресс-фон-1.png | Bin 0 -> 195 bytes data/прогресс-фон-1.png.import | 34 + scenes/pribor-prd-n-1/pribor-prd-n-1.tscn | 877 ++++++++++++++++++++-- scenes/контроль/element_h.tscn | 14 +- scenes/контроль/element_v.tscn | 175 +++-- scenes/контроль/indicator_h.tscn | 18 + 8 files changed, 988 insertions(+), 164 deletions(-) create mode 100644 data/прогресс-заполнение-1.png create mode 100644 data/прогресс-заполнение-1.png.import create mode 100644 data/прогресс-фон-1.png create mode 100644 data/прогресс-фон-1.png.import create mode 100644 scenes/контроль/indicator_h.tscn diff --git a/data/прогресс-заполнение-1.png b/data/прогресс-заполнение-1.png new file mode 100644 index 0000000000000000000000000000000000000000..1287ed5d17d741568503b13cd9b702ec84f0467f GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^!63}R1|%PEvIde2J)SO(Ar-gYUQpy?P!M3*X#Ma1 z^P_?~oNSj0lcQB%ey*CY;#kCSV=oVTU-iKjPT^$FVdQ&MBb@071GxTL1t6 literal 0 HcmV?d00001 diff --git a/data/прогресс-заполнение-1.png.import b/data/прогресс-заполнение-1.png.import new file mode 100644 index 00000000..e9c65005 --- /dev/null +++ b/data/прогресс-заполнение-1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1k856fxhrjnh" +path="res://.godot/imported/прогресс-заполнение-1.png-8f8393b6735f8a6bd330fcb64a737cde.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://data/прогресс-заполнение-1.png" +dest_files=["res://.godot/imported/прогресс-заполнение-1.png-8f8393b6735f8a6bd330fcb64a737cde.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/data/прогресс-фон-1.png b/data/прогресс-фон-1.png new file mode 100644 index 0000000000000000000000000000000000000000..00ddb834a55c52ff6df47dcee677f375d176b9cc GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^!63}R1|%PEvIde2U7jwEAr-gY-Zf-oFyJ}7q4baC za+Ob^Z3;~DR4QMwY<~X3@Jkb?u$s@o7S3RU#6vBbGYk^B)O= void: " -[node name="element_v" type="PanelContainer"] -offset_right = 153.0 -offset_bottom = 42.0 +[node name="element_h" type="PanelContainer"] +editor_description = "Элемент замены из ЗИП" +offset_right = 150.0 +offset_bottom = 50.0 theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u") script = SubResource("GDScript_oj3k3") textures = [ExtResource("1_vtino"), ExtResource("2_jqsb6"), ExtResource("3_cw6yg")] +metadata/ref_des = "" +metadata/dec_num = "" [node name="rect" type="NinePatchRect" parent="."] layout_mode = 2 @@ -101,14 +104,15 @@ custom_minimum_size = Vector2(24, 24) layout_mode = 2 size_flags_horizontal = 2 size_flags_vertical = 6 -texture = ExtResource("2_jqsb6") +texture = ExtResource("1_vtino") expand_mode = 1 [node name="fname" type="Label" parent="margin/vbox/grid"] +self_modulate = Color(1, 1, 1, 0.627451) layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 6 -theme_override_colors/font_color = Color(1, 1, 1, 0.588235) +theme_override_font_sizes/font_size = 17 horizontal_alignment = 1 vertical_alignment = 1 diff --git a/scenes/контроль/element_v.tscn b/scenes/контроль/element_v.tscn index 5bac42db..e07e9d4c 100644 --- a/scenes/контроль/element_v.tscn +++ b/scenes/контроль/element_v.tscn @@ -1,31 +1,52 @@ -[gd_scene load_steps=8 format=3 uid="uid://ckrunkgwb5cuo"] +[gd_scene load_steps=6 format=3 uid="uid://p2suppildvq0"] -[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_1rpfy"] -[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="1_60d60"] -[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="2_4s76c"] -[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="3_bfvei"] +[ext_resource type="Texture2D" uid="uid://c6nve6f8sfyj2" path="res://data/состояние-исправности-0.png" id="1_01aoa"] +[ext_resource type="Texture2D" uid="uid://c4mdrmk7h638f" path="res://data/nine-patch-round.png" id="2_4b43i"] +[ext_resource type="Texture2D" uid="uid://dnreyfh3cd1k2" path="res://data/состояние-исправности-1.png" id="2_q7pyf"] +[ext_resource type="Texture2D" uid="uid://c6booa8753u5t" path="res://data/состояние-исправности-2.png" id="3_u8ivy"] -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_3nd2u"] - -[sub_resource type="GDScript" id="GDScript_oj3k3"] +[sub_resource type="GDScript" id="GDScript_fbktk"] script/source = "@tool -extends PanelContainer +extends Control -@export var textures: Array +@export var margins: Array[int] = [8, 8, 8, 8] # top, left, bottom, right + + +@export var textures: Array[Texture] @export var fname: String: set(v): fname = v - $margin/vbox/grid/fname.text = v + $lbl_fname.text = v @export var rname: String: set(v): rname = v - $margin/vbox/grid/rname.text = v + $lbl_rname.text = v + + +func _resize_children() -> void: + $lbl_rname.size.x = size.x + $lbl_rname.position.y = margins[0] + $lbl_fname.size.y = size.x + $lbl_fname.position.y = size.y / 2 + $lbl_fname.size.x / 2 + $txr_state.position.x = size.x / 2 - ($txr_state.size.x * $txr_state.scale.x) / 2 + $txr_state.position.y = size.y - $txr_state.size.y * $txr_state.scale.x - margins[2] + + +func _on_nine_patch_rect_resized() -> void: + size = $np_rect.size + _resize_children() + + + +func _on_resized() -> void: + $np_rect.size = size + _resize_children() @export var state: int: @@ -33,89 +54,61 @@ extends PanelContainer v = 0 if v < 0 else v v %= textures.size() state = v - $margin/vbox/grid/state.texture = textures[v] + $txr_state.texture = textures[v] " -[sub_resource type="GDScript" id="GDScript_45hqb"] -script/source = "@tool +[node name="element_v" type="Control"] +editor_description = "Элемент замены из ЗИП" +layout_mode = 3 +anchors_preset = 0 +offset_right = 50.0 +offset_bottom = 150.0 +script = SubResource("GDScript_fbktk") +textures = Array[Texture]([ExtResource("1_01aoa"), ExtResource("2_q7pyf"), ExtResource("3_u8ivy")]) +metadata/ref_des = "" +metadata/dec_num = "" -extends MarginContainer - - -func _enter_tree() -> void: - margins = [8, 8, 8, 8] - - -@export var margins: Array: - set(vals): - add_theme_constant_override('margin_top', vals[0]) - add_theme_constant_override('margin_left', vals[1]) - add_theme_constant_override('margin_bottom', vals[2]) - add_theme_constant_override('margin_right', vals[3]) - get: - var vals = [0, 0, 0, 0] - vals[0] = get_theme_constant('margin_top') - vals[1] = get_theme_constant('margin_left') - vals[2] = get_theme_constant('margin_bottom') - vals[3] = get_theme_constant('margin_right') - return vals - - -" - -[node name="element_h" type="PanelContainer"] -offset_right = 153.0 -offset_bottom = 42.0 -theme_override_styles/panel = SubResource("StyleBoxEmpty_3nd2u") -script = SubResource("GDScript_oj3k3") -textures = [ExtResource("1_1rpfy"), ExtResource("2_4s76c"), ExtResource("3_bfvei")] - -[node name="rect" type="NinePatchRect" parent="."] -layout_mode = 2 -texture = ExtResource("1_60d60") -draw_center = false -region_rect = Rect2(0, 0, 63, 63) -patch_margin_left = 17 -patch_margin_top = 17 -patch_margin_right = 17 -patch_margin_bottom = 15 - -[node name="margin" type="MarginContainer" parent="."] -layout_mode = 2 -theme_override_constants/margin_left = 8 -theme_override_constants/margin_top = 8 -theme_override_constants/margin_right = 8 -theme_override_constants/margin_bottom = 8 -script = SubResource("GDScript_45hqb") -margins = [8, 8, 8, 8] - -[node name="vbox" type="VBoxContainer" parent="margin"] -layout_mode = 2 - -[node name="grid" type="GridContainer" parent="margin/vbox"] -layout_mode = 2 -columns = 3 - -[node name="state" type="TextureRect" parent="margin/vbox/grid"] -custom_minimum_size = Vector2(24, 24) -layout_mode = 2 -size_flags_horizontal = 2 -size_flags_vertical = 6 -texture = ExtResource("2_4s76c") -expand_mode = 1 - -[node name="fname" type="Label" parent="margin/vbox/grid"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 6 -theme_override_colors/font_color = Color(1, 1, 1, 0.588235) +[node name="lbl_rname" type="Label" parent="."] +layout_mode = 0 +offset_top = 8.0 +offset_right = 50.0 +offset_bottom = 34.0 +theme_override_font_sizes/font_size = 22 +text = "A1" horizontal_alignment = 1 vertical_alignment = 1 -[node name="rname" type="Label" parent="margin/vbox/grid"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 6 -theme_override_font_sizes/font_size = 22 -horizontal_alignment = 2 +[node name="lbl_fname" type="Label" parent="."] +self_modulate = Color(1, 1, 1, 0.627451) +layout_mode = 0 +offset_top = 102.0 +offset_right = 54.0 +offset_bottom = 152.0 +rotation = -1.5708 +theme_override_font_sizes/font_size = 17 +text = "Ячейка" +horizontal_alignment = 1 vertical_alignment = 1 + +[node name="txr_state" type="TextureRect" parent="."] +layout_mode = 0 +offset_left = 13.8 +offset_top = 119.6 +offset_right = 237.8 +offset_bottom = 343.6 +scale = Vector2(0.1, 0.1) +texture = ExtResource("1_01aoa") + +[node name="np_rect" type="NinePatchRect" parent="."] +layout_mode = 0 +offset_right = 50.0 +offset_bottom = 150.0 +texture = ExtResource("2_4b43i") +region_rect = Rect2(0, 0, 63, 63) +patch_margin_left = 16 +patch_margin_top = 16 +patch_margin_right = 16 +patch_margin_bottom = 16 + +[connection signal="resized" from="." to="." method="_on_resized"] +[connection signal="resized" from="np_rect" to="." method="_on_nine_patch_rect_resized"] diff --git a/scenes/контроль/indicator_h.tscn b/scenes/контроль/indicator_h.tscn new file mode 100644 index 00000000..32c96319 --- /dev/null +++ b/scenes/контроль/indicator_h.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=3 format=3 uid="uid://dyjtmfm4u58mu"] + +[ext_resource type="Texture2D" uid="uid://00871pb6moln" path="res://data/прогресс-фон-1.png" id="1_n4uxh"] +[ext_resource type="Texture2D" uid="uid://c1k856fxhrjnh" path="res://data/прогресс-заполнение-1.png" id="2_os1gp"] + +[node name="indicator_h" type="TextureProgressBar"] +offset_right = 100.0 +offset_bottom = 20.0 +value = 24.0 +nine_patch_stretch = true +stretch_margin_left = 8 +stretch_margin_top = 8 +stretch_margin_right = 8 +stretch_margin_bottom = 8 +texture_under = ExtResource("1_n4uxh") +texture_progress = ExtResource("2_os1gp") +tint_under = Color(0.65098, 0.65098, 0.65098, 0.862745) +tint_progress = Color(0.180392, 0.517647, 0.321569, 0.901961)