From fb0e071ab71ae84974590e40b422df1163138652 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Wed, 22 May 2024 15:03:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E6=8F=90=E7=A4=BA=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trainings/stepTip/stepTip.gd | 15 ++++++- trainings/stepTip/stepTip.tscn | 44 ++++++++++++++++++- .../trainingCloseDoorFault.tscn | 6 +-- trainings/trainingPanel/trainingPanel.tscn | 4 +- 4 files changed, 58 insertions(+), 11 deletions(-) diff --git a/trainings/stepTip/stepTip.gd b/trainings/stepTip/stepTip.gd index 4ebefc7..866facb 100644 --- a/trainings/stepTip/stepTip.gd +++ b/trainings/stepTip/stepTip.gd @@ -7,7 +7,18 @@ func _ready(): func updateOperationTip(desc): - if self.visible == false: - self.visible = true operationTip = desc $PanelContainer/VBoxContainer/Control2/Label.text = desc + + +func _on_restart_button_down(): + $"../ConfirmDialog".show_confirm('此操作将重新开始实训,是否确认?') + get_tree().paused = true + + +func _on_restart_mouse_entered(): + $PanelContainer/VBoxContainer/Control3/Restart.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND) + + +func _on_restart_mouse_exited(): + $PanelContainer/VBoxContainer/Control3/Restart.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW) diff --git a/trainings/stepTip/stepTip.tscn b/trainings/stepTip/stepTip.tscn index e91f564..3a1cb37 100644 --- a/trainings/stepTip/stepTip.tscn +++ b/trainings/stepTip/stepTip.tscn @@ -1,14 +1,27 @@ -[gd_scene load_steps=3 format=3 uid="uid://yhr1n6e2m2b6"] +[gd_scene load_steps=7 format=3 uid="uid://yhr1n6e2m2b6"] [ext_resource type="Script" path="res://trainings/stepTip/stepTip.gd" id="1_wxsfb"] [ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="2_k8n1n"] +[ext_resource type="Texture2D" uid="uid://x4cnaa1ay6so" path="res://Assets/重来重新开始_浅.png" id="3_6wod8"] +[ext_resource type="Texture2D" uid="uid://0txfneuxl2yq" path="res://Assets/重来重新开始_深.png" id="4_hqt7b"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l2bt2"] +bg_color = Color(0.189249, 0.649753, 0.849873, 1) +border_width_left = 4 +border_width_top = 4 +border_width_right = 4 +border_width_bottom = 4 +border_color = Color(0.00784314, 0.466667, 0.835294, 1) + +[sub_resource type="Theme" id="Theme_xlivw"] +Button/styles/normal = SubResource("StyleBoxFlat_l2bt2") [node name="StepTip" type="Node2D"] script = ExtResource("1_wxsfb") [node name="PanelContainer" type="PanelContainer" parent="."] offset_right = 300.0 -offset_bottom = 210.0 +offset_bottom = 240.0 theme = ExtResource("2_k8n1n") [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] @@ -51,3 +64,30 @@ offset_top = 4.0 offset_right = 285.0 offset_bottom = 175.0 autowrap_mode = 1 + +[node name="Control3" type="Control" parent="PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="ColorRect" type="ColorRect" parent="PanelContainer/VBoxContainer/Control3"] +layout_mode = 0 +offset_right = 300.0 +offset_bottom = 30.0 +color = Color(0.0509804, 0.388235, 0.752941, 1) + +[node name="Restart" type="TextureButton" parent="PanelContainer/VBoxContainer/Control3"] +offset_left = 5.0 +offset_top = 2.0 +offset_right = 57.0 +offset_bottom = 54.0 +scale = Vector2(0.5, 0.5) +size_flags_horizontal = 0 +size_flags_vertical = 0 +theme = SubResource("Theme_xlivw") +texture_normal = ExtResource("3_6wod8") +texture_hover = ExtResource("4_hqt7b") +stretch_mode = 5 + +[connection signal="button_down" from="PanelContainer/VBoxContainer/Control3/Restart" to="." method="_on_restart_button_down"] +[connection signal="mouse_entered" from="PanelContainer/VBoxContainer/Control3/Restart" to="." method="_on_restart_mouse_entered"] +[connection signal="mouse_exited" from="PanelContainer/VBoxContainer/Control3/Restart" to="." method="_on_restart_mouse_exited"] diff --git a/trainings/trainingCloseDoorFault/trainingCloseDoorFault.tscn b/trainings/trainingCloseDoorFault/trainingCloseDoorFault.tscn index f602ce1..10a974d 100644 --- a/trainings/trainingCloseDoorFault/trainingCloseDoorFault.tscn +++ b/trainings/trainingCloseDoorFault/trainingCloseDoorFault.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://b5yffodicwqm4"] +[gd_scene load_steps=9 format=3 uid="uid://b5yffodicwqm4"] [ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="1_efkp6"] [ext_resource type="Script" path="res://trainings/trainingCloseDoorFault/trainingCloseDoorFault.gd" id="1_iggb0"] @@ -7,7 +7,6 @@ [ext_resource type="PackedScene" uid="uid://ckoxw6kgpjyhd" path="res://trainings/trainTip.tscn" id="5_vn0y4"] [ext_resource type="PackedScene" uid="uid://b41vwoibfy5c6" path="res://trainings/stepJudgment.tscn" id="6_5gg1t"] [ext_resource type="PackedScene" uid="uid://b3whbe3mau53w" path="res://trainings/confirmDialog/confirmDialog.tscn" id="7_yeye4"] -[ext_resource type="PackedScene" uid="uid://bsb3nyi8xaqwh" path="res://trainings/trainingPanel/trainingPanel.tscn" id="8_axom0"] [ext_resource type="PackedScene" uid="uid://yhr1n6e2m2b6" path="res://trainings/stepTip/stepTip.tscn" id="9_3cm1b"] [node name="TrainingCloseDoorFault" type="Node"] @@ -30,10 +29,7 @@ sceneDesc = "上行门头灯亮关门故障" [node name="ConfirmDialog" parent="." instance=ExtResource("7_yeye4")] visible = false -[node name="TrainingPanel" parent="." instance=ExtResource("8_axom0")] - [node name="StepTip" parent="." instance=ExtResource("9_3cm1b")] -visible = false [node name="StepTimer" type="Timer" parent="."] one_shot = true diff --git a/trainings/trainingPanel/trainingPanel.tscn b/trainings/trainingPanel/trainingPanel.tscn index 35d93bc..61360c3 100644 --- a/trainings/trainingPanel/trainingPanel.tscn +++ b/trainings/trainingPanel/trainingPanel.tscn @@ -5,7 +5,7 @@ [ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="2_hmh0f"] [ext_resource type="Texture2D" uid="uid://0txfneuxl2yq" path="res://Assets/重来重新开始_深.png" id="3_0sd5r"] -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l2bt2"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q5iy8"] bg_color = Color(0.189249, 0.649753, 0.849873, 1) border_width_left = 4 border_width_top = 4 @@ -14,7 +14,7 @@ border_width_bottom = 4 border_color = Color(0.00784314, 0.466667, 0.835294, 1) [sub_resource type="Theme" id="Theme_kqpcn"] -Button/styles/normal = SubResource("StyleBoxFlat_l2bt2") +Button/styles/normal = SubResource("StyleBoxFlat_q5iy8") [node name="TrainingPanel" type="Node"] script = ExtResource("1_fka8c")