lcb钥匙使用逻辑修改:对于同一个LCB,已经插入钥匙,就不能再插入钥匙;在切换LCB的时候,不能重置已经插入的钥匙

This commit is contained in:
joylink_zhaoerwei 2024-04-28 15:51:51 +08:00
parent f8889907b2
commit 38eb629fb9
13 changed files with 140 additions and 330 deletions

View File

@ -1,21 +1,8 @@
extends Window
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_jjtc_click_jjtc_signal():
self.show()
$"../stationKeys".show()
$"../stationKeys".shouAllKeys()
pass # Replace with function body.
$"../stationKeys".onShowWindow($"../stationKeys".WindowType.JJTC)
func _on_close_requested():
@ -25,8 +12,7 @@ func _on_close_requested():
func _on_station_keys_gui_input(event):
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
$"../stationKeys".show()
$"../stationKeys".shouAllKeys()
$"../stationKeys".onShowWindow($"../stationKeys".WindowType.JJTC)
func shouJJTCKey():
$JJTC_Key.show()
@ -36,7 +22,6 @@ func shouJJTCKey():
func _on_jjtc_button_gui_input(event):
print('jjtc button 按下')
pass # Replace with function body.
func _on_jjtc_button_mouse_entered():

View File

@ -5,10 +5,9 @@ func _on_screen_door_click_lcb_signal(screenDoor: Variant) -> void:
var screenDoorName=String(screenDoor.name)
self.title='LCB'+screenDoorName[screenDoorName.length() - 1]
self.show()
$"../stationKeys".show()
$"../stationKeys".shouAllKeys()
$"../stationKeys".onShowWindow($"../stationKeys".WindowType.LCB,screenDoor.lcbKey.keyName)
currenScreenDoor=screenDoor
resetState()
resetState(screenDoor.lcbKey)
@ -27,17 +26,18 @@ enum KNOB_STATE{
@onready var knob_state : KNOB_STATE = KNOB_STATE.AUTO :
set(value):
knob_state = value
if knob_state==KNOB_STATE.OPEN:
currenScreenDoor.openScreenDoor()
elif knob_state==KNOB_STATE.CLOSE:
currenScreenDoor.closeScreenDoor()
func change_knob_state(state):
knob_state = state
currenScreenDoor.lcbKey.keyState = knob_state
if knob_state==KNOB_STATE.OPEN:
currenScreenDoor.openScreenDoor()
elif knob_state==KNOB_STATE.CLOSE:
currenScreenDoor.closeScreenDoor()
##展示控制的钥匙
func shouHandleKey():
func shouHandleKey(keyName:String):
currenScreenDoor.lcbKey.keyName = keyName
$TextureRect2.visible=true
$LCB2_Right_Rotate.visible=true
$LCB2_Left_Rotate.visible=true
@ -49,9 +49,49 @@ func hideHandleKey():
$LCB2_Left_Rotate.visible=false
##重置面板
func resetState():
change_knob_state(KNOB_STATE.AUTO)
$TextureRect2.rotation = 0
hideHandleKey()
func resetState(lcbKey):
if(lcbKey.keyName):
shouHandleKey(currenScreenDoor.lcbKey.keyName)
knob_state = lcbKey.keyState
match lcbKey.keyState:
KNOB_STATE.ISOLATE:
$TextureRect2.rotation = -PI*62/180
KNOB_STATE.AUTO:
$TextureRect2.rotation = 0
KNOB_STATE.CLOSE:
$TextureRect2.rotation = PI*59/180
KNOB_STATE.OPEN:
$TextureRect2.rotation = PI/2
else:
change_knob_state(KNOB_STATE.AUTO)
$TextureRect2.rotation = 0
hideHandleKey()
##打开钥匙盒相关
func _on_open_key_window_gui_input(event: InputEvent) -> void:
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
$"../stationKeys".onShowWindow($"../stationKeys".WindowType.LCB,currenScreenDoor.lcbKey.keyName)
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)
##拔钥匙相关
func _on_texture_rect_2_gui_input(event: InputEvent) -> void:
return
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
hideHandleKey()
$"../stationKeys".showKeyAfterRemoveKey(currenScreenDoor.lcbKey.keyName)
currenScreenDoor.lcbKey.keyName = ''
func _on_texture_rect_2_mouse_entered() -> void:
$TextureRect2.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_texture_rect_2_mouse_exited() -> void:
$TextureRect2.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)

