2024-04-19 17:48:20 +08:00
|
|
|
extends Window
|
|
|
|
|
2024-05-13 15:44:09 +08:00
|
|
|
##是否允许操作
|
|
|
|
var allowHandle :bool = true
|
2024-04-19 17:48:20 +08:00
|
|
|
|
2024-04-22 15:32:19 +08:00
|
|
|
func _on_psl_click_signal() -> void:
|
2024-05-13 15:44:09 +08:00
|
|
|
allClickPslSignal.emit('PSL',$".")
|
|
|
|
if !allowHandle :
|
|
|
|
return
|
2024-04-22 15:32:19 +08:00
|
|
|
self.show()
|
2024-04-29 17:13:14 +08:00
|
|
|
$"../stationKeys".onShowWindow(StationKeyWindow.WindowType.PSL)
|
2024-04-29 11:03:01 +08:00
|
|
|
if !$"../stationKeys".hsjcKeyVisible() :
|
|
|
|
hideInterlockReleaseSwitchHandleKey()
|
|
|
|
if !$"../stationKeys".pslKeyVisible() :
|
|
|
|
hidePSLAllowHandleKey()
|
2024-04-19 17:48:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
func _on_close_requested():
|
|
|
|
self.hide()
|
2024-04-26 16:54:17 +08:00
|
|
|
$"../stationKeys".hide()
|
2024-04-22 15:32:19 +08:00
|
|
|
|
2024-04-29 17:13:14 +08:00
|
|
|
##点击按钮或钥匙
|
|
|
|
func onHandleSignal(openLight: bool, keySwitch: Variant) -> void:
|
2024-05-29 15:18:03 +08:00
|
|
|
if keySwitch.name == 'PSLAllow':
|
|
|
|
if openLight :
|
|
|
|
allClickPslSignal.emit('PSLAllowRightRotate',keySwitch)
|
|
|
|
else :
|
|
|
|
allClickPslSignal.emit('PSLAllowLeftRotate',keySwitch)
|
|
|
|
elif keySwitch.name == 'InterlockReleaseSwitch' :
|
|
|
|
if openLight :
|
|
|
|
allClickPslSignal.emit('InterlockReleaseSwitchRightRotate',keySwitch)
|
|
|
|
else :
|
|
|
|
allClickPslSignal.emit('InterlockReleaseSwitchLeftRotate',keySwitch)
|
|
|
|
else :
|
|
|
|
allClickPslSignal.emit(keySwitch.name,keySwitch)
|
2024-04-29 17:13:14 +08:00
|
|
|
|
2024-05-06 17:28:42 +08:00
|
|
|
##显影psl相关钥匙操作
|
2024-04-22 15:32:19 +08:00
|
|
|
func shouPSLAllowHandleKey():
|
2024-04-23 09:33:07 +08:00
|
|
|
$MarginContainer/GridContainer/PSLAllow.shouHandleKey()
|
2024-04-19 17:48:20 +08:00
|
|
|
|
|
|
|
|
2024-04-22 15:32:19 +08:00
|
|
|
func hidePSLAllowHandleKey():
|
2024-04-23 09:33:07 +08:00
|
|
|
$MarginContainer/GridContainer/PSLAllow.hideHandleKey()
|
2024-04-19 17:48:20 +08:00
|
|
|
|
|
|
|
|
2024-04-22 15:32:19 +08:00
|
|
|
func shouInterlockReleaseSwitchHandleKey():
|
2024-04-23 09:33:07 +08:00
|
|
|
$MarginContainer/GridContainer/InterlockReleaseSwitch.shouHandleKey()
|
2024-04-22 15:32:19 +08:00
|
|
|
|
|
|
|
func hideInterlockReleaseSwitchHandleKey():
|
2024-04-23 09:33:07 +08:00
|
|
|
$MarginContainer/GridContainer/InterlockReleaseSwitch.hideHandleKey()
|
2024-04-19 17:48:20 +08:00
|
|
|
|
|
|
|
|
2024-05-13 15:44:09 +08:00
|
|
|
func remove_key(keySwitch: Variant) -> void:
|
2024-04-29 11:03:01 +08:00
|
|
|
var name = ''
|
2024-05-13 15:44:09 +08:00
|
|
|
if keySwitch.name == 'PSLAllow' :
|
2024-04-29 11:03:01 +08:00
|
|
|
name = 'PSL_Key'
|
2024-05-13 15:44:09 +08:00
|
|
|
allClickPslSignal.emit('removePSLKeyOfWindowPsl',keySwitch)
|
|
|
|
elif keySwitch.name == 'InterlockReleaseSwitch' :
|
2024-04-29 11:03:01 +08:00
|
|
|
name = 'HSJC_Key'
|
2024-05-13 15:44:09 +08:00
|
|
|
allClickPslSignal.emit('removeHSJCKeyOfWindowPsl',keySwitch)
|
|
|
|
if keySwitch.allowHandle :
|
|
|
|
$"../stationKeys".showKeyAfterRemoveKey(name)
|
2024-04-29 17:13:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
##打开钥匙盒相关
|
|
|
|
func _on_open_key_window_gui_input(event: InputEvent) -> void:
|
|
|
|
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
|
|
|
|
$"../stationKeys".onShowWindow(StationKeyWindow.WindowType.PSL)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_open_key_window_mouse_entered() -> void:
|
|
|
|
$openKeyWindow.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_open_key_window_mouse_exited() -> void:
|
|
|
|
$openKeyWindow.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)
|
2024-05-06 17:28:42 +08:00
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
if self.visible :
|
|
|
|
if $"..".allScreenDoorClose() :
|
|
|
|
$MarginContainer/GridContainer/MarginContainer/VBoxContainer/AllScreenDoorCloseLight.openLight()
|
|
|
|
else :
|
|
|
|
$MarginContainer/GridContainer/MarginContainer/VBoxContainer/AllScreenDoorCloseLight.closeLight()
|
|
|
|
if $"..".hasScreenDoorOpen():
|
|
|
|
$MarginContainer/GridContainer/VBoxContainer/ScreenDoorOpenLight.openLight()
|
|
|
|
else:
|
|
|
|
$MarginContainer/GridContainer/VBoxContainer/ScreenDoorOpenLight.closeLight()
|
|
|
|
|
2024-05-11 14:10:07 +08:00
|
|
|
|
|
|
|
##所有psl点击操作汇总
|
|
|
|
signal allClickPslSignal(equipmentName:String,equipmentInfo)
|
|
|
|
|