步骤提示调整

This commit is contained in:
joylink_fanyuhong 2024-05-22 15:03:03 +08:00
parent eaa81122e3
commit fb0e071ab7
4 changed files with 58 additions and 11 deletions

View File

@ -7,7 +7,18 @@ func _ready():
func updateOperationTip(desc): func updateOperationTip(desc):
if self.visible == false:
self.visible = true
operationTip = desc operationTip = desc
$PanelContainer/VBoxContainer/Control2/Label.text = 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)

View File

@ -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="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="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"] [node name="StepTip" type="Node2D"]
script = ExtResource("1_wxsfb") script = ExtResource("1_wxsfb")
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="PanelContainer" type="PanelContainer" parent="."]
offset_right = 300.0 offset_right = 300.0
offset_bottom = 210.0 offset_bottom = 240.0
theme = ExtResource("2_k8n1n") theme = ExtResource("2_k8n1n")
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
@ -51,3 +64,30 @@ offset_top = 4.0
offset_right = 285.0 offset_right = 285.0
offset_bottom = 175.0 offset_bottom = 175.0
autowrap_mode = 1 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"]

View File

@ -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="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"] [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://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://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://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"] [ext_resource type="PackedScene" uid="uid://yhr1n6e2m2b6" path="res://trainings/stepTip/stepTip.tscn" id="9_3cm1b"]
[node name="TrainingCloseDoorFault" type="Node"] [node name="TrainingCloseDoorFault" type="Node"]
@ -30,10 +29,7 @@ sceneDesc = "上行门头灯亮关门故障"
[node name="ConfirmDialog" parent="." instance=ExtResource("7_yeye4")] [node name="ConfirmDialog" parent="." instance=ExtResource("7_yeye4")]
visible = false visible = false
[node name="TrainingPanel" parent="." instance=ExtResource("8_axom0")]
[node name="StepTip" parent="." instance=ExtResource("9_3cm1b")] [node name="StepTip" parent="." instance=ExtResource("9_3cm1b")]
visible = false
[node name="StepTimer" type="Timer" parent="."] [node name="StepTimer" type="Timer" parent="."]
one_shot = true one_shot = true

View File

@ -5,7 +5,7 @@
[ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="2_hmh0f"] [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"] [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) bg_color = Color(0.189249, 0.649753, 0.849873, 1)
border_width_left = 4 border_width_left = 4
border_width_top = 4 border_width_top = 4
@ -14,7 +14,7 @@ border_width_bottom = 4
border_color = Color(0.00784314, 0.466667, 0.835294, 1) border_color = Color(0.00784314, 0.466667, 0.835294, 1)
[sub_resource type="Theme" id="Theme_kqpcn"] [sub_resource type="Theme" id="Theme_kqpcn"]
Button/styles/normal = SubResource("StyleBoxFlat_l2bt2") Button/styles/normal = SubResource("StyleBoxFlat_q5iy8")
[node name="TrainingPanel" type="Node"] [node name="TrainingPanel" type="Node"]
script = ExtResource("1_fka8c") script = ExtResource("1_fka8c")