psl面板调整

This commit is contained in:
joylink_zhaoerwei 2024-04-23 09:33:07 +08:00
parent 8cbdca61b1
commit ba07ffccce
4 changed files with 47 additions and 44 deletions

View File

@ -14,18 +14,18 @@ func _on_close_requested():
func shouPSLAllowHandleKey(): func shouPSLAllowHandleKey():
$PanelContainer/VBoxContainer/MarginContainer/GridContainer/PSLAllow.shouHandleKey() $MarginContainer/GridContainer/PSLAllow.shouHandleKey()
func hidePSLAllowHandleKey(): func hidePSLAllowHandleKey():
$PanelContainer/VBoxContainer/MarginContainer/GridContainer/PSLAllow.hideHandleKey() $MarginContainer/GridContainer/PSLAllow.hideHandleKey()
func shouInterlockReleaseSwitchHandleKey(): func shouInterlockReleaseSwitchHandleKey():
$PanelContainer/VBoxContainer/MarginContainer/GridContainer/InterlockReleaseSwitch.shouHandleKey() $MarginContainer/GridContainer/InterlockReleaseSwitch.shouHandleKey()
func hideInterlockReleaseSwitchHandleKey(): func hideInterlockReleaseSwitchHandleKey():
$PanelContainer/VBoxContainer/MarginContainer/GridContainer/InterlockReleaseSwitch.hideHandleKey() $MarginContainer/GridContainer/InterlockReleaseSwitch.hideHandleKey()
func onHandleSignal(openLight: bool, keySwitch: Variant) -> void: func onHandleSignal(openLight: bool, keySwitch: Variant) -> void:

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://dppmr7ifqt8oa"] [gd_scene load_steps=7 format=3 uid="uid://dppmr7ifqt8oa"]
[ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="1_oaabl"] [ext_resource type="Theme" uid="uid://bycedcl2nwwlu" path="res://ui_theme.tres" id="1_oaabl"]
[ext_resource type="FontFile" uid="uid://bkbpyidjguavf" path="res://Assets/FeiHuaSongTi-2.ttf" id="2_xva5j"] [ext_resource type="FontFile" uid="uid://bkbpyidjguavf" path="res://Assets/FeiHuaSongTi-2.ttf" id="2_xva5j"]
@ -7,12 +7,10 @@
[ext_resource type="PackedScene" uid="uid://ur86pfy4w0so" path="res://UI/psl/key_switch.tscn" id="6_8mvyb"] [ext_resource type="PackedScene" uid="uid://ur86pfy4w0so" path="res://UI/psl/key_switch.tscn" id="6_8mvyb"]
[ext_resource type="PackedScene" uid="uid://c31r8s27j4dcm" path="res://UI/psl/button_light.tscn" id="7_l5iwy"] [ext_resource type="PackedScene" uid="uid://c31r8s27j4dcm" path="res://UI/psl/button_light.tscn" id="7_l5iwy"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1w22c"]
[node name="psl" type="Window"] [node name="psl" type="Window"]
title = "psl操作面板" title = "psl操作面板"
position = Vector2i(10, 36) position = Vector2i(10, 36)
size = Vector2i(450, 950) size = Vector2i(400, 720)
unresizable = true unresizable = true
transparent = true transparent = true
theme = ExtResource("1_oaabl") theme = ExtResource("1_oaabl")
@ -24,96 +22,101 @@ position = Vector2(0.255, 0)
scale = Vector2(2.66, 2.865) scale = Vector2(2.66, 2.865)
texture = ExtResource("4_cpydh") texture = ExtResource("4_cpydh")
[node name="PanelContainer" type="PanelContainer" parent="."] [node name="MarginContainer" type="MarginContainer" parent="."]
offset_left = 4.0 offset_left = 4.0
offset_top = 4.0 offset_top = 4.0
offset_right = 436.0 offset_right = 436.0
offset_bottom = 1103.0 offset_bottom = 1459.0
theme_override_styles/panel = SubResource("StyleBoxEmpty_1w22c") scale = Vector2(0.7, 0.7)
theme_override_constants/margin_left = 45
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 35
theme_override_constants/margin_top = 35 theme_override_constants/margin_top = 35
[node name="GridContainer" type="GridContainer" parent="PanelContainer/VBoxContainer/MarginContainer"] [node name="GridContainer" type="GridContainer" parent="MarginContainer"]
layout_mode = 2 layout_mode = 2
columns = 3 columns = 3
[node name="PSLAllow" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("6_8mvyb")] [node name="PSLAllow" parent="MarginContainer/GridContainer" instance=ExtResource("6_8mvyb")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
keySwitchHasKey = true keySwitchHasKey = true
lightText = "PSL允许指示灯" lightText = "PSL允许指示灯"
keyText = "操作允许无效有效" keyText = "操作允许无效有效"
[node name="CloseDoorButton" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")] [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/GridContainer"]
layout_mode = 2
theme_override_constants/margin_left = 35
theme_override_constants/margin_right = 35
theme_override_constants/margin_bottom = 35
[node name="CloseDoorButton" parent="MarginContainer/GridContainer/MarginContainer" instance=ExtResource("7_l5iwy")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
buttonLightType = 1 buttonLightType = 1
lightText = "全部门关闭紧锁指" lightText = "全部门关闭紧锁指"
buttonText = "关门按钮" buttonText = "关门按钮"
[node name="OpenDoorButton" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")] [node name="OpenDoorButton" parent="MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
lightText = "开门到位指示灯" lightText = "开门到位指示灯"
buttonText = "开门按钮" buttonText = "开门按钮"
[node name="InterlockReleaseSwitch" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("6_8mvyb")] [node name="InterlockReleaseSwitch" parent="MarginContainer/GridContainer" instance=ExtResource("6_8mvyb")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
keySwitchHasKey = true keySwitchHasKey = true
lightText = "互锁解除指示灯" lightText = "互锁解除指示灯"
keyText = "互锁解除开关" keyText = "互锁解除开关"
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer"] [node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/GridContainer"]
layout_mode = 2
theme_override_constants/margin_bottom = 35
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/GridContainer/MarginContainer2"]
layout_mode = 2 layout_mode = 2
[node name="IBPHandle" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer/VBoxContainer" instance=ExtResource("6_8mvyb")] [node name="IBPHandle" parent="MarginContainer/GridContainer/MarginContainer2/VBoxContainer" instance=ExtResource("6_8mvyb")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
lightText = "IBP操作指示灯" lightText = "IBP操作指示灯"
[node name="LightTestButton" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer/VBoxContainer" instance=ExtResource("7_l5iwy")] [node name="LightTestButton" parent="MarginContainer/GridContainer/MarginContainer2/VBoxContainer" instance=ExtResource("7_l5iwy")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
buttonLightType = 2 buttonLightType = 2
buttonHasLight = false buttonHasLight = false
buttonText = "灯测试按钮" buttonText = "灯测试按钮"
[node name="PSTHandle" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("6_8mvyb")] [node name="PSTHandle" parent="MarginContainer/GridContainer" instance=ExtResource("6_8mvyb")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6 size_flags_horizontal = 6
lightText = "PST操作指示灯" lightText = "PST操作指示灯"
[node name="trainDepartsButton" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")] [node name="trainDepartsButton" parent="MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")]
layout_mode = 2 layout_mode = 2
buttonHasLight = false buttonHasLight = false
buttonText = "发车按钮" buttonText = "发车按钮"
[node name="interconnectedCloseButton" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")] [node name="interconnectedCloseButton" parent="MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 6
buttonLightType = 1 buttonLightType = 1
buttonHasLight = false buttonHasLight = false
buttonText = "联动关门按钮" buttonText = "联动关门按钮"
[node name="interconnectedOpenButton" parent="PanelContainer/VBoxContainer/MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")] [node name="interconnectedOpenButton" parent="MarginContainer/GridContainer" instance=ExtResource("7_l5iwy")]
layout_mode = 2 layout_mode = 2
buttonHasLight = false buttonHasLight = false
buttonText = "联动开门按钮" buttonText = "联动开门按钮"
[connection signal="close_requested" from="." to="." method="_on_close_requested"] [connection signal="close_requested" from="." to="." method="_on_close_requested"]
[connection signal="clickKeySwitchSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/PSLAllow" to="." method="onHandleSignal"] [connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/PSLAllow" to="." method="onHandleSignal"]
[connection signal="clickButtonSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/CloseDoorButton" to="." method="onHandleSignal"] [connection signal="clickButtonSignal" from="MarginContainer/GridContainer/MarginContainer/CloseDoorButton" to="." method="onHandleSignal"]
[connection signal="clickButtonSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/OpenDoorButton" to="." method="onHandleSignal"] [connection signal="clickButtonSignal" from="MarginContainer/GridContainer/OpenDoorButton" to="." method="onHandleSignal"]
[connection signal="clickKeySwitchSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/InterlockReleaseSwitch" to="." method="onHandleSignal"] [connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/InterlockReleaseSwitch" to="." method="onHandleSignal"]
[connection signal="clickKeySwitchSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/VBoxContainer/IBPHandle" to="." method="onHandleSignal"] [connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/MarginContainer2/VBoxContainer/IBPHandle" to="." method="onHandleSignal"]
[connection signal="clickButtonSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/VBoxContainer/LightTestButton" to="." method="onHandleSignal"] [connection signal="clickButtonSignal" from="MarginContainer/GridContainer/MarginContainer2/VBoxContainer/LightTestButton" to="." method="onHandleSignal"]
[connection signal="clickKeySwitchSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/PSTHandle" to="." method="onHandleSignal"] [connection signal="clickKeySwitchSignal" from="MarginContainer/GridContainer/PSTHandle" to="." method="onHandleSignal"]
[connection signal="clickButtonSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/trainDepartsButton" to="." method="onHandleSignal"] [connection signal="clickButtonSignal" from="MarginContainer/GridContainer/trainDepartsButton" to="." method="onHandleSignal"]
[connection signal="clickButtonSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/interconnectedCloseButton" to="." method="onHandleSignal"] [connection signal="clickButtonSignal" from="MarginContainer/GridContainer/interconnectedCloseButton" to="." method="onHandleSignal"]
[connection signal="clickButtonSignal" from="PanelContainer/VBoxContainer/MarginContainer/GridContainer/interconnectedOpenButton" to="." method="onHandleSignal"] [connection signal="clickButtonSignal" from="MarginContainer/GridContainer/interconnectedOpenButton" to="." method="onHandleSignal"]

View File

@ -31,11 +31,11 @@ func _on_show_button_pressed():
func shouAllKeys(): func shouAllKeys():
make_node_and_descendants_visible($PanelContainer/VBoxContainer/GridContainer) make_node_visible($PanelContainer/VBoxContainer/GridContainer)
static func make_node_and_descendants_visible(node: Node): func make_node_visible(node: Node):
node.visible = true node.visible = true
node.modulate.a = 255 node.modulate.a = 255
for child in node.get_children(): for child in node.get_children():
make_node_and_descendants_visible(child) make_node_visible(child)

View File

@ -79,7 +79,7 @@ position = Vector2i(1133, 325)
visible = false visible = false
[node name="psl" parent="." instance=ExtResource("6_e4hk2")] [node name="psl" parent="." instance=ExtResource("6_e4hk2")]
position = Vector2i(511, 85) position = Vector2i(568, 190)
visible = false visible = false
[connection signal="clickLPslSignal" from="PSL" to="psl" method="_on_psl_click_signal"] [connection signal="clickLPslSignal" from="PSL" to="psl" method="_on_psl_click_signal"]