godot-psd-training/UI/psl/psl_window.gd

46 lines
1.1 KiB
GDScript3
Raw Normal View History

2024-04-19 17:48:20 +08:00
extends Window
2024-04-22 15:32:19 +08:00
func _on_psl_click_signal() -> void:
self.show()
$"../stationKeys".onShowWindow($"../stationKeys".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
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-04-22 15:32:19 +08:00
func onHandleSignal(openLight: bool, keySwitch: Variant) -> void:
print(openLight,keySwitch,666)
2024-04-29 11:03:01 +08:00
func remove_key(keyName: Variant) -> void:
var name = ''
if keyName == 'PSLAllow' :
name = 'PSL_Key'
elif keyName == 'InterlockReleaseSwitch' :
name = 'HSJC_Key'
$"../stationKeys".showKeyAfterRemoveKey(name)