View File

@ -7,23 +7,7 @@
[ext_resource type="Texture2D" uid="uid://b7j3msd4bw0im" path="res://Assets/LCB_Arrow.svg" id="5_l3h46"]
[ext_resource type="Script" path="res://UI/LCB/LCB_Right_Rotate.gd" id="6_bg24u"]
[ext_resource type="Script" path="res://UI/LCB/LCB_Left_Rotate.gd" id="7_g7j6c"]
[sub_resource type="GDScript" id="GDScript_m3ckf"]
script/source = "extends TextureRect
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
"
[ext_resource type="Texture2D" uid="uid://cpmlwpev7rvbp" path="res://Assets/打开钥匙面板钥匙.png" id="8_12p4y"]
[sub_resource type="Animation" id="Animation_1u8bl"]
resource_name = "AutoToClose"
@ -169,8 +153,6 @@ offset_right = 328.0
offset_bottom = 328.0
pivot_offset = Vector2(128, 128)
texture = ExtResource("4_i7jy7")
stretch_mode = 5
script = SubResource("GDScript_m3ckf")
[node name="Label" type="Label" parent="."]
offset_left = 96.0
@ -225,3 +207,18 @@ script = ExtResource("7_g7j6c")
libraries = {
"": SubResource("AnimationLibrary_nflv5")
}
[node name="openKeyWindow" type="TextureRect" parent="."]
offset_left = 350.0
offset_top = 50.0
offset_right = 418.0
offset_bottom = 200.0
scale = Vector2(0.5, 0.5)
texture = ExtResource("8_12p4y")
[connection signal="gui_input" from="TextureRect2" to="." method="_on_texture_rect_2_gui_input"]
[connection signal="mouse_entered" from="TextureRect2" to="." method="_on_texture_rect_2_mouse_entered"]
[connection signal="mouse_exited" from="TextureRect2" to="." method="_on_texture_rect_2_mouse_exited"]
[connection signal="gui_input" from="openKeyWindow" to="." method="_on_open_key_window_gui_input"]
[connection signal="mouse_entered" from="openKeyWindow" to="." method="_on_open_key_window_mouse_entered"]
[connection signal="mouse_exited" from="openKeyWindow" to="." method="_on_open_key_window_mouse_exited"]

View File

