From 21d06ea5bcaece95251c3c688dac7dd2d2947996 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Mon, 18 Aug 2025 23:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E8=A6=81=E7=89=A9?= =?UTF-8?q?=E5=93=81=E8=AE=B0=E7=AC=94=E8=AE=B0=E5=8A=A8=E4=BD=9C=EF=BC=9B?= =?UTF-8?q?=E8=AE=B0=E7=AC=94=E8=AE=B0=E9=9F=B3=E6=95=88=EF=BC=88=E7=BA=BF?= =?UTF-8?q?=E7=B4=A2=20/=20=E9=87=8D=E8=A6=81=E7=89=A9=E5=93=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/event_manager/event_manager.gd | 3 +++ scene/ux/prop_hud.gd | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/manager/event_manager/event_manager.gd b/manager/event_manager/event_manager.gd index 149ac9a8..0d6e2ebb 100644 --- a/manager/event_manager/event_manager.gd +++ b/manager/event_manager/event_manager.gd @@ -52,6 +52,8 @@ func next_stage(event_name: StringName, stage_max := 99999) -> int: return new_stage return stage_max +# 写字声 +var note_sfx = preload("uid://cxeb1gsys78cb") # --- 游戏特定逻辑 --- func _on_stage_updated_for_handnote(event_name: StringName, stage: int) -> void: @@ -67,6 +69,7 @@ func _on_stage_updated_for_handnote(event_name: StringName, stage: int) -> void: # 笔记条目更新 # 0 初始化隐藏,1 开始显示,2 划掉,3 结束隐藏 if stage == 1: + AudioManager.play_sfx(note_sfx) SceneManager.lock_player(3.0, 16, true) SceneManager.pop_notification("ui_notify_note_update") diff --git a/scene/ux/prop_hud.gd b/scene/ux/prop_hud.gd index da2b26bd..1d77203e 100644 --- a/scene/ux/prop_hud.gd +++ b/scene/ux/prop_hud.gd @@ -554,11 +554,13 @@ func enable_important_item(prop_key: String, display_inspector: bool) -> void: return inventory.enable_important_item(prop_key) - SceneManager.pop_notification("ui_notify_important_item_update") if display_inspector: sfx_inspect.play() inspect_item(prop_key, false, true) + else: + # 如果不 inspect,则直接显示通知;否则在 inpect 结束后显示通知 + SceneManager.pop_notification("ui_notify_important_item_update") func enable_prop_item(prop_key: String, inspect := true) -> void: @@ -615,6 +617,8 @@ func inspect_item(prop_key: String, display_obtained := true, as_important_item inspector.hiding_tween_started.connect(_post_display_detail.bind(texture, full_content), CONNECT_ONE_SHOT) elif display_mode == "skip": inspector.pop_prop_inspection(prop_key, texture, true, describe_content) + # 检阅详情后增加记笔记动作 + inspector.quit_and_hidden.connect(_play_action_note, CONNECT_ONE_SHOT) else: inspector.pop_prop_inspection(prop_key, texture, display_obtained, describe_content) @@ -624,6 +628,17 @@ func _post_display_detail(texture, content) -> void: var wide = len(content) > 150 var inspector = SceneManager.get_inspector() as PropInspector inspector.pop_standard_inspection(texture, null, content, false, wide) + # 检阅详情后增加记笔记动作 + inspector.quit_and_hidden.connect(_play_action_note, CONNECT_ONE_SHOT) + +# 写字声 +var note_sfx = preload("uid://cxeb1gsys78cb") + +func _play_action_note() -> void: + # 显示通知的同时,玩家动作 + SceneManager.pop_notification("ui_notify_important_item_update") + SceneManager.lock_player(3.0, 16, true) + AudioManager.play_sfx(note_sfx) func disable_prop_item(prop_key: String) -> void: