jjtc调整

This commit is contained in:
joylink_fanyuhong 2024-04-28 11:21:59 +08:00
parent 30e7834bc4
commit a2bd1bca0c
13 changed files with 160 additions and 30 deletions

View File

@ -30,7 +30,7 @@
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../rts-sim-testing-client" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="RunDashboard">
<option name="ruleStates">

BIN
Assets/jjtc/jjtc_button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://350x85ekm0vo"
path="res://.godot/imported/jjtc_button.png-10c3ed825d171bce5dd07294454906f3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/jjtc/jjtc_button.png"
dest_files=["res://.godot/imported/jjtc_button.png-10c3ed825d171bce5dd07294454906f3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://c0j0dmes382ax"
path="res://.godot/imported/JJTC_Box_Voice.mp3-045199663e150f02531719627dd4e784.mp3str"
[deps]
source_file="res://Assets/music/JJTC_Box_Voice.mp3"
dest_files=["res://.godot/imported/JJTC_Box_Voice.mp3-045199663e150f02531719627dd4e784.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -19,4 +19,29 @@ func _on_jjtc_click_jjtc_signal():
func _on_close_requested():
$"../stationKeys".hide()
self.hide() # Replace with function body.
func _on_station_keys_gui_input(event):
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT:
$"../stationKeys".show()
$"../stationKeys".shouAllKeys()
func shouJJTCKey():
$JJTC_Key.show()
$JJTC_Right_Rotate.show()
$JJTC_Left_Rotate.show()
func _on_jjtc_button_gui_input(event):
print('jjtc button 按下')
pass # Replace with function body.
func _on_jjtc_button_mouse_entered():
$JJTC_Button.set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_jjtc_button_mouse_exited():
$PanelContainer/VBoxContainer/MarginContainer/JJTC_Box.set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)

View File

@ -1,13 +1,18 @@
[gd_scene load_steps=5 format=3 uid="uid://gjmtus0cnppi"]
[gd_scene load_steps=9 format=3 uid="uid://gjmtus0cnppi"]
[ext_resource type="Script" path="res://sceen/platform/TextureRect.gd" id="2_3cpku"]
[ext_resource type="Script" path="res://sceen/platform/JJTC_Box.gd" id="1_sa7p7"]
[ext_resource type="Script" path="res://UI/JJTC/jjlc.gd" id="1_ymor0"]
[ext_resource type="Texture2D" uid="uid://conkf5pl66e10" path="res://Assets/jjtc/jjtc_lockArea.png" id="3_0sd1y"]
[ext_resource type="Texture2D" uid="uid://cpmlwpev7rvbp" path="res://Assets/打开钥匙面板钥匙.png" id="3_3sobd"]
[ext_resource type="Texture2D" uid="uid://dwo21aihhep0w" path="res://Assets/jjtc/jjtc_ky.png" id="3_cilkf"]
[ext_resource type="Texture2D" uid="uid://350x85ekm0vo" path="res://Assets/jjtc/jjtc_button.png" id="3_t5xss"]
[ext_resource type="Texture2D" uid="uid://b7j3msd4bw0im" path="res://Assets/LCB_Arrow.svg" id="4_xrw3n"]
[ext_resource type="AudioStream" uid="uid://c0j0dmes382ax" path="res://Assets/music/JJTC_Box_Voice.mp3" id="7_khtfn"]
[node name="jjlc" type="Window"]
[node name="jjtc" type="Window"]
position = Vector2i(0, 36)
size = Vector2i(570, 512)
script = ExtResource("1_ymor0")
[node name="PanelContainer" type="PanelContainer" parent="."]
anchors_preset = -1
@ -23,9 +28,16 @@ layout_mode = 2
layout_mode = 2
theme_override_constants/margin_left = 60
[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/MarginContainer"]
[node name="JJTC_Box" type="TextureRect" parent="PanelContainer/VBoxContainer/MarginContainer"]
layout_mode = 2
script = ExtResource("2_3cpku")
script = ExtResource("1_sa7p7")
[node name="JJTC_Button" type="TextureRect" parent="."]
offset_left = 230.0
offset_top = 202.0
offset_right = 320.0
offset_bottom = 288.0
texture = ExtResource("3_t5xss")
[node name="Close_Click_Area" type="TextureRect" parent="."]
offset_left = 390.0
@ -34,27 +46,46 @@ offset_right = 470.0
offset_bottom = 530.0
texture = ExtResource("3_0sd1y")
[node name="TextureRect" type="TextureRect" parent="."]
[node name="StationKeys" type="TextureRect" parent="."]
offset_left = 525.0
offset_top = 100.0
offset_right = 593.0
offset_bottom = 250.0
scale = Vector2(0.5, 0.5)
texture = ExtResource("3_3sobd")
[node name="JJTC_Key" type="TextureRect" parent="."]
offset_left = 146.0
offset_top = 234.0
offset_right = 210.0
offset_bottom = 254.0
texture = ExtResource("3_cilkf")
[node name="JJLC_Right_Rotate" type="Sprite2D" parent="."]
[node name="JJTC_Right_Rotate" type="Sprite2D" parent="."]
position = Vector2(224, 210)
rotation = 0.912807
scale = Vector2(0.25, 0.25)
texture = ExtResource("4_xrw3n")
[node name="JJLC_Left_Rotate" type="Sprite2D" parent="."]
[node name="JJTC_Left_Rotate" type="Sprite2D" parent="."]
position = Vector2(132, 210)
rotation = -0.912807
scale = Vector2(0.25, 0.25)
texture = ExtResource("4_xrw3n")
flip_h = true
[connection signal="gui_input" from="Close_Click_Area" to="PanelContainer/VBoxContainer/MarginContainer/TextureRect" method="_on_close_click_area_gui_input"]
[connection signal="mouse_entered" from="Close_Click_Area" to="PanelContainer/VBoxContainer/MarginContainer/TextureRect" method="_on_close_click_area_mouse_entered"]
[connection signal="mouse_exited" from="Close_Click_Area" to="PanelContainer/VBoxContainer/MarginContainer/TextureRect" method="_on_close_click_area_mouse_exited"]
[connection signal="gui_input" from="TextureRect" to="PanelContainer/VBoxContainer/MarginContainer/TextureRect" method="_on_texture_rect_gui_input"]
[node name="JJTC_Box_Voice" type="AudioStreamPlayer" parent="."]
stream = ExtResource("7_khtfn")
[connection signal="gui_input" from="JJTC_Button" to="." method="_on_jjtc_button_gui_input"]
[connection signal="mouse_entered" from="JJTC_Button" to="." method="_on_jjtc_button_mouse_entered"]
[connection signal="mouse_exited" from="JJTC_Button" to="." method="_on_jjtc_button_mouse_exited"]
[connection signal="gui_input" from="Close_Click_Area" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_close_click_area_gui_input"]
[connection signal="mouse_entered" from="Close_Click_Area" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_close_click_area_mouse_entered"]
[connection signal="mouse_exited" from="Close_Click_Area" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_close_click_area_mouse_exited"]
[connection signal="gui_input" from="StationKeys" to="." method="_on_station_keys_gui_input"]
[connection signal="mouse_entered" from="StationKeys" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_station_keys_mouse_entered"]
[connection signal="mouse_exited" from="StationKeys" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_station_keys_mouse_exited"]
[connection signal="gui_input" from="JJTC_Key" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_texture_rect_gui_input"]
[connection signal="mouse_entered" from="JJTC_Key" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_texture_rect_mouse_entered"]
[connection signal="mouse_exited" from="JJTC_Key" to="PanelContainer/VBoxContainer/MarginContainer/JJTC_Box" method="_on_texture_rect_mouse_exited"]

View File

@ -23,6 +23,9 @@ func _on_button_pressed():
elif (current_focus.name.contains('HSJC')):
$"../psl".shouInterlockReleaseSwitchHandleKey()
$"../psl".grab_focus()
elif (current_focus.name.contains('JJTC')):
$"../jjtc".shouJJTCKey()
$"../jjtc".grab_focus()
func _on_close_requested():

View File

@ -9,7 +9,7 @@
[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" uid="uid://blixp06e6vnoe" path="res://UI/station_keys/hsjc_key_control.tscn" id="9_q6qly"]
[ext_resource type="PackedScene" 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"]

View File

@ -1,5 +1,5 @@
[gd_scene load_steps=2 format=3 uid="uid://dn7o6un5bypbq"]
[ext_resource type="PackedScene" uid="uid://m2y2cnlkw1gu" path="res://Model/train.blend" id="1_j1goo"]
[ext_resource type="PackedScene" uid="uid://bx2pauh0lw0sq" path="res://Model/train.blend" id="1_j1goo"]
[node name="train" instance=ExtResource("1_j1goo")]

View File

@ -8,9 +8,10 @@ var lockImg = preload("res://Assets/jjtc/jjtc_lock.png");
func _ready():
self.texture = lockImg;
$"../../../../Close_Click_Area".hide()
$"../../../../JJLC_Right_Rotate".hide()
$"../../../../JJLC_Left_Rotate".hide()
$"../../../../JJTC_Right_Rotate".hide()
$"../../../../JJTC_Left_Rotate".hide()
$"../../../../JJTC_Key".hide()
$"../../../../JJTC_Button".hide()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
@ -34,10 +35,12 @@ enum JJTC_STATE{
func _on_texture_rect_gui_input(event):
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT && jjtc_state == JJTC_STATE.CLOSE:
jjtc_state = JJTC_STATE.OPEN
$"../../../../TextureRect".hide()
$"../../../../JJLC_Right_Rotate".hide()
$"../../../../JJLC_Left_Rotate".hide()
$"../../../../JJTC_Box_Voice".play()
$"../../../../JJTC_Key".hide()
$"../../../../JJTC_Right_Rotate".hide()
$"../../../../JJTC_Left_Rotate".hide()
$"../../../../Close_Click_Area".show()
$"../../../../JJTC_Button".show()
func test_close_enter():
var mouse_position = get_global_mouse_position()
@ -55,7 +58,24 @@ func _on_close_click_area_mouse_exited():
func _on_close_click_area_gui_input(event):
if event.button_mask == MouseButtonMask.MOUSE_BUTTON_MASK_LEFT && jjtc_state == JJTC_STATE.OPEN:
jjtc_state = JJTC_STATE.CLOSE
$"../../../../TextureRect".show()
$"../../../../JJLC_Right_Rotate".show()
$"../../../../JJLC_Left_Rotate".show()
$"../../../../JJTC_Box_Voice".play()
$"../../../../JJTC_Key".show()
$"../../../../JJTC_Right_Rotate".show()
$"../../../../JJTC_Left_Rotate".show()
$"../../../../Close_Click_Area".hide()
func _on_station_keys_mouse_entered():
$"../../../../StationKeys".set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_station_keys_mouse_exited():
set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)
func _on_texture_rect_mouse_entered():
$"../../../../JJTC_Key".set_default_cursor_shape(Control.CursorShape.CURSOR_POINTING_HAND)
func _on_texture_rect_mouse_exited():
set_default_cursor_shape(Control.CursorShape.CURSOR_ARROW)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://cmnsn2joxo68l"]
[gd_scene load_steps=9 format=3 uid="uid://cmnsn2joxo68l"]
[ext_resource type="Script" path="res://sceen/platform/platform.gd" id="1_kerxo"]
[ext_resource type="PackedScene" uid="uid://dw3o1udrsmru8" path="res://Model/platform.blend" id="1_qvyng"]
@ -8,7 +8,6 @@
[ext_resource type="PackedScene" uid="uid://d167och8l6jms" path="res://UI/station_keys/station_keys_window.tscn" id="4_xd08d"]
[ext_resource type="PackedScene" uid="uid://dppmr7ifqt8oa" path="res://UI/psl/psl_window.tscn" id="6_e4hk2"]
[ext_resource type="PackedScene" uid="uid://gjmtus0cnppi" path="res://UI/JJTC/jjlc.tscn" id="7_5su0y"]
[ext_resource type="Script" path="res://UI/JJTC/jjlc.gd" id="9_wcp87"]
[node name="platform" type="Node3D"]
script = ExtResource("1_kerxo")
@ -33,12 +32,11 @@ visible = false
position = Vector2i(568, 190)
visible = false
[node name="jjlc" parent="." instance=ExtResource("7_5su0y")]
[node name="jjtc" parent="." instance=ExtResource("7_5su0y")]
position = Vector2i(518, 324)
visible = false
script = ExtResource("9_wcp87")
[connection signal="clickLPslSignal" from="PSL" to="psl" method="_on_psl_click_signal"]
[connection signal="clickJJTCSignal" from="JJTC" to="jjlc" method="_on_jjtc_click_jjtc_signal"]
[connection signal="clickJJTCSignal" from="JJTC" to="jjtc" method="_on_jjtc_click_jjtc_signal"]
[connection signal="close_requested" from="LCB" to="LCB" method="_on_close_requested"]
[connection signal="close_requested" from="jjlc" to="jjlc" method="_on_close_requested"]
[connection signal="close_requested" from="jjtc" to="jjtc" method="_on_close_requested"]