@ -1,83 +0,0 @@
[gd_scene load_steps=10 format=3 uid="uid://b7k8341jwy22f"]
[ext_resource type="PackedScene" uid="uid://bsr40ogx2e2ir" path="res://UI/station_keys/jjtc_key_control.tscn" id="1_taymr"]
[ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="1_vlsle"]
[ext_resource type="PackedScene" uid="uid://dkqnt73pyqgwj" path="res://UI/station_keys/lcb1_key_control.tscn" id="2_a6b1q"]
[ext_resource type="PackedScene" uid="uid://63r8gueubu2q" path="res://UI/station_keys/lcb2_key_control.tscn" id="3_8astu"]
[ext_resource type="PackedScene" uid="uid://biwdpy5pifxgi" path="res://UI/station_keys/lcb_key_control.tscn" id="4_dahi7"]
[ext_resource type="PackedScene" uid="uid://dnmfwdvba6td3" path="res://UI/station_keys/psl_key_control.tscn" id="5_n4mmv"]
[ext_resource type="PackedScene" uid="uid://cjjs2fsw6i8ye" path="res://UI/station_keys/sdjs_key_control.tscn" id="6_7pwvh"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eooev"]
bg_color = Color(0, 0, 0, 0.235294)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nu4ha"]
bg_color = Color(0, 0, 0, 0.352941)
[node name="PanelContainer" type="PanelContainer"]
offset_right = 368.0
offset_bottom = 232.0
theme_override_styles/panel = SubResource("StyleBoxFlat_eooev")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_nu4ha")
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/PanelContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="VBoxContainer/PanelContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 3.0
text = "标题"
horizontal_alignment = 1
[node name="Button" type="Button" parent="VBoxContainer/PanelContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 8
focus_mode = 0
theme = ExtResource("1_vlsle")
text = "X"
[node name="GridContainer" type="GridContainer" parent="VBoxContainer"]
layout_mode = 2
columns = 4
[node name="JJTC_Key" parent="VBoxContainer/GridContainer" instance=ExtResource("1_taymr")]
layout_mode = 2
[node name="LCB1_Key" parent="VBoxContainer/GridContainer" instance=ExtResource("2_a6b1q")]
layout_mode = 2
[node name="LCB2_Key" parent="VBoxContainer/GridContainer" instance=ExtResource("3_8astu")]
layout_mode = 2
[node name="LCB3_Key" parent="VBoxContainer/GridContainer" instance=ExtResource("4_dahi7")]
layout_mode = 2
[node name="PSL_Key" parent="VBoxContainer/GridContainer" instance=ExtResource("5_n4mmv")]
layout_mode = 2
[node name="SDJS_Key" parent="VBoxContainer/GridContainer" instance=ExtResource("6_7pwvh")]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_top = 30
theme_override_constants/margin_bottom = 0
[node name="Button" type="Button" parent="VBoxContainer/MarginContainer"]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
focus_mode = 0
theme_override_font_sizes/font_size = 24
text = "确认"

View File

@ -3,8 +3,7 @@ extends Window
func _on_psl_click_signal() -> void:
self.show()
$"../stationKeys".show()
$"../stationKeys".shouAllKeys()
$"../stationKeys".onShowWindow($"../stationKeys".WindowType.PSL)
hidePSLAllowHandleKey()
hideInterlockReleaseSwitchHandleKey()

View File

@ -1,51 +0,0 @@
[gd_scene load_steps=7 format=3 uid="uid://d1lavjoj2lsgo"]
[ext_resource type="PackedScene" uid="uid://b7k8341jwy22f" path="res://UI/panel_container.tscn" id="1_beblv"]
[ext_resource type="PackedScene" uid="uid://d167och8l6jms" path="res://UI/station_keys/station_keys_window.tscn" id="2_xrug6"]
[ext_resource type="PackedScene" uid="uid://6lortgihx5jy" path="res://Communication/voice_communication.tscn" id="3_0j5m0"]
[sub_resource type="BoxShape3D" id="BoxShape3D_qpl3n"]
size = Vector3(60, 2, 60)
[sub_resource type="BoxMesh" id="BoxMesh_n702p"]
size = Vector3(60, 2, 60)
[sub_resource type="CapsuleMesh" id="CapsuleMesh_tlxkr"]
[node name="Node3D" type="Node3D"]
[node name="Ground" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Ground"]
shape = SubResource("BoxShape3D_qpl3n")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Ground"]
mesh = SubResource("BoxMesh_n702p")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 0, 9, 11)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 15, 0)
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1.6, 0, 0, 0, 2.24, 0, 0, 0, 1.6, -11, 1, -2)
mesh = SubResource("CapsuleMesh_tlxkr")
[node name="PSL_Button" type="Button" parent="."]
offset_left = 144.0
offset_top = 132.0
offset_right = 180.0
offset_bottom = 163.0
text = "PSL"
[node name="PanelContainer" parent="." instance=ExtResource("1_beblv")]
visible = false
[node name="Window" parent="." instance=ExtResource("2_xrug6")]
[node name="VoiceCommunication" parent="." instance=ExtResource("3_0j5m0")]
[connection signal="pressed" from="PSL_Button" to="Window" method="_on_show_button_pressed"]
[connection signal="pressed" from="PSL_Button" to="VoiceCommunication" method="_on_psl_button_pressed"]

View File

