добавление боковой сдвиг панели

This commit is contained in:
2025-02-28 14:11:24 +03:00
parent a439ca4519
commit 4179225111
4 changed files with 1386 additions and 92 deletions

1213
PRD93D.tmp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=56 format=3 uid="uid://cvor2jm4xk3ha"]
[gd_scene load_steps=61 format=3 uid="uid://cvor2jm4xk3ha"]
[ext_resource type="Script" path="res://scripts/PRD.gd" id="1_v273n"]
[ext_resource type="Texture2D" uid="uid://cdxdluvyb5uei" path="res://table/on.png" id="2_dv7xx"]
@@ -7,8 +7,12 @@
[ext_resource type="Material" uid="uid://s6xe8igevnv2" path="res://Shaders/shader_edu.tres" id="3_3syd3"]
[ext_resource type="Texture2D" uid="uid://cfktmk2rowmul" path="res://table/off.png" id="3_qvuyu"]
[ext_resource type="Shader" path="res://Shaders/ray.gdshader" id="4_uy5o2"]
[ext_resource type="Texture2D" uid="uid://671got5vbput" path="res://pictures/бургер.png" id="5_eoogc"]
[ext_resource type="Texture2D" uid="uid://co8dxcd8eckjs" path="res://pictures/Web.png" id="5_i3nvb"]
[ext_resource type="Texture2D" uid="uid://didrk0pcfgirg" path="res://pictures/клад.png" id="6_bqc7t"]
[ext_resource type="Texture2D" uid="uid://cxn1guhi7lg3i" path="res://pictures/серпимолот.png" id="7_0pknj"]
[ext_resource type="Shader" path="res://Shaders/ray_2.gdshader" id="8_12mng"]
[ext_resource type="Texture2D" uid="uid://ckvwvec0hop37" path="res://pictures/контролер.png" id="8_qqoau"]
[ext_resource type="Texture2D" uid="uid://cgtg4gbqnuxrc" path="res://pictures/nine-patch-round.png" id="9_0r2qk"]
[ext_resource type="Script" path="res://scripts/control_panel.gd" id="9_akagi"]
[ext_resource type="Script" path="res://scripts/ems_g.gd" id="9_g1wia"]
@@ -81,6 +85,9 @@ shader = ExtResource("2_vn1it")
shader_parameter/outerRadius = 4.0
shader_parameter/MainAlpha = 1.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4qm5k"]
bg_color = Color(0.6, 0.501961, 0.6, 0.901961)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p247y"]
bg_color = Color(0.294118, 0.231373, 0.294118, 1)
corner_radius_top_left = 10
@@ -223,18 +230,20 @@ offset_right = 3008.0
offset_bottom = 1103.0
metadata/_edit_lock_ = true
[node name="side_panel" type="ColorRect" parent="Background"]
[node name="switch_panel" type="Panel" parent="Background"]
layout_mode = 0
offset_right = 216.0
offset_bottom = 1279.0
color = Color(0.6, 0.5, 0.6, 0.9)
metadata/_edit_lock_ = true
offset_left = -10.0
offset_top = -8.0
offset_right = 222.0
offset_bottom = 1112.0
theme_override_styles/panel = SubResource("StyleBoxFlat_4qm5k")
[node name="select_prd" type="Button" parent="Background/side_panel"]
[node name="select_prd" type="Button" parent="Background/switch_panel"]
layout_mode = 0
offset_top = 120.0
offset_right = 216.0
offset_bottom = 156.0
offset_left = 16.0
offset_top = 128.0
offset_right = 232.0
offset_bottom = 164.0
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 14
@@ -243,11 +252,12 @@ toggle_mode = true
button_pressed = true
text = "ПРД"
[node name="select_control" type="Button" parent="Background/side_panel"]
[node name="select_control" type="Button" parent="Background/switch_panel"]
layout_mode = 0
offset_top = 160.0
offset_right = 216.0
offset_bottom = 196.0
offset_left = 16.0
offset_top = 168.0
offset_right = 232.0
offset_bottom = 204.0
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 14
@@ -255,11 +265,12 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
toggle_mode = true
text = "КОНТРОЛЬ"
[node name="select_ems_g" type="Button" parent="Background/side_panel"]
[node name="select_ems_g" type="Button" parent="Background/switch_panel"]
layout_mode = 0
offset_top = 200.0
offset_right = 216.0
offset_bottom = 236.0
offset_left = 16.0
offset_top = 208.0
offset_right = 232.0
offset_bottom = 244.0
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 14
@@ -267,11 +278,12 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
toggle_mode = true
text = "ЭМС Г"
[node name="select_fs" type="Button" parent="Background/side_panel"]
[node name="select_fs" type="Button" parent="Background/switch_panel"]
layout_mode = 0
offset_top = 241.0
offset_right = 216.0
offset_bottom = 277.0
offset_left = 16.0
offset_top = 249.0
offset_right = 232.0
offset_bottom = 285.0
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 14
@@ -279,28 +291,83 @@ theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
toggle_mode = true
text = "Модуль ФС"
[node name="save_config" type="Button" parent="Background/side_panel"]
[node name="save_config" type="Button" parent="Background/switch_panel"]
layout_mode = 0
offset_top = 832.0
offset_right = 216.0
offset_bottom = 868.0
offset_left = 16.0
offset_top = 840.0
offset_right = 232.0
offset_bottom = 876.0
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 14
theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
text = "Сохранить"
[node name="load_config" type="Button" parent="Background/side_panel"]
[node name="load_config" type="Button" parent="Background/switch_panel"]
layout_mode = 0
offset_top = 872.0
offset_right = 216.0
offset_bottom = 908.0
offset_left = 16.0
offset_top = 880.0
offset_right = 232.0
offset_bottom = 916.0
focus_mode = 0
mouse_default_cursor_shape = 2
theme_override_font_sizes/font_size = 14
theme_override_styles/pressed = SubResource("StyleBoxFlat_p247y")
text = "Загрузить"
[node name="burgerButton" type="TextureButton" parent="Background/switch_panel"]
self_modulate = Color(1, 1, 0.941, 0.85)
layout_mode = 0
offset_left = 183.0
offset_top = 28.0
offset_right = 215.0
offset_bottom = 60.0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource("5_eoogc")
texture_pressed = ExtResource("6_bqc7t")
ignore_texture_size = true
stretch_mode = 0
metadata/_edit_lock_ = true
[node name="texture_prd" type="TextureButton" parent="Background/switch_panel"]
visible = false
self_modulate = Color(1, 1, 0.941, 0.85)
layout_mode = 0
offset_left = 176.0
offset_top = 122.0
offset_right = 224.0
offset_bottom = 162.0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource("7_0pknj")
ignore_texture_size = true
stretch_mode = 0
metadata/_edit_lock_ = true
[node name="texture_control" type="TextureButton" parent="Background/switch_panel"]
visible = false
self_modulate = Color(1, 1, 0.941, 0.85)
layout_mode = 0
offset_left = 180.0
offset_top = 184.0
offset_right = 220.0
offset_bottom = 224.0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource("8_qqoau")
ignore_texture_size = true
stretch_mode = 0
metadata/_edit_lock_ = true
[node name="side_panel" type="ColorRect" parent="Background"]
visible = false
layout_mode = 0
offset_right = 216.0
offset_bottom = 1279.0
color = Color(0.6, 0.5, 0.6, 0.9)
metadata/_edit_lock_ = true
[node name="ISA" type="Label" parent="."]
offset_left = 225.0
offset_top = 11.0
@@ -534,10 +601,10 @@ metadata/_edit_lock_ = true
[node name="select_dev" type="GridContainer" parent="TabContainer/PRD"]
layout_mode = 2
offset_left = 16.0
offset_top = 11.0
offset_right = 16.0
offset_bottom = 11.0
offset_left = 48.0
offset_top = 16.0
offset_right = 48.0
offset_bottom = 16.0
script = ExtResource("2_vmbyo")
node_gap = Vector2(100, 50)
@@ -552,10 +619,10 @@ metadata/_edit_lock_ = true
[node name="lbl_control" type="Label" parent="TabContainer/ControlPanel"]
modulate = Color(1, 0, 0, 1)
layout_mode = 0
offset_left = 151.0
offset_top = 16.0
offset_right = 771.0
offset_bottom = 47.0
offset_left = 135.0
offset_top = -8.0
offset_right = 755.0
offset_bottom = 23.0
theme_override_font_sizes/font_size = 22
text = "Прибор не исправен"
horizontal_alignment = 1
@@ -564,10 +631,10 @@ metadata/_edit_lock_ = true
[node name="socket_ym_lb" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 63.0
offset_top = 48.0
offset_right = 288.0
offset_bottom = 831.0
offset_left = 47.0
offset_top = 24.0
offset_right = 272.0
offset_bottom = 807.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -636,10 +703,10 @@ vertical_alignment = 1
[node name="socket_ym_pb" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 639.0
offset_top = 48.0
offset_right = 864.0
offset_bottom = 831.0
offset_left = 623.0
offset_top = 24.0
offset_right = 848.0
offset_bottom = 807.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -702,10 +769,10 @@ vertical_alignment = 1
[node name="soc_y5" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 303.0
offset_top = 48.0
offset_right = 620.0
offset_bottom = 238.0
offset_left = 287.0
offset_top = 24.0
offset_right = 604.0
offset_bottom = 214.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -774,10 +841,10 @@ vertical_alignment = 1
[node name="Kasseta_FS" parent="TabContainer/ControlPanel" instance=ExtResource("10_tdh2s")]
layout_mode = 0
offset_left = 302.0
offset_top = 239.0
offset_right = 620.0
offset_bottom = 458.0
offset_left = 286.0
offset_top = 215.0
offset_right = 604.0
offset_bottom = 434.0
script = null
metadata/_edit_lock_ = true
@@ -848,10 +915,10 @@ rname = "A1"
[node name="soc_P1" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 365.0
offset_top = 677.0
offset_right = 553.0
offset_bottom = 872.0
offset_left = 349.0
offset_top = 653.0
offset_right = 537.0
offset_bottom = 848.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -923,10 +990,10 @@ metadata/_edit_lock_ = true
[node name="soc_DKM" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 440.0
offset_top = 466.0
offset_right = 620.0
offset_bottom = 666.0
offset_left = 424.0
offset_top = 442.0
offset_right = 604.0
offset_bottom = 642.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -978,10 +1045,10 @@ metadata/_edit_lock_ = true
[node name="soc_P2" type="NinePatchRect" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 301.0
offset_top = 465.0
offset_right = 429.0
offset_bottom = 667.0
offset_left = 285.0
offset_top = 441.0
offset_right = 413.0
offset_bottom = 643.0
texture = ExtResource("9_0r2qk")
patch_margin_left = 16
patch_margin_top = 16
@@ -1023,15 +1090,16 @@ metadata/_edit_lock_ = true
[node name="log_array" type="TextEdit" parent="TabContainer/ControlPanel"]
layout_mode = 0
offset_left = 950.0
offset_top = 51.0
offset_right = 1774.0
offset_bottom = 922.0
offset_left = 870.0
offset_top = 27.0
offset_right = 1664.0
offset_bottom = 898.0
theme_override_colors/font_color = Color(1, 1, 0.815686, 1)
theme_override_font_sizes/font_size = 17
theme_override_styles/normal = SubResource("StyleBoxFlat_13x31")
placeholder_text = "Ожидание контроля ..."
wrap_mode = 1
metadata/_edit_lock_ = true
[node name="await" type="ColorRect" parent="TabContainer/ControlPanel/log_array"]
material = SubResource("ShaderMaterial_07wue")
@@ -1174,6 +1242,7 @@ offset_bottom = 226.0
text = "Темп"
[node name="save_other" type="CheckBox" parent="."]
visible = false
offset_left = 2.0
offset_top = 799.0
offset_right = 215.0
@@ -1181,12 +1250,15 @@ offset_bottom = 827.0
theme = SubResource("Theme_yblys")
text = "Сохранить все настройки"
[connection signal="pressed" from="Background/side_panel/select_prd" to="." method="_on_prd_select"]
[connection signal="pressed" from="Background/side_panel/select_control" to="." method="_on_control_button"]
[connection signal="pressed" from="Background/side_panel/select_ems_g" to="." method="_on_emsg_select"]
[connection signal="pressed" from="Background/side_panel/select_fs" to="." method="_on_mfs_select"]
[connection signal="pressed" from="Background/side_panel/save_config" to="." method="_on_save_config"]
[connection signal="pressed" from="Background/side_panel/load_config" to="." method="_on_load_config"]
[connection signal="pressed" from="Background/switch_panel/select_prd" to="." method="_on_prd_select"]
[connection signal="pressed" from="Background/switch_panel/select_control" to="." method="_on_control_button"]
[connection signal="pressed" from="Background/switch_panel/select_ems_g" to="." method="_on_emsg_select"]
[connection signal="pressed" from="Background/switch_panel/select_fs" to="." method="_on_mfs_select"]
[connection signal="pressed" from="Background/switch_panel/save_config" to="." method="_on_save_config"]
[connection signal="pressed" from="Background/switch_panel/load_config" to="." method="_on_load_config"]
[connection signal="toggled" from="Background/switch_panel/burgerButton" to="." method="_on_burger_button"]
[connection signal="pressed" from="Background/switch_panel/texture_prd" to="." method="_on_prd_select"]
[connection signal="pressed" from="Background/switch_panel/texture_control" to="." method="_on_control_button"]
[connection signal="pressed" from="read_isa" to="." method="_on_read_isa_pressed"]
[connection signal="pressed" from="TabContainer/Modul_fs/manage_panel/con" to="TabContainer/Modul_fs" method="_on_start"]
[connection signal="text_submitted" from="TabContainer/Modul_fs/manage_panel/addres_fs" to="TabContainer/Modul_fs" method="_on_addres_fs"]

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env bash
#
# Описание
#
# Генерирует модуль на языке GDScript с информацией для контроля
# версий в системе git. Использовать для проектов GoDot Engine.
GDSCRIPT_FILE="commit.gd"
HEAD="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short HEAD) $(git log -1 --format=%cd)"
echo "extends Node" > ${GDSCRIPT_FILE}
echo "# Файл сгенерирован автоматически! Не изменять вручную!" >> ${GDSCRIPT_FILE}
echo "const VCS_HEAD = '${HEAD}'" >> ${GDSCRIPT_FILE}

View File

@@ -560,9 +560,9 @@ func _on_load_config():
func set_tab_and_buttons(tab_index: int, button_name: String) -> void:
$TabContainer.current_tab = tab_index
var side_panel = $Background/side_panel
var switch_panel = $Background/switch_panel
for button in side_panel.get_children():
for button in switch_panel.get_children():
if button is Button:
button.button_pressed = (button.name == button_name)
@@ -724,7 +724,7 @@ func _on_modul_fs_1(modulation_select_1) -> void:
func _on_get_status_1(toggled_btn):
if $Background/side_panel/select_prd.button_pressed:
if $Background/switch_panel/select_prd.button_pressed or $Background/switch_panel/texture_prd.button_pressed:
var inverted_state = not toggled_btn
Network.set_fs_gen_status(inverted_state)
Network.get_gen_state_1()
@@ -771,7 +771,7 @@ func _on_start_fs_2():
func _on_get_status_2(toggled_btn):
if $Background/side_panel/select_prd.button_pressed:
if $Background/switch_panel/select_prd.button_pressed:
var inverted_state = not toggled_btn
Network.set_fs_gen_status_2(inverted_state)
Network.get_gen_state_2()
@@ -811,3 +811,24 @@ func _on_modul_fs_2(modulation_select_2) -> void:
Network.set_configure_gen_const_2()
elif modulation_select_2 == 1:
Network.set_configure_gen_msk_2()
func _on_burger_button(toggled_on: bool) -> void:
$Background/switch_panel/texture_prd.visible = toggled_on
$Background/switch_panel/select_prd.visible = not toggled_on
$Background/switch_panel/texture_control.visible = toggled_on
$Background/switch_panel/select_control.visible = not toggled_on
$Background/switch_panel/select_ems_g.visible = not toggled_on
$Background/switch_panel/select_fs.visible = not toggled_on
$Background/switch_panel/save_config.visible = not toggled_on
$Background/switch_panel/load_config.visible = not toggled_on
var panel = $Background/switch_panel
if toggled_on:
# Анимация вправо
var tween = get_tree().create_tween()
tween.tween_property(panel, "global_position", Vector2(-170, panel.global_position.y), 0.5).set_trans(Tween.TRANS_QUINT).set_ease(Tween.EASE_OUT)
else:
# Анимация влево
var tween = get_tree().create_tween()
tween.tween_property(panel, "global_position", Vector2(0, panel.global_position.y), 0.5).set_trans(Tween.TRANS_QUINT).set_ease(Tween.EASE_OUT)