Merge remote-tracking branch 'origin/demo'
This commit is contained in:
commit
bfd510039d
@ -8,6 +8,7 @@ signal exit(arg)
|
||||
|
||||
@export var packed_scene: PackedScene
|
||||
@export var quit_closeup_on_cancel := true
|
||||
@export var on_display_hide_hud := false
|
||||
@export var on_display_change_volumn := true
|
||||
@export var on_display_changed_volumn_db := -7.0
|
||||
@export_tool_button("新建特写场景") var create_closeup_scene = _create_scene_with_script
|
||||
@ -23,6 +24,7 @@ func _ready() -> void:
|
||||
return
|
||||
interacted.connect(display)
|
||||
|
||||
|
||||
func hold_cancel_before_exit() -> void:
|
||||
_holding_cancel_before_exit = true
|
||||
|
||||
@ -32,6 +34,8 @@ func display() -> void:
|
||||
if current_child:
|
||||
return
|
||||
if packed_scene:
|
||||
if on_display_hide_hud and SceneManager.get_ground().display_hud:
|
||||
SceneManager.get_prop_hud().hide_hud()
|
||||
if on_display_change_volumn:
|
||||
get_tree().call_group(GlobalConfig.GROUP_GROUND_SFX, "change_volumn_db" , on_display_changed_volumn_db)
|
||||
get_tree().call_group(GlobalConfig.GROUP_GROUND_SFX2D, "change_volumn_db" , on_display_changed_volumn_db)
|
||||
@ -48,6 +52,8 @@ func display() -> void:
|
||||
|
||||
func _exit(arg = null):
|
||||
if current_child:
|
||||
if on_display_hide_hud and SceneManager.get_ground().display_hud:
|
||||
SceneManager.get_prop_hud().display_hud()
|
||||
if on_display_change_volumn:
|
||||
get_tree().call_group(GlobalConfig.GROUP_GROUND_SFX, "reset_volumn_to_default")
|
||||
get_tree().call_group(GlobalConfig.GROUP_GROUND_SFX2D, "reset_volumn_to_default")
|
||||
@ -62,12 +68,13 @@ func _exit(arg = null):
|
||||
# exit 信号后,恢复处理 cancel 事件
|
||||
_holding_cancel_before_exit = false
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if not current_child:
|
||||
return
|
||||
if event.is_action_pressed("cancel"):
|
||||
get_viewport().set_input_as_handled()
|
||||
if quit_closeup_on_cancel and not _holding_cancel_before_exit:
|
||||
get_viewport().set_input_as_handled()
|
||||
_exit()
|
||||
# 在有特写界面时,阻塞 interact 输入
|
||||
elif event.is_action_pressed("interact"):
|
||||
|
@ -131,6 +131,7 @@ content_key = "c02_海报1"
|
||||
position = Vector2(253, -31)
|
||||
texture = ExtResource("10_jg8g0")
|
||||
packed_scene = ExtResource("11_jg8g0")
|
||||
on_display_hide_hud = true
|
||||
first_interact_os_key = "c02_海报_剪辫子侦探"
|
||||
|
||||
[node name="青岛啤酒" parent="Ground/DeployLayer" index="7" instance=ExtResource("12_0fckv")]
|
||||
@ -260,10 +261,7 @@ player_movement_rect = Rect2(19, -158, 667, 316)
|
||||
facing_direction = Vector2(1, 0)
|
||||
|
||||
[node name="CameraFocusMarker" parent="Ground" index="6"]
|
||||
limit_left = 0
|
||||
limit_top = -158
|
||||
limit_right = 700
|
||||
limit_bottom = 158
|
||||
|
||||
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
|
||||
points = PackedVector2Array(19, 150, 686, 150)
|
||||
|
@ -800,6 +800,7 @@ collision_width_and_x = Vector2(40, 0)
|
||||
[node name="Closeup敲门游戏" parent="Ground/DeployLayer" index="25" instance=ExtResource("23_81juy")]
|
||||
position = Vector2(466, 3)
|
||||
packed_scene = ExtResource("24_0o4rt")
|
||||
on_display_hide_hud = true
|
||||
collision_width_and_x = Vector2(40, 0)
|
||||
|
||||
[node name="Ambush惊悚闪电" parent="Ground/DeployLayer" index="26" instance=ExtResource("25_iyaiw")]
|
||||
@ -822,6 +823,7 @@ frame_progress = 0.643855
|
||||
z_index = 6
|
||||
position = Vector2(2063, 50)
|
||||
packed_scene = ExtResource("26_yy4fp")
|
||||
on_display_hide_hud = true
|
||||
action_key = 3
|
||||
|
||||
[node name="Npc井边疯子" parent="Ground/DeployLayer" index="30" instance=ExtResource("35_plfv5")]
|
||||
|
@ -92,6 +92,7 @@ texture = ExtResource("9_k74x7")
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(189, 15)
|
||||
packed_scene = ExtResource("7_fvlg0")
|
||||
on_display_hide_hud = true
|
||||
first_interact_os_key = "c02_保卫科祭台os"
|
||||
|
||||
[node name="Closeup老鼠精" parent="Ground/DeployLayer" index="7" instance=ExtResource("6_66gue")]
|
||||
@ -99,11 +100,13 @@ light_mask = 5
|
||||
position = Vector2(207.5, -40.5)
|
||||
texture = ExtResource("11_ffvrp")
|
||||
packed_scene = ExtResource("8_cm3g6")
|
||||
on_display_hide_hud = true
|
||||
|
||||
[node name="Closeup花名册" parent="Ground/DeployLayer" index="8" instance=ExtResource("6_66gue")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(351, 31)
|
||||
packed_scene = ExtResource("6_fvlg0")
|
||||
on_display_hide_hud = true
|
||||
first_interact_os_key = "c02_保卫科花名册os"
|
||||
|
||||
[node name="煤油灯" type="Sprite2D" parent="Ground/DeployLayer" index="9"]
|
||||
|
@ -185,6 +185,7 @@ hook_method = "wood_puppet"
|
||||
position = Vector2(-108, -168)
|
||||
packed_scene = ExtResource("10_7mq0m")
|
||||
quit_closeup_on_cancel = false
|
||||
on_display_hide_hud = true
|
||||
on_display_changed_volumn_db = 0.0
|
||||
action_key = 3
|
||||
first_interact_os_key = "c02_一楼戏台"
|
||||
@ -225,6 +226,7 @@ texture = ExtResource("8_mrltr")
|
||||
[node name="Closeup戏台" parent="Ground/DeployLayer" index="8" instance=ExtResource("10_2yvhw")]
|
||||
position = Vector2(305, -249)
|
||||
packed_scene = ExtResource("11_2yvhw")
|
||||
on_display_hide_hud = true
|
||||
first_interact_os_key = "c02_一楼戏台"
|
||||
|
||||
[node name="Note一楼内侧通道" parent="Ground/DeployLayer" index="9" instance=ExtResource("10_8t4w6")]
|
||||
|
@ -1237,12 +1237,14 @@ quit_closeup_on_cancel = false
|
||||
[node name="Closeup水盆" parent="Ground/DeployLayer" index="19" instance=ExtResource("11_owxx3")]
|
||||
position = Vector2(289, 16)
|
||||
packed_scene = ExtResource("16_p6da7")
|
||||
on_display_hide_hud = true
|
||||
first_interact_os_key = "c02_二楼水盆"
|
||||
|
||||
[node name="Closeup谢幕演出" parent="Ground/DeployLayer" index="20" instance=ExtResource("11_owxx3")]
|
||||
position = Vector2(518, -272)
|
||||
packed_scene = ExtResource("25_m28ab")
|
||||
quit_closeup_on_cancel = false
|
||||
on_display_hide_hud = true
|
||||
action_key = 3
|
||||
|
||||
[node name="c02_final" type="Node2D" parent="Ground/DeployLayer" index="21"]
|
||||
@ -1410,10 +1412,7 @@ player_movement_rect = Rect2(26, -158, 874, 316)
|
||||
facing_direction = Vector2(1, 0)
|
||||
|
||||
[node name="CameraFocusMarker" parent="Ground" index="6"]
|
||||
limit_left = 0
|
||||
limit_top = -158
|
||||
limit_right = 927
|
||||
limit_bottom = 158
|
||||
|
||||
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
|
||||
position = Vector2(0, -5)
|
||||
|
@ -77,6 +77,7 @@ position = Vector2(-5, 78)
|
||||
position = Vector2(292, -11)
|
||||
texture = ExtResource("10_6ivku")
|
||||
packed_scene = ExtResource("11_vxng8")
|
||||
on_display_hide_hud = true
|
||||
first_interact_os_key = "c02_海报_戏法班"
|
||||
|
||||
[node name="Note老鼠洞" parent="Ground/DeployLayer" index="7" instance=ExtResource("13_s75vl")]
|
||||
@ -115,10 +116,7 @@ position = Vector2(41, 98)
|
||||
player_movement_rect = Rect2(37, -158, 573, 316)
|
||||
|
||||
[node name="CameraFocusMarker" parent="Ground" index="6"]
|
||||
limit_left = 0
|
||||
limit_top = -158
|
||||
limit_right = 645
|
||||
limit_bottom = 158
|
||||
|
||||
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
|
||||
position = Vector2(11, -1)
|
||||
|
@ -204,11 +204,13 @@ texture_scale = 0.15
|
||||
[node name="Closeup画" parent="Ground/DeployLayer" index="3" instance=ExtResource("10_a48k2")]
|
||||
position = Vector2(214, -19)
|
||||
packed_scene = ExtResource("11_mc126")
|
||||
on_display_hide_hud = true
|
||||
enabled = false
|
||||
|
||||
[node name="Closeup讨厌他们" parent="Ground/DeployLayer" index="4" instance=ExtResource("10_a48k2")]
|
||||
position = Vector2(214, -19)
|
||||
packed_scene = ExtResource("16_nub1x")
|
||||
on_display_hide_hud = true
|
||||
enabled = false
|
||||
|
||||
[node name="灯座Sprite2D" type="Sprite2D" parent="Ground/DeployLayer" index="5"]
|
||||
@ -368,10 +370,7 @@ texture = SubResource("GradientTexture2D_bp5fr")
|
||||
current = true
|
||||
|
||||
[node name="CameraFocusMarker" parent="Ground" index="6"]
|
||||
limit_left = 0
|
||||
limit_top = -158
|
||||
limit_right = 725
|
||||
limit_bottom = 158
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0"]
|
||||
position = Vector2(291, 94)
|
||||
|
@ -183,6 +183,7 @@ texture = ExtResource("8_3ftnp")
|
||||
position = Vector2(349, 15)
|
||||
texture = ExtResource("18_3kyh4")
|
||||
packed_scene = ExtResource("18_5t4pt")
|
||||
on_display_hide_hud = true
|
||||
sign_mark_offset = Vector2(0, -7.93)
|
||||
first_interact_os_key = "c02_互动小蝉头套"
|
||||
|
||||
@ -271,12 +272,6 @@ position = Vector2(315, 98)
|
||||
player_movement_rect = Rect2(50, -158, 460, 316)
|
||||
facing_direction = Vector2(1, 0)
|
||||
|
||||
[node name="CameraFocusMarker" parent="Ground" index="6"]
|
||||
limit_left = 0
|
||||
limit_top = -158
|
||||
limit_right = 564
|
||||
limit_bottom = 158
|
||||
|
||||
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
|
||||
visible = false
|
||||
position = Vector2(193, 0)
|
||||
|
@ -149,6 +149,7 @@ metadata/_custom_type_script = "uid://bkkiyk5jkdw4d"
|
||||
position = Vector2(573, -6)
|
||||
texture = ExtResource("11_amci2")
|
||||
packed_scene = ExtResource("7_d27sg")
|
||||
on_display_hide_hud = true
|
||||
|
||||
[node name="EventBinder" type="Node" parent="Ground/DeployLayer/Event2D放肉后/CloseupDemo公告"]
|
||||
script = ExtResource("6_yaa68")
|
||||
|
@ -262,6 +262,13 @@ func _chechout_stage(s: int, play_sfx := true) -> void:
|
||||
stage = s
|
||||
_hide_all()
|
||||
var display_handle_outline = false
|
||||
if s >= 3:
|
||||
# 隐藏道具栏
|
||||
SceneManager.get_prop_hud().hide_hud()
|
||||
# 禁止退出特写
|
||||
var closeup = get_parent() as Closeup2D
|
||||
if closeup:
|
||||
closeup.hold_cancel_before_exit()
|
||||
# 1关闭 2打开 3放入小蝉人偶 4全部放置正确(可摇手柄) 5已播放完成
|
||||
match s:
|
||||
0:
|
||||
@ -326,6 +333,10 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
hud.on_toggle_invalid_prop()
|
||||
elif event.is_action_pressed("cancel"):
|
||||
get_viewport().set_input_as_handled()
|
||||
if stage == 3:
|
||||
# 摇把手阶段不可退出
|
||||
return
|
||||
SceneManager.get_prop_hud().display_hud()
|
||||
exit.emit(false)
|
||||
|
||||
|
||||
|
@ -73,6 +73,9 @@ var shooting = false
|
||||
|
||||
|
||||
func checkout_round(r: int):
|
||||
if r == 0:
|
||||
# 游戏开始,隐藏 hud
|
||||
SceneManager.get_prop_hud().hide_hud()
|
||||
round_id = r
|
||||
# 关闭所有碰撞
|
||||
for i in range(3):
|
||||
@ -260,6 +263,7 @@ func game_win() -> void:
|
||||
var scene = DialogueManager.show_dialogue_balloon_scene(dialog_balloon_scene, dialogue_c02, "c02_弹珠游戏4")
|
||||
await scene.ball_dialogue_ended
|
||||
await Util.wait(3.0)
|
||||
SceneManager.get_prop_hud().display_hud()
|
||||
exit.emit(true)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user