Merge branch 'main' of https://gitea.joylink.club/joylink/godot-psd-training into main
This commit is contained in:
commit
70208c5a56
BIN
Assets/LCB旋钮.png
BIN
Assets/LCB旋钮.png
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.1 KiB |
@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cpukjt3o0dk41"
|
||||
uid="uid://b71j1cvmaukrv"
|
||||
path="res://.godot/imported/LCB旋钮.png-d401168d919d90772072acbb06bfa0df.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 5.1 KiB |
@ -2,7 +2,7 @@
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://csenwwkcbfcej"
|
||||
uid="uid://dyemyrw74u47v"
|
||||
path="res://.godot/imported/钥匙.png-83a50aacc634313b557d0dd28210e116.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
|
@ -82,7 +82,6 @@ func _on_open_key_window_mouse_exited() -> void:
|
||||
|
||||
##拔钥匙相关
|
||||
func _on_texture_rect_2_gui_input(event: InputEvent) -> void:
|
||||
return
|
||||
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
|
||||
hideHandleKey()
|
||||
$"../stationKeys".showKeyAfterRemoveKey(currenScreenDoor.lcbKey.keyName)
|
||||
|
@ -3,7 +3,7 @@
|
||||
[ext_resource type="Script" path="res://UI/LCB/lcb.gd" id="1_x2nee"]
|
||||
[ext_resource type="Theme" uid="uid://dn8j4j5ct40v6" path="res://lcb_text.tres" id="2_pno1b"]
|
||||
[ext_resource type="Texture2D" uid="uid://cmej8kbdhxqss" path="res://Assets/LCB旋钮孔.png" id="3_g3cqx"]
|
||||
[ext_resource type="Texture2D" uid="uid://cpukjt3o0dk41" path="res://Assets/LCB旋钮.png" id="4_i7jy7"]
|
||||
[ext_resource type="Texture2D" uid="uid://b71j1cvmaukrv" path="res://Assets/LCB旋钮.png" id="4_i7jy7"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7j3msd4bw0im" path="res://Assets/LCB_Arrow.svg" id="5_l3h46"]
|
||||
[ext_resource type="Script" path="res://UI/LCB/LCB_Right_Rotate.gd" id="6_bg24u"]
|
||||
[ext_resource type="Script" path="res://UI/LCB/LCB_Left_Rotate.gd" id="7_g7j6c"]
|
||||
@ -147,11 +147,18 @@ texture = ExtResource("3_g3cqx")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="."]
|
||||
offset_left = 72.0
|
||||
offset_top = 72.0
|
||||
offset_right = 328.0
|
||||
offset_bottom = 328.0
|
||||
pivot_offset = Vector2(128, 128)
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -25.0
|
||||
offset_top = -50.0
|
||||
offset_right = 25.0
|
||||
offset_bottom = 52.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
pivot_offset = Vector2(25, 51)
|
||||
texture = ExtResource("4_i7jy7")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
|
@ -9,6 +9,8 @@ extends VBoxContainer
|
||||
|
||||
signal clickKeySwitchSignal(openLight:bool,keySwitch)
|
||||
|
||||
signal removeKey(keyName)
|
||||
|
||||
func _ready() -> void:
|
||||
$Light/MarginContainer/Label.text=lightText
|
||||
if keySwitchHasKey:
|
||||
@ -25,3 +27,18 @@ func shouHandleKey() -> void:
|
||||
func hideHandleKey() -> void:
|
||||
$Key/Key.visible = false
|
||||
$Key/Right_Rotate.visible = false
|
||||
|
||||
|
||||
##拔钥匙相关
|
||||
func _on_key_gui_input(event: InputEvent) -> void:
|
||||
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
|
||||
removeKey.emit(self.name)
|
||||
hideHandleKey()
|
||||
|
||||
|
||||
func _on_key_mouse_entered() -> void:
|
||||
$Key/Key.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
|
||||
|
||||
|
||||
func _on_key_mouse_exited() -> void:
|
||||
$Key/Key.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)
|
||||
|
@ -5,7 +5,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://lr1gcgtutatw" path="res://Assets/psl/指示灯_红.png" id="3_d617q"]
|
||||
[ext_resource type="Texture2D" uid="uid://bw10gny5v6s5m" path="res://Assets/psl/指示灯亮_红.png" id="4_hp6yx"]
|
||||
[ext_resource type="Texture2D" uid="uid://ba8byksb7lxhd" path="res://Assets/psl/钥匙孔.png" id="5_7s053"]
|
||||
[ext_resource type="Texture2D" uid="uid://csenwwkcbfcej" path="res://Assets/psl/钥匙.png" id="5_ptmia"]
|
||||
[ext_resource type="Texture2D" uid="uid://dyemyrw74u47v" path="res://Assets/psl/钥匙.png" id="5_ptmia"]
|
||||
[ext_resource type="Texture2D" uid="uid://b7j3msd4bw0im" path="res://Assets/LCB_Arrow.svg" id="6_s6bbn"]
|
||||
[ext_resource type="Script" path="res://UI/psl/key_right_rotate.gd" id="8_sbs8q"]
|
||||
|
||||
@ -55,10 +55,16 @@ rotation = -0.523599
|
||||
scale = Vector2(0.8, 0.8)
|
||||
texture = ExtResource("5_7s053")
|
||||
|
||||
[node name="Key" type="Sprite2D" parent="Key"]
|
||||
[node name="Key" type="TextureRect" parent="Key"]
|
||||
visible = false
|
||||
position = Vector2(63, 122)
|
||||
layout_mode = 0
|
||||
offset_left = 39.0
|
||||
offset_top = 68.0
|
||||
offset_right = 89.0
|
||||
offset_bottom = 170.0
|
||||
rotation = -0.523599
|
||||
scale = Vector2(0.72, 0.72)
|
||||
pivot_offset = Vector2(25, 51)
|
||||
texture = ExtResource("5_ptmia")
|
||||
|
||||
[node name="Right_Rotate" type="Sprite2D" parent="Key"]
|
||||
@ -85,3 +91,7 @@ theme_override_font_sizes/font_size = 18
|
||||
text = "钥匙"
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[connection signal="gui_input" from="Key/Key" to="." method="_on_key_gui_input"]
|
||||
[connection signal="mouse_entered" from="Key/Key" to="." method="_on_key_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="Key/Key" to="." method="_on_key_mouse_exited"]
|
||||
|
@ -4,8 +4,12 @@ extends Window
|
||||
func _on_psl_click_signal() -> void:
|
||||
self.show()
|
||||
$"../stationKeys".onShowWindow($"../stationKeys".WindowType.PSL)
|
||||
hidePSLAllowHandleKey()
|
||||
hideInterlockReleaseSwitchHandleKey()
|
||||
if !$"../stationKeys".hsjcKeyVisible() :
|
||||
hideInterlockReleaseSwitchHandleKey()
|
||||
if !$"../stationKeys".pslKeyVisible() :
|
||||
hidePSLAllowHandleKey()
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_close_requested():
|
||||
@ -30,3 +34,12 @@ func hideInterlockReleaseSwitchHandleKey():
|
||||
|
||||
func onHandleSignal(openLight: bool, keySwitch: Variant) -> void:
|
||||
print(openLight,keySwitch,666)
|
||||
|
||||
|
||||
func remove_key(keyName: Variant) -> void:
|
||||
var name = ''
|
||||
if keyName == 'PSLAllow' :
|
||||
name = 'PSL_Key'
|
||||
elif keyName == 'InterlockReleaseSwitch' :
|
||||
name = 'HSJC_Key'
|
||||
$"../stationKeys".showKeyAfterRemoveKey(name)
|
||||
|
@ -111,9 +111,11 @@ buttonText = "联动开门按钮"
|
||||
|
||||
[connection signal="close_requested" from="." to="." method="_on_close_requested"]
|
||||
[connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/PSLAllow" to="." method="onHandleSignal"]
|
||||
[connection signal="removeKey" from="MarginContainer/GridContainer/PSLAllow" to="." method="remove_key"]
|
||||
[connection signal="clickButtonSignal" from="MarginContainer/GridContainer/MarginContainer/CloseDoorButton" to="." method="onHandleSignal"]
|
||||
[connection signal="clickButtonSignal" from="MarginContainer/GridContainer/OpenDoorButton" to="." method="onHandleSignal"]
|
||||
[connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/InterlockReleaseSwitch" to="." method="onHandleSignal"]
|
||||
[connection signal="removeKey" from="MarginContainer/GridContainer/InterlockReleaseSwitch" to="." method="remove_key"]
|
||||
[connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/MarginContainer2/VBoxContainer/IBPHandle" to="." method="onHandleSignal"]
|
||||
[connection signal="clickButtonSignal" from="MarginContainer/GridContainer/MarginContainer2/VBoxContainer/LightTestButton" to="." method="onHandleSignal"]
|
||||
[connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/PSTHandle" to="." method="onHandleSignal"]
|
||||
|
@ -38,12 +38,22 @@ func _on_button_pressed():
|
||||
$"../jjtc".grab_focus()
|
||||
current_focus.hide_key()
|
||||
$AudioStreamPlayer.play()
|
||||
|
||||
|
||||
|
||||
func showKeyAfterRemoveKey(keyName):
|
||||
$PanelContainer/VBoxContainer/GridContainer.find_child(keyName).show_key()
|
||||
$AudioStreamPlayer.play()
|
||||
current_lcb_keyname = ''
|
||||
|
||||
|
||||
func hsjcKeyVisible ()-> bool:
|
||||
return $PanelContainer/VBoxContainer/GridContainer/HSJC_Key.visible
|
||||
|
||||
|
||||
func pslKeyVisible ()-> bool:
|
||||
return $PanelContainer/VBoxContainer/GridContainer/PSL_Key.visible
|
||||
|
||||
|
||||
func _on_close_requested():
|
||||
self.hide()
|
||||
|
||||
|
@ -8,3 +8,7 @@ extends Node
|
||||
func _ready():
|
||||
$TrainingDescDialog.title = trainingName
|
||||
$TrainingDescDialog.updateSceneDesc(trainingDesc)
|
||||
|
||||
|
||||
func _on_training_desc_dialog_start_training():
|
||||
pass # Replace with function body.
|
||||
|
@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dvsauaycyah6j"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dvsauaycyah6j"]
|
||||
|
||||
[ext_resource type="Script" path="res://trainings/training1.gd" id="1_71wgx"]
|
||||
[ext_resource type="PackedScene" uid="uid://btcksdsburk7t" path="res://sceen/total.tscn" id="1_im1rp"]
|
||||
[ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="2_oc00d"]
|
||||
|
||||
[node name="Training1" type="Node"]
|
||||
@ -9,7 +8,7 @@ script = ExtResource("1_71wgx")
|
||||
trainingName = "站台单档滑动门关门故障处置"
|
||||
trainingDesc = "列车关门作业,突发单个站台门未正常关闭。"
|
||||
|
||||
[node name="total" parent="." instance=ExtResource("1_im1rp")]
|
||||
|
||||
[node name="TrainingDescDialog" parent="." instance=ExtResource("2_oc00d")]
|
||||
size = Vector2i(400, 300)
|
||||
|
||||
[connection signal="StartTraining" from="TrainingDescDialog" to="." method="_on_training_desc_dialog_start_training"]
|
||||
|
@ -16,14 +16,13 @@ func updateSceneDesc(desc):
|
||||
update()
|
||||
|
||||
func update():
|
||||
$PanelContainer/VBoxContainer/SceneDescription.text = sceneDesc
|
||||
%SceneDescription.text = sceneDesc
|
||||
|
||||
|
||||
func _on_start_pressed():
|
||||
StartTraining.emit()
|
||||
hide()
|
||||
|
||||
|
||||
func _on_quit_pressed():
|
||||
QuitTraining.emit()
|
||||
hide()
|
||||
|
@ -9,13 +9,14 @@
|
||||
[node name="TrainingDescDialog" type="Window"]
|
||||
title = "实训"
|
||||
initial_position = 1
|
||||
size = Vector2i(300, 200)
|
||||
size = Vector2i(400, 250)
|
||||
wrap_controls = true
|
||||
unresizable = true
|
||||
transparent = true
|
||||
theme = ExtResource("1_8qohy")
|
||||
theme_override_fonts/title_font = ExtResource("2_s842n")
|
||||
script = ExtResource("2_3504l")
|
||||
sceneDesc = "场景说明大姐夫卡死了;大家付款啦但是;附近看到拉萨;荆防颗粒的;撒酒疯可怜的;撒酒疯开了多少啊;荆防颗粒;大数据分开了;打撒就开了发;觉得撒开了;"
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
@ -28,13 +29,17 @@ theme_override_styles/panel = SubResource("StyleBoxEmpty_040cp")
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="SceneDescription" type="Label" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "场景说明"
|
||||
|
||||
[node name="Control" type="Control" parent="PanelContainer/VBoxContainer"]
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="SceneDescription" type="Label" parent="PanelContainer/VBoxContainer/ScrollContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(390, 100)
|
||||
layout_mode = 2
|
||||
text = "场景说明"
|
||||
autowrap_mode = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
Loading…
Reference in New Issue
Block a user