extends Window var current_focus: CanvasItem func _on_key_focus_entered(node): current_focus = node print("node : ", current_focus.name, " focus") func _on_button_pressed(): if current_focus == null: print("请选择钥匙") else: print("使用钥匙:", current_focus.name) current_focus.hide_key() if(current_focus.name.contains('LCB')): $"../LCB".shouHandleKey() elif (current_focus.name.contains('PSL')): $"../psl".shouInterlockReleaseSwitchHandleKey() $"../psl".shouPSLAllowHandleKey() func _on_close_requested(): self.hide() func _on_show_button_pressed(): print('on_show_button_pressed'); self.show() func shouAllKeys(): make_node_and_descendants_visible($PanelContainer/VBoxContainer/GridContainer) static func make_node_and_descendants_visible(node: Node): node.visible = true node.modulate.a = 255 for child in node.get_children(): make_node_and_descendants_visible(child)