钥匙显示位置bug修复,需要先显示面板完成布局才能获取相应节点的位置
This commit is contained in:
parent
f4c7f4474c
commit
bf066602fe
@ -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")
|
||||
@ -119,7 +113,7 @@ func allClickEquipmentPostion(equipmentName: String) -> Vector2:
|
||||
var confirmUseKeyPos=NodeUtils.find_child_by_name(keysWindow,'Button').get_global_position()
|
||||
return Vector2(lcbWindowPos.x+confirmUseKeyPos.x,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' :
|
||||
@ -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