Merge branch 'main' of https://gitea.joylink.club/joylink/godot-psd-training into main
This commit is contained in:
commit
214e7d4cbc
@ -95,18 +95,12 @@ func checkCurrentClick() -> bool:
|
||||
return true
|
||||
else :
|
||||
return false
|
||||
|
||||
|
||||
func _on_platform_all_click_platform_signal(equipmentName: String,equipmentInfo=null) -> void:
|
||||
print(equipmentName,equipmentInfo,6666)
|
||||
currentClickNode = equipmentName
|
||||
var isClickCorrect = checkCurrentClick()
|
||||
currentClickCheckSignal.emit(isClickCorrect)
|
||||
equipmentInfo.allowHandle = isClickCorrect
|
||||
if isClickCorrect:
|
||||
print('操作正确')
|
||||
else :
|
||||
print('操作错误')
|
||||
|
||||
|
||||
const NodeUtils = preload("res://util/NodeUtils.gd")
|
||||
@ -117,9 +111,9 @@ func allClickEquipmentPostion(equipmentName: String) -> Vector2:
|
||||
var lcbWindowPos = keysWindow.position
|
||||
if equipmentName == 'confirmUseKey':
|
||||
var confirmUseKeyPos=NodeUtils.find_child_by_name(keysWindow,'Button').get_global_position()
|
||||
return Vector2(lcbWindowPos.x+confirmUseKeyPos.x,lcbWindowPos.y+confirmUseKeyPos.y)
|
||||
return Vector2(lcbWindowPos.x+confirmUseKeyPos.x+30,lcbWindowPos.y+confirmUseKeyPos.y)
|
||||
var LCB_KeyPos=NodeUtils.find_child_by_name(keysWindow,equipmentName).get_global_position()
|
||||
return Vector2(lcbWindowPos.x+LCB_KeyPos.x,lcbWindowPos.y+LCB_KeyPos.y)
|
||||
return Vector2(lcbWindowPos.x+LCB_KeyPos.x+70,lcbWindowPos.y+LCB_KeyPos.y+20)
|
||||
elif equipmentName == 'LCB1' : ##LCB以及LCB面板
|
||||
return getScreenPosition($platform.get_node('screenDoor1').get_node('LCB').get_node('LCB_body'))
|
||||
elif equipmentName == 'LCB2' :
|
||||
@ -139,7 +133,7 @@ func allClickEquipmentPostion(equipmentName: String) -> Vector2:
|
||||
elif equipmentName in ['removeKeyOfWindowLCB1','removeKeyOfWindowLCB2','removeKeyOfWindowLCB3','removeKeyOfWindowLCB4'] :
|
||||
var lcbPos = $platform.get_node('LCB').position
|
||||
var removePos = $platform.get_node('LCB').get_node('TextureRect2').get_global_position()
|
||||
return Vector2(lcbPos.x+removePos.x,lcbPos.y+removePos.y)
|
||||
return Vector2(lcbPos.x+removePos.x-25,lcbPos.y+removePos.y-5)
|
||||
elif equipmentName == 'PSL' : ##PSL以及PSL面板
|
||||
return getScreenPosition($platform.get_node('PSL').get_node('PSL_body'))
|
||||
elif equipmentName in ['PSLAllow','CloseDoorButton','OpenDoorButton','InterlockReleaseSwitch','LightTestButton','trainDepartsButton','interconnectedCloseButton','interconnectedOpenButton','removePSLKeyOfWindowPsl','removeHSJCKeyOfWindowPsl'] :
|
||||
@ -256,3 +250,21 @@ const allClickEquipmentInfo = {
|
||||
"clickAdhesiveTapeOfscreenDoor4": "请选择粘贴胶带",
|
||||
"clickIsolationStripOfscreenDoor4": "请选择放置隔离带",
|
||||
}
|
||||
|
||||
func _ready():
|
||||
var stationKeys = $platform.get_node('stationKeys')
|
||||
var psl = $platform.get_node('psl')
|
||||
stationKeys.visible = true
|
||||
stationKeys.position = Vector2(2100,1100)
|
||||
psl.visible = true
|
||||
psl.position = Vector2(2100,1100)
|
||||
$openAllwindow.start()
|
||||
|
||||
|
||||
func _on_open_allwindow_timeout() -> void:
|
||||
var stationKeys = $platform.get_node('stationKeys')
|
||||
var psl = $platform.get_node('psl')
|
||||
stationKeys.visible = false
|
||||
stationKeys.position = Vector2(1133,325)
|
||||
psl.visible = false
|
||||
psl.position = Vector2(568,190)
|
||||
|
@ -93,7 +93,11 @@ one_shot = true
|
||||
wait_time = 3.0
|
||||
one_shot = true
|
||||
|
||||
[node name="openAllwindow" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[connection signal="allClickPlatformSignal" from="platform" to="." method="_on_platform_all_click_platform_signal"]
|
||||
[connection signal="animation_finished" from="trainAnimationPlayer" to="train" method="_on_train_animation_player_animation_finished"]
|
||||
[connection signal="timeout" from="BeginTimer" to="." method="_on_beginTimer_timeout"]
|
||||
[connection signal="timeout" from="EndTimer" to="." method="_on_end_timer_timeout"]
|
||||
[connection signal="timeout" from="openAllwindow" to="." method="_on_open_allwindow_timeout"]
|
||||
|
Loading…
Reference in New Issue
Block a user