@ -1,37 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://dkqnt73pyqgwj"]
[ext_resource type="Script" path="res://UI/station_keys/outlined_key.gd" id="1_5bwgk"]
[ext_resource type="Shader" path="res://shaders/outline.gdshader" id="2_bgq1b"]
[ext_resource type="Texture2D" uid="uid://c3dplk5y1607u" path="res://Assets/LCB钥匙.png" id="3_5sgan"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0dtby"]
shader = ExtResource("2_bgq1b")
shader_parameter/color = Color(0, 1, 1, 1)
shader_parameter/width = 3.0
shader_parameter/pattern = 1
shader_parameter/inside = false
shader_parameter/add_margins = true
shader_parameter/number_of_images = Vector2(1, 1)
[node name="LCB_Key" type="VBoxContainer"]
offset_right = 128.0
offset_bottom = 155.0
focus_mode = 1
script = ExtResource("1_5bwgk")
outline_material = SubResource("ShaderMaterial_0dtby")
[node name="Key" type="TextureRect" parent="."]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 2
texture = ExtResource("3_5sgan")
[node name="Label" type="Label" parent="."]
layout_mode = 2
size_flags_horizontal = 4
text = "LCB钥匙"
[connection signal="focus_entered" from="Key" to="." method="_on_focus_entered"]
[connection signal="focus_exited" from="Key" to="." method="_on_focus_exited"]
[connection signal="mouse_entered" from="Key" to="." method="_on_area_2d_mouse_entered"]
[connection signal="mouse_exited" from="Key" to="." method="_on_area_2d_mouse_exited"]

View File

@ -1,37 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://63r8gueubu2q"]
[ext_resource type="Script" path="res://UI/station_keys/outlined_key.gd" id="1_f23n4"]
[ext_resource type="Shader" path="res://shaders/outline.gdshader" id="2_op1qj"]
[ext_resource type="Texture2D" uid="uid://c3dplk5y1607u" path="res://Assets/LCB钥匙.png" id="3_2ad7b"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_0dtby"]
shader = ExtResource("2_op1qj")
shader_parameter/color = Color(0, 1, 1, 1)
shader_parameter/width = 3.0
shader_parameter/pattern = 1
shader_parameter/inside = false
shader_parameter/add_margins = true
shader_parameter/number_of_images = Vector2(1, 1)
[node name="LCB_Key" type="VBoxContainer"]
offset_right = 128.0
offset_bottom = 155.0
focus_mode = 1
script = ExtResource("1_f23n4")
outline_material = SubResource("ShaderMaterial_0dtby")
[node name="Key" type="TextureRect" parent="."]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 2
texture = ExtResource("3_2ad7b")
[node name="Label" type="Label" parent="."]
layout_mode = 2
size_flags_horizontal = 4
text = "LCB钥匙"
[connection signal="focus_entered" from="Key" to="." method="_on_focus_entered"]
[connection signal="focus_exited" from="Key" to="." method="_on_focus_exited"]
[connection signal="mouse_entered" from="Key" to="." method="_on_area_2d_mouse_entered"]
[connection signal="mouse_exited" from="Key" to="." method="_on_area_2d_mouse_exited"]

View File

@ -2,48 +2,53 @@ extends Window
var current_focus: CanvasItem
## 打开的面板类型枚举
enum WindowType{
LCB,
PSL,
JJTC,
}
var current_together_window: WindowType
var current_lcb_keyname: String=''
func _on_key_focus_entered(node):
current_focus = node
print("node : ", current_focus.name, " focus")
func _on_button_pressed():
if current_focus == null:
if current_focus == null or (current_together_window==WindowType.LCB and (!current_focus.name.contains('LCB') or current_lcb_keyname)) or (current_together_window==WindowType.PSL and (!current_focus.name.contains('PSL') and !current_focus.name.contains('HSJC') )) or (current_together_window==WindowType.JJTC and !current_focus.name.contains('JJTC')):
print("请选择钥匙")
else:
print("使用钥匙:", current_focus.name)
current_focus.hide_key()
$AudioStreamPlayer.play()
if(current_focus.name.contains('LCB')):
$"../LCB".shouHandleKey()
if current_focus.name.contains('LCB') :
$"../LCB".shouHandleKey(current_focus.name)
$"../LCB".grab_focus()
elif (current_focus.name.contains('PSL')):
current_lcb_keyname = current_focus.name
elif current_focus.name.contains('PSL'):
$"../psl".shouPSLAllowHandleKey()
$"../psl".grab_focus()
elif (current_focus.name.contains('HSJC')):
elif current_focus.name.contains('HSJC'):
$"../psl".shouInterlockReleaseSwitchHandleKey()
$"../psl".grab_focus()
elif (current_focus.name.contains('JJTC')):
$"../jjtc".shouJJTCKey()
$"../jjtc".grab_focus()
current_focus.hide_key()
$AudioStreamPlayer.play()
func showKeyAfterRemoveKey(keyName):
$PanelContainer/VBoxContainer/GridContainer.find_child(keyName).show_key()
current_lcb_keyname = ''
func _on_close_requested():
self.hide()
func _on_show_button_pressed():
print('on_show_button_pressed');
func onShowWindow(togetherWindow:WindowType,lcbKeyName = ''):
current_together_window = togetherWindow
current_lcb_keyname = lcbKeyName
self.show()
func shouAllKeys():
make_node_visible($PanelContainer/VBoxContainer/GridContainer)
func make_node_visible(node: Node):
node.visible = true
node.modulate.a = 255
for child in node.get_children():
make_node_visible(child)

View File

@ -1,15 +1,13 @@
[gd_scene load_steps=13 format=3 uid="uid://d167och8l6jms"]
[gd_scene load_steps=11 format=3 uid="uid://d167och8l6jms"]
[ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="1_gct42"]
[ext_resource type="PackedScene" uid="uid://dnmfwdvba6td3" path="res://UI/station_keys/psl_key_control.tscn" id="1_pwbsc"]
[ext_resource type="PackedScene" uid="uid://cjjs2fsw6i8ye" path="res://UI/station_keys/sdjs_key_control.tscn" id="1_wmags"]
[ext_resource type="Script" path="res://UI/station_keys/station_keys_window.gd" id="1_x7tnv"]
[ext_resource type="PackedScene" uid="uid://bsr40ogx2e2ir" path="res://UI/station_keys/jjtc_key_control.tscn" id="2_cndsv"]
[ext_resource type="PackedScene" uid="uid://dkqnt73pyqgwj" path="res://UI/station_keys/lcb1_key_control.tscn" id="2_h8ap0"]
[ext_resource type="FontFile" uid="uid://bkbpyidjguavf" path="res://Assets/FeiHuaSongTi-2.ttf" id="2_mlqh2"]
[ext_resource type="PackedScene" uid="uid://biwdpy5pifxgi" path="res://UI/station_keys/lcb_key_control.tscn" id="2_xelwb"]
[ext_resource type="PackedScene" uid="uid://63r8gueubu2q" path="res://UI/station_keys/lcb2_key_control.tscn" id="3_0e67u"]
[ext_resource type="PackedScene" path="res://UI/station_keys/hsjc_key_control.tscn" id="9_q6qly"]
[ext_resource type="PackedScene" uid="uid://blixp06e6vnoe" path="res://UI/station_keys/hsjc_key_control.tscn" id="9_q6qly"]
[ext_resource type="AudioStream" uid="uid://di5nwer0mdafr" path="res://Assets/music/箭头提示音.mp3" id="10_cspe3"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1w22c"]
@ -17,7 +15,7 @@
[node name="Window" type="Window"]
title = "请选择钥匙"
position = Vector2i(10, 36)
size = Vector2i(656, 534)
size = Vector2i(528, 406)
wrap_controls = true
unresizable = true
transparent = true
@ -29,7 +27,7 @@ script = ExtResource("1_x7tnv")
offset_left = 4.0
offset_top = 4.0
offset_right = 528.0
offset_bottom = 404.0
offset_bottom = 406.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_1w22c")
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
@ -39,22 +37,22 @@ layout_mode = 2
layout_mode = 2
columns = 4
[node name="LCB_Key1" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_xelwb")]
layout_mode = 2
[node name="LCB_Key2" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_xelwb")]
layout_mode = 2
[node name="LCB_Key3" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_xelwb")]
layout_mode = 2
[node name="LCB_Key4" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_xelwb")]
layout_mode = 2
[node name="JJTC_Key" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_cndsv")]
layout_mode = 2
tooltip_text = "紧急停车钥匙"
[node name="LCB1_Key" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_h8ap0")]
layout_mode = 2
[node name="LCB2_Key" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("3_0e67u")]
layout_mode = 2
[node name="LCB2_Key2" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("3_0e67u")]
layout_mode = 2
[node name="LCB3_Key" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("2_xelwb")]
layout_mode = 2
[node name="PSL_Key" parent="PanelContainer/VBoxContainer/GridContainer" instance=ExtResource("1_pwbsc")]
layout_mode = 2
@ -81,11 +79,11 @@ text = "确认"
stream = ExtResource("10_cspe3")
[connection signal="close_requested" from="." to="." method="_on_close_requested"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB_Key1" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB_Key2" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB_Key3" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB_Key4" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/JJTC_Key" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB1_Key" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB2_Key" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB2_Key2" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/LCB3_Key" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/PSL_Key" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/HSJC_Key" to="." method="_on_key_focus_entered"]
[connection signal="on_focus" from="PanelContainer/VBoxContainer/GridContainer/SDJS_Key" to="." method="_on_key_focus_entered"]

View File

@ -1 +0,0 @@
extends Window

View File

@ -1,21 +0,0 @@
[gd_scene load_steps=6 format=3 uid="uid://bhtvin66eei32"]
[ext_resource type="Script" path="res://UI/transparent_window.gd" id="1_bfvn2"]
[ext_resource type="PackedScene" uid="uid://bsr40ogx2e2ir" path="res://UI/station_keys/jjtc_key_control.tscn" id="1_l6iqj"]
[ext_resource type="PackedScene" uid="uid://dkqnt73pyqgwj" path="res://UI/station_keys/lcb1_key_control.tscn" id="2_5nk4v"]
[ext_resource type="PackedScene" uid="uid://63r8gueubu2q" path="res://UI/station_keys/lcb2_key_control.tscn" id="3_lpt01"]
[ext_resource type="PackedScene" uid="uid://biwdpy5pifxgi" path="res://UI/station_keys/lcb_key_control.tscn" id="4_ud6su"]
[node name="Window" type="Window"]
transparent_bg = true
position = Vector2i(10, 36)
transparent = true
script = ExtResource("1_bfvn2")
[node name="JJTC_Key" parent="." instance=ExtResource("1_l6iqj")]
[node name="LCB_Key" parent="." instance=ExtResource("2_5nk4v")]
[node name="LCB_Key2" parent="." instance=ExtResource("3_lpt01")]
[node name="LCB_Key3" parent="." instance=ExtResource("4_ud6su")]

View File

@ -6,7 +6,28 @@ class_name ScreenDoor
@onready var right_animation_player: AnimationPlayer = $RightAnimationPlayer
signal clickLcbSignalAndSent(screenDoor)
signal clickLcbSignalAndSent(screenDoor,hasKey)
## Lcb旋钮的状态枚举
enum KNOB_STATE{
ISOLATE,# 隔离
AUTO,# 自动
OPEN,# 开门
CLOSE,# 关门
}
class LcbKeyWindow :
var keyName: String
var keyState:KNOB_STATE
func _init(keyName: String, keyState: KNOB_STATE):
self.keyName = keyName
self.keyState = keyState
var lcbKey = LcbKeyWindow.new('',KNOB_STATE.AUTO)
func _on_lcb_click() -> void:
self.clickLcbSignalAndSent.emit(self)
## 屏蔽门的状态枚举
@ -49,8 +70,3 @@ func _process(delta: float) -> void:
screenDoorState=Screen_Door_STATE.close
elif count>2000 :
count=0
func _on_lcb_click() -> void:
self.clickLcbSignalAndSent.emit(self)