From fb214808804c9ef2fe5130580c104b2f2ffa4789 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Sun, 6 Jul 2025 01:04:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A4=9C=E8=A1=8C=E8=88=B9=E4=B8=AD?= =?UTF-8?q?=E8=8B=B1=E6=8E=92=E7=89=88=EF=BC=9B=E5=9B=9E=E5=BF=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=88=E4=BA=95+=E5=81=B7=E5=90=AC=EF=BC=89?= =?UTF-8?q?=EF=BC=9Bprop/local=20inspector=20=E6=96=87=E6=9C=AC=E5=8F=AF?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9F=A5=E7=9C=8B&=E5=B1=85=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=B8=94=E6=BB=9A=E8=BD=AE=E4=B8=8D=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E5=88=87=E6=8D=A2=E9=81=93=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/dialogue/item_description.csv | 4 +- asset/dialogue/item_description.dialogue | 4 +- asset/dialogue/names.csv | 16 +- ...gs.tres => 序章夜行船_label_settings.tres} | 0 manager/archive_manager/archive_manager.gd | 11 + manager/archive_manager/assembled_archive.gd | 2 + manager/event_manager/event_manager.gd | 3 - manager/scene/scene_manager.gd | 1 + project.godot | 4 +- scene/entity/closeup.gd | 4 - scene/entity/closeup_template.tscn | 1 + scene/entity/inspectable.gd | 76 ++-- scene/entity/inspectable.tscn | 43 ++- scene/entity/note.gd | 4 - scene/entity/npc.gd | 8 +- scene/ground/scene/animation_root.gd | 4 +- scene/ground/scene/c01/s05_院长房间.gd | 22 +- scene/ground/scene/c01/s05_院长房间.tscn | 325 ++++++++++-------- scene/ground/scene/c01/s08_书店.gd | 4 +- scene/ground/scene/c02/s01_公寓门口.gd | 8 +- scene/ground/scene/c02/s03_院子.gd | 6 + scene/ground/scene/debug_archive.txt | 118 +++++++ scene/ground/script/c02/井特写.gd | 2 +- scene/main.tscn | 14 +- scene/ux/bag/prop_bag.tscn | 12 +- scene/ux/bag/prop_bag_button.tscn | 5 +- scene/ux/memory/memory.gd | 24 +- scene/ux/memory/memory.tscn | 52 ++- scene/ux/prop_hud.gd | 7 + scene/ux/prop_inspector.gd | 11 + scene/ux/prop_inspector.tscn | 20 +- ui/text_helper.gd | 14 +- ui/vertical_label.tscn | 2 +- 33 files changed, 572 insertions(+), 259 deletions(-) rename config/{vertical_label_settings.tres => 序章夜行船_label_settings.tres} (100%) diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv index a98b63d4..c141280b 100644 --- a/asset/dialogue/item_description.csv +++ b/asset/dialogue/item_description.csv @@ -27,6 +27,7 @@ ui_new_archive,已创建新存档,,,,,New save file created ui_auto_saved,自动保存成功,,,,,Auto save successful ui_notify_important_item_update,重要物品已更新,,,,,Important items updated ui_notify_note_update,线索笔记已更新,,,,,Clue notes updated +ui_notify_mem_update,回忆已更新,,,,,"Memories updated" ui_center_notify_press_e_to_interact,按 E 可与场景互动,,,,,Press E to interact ui_center_notify_press_q_to_exit,按 Q 可退出,,,,,Press Q to exit ui_center_notify_use_prop,按 E 使用道具,,,,,Press E to use item @@ -46,7 +47,6 @@ ui_检阅,检阅,,,,,Examine ui_收起,收起,,,,,Put away ui_夜行船1,百岁光阴一梦蝶。,,,,,"A hundred years of life, like a butterfly's dream." ui_夜行船2,重回首往事堪嗟。,,,,,"Looking back, past events are cause for lament." -ui_夜行船3,今日春来。,,,,,Spring comes today. ui_夜行船4,今日春来,明朝花谢。,,,,,"Spring comes today, tomorrow the flowers will wither." ui_夜行船5,急罚盏夜阑灯灭。,,,,,Hastily draining cups as night deepens and lamps fade. ui_夜行船6,夜行船,,,,,Night Voyage @@ -109,7 +109,7 @@ c01_s07_需要报纸,书店还没开门。,,,,,The bookstore isn't open yet. c01_s08_书店工作,老板交代的工作还没做完,不能偷懒。,,,,,I haven't finished the work the boss assigned. I can't slack off. c01_s08_书店工钱,这个月的工钱还没拿。,,,,,I haven't collected this month's wages yet. mem_偷听对话,偷听对话,,,,,Eavesdropping -mem_疯子看井,疯子看井,,,,,Madman Looking at Well +mem_疯子看井,疯子看井,,,,,Madman Guards Well c01_鸡毛掸子,这是鸡毛掸子吗?,,,,,Is this a feather duster? c01_院长书桌,桌上放着一本《圣经》。{br}「得著生命的,將要失喪生命...」,,,,,There's a Bible on the desk.{br}'Whoever finds their life will lose it...' c01_院长床,这本书已经看过了。{br}...那些句子是什么意思呢?,,,,,I've already read this book.{br}...What do those sentences mean? diff --git a/asset/dialogue/item_description.dialogue b/asset/dialogue/item_description.dialogue index 9c57793f..3f917fc9 100644 --- a/asset/dialogue/item_description.dialogue +++ b/asset/dialogue/item_description.dialogue @@ -34,6 +34,8 @@ 重要物品已更新 [ID:ui_notify_important_item_update] 线索笔记已更新 [ID:ui_notify_note_update] +回忆已更新 [ID:ui_notify_mem_update] + 按 E 可与场景互动 [ID:ui_center_notify_press_e_to_interact] 按 Q 可退出 [ID:ui_center_notify_press_q_to_exit] @@ -56,7 +58,7 @@ 百岁光阴一梦蝶。 [ID:ui_夜行船1] 重回首往事堪嗟。 [ID:ui_夜行船2] -今日春来。 [ID:ui_夜行船3] +#今日春来 [ID:ui_夜行船3] 今日春来,明朝花谢。 [ID:ui_夜行船4] 急罚盏夜阑灯灭。 [ID:ui_夜行船5] 夜行船 [ID:ui_夜行船6] diff --git a/asset/dialogue/names.csv b/asset/dialogue/names.csv index 807439e8..75499caf 100644 --- a/asset/dialogue/names.csv +++ b/asset/dialogue/names.csv @@ -1,7 +1,7 @@ keys,zh_CN,en 老师,老师,"Teacher" -大胖,大胖,"Big Fatty" -监督小孩,监督小孩,"Supervising Child" +大胖,大胖,"Tubby" +监督小孩,监督小孩,"Monitor Kid" 书店老板,书店老板,"Bookstore Owner" 车夫,车夫,"Rickshaw Puller" 李兰,李兰,"Li Lan" @@ -12,13 +12,13 @@ keys,zh_CN,en 小蝉,小蝉,"Little Cicada" 男孩黄,男孩黄,"Boy in Yellow" 男孩蓝,男孩蓝,"Boy in Blue" -小肉圆,小肉圆,"Little Meatball" -小竹竿,小竹竿,"Little Bamboo Pole" -孩子王,孩子王,"King of the Kids" +小肉圆,小肉圆,"Pudgy" +小竹竿,小竹竿,"Skinny" +孩子王,孩子王,"Boss Kid" 小丁,小丁,"Xiao Ding" -蛋蛋,蛋蛋,"Dan Dan" -沫儿,沫儿,"Mo'er" +蛋蛋,蛋蛋,"Eggy" +沫儿,沫儿,"Bubbles" 陆仁,陆仁,"Lu Ren" 吕萍,吕萍,"Lu Ping" ???,???,"???" -小蝶,小蝶,"Little Butterfly" \ No newline at end of file +小蝶,小蝶,"Little Die" \ No newline at end of file diff --git a/config/vertical_label_settings.tres b/config/序章夜行船_label_settings.tres similarity index 100% rename from config/vertical_label_settings.tres rename to config/序章夜行船_label_settings.tres diff --git a/manager/archive_manager/archive_manager.gd b/manager/archive_manager/archive_manager.gd index 0dc37988..be34a4c1 100644 --- a/manager/archive_manager/archive_manager.gd +++ b/manager/archive_manager/archive_manager.gd @@ -285,3 +285,14 @@ func set_chapter_if_greater(c: int) -> void: archive.current_chapter = c # 笔记也进入下一章 EventManager.set_stage_if_greater("handnote_chapter_stage", c) + + +func unlock_memory(id: int) -> void: + if archive: + if archive.mem_display_dict.get(id): + print("memory already unlocked. id=", id) + return + archive.mem_display_dict[id] = true + SceneManager.pop_notification("ui_notify_mem_update") + else: + printerr("Archive is null, cannot unlock memory. id=", id) diff --git a/manager/archive_manager/assembled_archive.gd b/manager/archive_manager/assembled_archive.gd index 582d301f..84c88163 100644 --- a/manager/archive_manager/assembled_archive.gd +++ b/manager/archive_manager/assembled_archive.gd @@ -39,6 +39,8 @@ class_name AssembledArchive extends Resource @export var player_running_locked := true # prop hud 显示道具 @export var prop_inventory: PropInventory +# mem 展示 dict, 1-16 号 +@export var mem_display_dict: Dictionary[int, bool] = {} @export_group("八音盒", "bayinhe") @export var bayinhe_current_answer := [0, 0, 0, 0, 0, 0, 0, 0, 0] diff --git a/manager/event_manager/event_manager.gd b/manager/event_manager/event_manager.gd index a5876df7..7c940664 100644 --- a/manager/event_manager/event_manager.gd +++ b/manager/event_manager/event_manager.gd @@ -31,9 +31,6 @@ func set_stage(event_name: StringName, stage := 1) -> void: if stage == 1: SceneManager.lock_player(3.0, 16, true) SceneManager.pop_notification("ui_notify_note_update") - # 第一次记笔记,提示查看笔记 - if event_name == &"handnote_c02_road_address": - SceneManager.pop_center_notification("ui_center_notify_check_note") # 仅在设置的 stage > 当前 stage 时更新,相等或小于时不更新 diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index c8790dd6..c277d7ff 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -202,6 +202,7 @@ func enable_prop_item(prop_key: String) -> void: else: printerr("enable_prop_item PropHud node not found") + # display_inspector 的时候会伴随音效 func enable_important_item(prop_key: String, display_inspector = true) -> void: var prop_hud = get_prop_hud() diff --git a/project.godot b/project.godot index 5970480b..289a25f2 100644 --- a/project.godot +++ b/project.godot @@ -179,13 +179,11 @@ cancel={ prop_left={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null) -, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":8,"position":Vector2(229, 27),"global_position":Vector2(248, 118),"factor":0.0300018,"button_index":4,"canceled":false,"pressed":true,"double_click":false,"script":null) ] } prop_right={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null) -, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(427, 48),"global_position":Vector2(446, 139),"factor":0.0300018,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null) ] } escape={ @@ -224,7 +222,7 @@ panel={ locale/translation_remaps={ "res://asset/art/ui/note/c02_slices.png": PackedStringArray("res://asset/art/ui/note/c02_slices_en.png:en") } -locale/translations=PackedStringArray("res://asset/dialogue/c01.zh_CN.translation", "res://asset/dialogue/c02.zh_CN.translation", "res://asset/dialogue/inspect_content.zh_CN.translation", "res://asset/dialogue/item_description.zh_CN.translation", "res://asset/dialogue/names.zh_CN.translation", "res://asset/dialogue/npc.zh_CN.translation", "res://asset/dialogue/c01.zh_SH.translation", "res://asset/dialogue/纯中文_无需本地化.zh_CN.translation", "res://asset/dialogue/c01.en.translation", "res://asset/dialogue/c03.zh_CN.translation", "res://asset/dialogue/c04.zh_CN.translation", "res://asset/dialogue/c05.zh_CN.translation", "res://asset/dialogue/c06.zh_CN.translation", "res://asset/dialogue/item_description.en.translation", "res://asset/dialogue/item_description.zh_SH.translation", "res://asset/dialogue/c02.zh_SH.translation", "res://asset/dialogue/npc.zh_SH.translation") +locale/translations=PackedStringArray("res://asset/dialogue/c01.zh_CN.translation", "res://asset/dialogue/c02.zh_CN.translation", "res://asset/dialogue/inspect_content.zh_CN.translation", "res://asset/dialogue/item_description.zh_CN.translation", "res://asset/dialogue/names.zh_CN.translation", "res://asset/dialogue/npc.zh_CN.translation", "res://asset/dialogue/c01.zh_SH.translation", "res://asset/dialogue/纯中文_无需本地化.zh_CN.translation", "res://asset/dialogue/c01.en.translation", "res://asset/dialogue/c03.zh_CN.translation", "res://asset/dialogue/c04.zh_CN.translation", "res://asset/dialogue/c05.zh_CN.translation", "res://asset/dialogue/c06.zh_CN.translation", "res://asset/dialogue/item_description.en.translation", "res://asset/dialogue/item_description.zh_SH.translation", "res://asset/dialogue/c02.zh_SH.translation", "res://asset/dialogue/npc.zh_SH.translation", "res://asset/dialogue/c02.en.translation", "res://asset/dialogue/inspect_content.en.translation", "res://asset/dialogue/names.en.translation", "res://asset/dialogue/npc.en.translation") locale/translations_pot_files=PackedStringArray("res://asset/dialogue/item_description.dialogue", "res://asset/dialogue/c01.dialogue", "res://asset/dialogue/c02.dialogue", "res://asset/dialogue/inspect_content.dialogue", "res://asset/dialogue/npc.dialogue", "res://asset/dialogue/c03.dialogue", "res://asset/dialogue/c04.dialogue", "res://asset/dialogue/c05.dialogue", "res://asset/dialogue/c06.dialogue", "res://asset/dialogue/纯中文_无需本地化.dialogue", "res://asset/dialogue/event_stage.dialogue") locale/test="zh-Hans" locale/fallback="zh" diff --git a/scene/entity/closeup.gd b/scene/entity/closeup.gd index 852ec6e3..e70cf3aa 100644 --- a/scene/entity/closeup.gd +++ b/scene/entity/closeup.gd @@ -25,8 +25,6 @@ func display() -> void: if current_child: return if packed_scene: - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.lock_player(0, action_key) # 展示时,禁用 sign_mark 的输入 sign_mark.pass_unhandled_input = true @@ -40,8 +38,6 @@ func display() -> void: func _exit(arg = null): if current_child: - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.unlock_player() if current_child: remove_child(current_child) diff --git a/scene/entity/closeup_template.tscn b/scene/entity/closeup_template.tscn index e845c56d..2905ae75 100644 --- a/scene/entity/closeup_template.tscn +++ b/scene/entity/closeup_template.tscn @@ -56,3 +56,4 @@ grow_vertical = 2 vertical_alignment = 1 autowrap_mode = 3 script = ExtResource("5_ik70a") +vertical = null diff --git a/scene/entity/inspectable.gd b/scene/entity/inspectable.gd index 6f08c76f..8e4ba541 100644 --- a/scene/entity/inspectable.gd +++ b/scene/entity/inspectable.gd @@ -9,7 +9,7 @@ signal sign_mark_offset_updated # set(value): # entity_config = value -enum { STATUS_NORAML, STATUS_TRANSITIONING, STATUS_INSPECTING_COVER, STATUS_INSPECTING_NOTES } +enum { STATUS_HIDDEN, STATUS_TRANSITIONING, STATUS_INSPECTING_COVER, STATUS_INSPECTING_NOTES } @export var enabled := true: set(val): @@ -51,18 +51,28 @@ var content_key: String = "" @onready var sfx = %Sfx @onready var container = %Container @onready var cover_rect = %Cover as TextureRect +@onready var content_area = %ContentArea as Control @onready var content_label = %ContentLabel as Label @onready var tip_label = %TipLabel as Label -var tip_cover_hide_notes = "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_阅读") -var tip_cover_without_notes = "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_检阅") -var tip_notes = "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_收起") + +func tip_cover_hide_notes() -> String: + return "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_阅读") + + +func tip_cover_without_notes() -> String: + return "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_检阅") + + +func tip_notes() -> String: + return "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_收起") + static var content_dialogue = ( preload("res://asset/dialogue/inspect_content.dialogue") as DialogueResource ) -var status := STATUS_NORAML +var status := STATUS_HIDDEN var blinking_tween: Tween var ground_archive: GroundArchive @@ -81,9 +91,8 @@ func _ready() -> void: shape.size.x = collision_width_and_x.x area2d.position.x = collision_width_and_x.y container.modulate.a = 0.0 - content_label.modulate.a = 0.0 - content_label.text = _get_tr_content() - tip_label.text = tip_cover_hide_notes + content_area.modulate.a = 0.0 + tip_label.text = tip_cover_hide_notes() cover_rect.texture = texture_cover if Engine.is_editor_hint(): return @@ -113,7 +122,7 @@ func _get_tr_content(): while line_id and line_id != "end": var line = content_dialogue.lines[line_id] if line.has("text"): - inspection_note += tr(line.get("text")) + "\n" + inspection_note += tr(line.get("translation_key")) + "\n" line_id = line.get("next_id") return inspection_note @@ -134,10 +143,14 @@ func _on_interacted() -> void: func _do_action() -> void: - if status == STATUS_NORAML: + if status == STATUS_HIDDEN: + # 刷新文本 translation + if TranslationServer.get_locale().begins_with("zh_"): + content_label.add_theme_font_size_override("font_size", 0) + else: + content_label.add_theme_font_size_override("font_size", 7) + content_label.text = _get_tr_content() # 不使用 lock player, 因为需要用 sign 进行继续交互 - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.freeze_player(0, action_key) status = STATUS_TRANSITIONING icount += 1 @@ -154,28 +167,28 @@ func _do_action() -> void: sign_mark.display_sign = false cover_rect.texture = texture_cover if content_key == "": - tip_label.text = tip_cover_without_notes + tip_label.text = tip_cover_without_notes() else: - tip_label.text = tip_cover_hide_notes + tip_label.text = tip_cover_hide_notes() _blink_label(true) start_inspecting.emit() elif status == STATUS_INSPECTING_COVER: sfx.play() status = STATUS_INSPECTING_NOTES - tip_label.text = tip_notes - create_tween().tween_property(content_label, "modulate:a", 1.0, 0.15) + tip_label.text = tip_notes() + create_tween().tween_property(content_area, "modulate:a", 1.0, 0.15) elif status == STATUS_INSPECTING_NOTES: sfx.play() status = STATUS_INSPECTING_COVER if content_key == "": - tip_label.text = tip_cover_without_notes + tip_label.text = tip_cover_without_notes() else: - tip_label.text = tip_cover_hide_notes - create_tween().tween_property(content_label, "modulate:a", 0.0, 0.15) + tip_label.text = tip_cover_hide_notes() + create_tween().tween_property(content_area, "modulate:a", 0.0, 0.15) func _blink_label(init := true): - if status == STATUS_NORAML: + if status == STATUS_HIDDEN: return blinking_tween = create_tween() if init: @@ -187,7 +200,7 @@ func _blink_label(init := true): func _on_cancel(_body = null): - if STATUS_TRANSITIONING == status or status == STATUS_NORAML: + if STATUS_TRANSITIONING == status or status == STATUS_HIDDEN: return quit_inspecting.emit() status = STATUS_TRANSITIONING @@ -197,11 +210,9 @@ func _on_cancel(_body = null): blinking_tween.kill() tween.parallel().tween_property(tip_label, "modulate:a", 0.0, 0.15) tween.tween_interval(1.0) - tween.tween_callback(func(): status = STATUS_NORAML) - tween.tween_callback(func(): content_label.modulate.a = 0.0) + tween.tween_callback(func(): status = STATUS_HIDDEN) + tween.tween_callback(func(): content_area.modulate.a = 0.0) SceneManager.focus_player_and_reset_zoom() - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.release_player() sign_mark.display_sign = true # 改变信号源 @@ -212,7 +223,6 @@ func _on_cancel(_body = null): func _set(property: StringName, value: Variant) -> bool: if property == "content_key": content_key = value - content_label.text = _get_tr_content() return true return false @@ -246,3 +256,17 @@ func _get_property_list() -> Array[Dictionary]: func _filter_property(property: StringName) -> bool: return property.find(editor_filter) >= 0 + + +func _unhandled_input(event: InputEvent) -> void: + if status == STATUS_INSPECTING_NOTES: + # 阅读状态下,消费鼠标滚轮事件 + if ( + event is InputEventMouseButton + and ( + event.button_index == MOUSE_BUTTON_WHEEL_DOWN + or event.button_index == MOUSE_BUTTON_WHEEL_UP + ) + ): + get_viewport().set_input_as_handled() + # print("[inspectable] mouse wheel handled") diff --git a/scene/entity/inspectable.tscn b/scene/entity/inspectable.tscn index 75fa0450..4b98e03c 100644 --- a/scene/entity/inspectable.tscn +++ b/scene/entity/inspectable.tscn @@ -82,19 +82,14 @@ size_flags_horizontal = 4 size_flags_vertical = 4 mouse_filter = 2 -[node name="ContentLabel" type="Label" parent="InspectLayer/Root/Container"] +[node name="ContentArea" type="Control" parent="InspectLayer/Root/Container"] unique_name_in_owner = true modulate = Color(1, 1, 1, 0) -z_index = 100 -custom_minimum_size = Vector2(130, 0) layout_mode = 2 -size_flags_horizontal = 4 -vertical_alignment = 1 -autowrap_mode = 3 +mouse_filter = 2 -[node name="TextureRect" type="TextureRect" parent="InspectLayer/Root/Container/ContentLabel"] +[node name="TextureRect" type="TextureRect" parent="InspectLayer/Root/Container/ContentArea"] self_modulate = Color(1, 1, 1, 0.733333) -show_behind_parent = true layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -104,6 +99,36 @@ grow_vertical = 2 mouse_filter = 2 texture = ExtResource("7_xawjo") +[node name="ScrollContainer" type="ScrollContainer" parent="InspectLayer/Root/Container/ContentArea"] +custom_minimum_size = Vector2(0, 200) +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -65.0 +offset_top = -75.0 +offset_right = 65.0 +offset_bottom = 75.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 0 +horizontal_scroll_mode = 0 +vertical_scroll_mode = 3 + +[node name="ContentLabel" type="Label" parent="InspectLayer/Root/Container/ContentArea/ScrollContainer"] +unique_name_in_owner = true +z_index = 100 +custom_minimum_size = Vector2(130, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 6 +text = "tdb119a3714,据闻奉贤县分水墩有两人染受鼠疫毙命,医官拟将死者尸骸解剖以观受病之原因及其情状,竟未得死者家属之同意,以该处风气闭塞,闻解剖之说,地方人民甚为惊骇,闻已有聚众滋闹之事,并闻医官已被人殴打,政府以防疫事宜关系紧要拟改令赴沪南区一带调查防疫事宜云。,,,,\"It is reported that two people in Fenshuidun, Fengxian County have died from plague. Medical officials proposed to autopsy the bodies to examine the cause and nature of the disease, but failed to obtain consent from the families of the deceased. Due to the conservative local customs, the mention of autopsy has greatly alarmed the local people. There are reports of crowds gathering to cause trouble, and medical officials have been assaulted. Given the critical importance of epidemic prevention, the government plans to redirect orders to investigate epidemic prevention matters in the southern Shanghai area.\" +" +vertical_alignment = 1 +autowrap_mode = 3 + [node name="MarginContainer" type="MarginContainer" parent="InspectLayer/Root"] layout_mode = 2 offset_top = 263.0 @@ -121,7 +146,7 @@ layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 8 theme_override_fonts/font = ExtResource("7_ianbs") -text = "Q: 退出 E: 阅读" +text = "Q: Exit E: Read" horizontal_alignment = 1 vertical_alignment = 1 diff --git a/scene/entity/note.gd b/scene/entity/note.gd index d24552d9..fbb4ab0a 100644 --- a/scene/entity/note.gd +++ b/scene/entity/note.gd @@ -125,12 +125,8 @@ func _show_balloon(res, title): # SceneManager.focus_node(self) DialogueManager.show_dialogue_balloon(res, title) # note viewing animation - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.lock_player(0, action) await DialogueManager.dialogue_ended - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.unlock_player() diff --git a/scene/entity/npc.gd b/scene/entity/npc.gd index 4ccdbbe6..94a2884a 100644 --- a/scene/entity/npc.gd +++ b/scene/entity/npc.gd @@ -2,6 +2,8 @@ class_name Npc2D extends AnimatedSprite2D signal interacted +# 在 unlock player 之前发射 +signal talk_finished # <0 means no walk to edge @export var snap_to_edge := true @@ -140,8 +142,6 @@ func _on_toggle_active(activated: bool) -> void: func _on_interacted() -> void: # play dialogue if dialogue_title: - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") SceneManager.lock_player(0, action_key) icount += 1 ground_archive.set_pair(name, "icount", icount) @@ -150,8 +150,8 @@ func _on_interacted() -> void: speaking_sign_mode = 2 await DialogueManager.dialogue_ended speaking_sign_mode = 1 - if GlobalConfig.DEBUG: - print("[" + name + "] call lock") + # 在 unlock 之前发射 + talk_finished.emit() SceneManager.unlock_player() diff --git a/scene/ground/scene/animation_root.gd b/scene/ground/scene/animation_root.gd index dbdff996..7a8020bc 100644 --- a/scene/ground/scene/animation_root.gd +++ b/scene/ground/scene/animation_root.gd @@ -326,10 +326,10 @@ func _find_props(props: Dictionary, node: Node) -> void: if child.prop_key != &"": props[child.prop_key] = true print("Find Interactable2D prop1: " + child.prop_key) - elif child.prop_key2 != &"": + if child.prop_key2 != &"": props[child.prop_key2] = true print("Find Interactable2D prop2: " + child.prop_key2) - elif child.prop_key3 != &"": + if child.prop_key3 != &"": props[child.prop_key3] = true print("Find Interactable2D prop3: " + child.prop_key3) elif child is Pickable2D: diff --git a/scene/ground/scene/c01/s05_院长房间.gd b/scene/ground/scene/c01/s05_院长房间.gd index 3608089b..f3808121 100644 --- a/scene/ground/scene/c01/s05_院长房间.gd +++ b/scene/ground/scene/c01/s05_院长房间.gd @@ -10,16 +10,27 @@ var piano: Interactable2D # 覆盖该方法 func _default_data() -> Dictionary: - return {"frame_relocated": false, - "intro_played": false - } + return {"frame_relocated": false, "intro_played": false} func _ready() -> void: super._ready() - + + +func _setup_display_on_locale(): + var is_zh = TranslationServer.get_locale().begins_with("zh_") + # 其他语言 + $"Intro/Content/水平排版".visible = not is_zh + $"Intro/Content/竖直排版".visible = is_zh + + +func _notification(what: int) -> void: + if what == NOTIFICATION_TRANSLATION_CHANGED: + _setup_display_on_locale() + func intro_start(): + _setup_display_on_locale() SceneManager.lock_player() await animation_finished SceneManager.unlock_player() @@ -28,6 +39,7 @@ func intro_start(): show_interact_help() set_data("intro_played", true) + func play_intro_dialogue(): # 直接使用 sfx,防止下方字幕与全屏文字重复 $intro_audio_player.play() @@ -99,10 +111,12 @@ func _on_ambush_triggered(): # 鸡毛掸子 4.5s,再等待 3s 后掉落纸片 Util.timer(8, _play_paper_animation) + func lock_on_use_stick(): SceneManager.lock_player(4.0) SceneManager.get_player().walk_to_x(261.0) + func _play_paper_animation(): # 播放纸片动画 paper.enabled = true diff --git a/scene/ground/scene/c01/s05_院长房间.tscn b/scene/ground/scene/c01/s05_院长房间.tscn index ab53d83f..c18a520b 100644 --- a/scene/ground/scene/c01/s05_院长房间.tscn +++ b/scene/ground/scene/c01/s05_院长房间.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=37 format=3 uid="uid://dlx5xxbg53rb8"] +[gd_scene load_steps=38 format=3 uid="uid://dlx5xxbg53rb8"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_ff4yb"] [ext_resource type="Script" uid="uid://q2qgg85xa6ie" path="res://scene/ground/scene/c01/s05_院长房间.gd" id="2_j5oim"] @@ -27,8 +27,9 @@ [ext_resource type="Texture2D" uid="uid://bloct6cpdt2qi" path="res://asset/art/scene/c01/s05_院长房间/l_墙.png" id="16_qh7fg"] [ext_resource type="Texture2D" uid="uid://df30bmtgdoqc3" path="res://asset/art/scene/c01/s05_院长房间/l_窗户光源.png" id="17_qqw2v"] [ext_resource type="AudioStream" uid="uid://dky3j8lwcy5sk" path="res://asset/audio/sfx/UI/物品查看.mp3" id="17_yfgov"] -[ext_resource type="PackedScene" uid="uid://dw0s23v7qmj28" path="res://ui/vertical_label.tscn" id="20_t1dxj"] [ext_resource type="Texture2D" uid="uid://gui0ubwlwoi0" path="res://asset/art/ui/action_mark/UI手.png" id="22_00ufd"] +[ext_resource type="LabelSettings" uid="uid://dd6jhbqr6uh3x" path="res://config/序章夜行船_label_settings.tres" id="28_8gx6s"] +[ext_resource type="Script" uid="uid://dpocj5al0rvai" path="res://ui/text_helper.gd" id="29_247wt"] [sub_resource type="Animation" id="Animation_c6mhi"] length = 0.001 @@ -95,7 +96,7 @@ tracks/4/keys = { tracks/5/type = "value" tracks/5/imported = false tracks/5/enabled = true -tracks/5/path = NodePath("Intro:visible") +tracks/5/path = NodePath("AnimationPlayer/Intro:visible") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/keys = { @@ -107,7 +108,7 @@ tracks/5/keys = { tracks/6/type = "value" tracks/6/imported = false tracks/6/enabled = true -tracks/6/path = NodePath("Intro:modulate") +tracks/6/path = NodePath("AnimationPlayer/Intro:modulate") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/keys = { @@ -263,7 +264,7 @@ tracks/18/keys = { tracks/19/type = "value" tracks/19/imported = false tracks/19/enabled = true -tracks/19/path = NodePath("Intro/HBoxContainer:modulate") +tracks/19/path = NodePath("AnimationPlayer/Intro/Content:modulate") tracks/19/interp = 1 tracks/19/loop_wrap = true tracks/19/keys = { @@ -292,7 +293,7 @@ capture_included = true tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true -tracks/0/path = NodePath("Intro:visible") +tracks/0/path = NodePath("AnimationPlayer/Intro:visible") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { @@ -304,7 +305,7 @@ tracks/0/keys = { tracks/1/type = "value" tracks/1/imported = false tracks/1/enabled = true -tracks/1/path = NodePath("Intro:modulate") +tracks/1/path = NodePath("AnimationPlayer/Intro:modulate") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { @@ -372,7 +373,7 @@ tracks/5/keys = { tracks/6/type = "method" tracks/6/imported = false tracks/6/enabled = true -tracks/6/path = NodePath("Intro") +tracks/6/path = NodePath("AnimationPlayer/Intro") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/keys = { @@ -422,7 +423,7 @@ tracks/9/keys = { tracks/10/type = "value" tracks/10/imported = false tracks/10/enabled = true -tracks/10/path = NodePath("Intro/HBoxContainer:modulate") +tracks/10/path = NodePath("AnimationPlayer/Intro/Content:modulate") tracks/10/interp = 1 tracks/10/loop_wrap = true tracks/10/keys = { @@ -643,33 +644,198 @@ libraries = { } script = ExtResource("2_j5oim") -[node name="intro_audio_player" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="0"] +[node name="Intro" type="ColorRect" parent="Ground/AnimationPlayer" index="0"] +visible = false +z_index = 100 +custom_minimum_size = Vector2(564, 318) +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -158.0 +offset_bottom = -156.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +color = Color(0, 0, 0, 1) + +[node name="Content" type="MarginContainer" parent="Ground/AnimationPlayer/Intro"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -46.0 +offset_top = -90.5 +offset_right = 46.0 +offset_bottom = 90.5 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="竖直排版" type="HBoxContainer" parent="Ground/AnimationPlayer/Intro/Content"] +visible = false +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 + +[node name="VerticalLabel6" type="Label" parent="Ground/AnimationPlayer/Intro/Content/竖直排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "急 +罚 +盏 +夜 +阑 +灯 +灭 +。 +" +label_settings = ExtResource("28_8gx6s") +text_overrun_behavior = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船5" +vertical = true + +[node name="MarginContainer2" type="MarginContainer" parent="Ground/AnimationPlayer/Intro/Content/竖直排版"] +layout_mode = 2 +mouse_filter = 2 +theme_override_constants/margin_top = 30 + +[node name="VerticalLabel2" type="Label" parent="Ground/AnimationPlayer/Intro/Content/竖直排版/MarginContainer2"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "今 +日 +春 +来 +, +明 +朝 +花 +谢 +。 +" +label_settings = ExtResource("28_8gx6s") +text_overrun_behavior = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船4" +vertical = true + +[node name="VerticalLabel4" type="Label" parent="Ground/AnimationPlayer/Intro/Content/竖直排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "重 +回 +首 +往 +事 +堪 +嗟 +。 +" +label_settings = ExtResource("28_8gx6s") +text_overrun_behavior = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船2" +vertical = true + +[node name="VerticalLabel3" type="Label" parent="Ground/AnimationPlayer/Intro/Content/竖直排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "百 +岁 +光 +阴 +一 +梦 +蝶 +。 +" +label_settings = ExtResource("28_8gx6s") +text_overrun_behavior = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船1" +vertical = true + +[node name="水平排版" type="VBoxContainer" parent="Ground/AnimationPlayer/Intro/Content"] +visible = false +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +mouse_filter = 2 + +[node name="VerticalLabel4" type="Label" parent="Ground/AnimationPlayer/Intro/Content/水平排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "百岁光阴一梦蝶。" +label_settings = ExtResource("28_8gx6s") +horizontal_alignment = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船1" + +[node name="VerticalLabel5" type="Label" parent="Ground/AnimationPlayer/Intro/Content/水平排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "重回首往事堪嗟。" +label_settings = ExtResource("28_8gx6s") +horizontal_alignment = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船2" + +[node name="VerticalLabel6" type="Label" parent="Ground/AnimationPlayer/Intro/Content/水平排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "今日春来,明朝花谢。" +label_settings = ExtResource("28_8gx6s") +horizontal_alignment = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船4" + +[node name="VerticalLabel7" type="Label" parent="Ground/AnimationPlayer/Intro/Content/水平排版"] +auto_translate_mode = 2 +custom_minimum_size = Vector2(20, 0) +layout_mode = 2 +text = "急罚盏夜阑灯灭。" +label_settings = ExtResource("28_8gx6s") +horizontal_alignment = 1 +script = ExtResource("29_247wt") +translation_key = "ui_夜行船5" + +[node name="intro_audio_player" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="1"] stream = ExtResource("3_sluu3") volume_db = -10.0 bus = &"game_sfx" script = ExtResource("4_1jor4") metadata/_custom_type_script = "uid://rq6w1vuhuq1m" -[node name="piano_player" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="1"] +[node name="piano_player" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="2"] bus = &"game_sfx" script = ExtResource("4_1jor4") metadata/_custom_type_script = "uid://rq6w1vuhuq1m" -[node name="扶正相框" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="2"] +[node name="扶正相框" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="3"] stream = ExtResource("3_jk3np") volume_db = -6.933 bus = &"game_sfx" script = ExtResource("4_1jor4") metadata/_custom_type_script = "uid://rq6w1vuhuq1m" -[node name="捡起纸片后开门声" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="3"] +[node name="捡起纸片后开门声" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="4"] stream = ExtResource("5_1jor4") volume_db = -2.0 bus = &"game_sfx" script = ExtResource("4_1jor4") metadata/_custom_type_script = "uid://rq6w1vuhuq1m" -[node name="下床与铃声音效" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="4"] +[node name="下床与铃声音效" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="5"] stream = SubResource("AudioStreamSynchronized_sluu3") bus = &"game_sfx" script = ExtResource("4_1jor4") @@ -830,137 +996,6 @@ rotation = -0.000622023 energy = 0.3 blend_mode = 1 -[node name="Intro" type="ColorRect" parent="Ground"] -visible = false -custom_minimum_size = Vector2(564, 318) -anchors_preset = 4 -anchor_top = 0.5 -anchor_bottom = 0.5 -offset_top = -159.0 -offset_right = 564.0 -offset_bottom = 159.0 -grow_vertical = 2 -mouse_filter = 2 -color = Color(0, 0, 0, 1) - -[node name="HBoxContainer" type="HBoxContainer" parent="Ground/Intro"] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -34.0 -offset_top = -10.0 -offset_right = 34.0 -offset_bottom = 10.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 - -[node name="MarginContainer" type="MarginContainer" parent="Ground/Intro/HBoxContainer"] -layout_mode = 2 -mouse_filter = 2 -theme_override_constants/margin_top = 70 -theme_override_constants/margin_right = 20 - -[node name="VerticalLabel" parent="Ground/Intro/HBoxContainer/MarginContainer" instance=ExtResource("20_t1dxj")] -visible = false -custom_minimum_size = Vector2(20, 0) -layout_mode = 2 -text = "u -i -_ -夜 -行 -船 -6 -" -text_overrun_behavior = 1 -text_key = "ui_夜行船6" - -[node name="VerticalLabel6" parent="Ground/Intro/HBoxContainer" instance=ExtResource("20_t1dxj")] -custom_minimum_size = Vector2(20, 0) -layout_mode = 2 -text = "u -i -_ -夜 -行 -船 -5 -" -text_overrun_behavior = 1 -text_key = "ui_夜行船5" - -[node name="MarginContainer2" type="MarginContainer" parent="Ground/Intro/HBoxContainer"] -layout_mode = 2 -mouse_filter = 2 -theme_override_constants/margin_top = 30 - -[node name="VerticalLabel2" parent="Ground/Intro/HBoxContainer/MarginContainer2" instance=ExtResource("20_t1dxj")] -custom_minimum_size = Vector2(20, 0) -layout_mode = 2 -text = "u -i -_ -夜 -行 -船 -4 -" -text_overrun_behavior = 1 -text_key = "ui_夜行船4" - -[node name="MarginContainer3" type="MarginContainer" parent="Ground/Intro/HBoxContainer"] -visible = false -layout_mode = 2 -mouse_filter = 2 -theme_override_constants/margin_top = -30 - -[node name="VerticalLabel5" parent="Ground/Intro/HBoxContainer/MarginContainer3" instance=ExtResource("20_t1dxj")] -visible = false -custom_minimum_size = Vector2(20, 0) -layout_mode = 2 -text = "u -i -_ -夜 -行 -船 -3 -" -text_overrun_behavior = 1 -text_key = "ui_夜行船3" - -[node name="VerticalLabel4" parent="Ground/Intro/HBoxContainer" instance=ExtResource("20_t1dxj")] -custom_minimum_size = Vector2(20, 0) -layout_mode = 2 -text = "u -i -_ -夜 -行 -船 -2 -" -text_overrun_behavior = 1 -text_key = "ui_夜行船2" - -[node name="VerticalLabel3" parent="Ground/Intro/HBoxContainer" instance=ExtResource("20_t1dxj")] -custom_minimum_size = Vector2(20, 0) -layout_mode = 2 -text = "u -i -_ -夜 -行 -船 -1 -" -text_overrun_behavior = 1 -text_key = "ui_夜行船1" - [node name="参考" type="Sprite2D" parent="."] visible = false modulate = Color(1, 1, 1, 0.219608) diff --git a/scene/ground/scene/c01/s08_书店.gd b/scene/ground/scene/c01/s08_书店.gd index 508186e4..c633f8b7 100644 --- a/scene/ground/scene/c01/s08_书店.gd +++ b/scene/ground/scene/c01/s08_书店.gd @@ -90,11 +90,11 @@ func _on_envolope_table_interacted() -> void: func first_enter_door() -> void: - SceneManager.freeze_player(0) + SceneManager.lock_player() await Util.wait(1.5) DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s08_书店进门老板台词") await DialogueManager.dialogue_ended - SceneManager.release_player() + SceneManager.unlock_player() func assign_tasks() -> void: diff --git a/scene/ground/scene/c02/s01_公寓门口.gd b/scene/ground/scene/c02/s01_公寓门口.gd index b8a833c9..22e66cdf 100644 --- a/scene/ground/scene/c02/s01_公寓门口.gd +++ b/scene/ground/scene/c02/s01_公寓门口.gd @@ -17,8 +17,10 @@ func _ready() -> void: func _on_ground_ready() -> void: SceneManager.get_player().set_facing_direction(Vector2.RIGHT) SceneManager.get_player().update_x_with_camera_followed(78.0) + # 先更新地址,提示查看线索笔记 + EventManager.set_stage_if_greater(&"handnote_c02_road_address", 1) + SceneManager.pop_center_notification("ui_center_notify_check_note") + ArchiveManager.set_chapter_if_greater(2) SceneManager.enable_important_item("prop_眼镜盒") SceneManager.enable_important_item("prop_船票") - await SceneManager.pop_os_with_str("c02_s01_下黄包车") - ArchiveManager.set_chapter_if_greater(2) - EventManager.set_stage_if_greater(&"handnote_c02_road_address", 1) + SceneManager.pop_os_with_str("c02_s01_下黄包车") \ No newline at end of file diff --git a/scene/ground/scene/c02/s03_院子.gd b/scene/ground/scene/c02/s03_院子.gd index 4c5058e0..85f6bce1 100644 --- a/scene/ground/scene/c02/s03_院子.gd +++ b/scene/ground/scene/c02/s03_院子.gd @@ -73,6 +73,10 @@ func _on_ground_ready() -> void: $"../DeployLayer/Closeup井".exit.connect(func(_arg): madman_npc.visible = true) else: madman_npc.visible = true + madman_npc.talk_finished.connect(func(): + # 2 号为井边记忆 + ArchiveManager.unlock_memory(2) + ) if ArchiveManager.get_global_value(&"c02_show_grounded_coins"): # 奠字 + 纸钱 @@ -191,6 +195,8 @@ func eavesdrop() -> void: await Util.wait(1.5) await SceneManager.pop_os_with_str("c02_偷听李癞对话后") EventManager.set_stage_if_greater(&"handnote_c02_meat_knockDoor", 1) + # 1 号为偷听对话 + ArchiveManager.unlock_memory(1) SceneManager.unlock_player() diff --git a/scene/ground/scene/debug_archive.txt b/scene/ground/scene/debug_archive.txt index 573e955e..96d4bf51 100644 --- a/scene/ground/scene/debug_archive.txt +++ b/scene/ground/scene/debug_archive.txt @@ -1,4 +1,122 @@ { +"c01_s05_院长房间": { +"global": { +"enabled_items": {}, +"player_x": 30.0 +}, +"ground": { +&"AnimationPlayer": { +"intro_played": true +}, +&"ambush鸡毛掸子": { +"played": false +}, +&"oneshot纸片": { +"interacted_times": 0 +}, +&"钢琴": { +"interacted_times": 0 +} +} +}, +"c01_s08_书店": { +"global": { +"c01_shelf_game_success": false, +"enabled_items": { +"prop_信碎片1": true, +"prop_信碎片2": true +}, +"envelope_game_success": false, +"player_x": 30.0 +}, +"ground": { +&"Ambush梯子": { +"played": false +}, +&"Ambush银元": { +"played": false +}, +&"Ambush首次进店": { +"played": false +}, +&"AnimationPlayer": {}, +&"Interactable信件书桌": { +"interacted_times": 0 +}, +&"Interactable报纸柜台": { +"interacted_times": 0 +} +} +}, +"c02_s03_院子": { +"global": { +"c02_ball_game_stage": 0, +"c02_burning": false, +"c02_burning_end_stage": 0, +"c02_counter_pushed_out": false, +"c02_eavesdrop_finished": false, +&"c02_got_pliers": 0, +"c02_madman_interacted_stage": 0, +"c02_open_gate_first_failed": false, +"c02_ready_to_fire": false, +"c02_show_grounded_coins": false, +"c02_watched_the_well": false, +"enabled_items": { +"prop_小鞋子2": true, +"prop_火柴": true, +"prop_老虎钳": true +}, +"handnote_c02_gate_chain": 0, +"handnote_c02_map_1Right": 0, +"handnote_c02_meat_knockDoor": 0, +"player_x": 1600.0 +}, +"ground": { +&"Ambush保卫科旁边os": { +"played": false +}, +&"Ambush偷听对话": { +"played": false +}, +&"Ambush惊悚闪电": { +"played": false +}, +&"Ambush点火游戏阻挡右移": { +"played": false +}, +&"Ambush等待的小蝉": { +"played": false +}, +&"Ambush老虎钳后小蝉跑": { +"played": false +}, +&"Ambush要下雨了": { +"played": false +}, +&"Ambush闷雷纸人": { +"played": false +}, +&"Ambush霸凌": { +"played": false +}, +&"AnimationPlayer": {}, +&"Closeup井": { +"interacted_times": 0 +}, +&"Closeup敲门游戏": { +"interacted_times": 0 +}, +&"Interactable柜子": { +"interacted_times": 0 +}, +&"Interactable铁门": { +"interacted_times": 0 +}, +&"Pickable小鞋子": { +"picked": false +} +} +}, "c02_s05_一楼内侧楼道": { "global": { "c02_madman_hitwall": true, diff --git a/scene/ground/script/c02/井特写.gd b/scene/ground/script/c02/井特写.gd index 8fd92a07..dca3d574 100644 --- a/scene/ground/script/c02/井特写.gd +++ b/scene/ground/script/c02/井特写.gd @@ -7,4 +7,4 @@ func _ready() -> void: DialogueManager.show_dialogue_balloon( preload("res://asset/dialogue/npc.dialogue"), "c02_看井对话" ) - ArchiveManager.set_global_entry("c02_watched_the_well", true) + ArchiveManager.set_global_entry("c02_watched_the_well", true) \ No newline at end of file diff --git a/scene/main.tscn b/scene/main.tscn index 15234956..5a962992 100644 --- a/scene/main.tscn +++ b/scene/main.tscn @@ -20,13 +20,6 @@ script = ExtResource("1_pks84") [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = ExtResource("9_jsof5") -[node name="GroundLoader" parent="." instance=ExtResource("10_8rc5n")] -position = Vector2(1, 0) -entrance_portal = "right" - -[node name="PropInspector" parent="." instance=ExtResource("5_ux0rw")] -unique_name_in_owner = true - [node name="UILayer" type="CanvasLayer" parent="."] unique_name_in_owner = true layer = 12 @@ -80,3 +73,10 @@ scale = Vector2(0.24, 0.24) item_key = "prop_令牌" display_time = 1.5 metadata/_edit_use_anchors_ = true + +[node name="GroundLoader" parent="." instance=ExtResource("10_8rc5n")] +position = Vector2(1, 0) +entrance_portal = "right" + +[node name="PropInspector" parent="." instance=ExtResource("5_ux0rw")] +unique_name_in_owner = true diff --git a/scene/ux/bag/prop_bag.tscn b/scene/ux/bag/prop_bag.tscn index 59c8d0a7..8a0b9825 100644 --- a/scene/ux/bag/prop_bag.tscn +++ b/scene/ux/bag/prop_bag.tscn @@ -80,6 +80,7 @@ offset_bottom = 261.0 grow_horizontal = 2 grow_vertical = 2 horizontal_scroll_mode = 0 +vertical_scroll_mode = 3 [node name="ButtonsVBox" type="VBoxContainer" parent="Bag/Book/ScrollContainer"] unique_name_in_owner = true @@ -135,7 +136,13 @@ texture = ExtResource("8_j146j") expand_mode = 1 stretch_mode = 5 -[node name="Content" type="TextEdit" parent="Bag/Book/DisplayVBox"] +[node name="ScrollContainer" type="ScrollContainer" parent="Bag/Book/DisplayVBox"] +custom_minimum_size = Vector2(0, 100) +layout_mode = 2 +horizontal_scroll_mode = 0 +vertical_scroll_mode = 3 + +[node name="Content" type="TextEdit" parent="Bag/Book/DisplayVBox/ScrollContainer"] unique_name_in_owner = true custom_minimum_size = Vector2(164, 90) layout_mode = 2 @@ -161,4 +168,5 @@ text = "浦育院院长秦阳 公寓地址 芦昌路26弄3号" editable = false wrap_mode = 1 -scroll_smooth = true +indent_wrapped_lines = true +scroll_fit_content_height = true diff --git a/scene/ux/bag/prop_bag_button.tscn b/scene/ux/bag/prop_bag_button.tscn index 82f61d1c..533fa4ae 100644 --- a/scene/ux/bag/prop_bag_button.tscn +++ b/scene/ux/bag/prop_bag_button.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=4 format=3 uid="uid://wxd25ec3cqyy"] +[gd_scene load_steps=5 format=3 uid="uid://wxd25ec3cqyy"] [ext_resource type="FontFile" uid="uid://dr8bp6p7byb37" path="res://asset/font/字体/方正楷体简体.TTF" id="1_5nv8m"] [ext_resource type="Texture2D" uid="uid://1ky8heqxctnf" path="res://asset/art/ui/bag/重要物品ui-25.png" id="1_jf0g1"] [ext_resource type="Texture2D" uid="uid://c1l5royi6w0cm" path="res://asset/art/ui/bag/重要物品ui-27.png" id="3_dck1d"] +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dck1d"] + [node name="Button" type="Button"] custom_minimum_size = Vector2(130, 26) offset_right = 20.0 @@ -17,6 +19,7 @@ theme_override_colors/font_color = Color(0, 0, 0, 1) theme_override_constants/icon_max_width = 8 theme_override_fonts/font = ExtResource("1_5nv8m") theme_override_font_sizes/font_size = 15 +theme_override_styles/focus = SubResource("StyleBoxEmpty_dck1d") toggle_mode = true text = "院长的信" icon = ExtResource("1_jf0g1") diff --git a/scene/ux/memory/memory.gd b/scene/ux/memory/memory.gd index 8d7de73c..72b7c8ae 100644 --- a/scene/ux/memory/memory.gd +++ b/scene/ux/memory/memory.gd @@ -1,9 +1,10 @@ -extends CanvasLayer +class_name Memory extends CanvasLayer func _ready() -> void: layer = GlobalConfig.CANVAS_LAYER_UX_PANEL SceneManager.toggle_pause_counter(true) + update_display() func _unhandled_input(event: InputEvent) -> void: @@ -20,3 +21,24 @@ func _unhandled_input(event: InputEvent) -> void: func quit() -> void: SceneManager.toggle_pause_counter(false) queue_free() + + +# 1-8 in P1, 9-16 in P2 +# path example: Mem/P1/1 +func update_display(): + if ArchiveManager.archive: + # node name -> display bool + var display_dict := ArchiveManager.archive.mem_display_dict + for k in display_dict: + var node_path = "Mem/" + if k < 0: + continue + elif k < 9: + node_path += "P1/" + str(k) + elif k < 17: + node_path += "P2/" + str(k) + else: + continue + var node = get_node_or_null(node_path) + if node: + node.visible = display_dict[k] diff --git a/scene/ux/memory/memory.tscn b/scene/ux/memory/memory.tscn index c42e562d..ec1137d6 100644 --- a/scene/ux/memory/memory.tscn +++ b/scene/ux/memory/memory.tscn @@ -65,7 +65,7 @@ texture = ExtResource("3_mydtv") expand_mode = 5 stretch_mode = 5 -[node name="GridContainer" type="GridContainer" parent="Mem"] +[node name="P1" type="GridContainer" parent="Mem"] z_index = 10 layout_mode = 2 offset_left = 90.0 @@ -76,47 +76,55 @@ theme_override_constants/h_separation = 19 theme_override_constants/v_separation = 7 columns = 2 -[node name="MemoryItem" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="1" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem2" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="2" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="MemoryItem3" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="3" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem4" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="4" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="MemoryItem5" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="5" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem6" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="6" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="MemoryItem7" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="7" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem8" parent="Mem/GridContainer" instance=ExtResource("4_6dhhp")] +[node name="8" parent="Mem/P1" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="GridContainer2" type="GridContainer" parent="Mem"] +[node name="P2" type="GridContainer" parent="Mem"] z_index = 10 layout_mode = 2 offset_left = 320.0 @@ -127,42 +135,50 @@ theme_override_constants/h_separation = 19 theme_override_constants/v_separation = 7 columns = 2 -[node name="MemoryItem" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="9" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem2" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="10" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="MemoryItem3" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="11" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem4" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="12" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="MemoryItem5" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="13" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem6" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="14" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" -[node name="MemoryItem7" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="15" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("5_7f8pt") title = "mem_偷听对话" -[node name="MemoryItem8" parent="Mem/GridContainer2" instance=ExtResource("4_6dhhp")] +[node name="16" parent="Mem/P2" instance=ExtResource("4_6dhhp")] +visible = false layout_mode = 2 packed_scene = ExtResource("6_dp1y4") title = "mem_疯子看井" diff --git a/scene/ux/prop_hud.gd b/scene/ux/prop_hud.gd index c71e4616..26eb6bbd 100644 --- a/scene/ux/prop_hud.gd +++ b/scene/ux/prop_hud.gd @@ -419,6 +419,13 @@ func _unhandled_input(event: InputEvent) -> void: elif event.is_action_pressed("prop_right"): on_right_pressed() get_viewport().set_input_as_handled() + elif event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_WHEEL_DOWN and event.pressed: + on_left_pressed() + get_viewport().set_input_as_handled() + elif event.button_index == MOUSE_BUTTON_WHEEL_UP and event.pressed: + on_right_pressed() + get_viewport().set_input_as_handled() func _input(event: InputEvent) -> void: diff --git a/scene/ux/prop_inspector.gd b/scene/ux/prop_inspector.gd index 516d4535..29ebd1ef 100644 --- a/scene/ux/prop_inspector.gd +++ b/scene/ux/prop_inspector.gd @@ -186,6 +186,17 @@ func _show_prop_words(line_id: String): func _unhandled_input(event: InputEvent) -> void: if status == STATUS_HIDDEN: return + if ( + status == STATUS_INSPECTING_NOTES + and event is InputEventMouseButton + and ( + event.button_index == MOUSE_BUTTON_WHEEL_DOWN + or event.button_index == MOUSE_BUTTON_WHEEL_UP + ) + ): + # STATUS_INSPECTING_NOTES 状态下,消费鼠标滚轮事件 + get_viewport().set_input_as_handled() + # print("[prop inspector] mouse wheel handled on STATUS_INSPECTING_NOTES") if event.is_action_pressed("cancel"): get_viewport().set_input_as_handled() _hide() diff --git a/scene/ux/prop_inspector.tscn b/scene/ux/prop_inspector.tscn index 11360723..a34373f6 100644 --- a/scene/ux/prop_inspector.tscn +++ b/scene/ux/prop_inspector.tscn @@ -90,16 +90,22 @@ theme_override_constants/margin_top = 60 theme_override_constants/margin_right = 200 theme_override_constants/margin_bottom = 60 -[node name="ContentLabel" type="Label" parent="MarginContainer2"] +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer2"] +custom_minimum_size = Vector2(0, 200) +layout_mode = 2 +size_flags_horizontal = 4 +mouse_filter = 0 +horizontal_scroll_mode = 0 +vertical_scroll_mode = 3 + +[node name="ContentLabel" type="Label" parent="MarginContainer2/ScrollContainer"] unique_name_in_owner = true custom_minimum_size = Vector2(150, 0) layout_mode = 2 size_flags_horizontal = 4 -text = "据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。 -有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。 - -《申报》 -民国五年一月十三日" +size_flags_vertical = 6 +text = "tdb119a3714,据闻奉贤县分水墩有两人染受鼠疫毙命,医官拟将死者尸骸解剖以观受病之原因及其情状,竟未得死者家属之同意,以该处风气闭塞,闻解剖之说,地方人民甚为惊骇,闻已有聚众滋闹之事,并闻医官已被人殴打,政府以防疫事宜关系紧要拟改令赴沪南区一带调查防疫事宜云。,,,,\"It is reported that two people in Fenshuidun, Fengxian County have died from plague. Medical officials proposed to autopsy the bodies to examine the cause and nature of the disease, but failed to obtain consent from the families of the deceased. Due to the conservative local customs, the mention of autopsy has greatly alarmed the local people. There are reports of crowds gathering to cause trouble, and medical officials have been assaulted. Given the critical importance of epidemic prevention, the government plans to redirect orders to investigate epidemic prevention matters in the southern Shanghai area.\" +" vertical_alignment = 1 autowrap_mode = 3 @@ -123,6 +129,6 @@ modulate = Color(1, 1, 1, 0) layout_mode = 2 size_flags_horizontal = 4 theme_override_fonts/font = ExtResource("4_opug5") -text = "Q: 退出 E: 阅读" +text = "Q: Exit E: Read" horizontal_alignment = 1 vertical_alignment = 1 diff --git a/ui/text_helper.gd b/ui/text_helper.gd index 4f0a39f1..a4ccd2cd 100644 --- a/ui/text_helper.gd +++ b/ui/text_helper.gd @@ -3,6 +3,7 @@ extends Node @export var property_name := "text" @export var translation_key := "" +@export var vertical := false @export_tool_button("刷新") var refresh = _refresh.bind(true) @@ -19,4 +20,15 @@ func _refresh(from_tool := false): var msg = tr(translation_key) if from_tool: msg = items_translation.get_message(translation_key) - set(property_name, msg.replace("{br}", "\n")) + msg = msg.replace("{br}", "\n") + if vertical: + var new_text = "" + for c in msg: + new_text += c + "\n" + msg = new_text + set(property_name, msg) + + +func _notification(what: int) -> void: + if what == NOTIFICATION_TRANSLATION_CHANGED: + _refresh() diff --git a/ui/vertical_label.tscn b/ui/vertical_label.tscn index e71fea3a..67566aa9 100644 --- a/ui/vertical_label.tscn +++ b/ui/vertical_label.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://dw0s23v7qmj28"] -[ext_resource type="LabelSettings" uid="uid://dd6jhbqr6uh3x" path="res://config/vertical_label_settings.tres" id="1_v3g0d"] +[ext_resource type="LabelSettings" uid="uid://dd6jhbqr6uh3x" path="res://config/序章夜行船_label_settings.tres" id="1_v3g0d"] [ext_resource type="Script" uid="uid://c0l6vgrnqr2ge" path="res://ui/vertical_label.gd" id="2_vs1gg"] [node name="VerticalLabel" type="Label"] From b9fb44ec4b1159977cdc94f71eceb45393fc378d Mon Sep 17 00:00:00 2001 From: cakipaul Date: Sun, 6 Jul 2025 02:13:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8A=B1=E5=90=8D?= =?UTF-8?q?=E5=86=8C=E3=80=81=E8=80=81=E9=BC=A0=E7=B2=BE=E9=9F=B3=E6=95=88?= =?UTF-8?q?=EF=BC=9B=E8=A7=A3=E5=86=B3=20inspector=20=E6=96=87=E6=9C=AC=20?= =?UTF-8?q?scroll=20=E4=B8=8E=20prop=20hud=20=E5=86=B2=E7=AA=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=9B=E6=96=87=E6=9C=AC=E5=89=A7=E4=B8=AD=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scene/entity/inspectable.gd | 19 +++++++-- scene/entity/inspectable.tscn | 21 +++++----- scene/entity/ux/content_inspector.gd | 4 +- scene/entity/ux/content_inspector.tscn | 19 ++++++++- scene/entity/ux/scrollable_words.gd | 19 +++++++++ scene/entity/ux/scrollable_words.gd.uid | 1 + scene/entity/ux/scrollable_words.tscn | 51 +++++++++++++++++++++++++ scene/ground/scene/c02/s02_过道.tscn | 1 + scene/ground/scene/c02/s04_保卫科.tscn | 28 +++++++------- scene/ground/script/c02/老鼠精画像.tscn | 12 +++++- scene/ground/script/c02/花名册.gd | 2 + scene/ground/script/c02/花名册.tscn | 10 ++++- scene/main.tscn | 6 +-- scene/ux/prop_inspector.gd | 5 +++ scene/ux/prop_inspector.tscn | 5 ++- ui/text_helper.gd | 14 ++++--- 16 files changed, 176 insertions(+), 41 deletions(-) create mode 100644 scene/entity/ux/scrollable_words.gd create mode 100644 scene/entity/ux/scrollable_words.gd.uid create mode 100644 scene/entity/ux/scrollable_words.tscn diff --git a/scene/entity/inspectable.gd b/scene/entity/inspectable.gd index 8e4ba541..14087f81 100644 --- a/scene/entity/inspectable.gd +++ b/scene/entity/inspectable.gd @@ -27,6 +27,11 @@ enum { STATUS_HIDDEN, STATUS_TRANSITIONING, STATUS_INSPECTING_COVER, STATUS_INSP # 第一次交互时的气泡文字(unrevealed -> revealed) 如果为空则跳过 @export var first_interact_os_key := "" @export var content_centered: bool = false +@export var content_width := 150.0: + set(val): + content_width = val + if is_node_ready(): + content_label.custom_minimum_size.x = content_width @export var action_key := 4 @export var collision_width_and_x := Vector2(20.0, 0): set(val): @@ -52,6 +57,7 @@ var content_key: String = "" @onready var container = %Container @onready var cover_rect = %Cover as TextureRect @onready var content_area = %ContentArea as Control +@onready var scroll_container = %ScrollContainer as ScrollContainer @onready var content_label = %ContentLabel as Label @onready var tip_label = %TipLabel as Label @@ -99,6 +105,7 @@ func _ready() -> void: # setup default value ground_archive = ArchiveManager.archive.ground_archive() icount = ground_archive.get_value(name, "icount", 0) + content_label.custom_minimum_size.x = content_width if content_centered: content_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER # sign_mark.interacted.connect(_on_interacted) @@ -143,12 +150,14 @@ func _on_interacted() -> void: func _do_action() -> void: + scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE if status == STATUS_HIDDEN: + # if TranslationServer.get_locale().begins_with("zh_"): + # content_label.add_theme_font_size_override("font_size", 0) + # else: + # content_label.add_theme_font_size_override("font_size", 7) + # 刷新文本 translation - if TranslationServer.get_locale().begins_with("zh_"): - content_label.add_theme_font_size_override("font_size", 0) - else: - content_label.add_theme_font_size_override("font_size", 7) content_label.text = _get_tr_content() # 不使用 lock player, 因为需要用 sign 进行继续交互 SceneManager.freeze_player(0, action_key) @@ -175,6 +184,7 @@ func _do_action() -> void: elif status == STATUS_INSPECTING_COVER: sfx.play() status = STATUS_INSPECTING_NOTES + scroll_container.mouse_filter = Control.MOUSE_FILTER_PASS tip_label.text = tip_notes() create_tween().tween_property(content_area, "modulate:a", 1.0, 0.15) elif status == STATUS_INSPECTING_NOTES: @@ -200,6 +210,7 @@ func _blink_label(init := true): func _on_cancel(_body = null): + scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE if STATUS_TRANSITIONING == status or status == STATUS_HIDDEN: return quit_inspecting.emit() diff --git a/scene/entity/inspectable.tscn b/scene/entity/inspectable.tscn index 4b98e03c..0bcb7911 100644 --- a/scene/entity/inspectable.tscn +++ b/scene/entity/inspectable.tscn @@ -45,6 +45,13 @@ collision_layer = 0 unique_name_in_owner = true shape = SubResource("RectangleShape2D_4fuic") +[node name="SignSnapper" type="Marker2D" parent="."] +unique_name_in_owner = true +script = ExtResource("10_mtbvd") +radius = 3.0 +action_on_arrived = 4 +metadata/_custom_type_script = "uid://cnt01hiw52bmn" + [node name="InspectLayer" type="CanvasLayer" parent="."] layer = 20 @@ -100,6 +107,7 @@ mouse_filter = 2 texture = ExtResource("7_xawjo") [node name="ScrollContainer" type="ScrollContainer" parent="InspectLayer/Root/Container/ContentArea"] +unique_name_in_owner = true custom_minimum_size = Vector2(0, 200) layout_mode = 1 anchors_preset = 8 @@ -113,17 +121,19 @@ offset_right = 65.0 offset_bottom = 75.0 grow_horizontal = 2 grow_vertical = 2 -mouse_filter = 0 +focus_mode = 2 +mouse_filter = 2 horizontal_scroll_mode = 0 vertical_scroll_mode = 3 [node name="ContentLabel" type="Label" parent="InspectLayer/Root/Container/ContentArea/ScrollContainer"] unique_name_in_owner = true z_index = 100 -custom_minimum_size = Vector2(130, 0) +custom_minimum_size = Vector2(150, 0) layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 6 +mouse_filter = 1 text = "tdb119a3714,据闻奉贤县分水墩有两人染受鼠疫毙命,医官拟将死者尸骸解剖以观受病之原因及其情状,竟未得死者家属之同意,以该处风气闭塞,闻解剖之说,地方人民甚为惊骇,闻已有聚众滋闹之事,并闻医官已被人殴打,政府以防疫事宜关系紧要拟改令赴沪南区一带调查防疫事宜云。,,,,\"It is reported that two people in Fenshuidun, Fengxian County have died from plague. Medical officials proposed to autopsy the bodies to examine the cause and nature of the disease, but failed to obtain consent from the families of the deceased. Due to the conservative local customs, the mention of autopsy has greatly alarmed the local people. There are reports of crowds gathering to cause trouble, and medical officials have been assaulted. Given the critical importance of epidemic prevention, the government plans to redirect orders to investigate epidemic prevention matters in the southern Shanghai area.\" " vertical_alignment = 1 @@ -149,10 +159,3 @@ theme_override_fonts/font = ExtResource("7_ianbs") text = "Q: Exit E: Read" horizontal_alignment = 1 vertical_alignment = 1 - -[node name="SignSnapper" type="Marker2D" parent="."] -unique_name_in_owner = true -script = ExtResource("10_mtbvd") -radius = 3.0 -action_on_arrived = 4 -metadata/_custom_type_script = "uid://cnt01hiw52bmn" diff --git a/scene/entity/ux/content_inspector.gd b/scene/entity/ux/content_inspector.gd index 21220518..ebb2ef92 100644 --- a/scene/entity/ux/content_inspector.gd +++ b/scene/entity/ux/content_inspector.gd @@ -21,7 +21,7 @@ func _setup_content(): for c in get_children(): if c.name == "TipContainer": continue - c.visible = displaying + c.set("visible", displaying) # reset_tips if displaying: label.text = tip_can_hide @@ -41,10 +41,12 @@ func _unhandled_input(event: InputEvent) -> void: return if event.is_action_pressed("interact"): if not visible: + $"Sfx显示".play() visible = true displaying = false _setup_content() else: + $"Sfx收起".play() displaying = not displaying _setup_content() get_viewport().set_input_as_handled() diff --git a/scene/entity/ux/content_inspector.tscn b/scene/entity/ux/content_inspector.tscn index 3c193e7d..b74c52e0 100644 --- a/scene/entity/ux/content_inspector.tscn +++ b/scene/entity/ux/content_inspector.tscn @@ -1,7 +1,10 @@ -[gd_scene load_steps=3 format=3 uid="uid://dmysq4sxx8iqh"] +[gd_scene load_steps=6 format=3 uid="uid://dmysq4sxx8iqh"] [ext_resource type="Script" uid="uid://0dcbk75cd5pl" path="res://scene/entity/ux/content_inspector.gd" id="1_4n727"] [ext_resource type="FontVariation" uid="uid://1ryw42kej6lv" path="res://config/font_ui.tres" id="2_mtwgq"] +[ext_resource type="AudioStream" uid="uid://dky3j8lwcy5sk" path="res://asset/audio/sfx/UI/物品查看.mp3" id="2_x36rf"] +[ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="3_ksykb"] +[ext_resource type="AudioStream" uid="uid://3nfd1t2lllmh" path="res://asset/audio/sfx/UI/花名册.mp3" id="4_ndmve"] [node name="ContentInspector" type="Control"] layout_mode = 3 @@ -12,6 +15,20 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_4n727") +[node name="Sfx显示" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_x36rf") +volume_db = 5.0 +bus = &"game_sfx" +script = ExtResource("3_ksykb") +metadata/_custom_type_script = "uid://rq6w1vuhuq1m" + +[node name="Sfx收起" type="AudioStreamPlayer" parent="."] +stream = ExtResource("4_ndmve") +volume_db = 5.0 +bus = &"game_sfx" +script = ExtResource("3_ksykb") +metadata/_custom_type_script = "uid://rq6w1vuhuq1m" + [node name="TipContainer" type="MarginContainer" parent="."] z_index = 100 layout_mode = 1 diff --git a/scene/entity/ux/scrollable_words.gd b/scene/entity/ux/scrollable_words.gd new file mode 100644 index 00000000..d9a5ac90 --- /dev/null +++ b/scene/entity/ux/scrollable_words.gd @@ -0,0 +1,19 @@ +extends Control + +@export var width := 200: + set(val): + width = val + if is_node_ready(): + label.custom_minimum_size.x = width +@export var translation_key := "": + set(val): + translation_key = val + if is_node_ready(): + label.translation_key = translation_key + +@onready var label = $ScrollContainer/WordsLabel as Label + + +func _ready() -> void: + label.custom_minimum_size.x = width + label.translation_key = translation_key diff --git a/scene/entity/ux/scrollable_words.gd.uid b/scene/entity/ux/scrollable_words.gd.uid new file mode 100644 index 00000000..bc8cc99f --- /dev/null +++ b/scene/entity/ux/scrollable_words.gd.uid @@ -0,0 +1 @@ +uid://pkdpas41oa2d diff --git a/scene/entity/ux/scrollable_words.tscn b/scene/entity/ux/scrollable_words.tscn new file mode 100644 index 00000000..8863e297 --- /dev/null +++ b/scene/entity/ux/scrollable_words.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=4 format=3 uid="uid://cp8aee5onwjuc"] + +[ext_resource type="Script" uid="uid://pkdpas41oa2d" path="res://scene/entity/ux/scrollable_words.gd" id="1_86u3k"] +[ext_resource type="Texture2D" uid="uid://f186lvt5y2ql" path="res://asset/art/ui/遮罩/inspect背景遮罩.png" id="2_gmjbs"] +[ext_resource type="Script" uid="uid://dpocj5al0rvai" path="res://ui/text_helper.gd" id="3_6l2e8"] + +[node name="ScrollableWords" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_86u3k") + +[node name="遮罩" type="TextureRect" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_gmjbs") + +[node name="ScrollContainer" type="ScrollContainer" parent="."] +custom_minimum_size = Vector2(0, 200) +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 20.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 +horizontal_scroll_mode = 0 +vertical_scroll_mode = 3 + +[node name="WordsLabel" type="Label" parent="ScrollContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(200, 10) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 1 +text = "tdb119a3714,据闻奉贤县分水墩有两人染受鼠疫毙命,医官拟将死者尸骸解剖以观受病之原因及其情状,竟未得死者家属之同意,以该处风气闭塞,闻解剖之说,地方人民甚为惊骇,闻已有聚众滋闹之事,并闻医官已被人殴打,政府以防疫事宜关系紧要拟改令赴沪南区一带调查防疫事宜云。,,,,\"It is reported that two people in Fenshuidun, Fengxian County have died from plague. Medical officials proposed to autopsy the bodies to examine the cause and nature of the disease, but failed to obtain consent from the families of the deceased. Due to the conservative local customs, the mention of autopsy has greatly alarmed the local people. There are reports of crowds gathering to cause trouble, and medical officials have been assaulted. Given the critical importance of epidemic prevention, the government plans to redirect orders to investigate epidemic prevention matters in the southern Shanghai area.\" +" +autowrap_mode = 3 +script = ExtResource("3_6l2e8") diff --git a/scene/ground/scene/c02/s02_过道.tscn b/scene/ground/scene/c02/s02_过道.tscn index 873609fc..48eae499 100644 --- a/scene/ground/scene/c02/s02_过道.tscn +++ b/scene/ground/scene/c02/s02_过道.tscn @@ -125,6 +125,7 @@ content_key = "c02_青岛啤酒" [node name="鼠疫海报" parent="Ground/DeployLayer" index="8" instance=ExtResource("12_0fckv")] position = Vector2(442, -30) +content_width = 200.0 texture_cover = ExtResource("7_wdwbi") content_key = "c02_鼠疫海报" diff --git a/scene/ground/scene/c02/s04_保卫科.tscn b/scene/ground/scene/c02/s04_保卫科.tscn index dcb41c4b..6a53563c 100644 --- a/scene/ground/scene/c02/s04_保卫科.tscn +++ b/scene/ground/scene/c02/s04_保卫科.tscn @@ -61,38 +61,44 @@ target_portal = "1" [node name="portal_right" parent="Ground/DeployLayer" index="1"] position = Vector2(551, 22) -[node name="Ambush进门看到小蝉" parent="Ground/DeployLayer" index="2" instance=ExtResource("7_ypth3")] +[node name="Local寻人启事" parent="Ground/DeployLayer" index="2" instance=ExtResource("19_k74x7")] +position = Vector2(116, -1) +texture = ExtResource("20_g8amr") +texture_cover = ExtResource("21_cq2m4") +content_key = "c02_寻人启事_完整" + +[node name="Ambush进门看到小蝉" parent="Ground/DeployLayer" index="3" instance=ExtResource("7_ypth3")] unique_name_in_owner = true position = Vector2(72, 51) hook_method = "xiaochan_disappear" -[node name="涂鸦提示" type="Sprite2D" parent="Ground/DeployLayer" index="3"] +[node name="涂鸦提示" type="Sprite2D" parent="Ground/DeployLayer" index="4"] position = Vector2(275, 13) texture = ExtResource("6_gk1h4") -[node name="小钳子提示" type="Sprite2D" parent="Ground/DeployLayer" index="4"] +[node name="小钳子提示" type="Sprite2D" parent="Ground/DeployLayer" index="5"] position = Vector2(270, -3) texture = ExtResource("9_k74x7") -[node name="Closeup折锡纸" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_66gue")] +[node name="Closeup折锡纸" parent="Ground/DeployLayer" index="6" instance=ExtResource("6_66gue")] unique_name_in_owner = true position = Vector2(189, 15) packed_scene = ExtResource("7_fvlg0") first_interact_os_key = "c02_保卫科祭台os" -[node name="Closeup老鼠精" parent="Ground/DeployLayer" index="6" instance=ExtResource("6_66gue")] +[node name="Closeup老鼠精" parent="Ground/DeployLayer" index="7" instance=ExtResource("6_66gue")] light_mask = 5 position = Vector2(207.5, -40.5) texture = ExtResource("11_ffvrp") packed_scene = ExtResource("8_cm3g6") -[node name="Closeup花名册" parent="Ground/DeployLayer" index="7" instance=ExtResource("6_66gue")] +[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") first_interact_os_key = "c02_保卫科花名册os" -[node name="煤油灯" type="Sprite2D" parent="Ground/DeployLayer" index="8"] +[node name="煤油灯" type="Sprite2D" parent="Ground/DeployLayer" index="9"] position = Vector2(370, 39) [node name="灯光" type="AnimatedSprite2D" parent="Ground/DeployLayer/煤油灯"] @@ -109,15 +115,9 @@ energy = 2.0 blend_mode = 2 texture = ExtResource("9_a43aq") -[node name="小手讨东西" parent="Ground/DeployLayer" index="9" instance=ExtResource("10_a43aq")] +[node name="小手讨东西" parent="Ground/DeployLayer" index="10" instance=ExtResource("10_a43aq")] position = Vector2(295, -6) -[node name="Local寻人启事" parent="Ground/DeployLayer" index="10" instance=ExtResource("19_k74x7")] -position = Vector2(116, -1) -texture = ExtResource("20_g8amr") -texture_cover = ExtResource("21_cq2m4") -content_key = "c02_寻人启事_完整" - [node name="小蝉写字" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="11"] position = Vector2(351, 51) sprite_frames = ExtResource("20_47ju4") diff --git a/scene/ground/script/c02/老鼠精画像.tscn b/scene/ground/script/c02/老鼠精画像.tscn index e7d10b98..9b3f3116 100644 --- a/scene/ground/script/c02/老鼠精画像.tscn +++ b/scene/ground/script/c02/老鼠精画像.tscn @@ -1,13 +1,23 @@ -[gd_scene load_steps=5 format=3 uid="uid://cdf2qe8l7323i"] +[gd_scene load_steps=7 format=3 uid="uid://cdf2qe8l7323i"] [ext_resource type="Script" uid="uid://dyk58stu5enia" path="res://scene/ground/script/c02/老鼠精画像.gd" id="1_l77sh"] [ext_resource type="Texture2D" uid="uid://d1xr7g5huv5or" path="res://asset/art/scene/c02/s04_保卫科/ux_老鼠画像特写.png" id="2_eyynm"] +[ext_resource type="AudioStream" uid="uid://bi4hcr04231qr" path="res://asset/audio/sfx/UI/挂画查看.mp3" id="2_nvvir"] [ext_resource type="PackedScene" uid="uid://dmysq4sxx8iqh" path="res://scene/entity/ux/content_inspector.tscn" id="3_lpmq3"] +[ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="3_u15ce"] [ext_resource type="Texture2D" uid="uid://f186lvt5y2ql" path="res://asset/art/ui/遮罩/inspect背景遮罩.png" id="4_l77sh"] [node name="老鼠精画像" type="CanvasLayer"] script = ExtResource("1_l77sh") +[node name="Sfx打开查看" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_nvvir") +volume_db = 3.0 +autoplay = true +bus = &"game_sfx" +script = ExtResource("3_u15ce") +metadata/_custom_type_script = "uid://rq6w1vuhuq1m" + [node name="TextureRect" type="TextureRect" parent="."] anchors_preset = 15 anchor_right = 1.0 diff --git a/scene/ground/script/c02/花名册.gd b/scene/ground/script/c02/花名册.gd index a62cce15..513d4e2e 100644 --- a/scene/ground/script/c02/花名册.gd +++ b/scene/ground/script/c02/花名册.gd @@ -11,11 +11,13 @@ var texture_dict = { var click_count = 0 func _ready() -> void: + $"Sfx翻页".play() layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME button.pressed.connect(_on_button_pressed) func _on_button_pressed() -> void: + $"Sfx翻页".play() click_count += 1 if click_count == 1: button.texture_normal = texture_dict["1"] diff --git a/scene/ground/script/c02/花名册.tscn b/scene/ground/script/c02/花名册.tscn index 117ed974..2b729eb3 100644 --- a/scene/ground/script/c02/花名册.tscn +++ b/scene/ground/script/c02/花名册.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=6 format=3 uid="uid://b8i6tqwdvvddy"] +[gd_scene load_steps=8 format=3 uid="uid://b8i6tqwdvvddy"] [ext_resource type="Script" uid="uid://cmapmn0v70p4l" path="res://scene/ground/script/c02/花名册.gd" id="1_jin3n"] +[ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="2_654vh"] +[ext_resource type="AudioStream" uid="uid://c3qonrtdjnmau" path="res://asset/audio/sfx/UI/纸声.wav" id="2_su2aa"] [ext_resource type="Texture2D" uid="uid://cypvxj1vsl5yk" path="res://asset/art/scene/c02/s04_保卫科/花名册/bg_花名册桌面.png" id="2_v047l"] [ext_resource type="Texture2D" uid="uid://sx3i3lkt2vfd" path="res://asset/art/scene/c02/s04_保卫科/花名册/花名册封皮.png" id="3_myeas"] [ext_resource type="PackedScene" uid="uid://dmysq4sxx8iqh" path="res://scene/entity/ux/content_inspector.tscn" id="4_1s4sv"] @@ -9,6 +11,12 @@ [node name="花名册" type="CanvasLayer"] script = ExtResource("1_jin3n") +[node name="Sfx翻页" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_su2aa") +bus = &"game_sfx" +script = ExtResource("2_654vh") +metadata/_custom_type_script = "uid://rq6w1vuhuq1m" + [node name="TextureRect" type="TextureRect" parent="."] anchors_preset = 15 anchor_right = 1.0 diff --git a/scene/main.tscn b/scene/main.tscn index 5a962992..91357466 100644 --- a/scene/main.tscn +++ b/scene/main.tscn @@ -74,9 +74,9 @@ item_key = "prop_令牌" display_time = 1.5 metadata/_edit_use_anchors_ = true +[node name="PropInspector" parent="." instance=ExtResource("5_ux0rw")] +unique_name_in_owner = true + [node name="GroundLoader" parent="." instance=ExtResource("10_8rc5n")] position = Vector2(1, 0) entrance_portal = "right" - -[node name="PropInspector" parent="." instance=ExtResource("5_ux0rw")] -unique_name_in_owner = true diff --git a/scene/ux/prop_inspector.gd b/scene/ux/prop_inspector.gd index 29ebd1ef..865ce7de 100644 --- a/scene/ux/prop_inspector.gd +++ b/scene/ux/prop_inspector.gd @@ -16,9 +16,11 @@ signal quit_and_hidden @onready var prop_bg = %PropBG as TextureRect @onready var origin_texture = %OriginPropTexture as TextureRect @onready var full_texture = %FullTexture as TextureRect +@onready var scroll_container = %ScrollContainer as ScrollContainer @onready var content_label = %ContentLabel as Label @onready var tip_label = %TipLabel as Label + var tip_cover = "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_阅读") var tip_notes = "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_收起") var texture_cover: Texture2D @@ -60,6 +62,7 @@ func _hide(): func _post_hide(): status = STATUS_HIDDEN + scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE locking = false origin_texture.texture = null full_texture.texture = null @@ -202,10 +205,12 @@ func _unhandled_input(event: InputEvent) -> void: _hide() if event.is_action_pressed("interact"): get_viewport().set_input_as_handled() + scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE # STATUS_INSPECTING_COVER 与 STATUS_INSPECTING_NOTES 之间互相切换 if status == STATUS_INSPECTING_COVER: # inspect notes status = STATUS_INSPECTING_NOTES + scroll_container.mouse_filter = Control.MOUSE_FILTER_PASS if not texture_notes: notes_bg.visible = true else: diff --git a/scene/ux/prop_inspector.tscn b/scene/ux/prop_inspector.tscn index a34373f6..d10fb871 100644 --- a/scene/ux/prop_inspector.tscn +++ b/scene/ux/prop_inspector.tscn @@ -22,7 +22,7 @@ offset_bottom = 120.0 grow_horizontal = 2 grow_vertical = 2 size_flags_horizontal = 4 -mouse_filter = 0 +mouse_filter = 2 texture = ExtResource("2_j83lq") [node name="CenterContainer" type="CenterContainer" parent="."] @@ -91,10 +91,11 @@ theme_override_constants/margin_right = 200 theme_override_constants/margin_bottom = 60 [node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer2"] +unique_name_in_owner = true custom_minimum_size = Vector2(0, 200) layout_mode = 2 size_flags_horizontal = 4 -mouse_filter = 0 +mouse_filter = 2 horizontal_scroll_mode = 0 vertical_scroll_mode = 3 diff --git a/ui/text_helper.gd b/ui/text_helper.gd index a4ccd2cd..59fb8c2b 100644 --- a/ui/text_helper.gd +++ b/ui/text_helper.gd @@ -2,20 +2,24 @@ extends Node @export var property_name := "text" -@export var translation_key := "" +@export var translation_key := "": + set(val): + translation_key = val + if is_node_ready(): + refresh() @export var vertical := false -@export_tool_button("刷新") var refresh = _refresh.bind(true) +@export_tool_button("刷新") var _refresh = refresh.bind(true) func _ready() -> void: - _refresh() + refresh() # res://asset/dialogue/item_description.zh_CN.translation var items_translation = preload("uid://c1x5bqwulamey") as Translation -func _refresh(from_tool := false): +func refresh(from_tool := false): if property_name and translation_key: var msg = tr(translation_key) if from_tool: @@ -31,4 +35,4 @@ func _refresh(from_tool := false): func _notification(what: int) -> void: if what == NOTIFICATION_TRANSLATION_CHANGED: - _refresh() + refresh() From 1c2fc4fb703df51882dc86d427cb4ebd944d82cf Mon Sep 17 00:00:00 2001 From: cakipaul Date: Sun, 6 Jul 2025 02:24:20 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=8C=96=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=9A=E8=A3=82=E7=BC=9D=E8=AE=AE=E8=AE=BA=EF=BC=9B?= =?UTF-8?q?Cicada->Chan...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/dialogue/c02.csv | 4 +-- asset/dialogue/inspect_content.csv | 25 +++++++++++++++++ asset/dialogue/inspect_content.dialogue | 28 +++++++++++++++++++ asset/dialogue/item_description.csv | 4 +-- asset/dialogue/纯中文_无需本地化.csv | 26 ----------------- asset/dialogue/纯中文_无需本地化.csv.import | 17 ----------- asset/dialogue/纯中文_无需本地化.dialogue | 27 ------------------ .../纯中文_无需本地化.dialogue.import | 16 ----------- project.godot | 4 +-- scene/entity/inspectable.tscn | 1 - scene/ground/script/c02/花名册.gd | 1 + 11 files changed, 60 insertions(+), 93 deletions(-) delete mode 100644 asset/dialogue/纯中文_无需本地化.csv delete mode 100644 asset/dialogue/纯中文_无需本地化.csv.import delete mode 100644 asset/dialogue/纯中文_无需本地化.dialogue delete mode 100644 asset/dialogue/纯中文_无需本地化.dialogue.import diff --git a/asset/dialogue/c02.csv b/asset/dialogue/c02.csv index 7029a5c5..79d701cf 100644 --- a/asset/dialogue/c02.csv +++ b/asset/dialogue/c02.csv @@ -22,7 +22,7 @@ c02_6偷听对话_李氏_7_fx,想当年,咱们好歹也过了几年体面日 c02_6偷听对话_癞子_7_fx,等胖子那肉铺开门,你趁晚上摸黑去,一句话也别说,敲六下门,三快三慢。,等胖子的肉摊头开门,侬趁夜里厢偷摸较去,覅发声音,敲六击门,三快三慢。,王守义,,,"When Fatty's butcher shop opens, go there after dark. Don't say a word, just knock six times on the door - three fast, three slow." c02_6偷听对话_李氏_8_fx,我记着了。,有数了。,李兰,,[#wait=2],I'll remember. c02_6偷听对话_李氏_9_fx,...谁在外面?!,外头啥人?!,李兰,,,...Who's out there?! -c02_4瞎子_1,小蝉,要是有天我死了,你会怎么办?,小蝉,要是哪一天我没了,侬会哪能办?,方启钊,,,"Little Cicada, if I were to die someday, what would you do?" +c02_4瞎子_1,小蝉,要是有天我死了,你会怎么办?,小蝉,要是哪一天我没了,侬会哪能办?,方启钊,,,"Little Chan, if I were to die someday, what would you do?" c02_4小蝉_1,啊?,,方小蝉,,,Huh? c02_4小蝉_2,...「死」是什么意思?,...“没”是啥意思?,方小蝉,,,...What does 'die' mean? c02_4瞎子_2,每个人就像一个封起来的盒子,人死了,就是打开盒盖,把里面的灵魂放走了。,每个人就像一个封好的盒头,人要是没了,就是盒头盖头打开来了,里厢的魂灵头跑掉了。,方启钊,,,"Everyone is like a sealed box. When a person dies, the lid opens and the soul inside is released." @@ -65,6 +65,6 @@ c02_10小蝶_2,我能感觉到,从我一进来,你就在盯着我。,我觉 c02_10小蝉_2,...你不记得我了。,……侬对我没印象了。,方小蝉,,[#ban_skip],...You don't remember me anymore. c02_10小蝶_3,...我更好奇另一件事。,……有桩事情我觉着老奇怪的。,吕萍,,[#ban_skip],...I'm more curious about something else. c02_10小蝶_4,你...是怎么死的?,侬……是怎么死的?,吕萍,,[#ban_skip],How... did you die? -c02_10瞎子_1,小蝉,该回家了。,小蝉,好回去了。,方启钊,,,"Little Cicada, it's time to go home." +c02_10瞎子_1,小蝉,该回家了。,小蝉,好回去了。,方启钊,,,"Little Chan, it's time to go home." c02_10瞎子_2,你胖叔叔带了鲜肉过来,要给咱们露一手呢。,胖阿叔拿了肉肉过来,要帮侬烧好吃的。,方启钊,,,Your Uncle Fatty brought fresh meat over. He wants to show off his cooking skills for us. c02_10瞎子_3,还不快点过来谢谢人家?,还不快点过来谢谢阿叔?,方启钊,,,"Hurry over and thank him, won't you?" diff --git a/asset/dialogue/inspect_content.csv b/asset/dialogue/inspect_content.csv index 2536bd15..5bbd3640 100644 --- a/asset/dialogue/inspect_content.csv +++ b/asset/dialogue/inspect_content.csv @@ -28,3 +28,28 @@ c02_保卫科花名册6,三〇一三 (看不清),,,,3013 (Illegible) c02_保卫科花名册7,把我的鞋子拿给老鼠,老鼠会引开那个疯男人,,,,"Give my shoes to the rats, the rats will lure away that crazy man" c02_保卫科花名册8,不要相信墙里的东西!,,,,Don't trust what's in the wall! c02_小猫纸条,大哥!今晚老地方见 /井\,,,,Big brother! Meet at the usual place tonight /well\ +c02_议论文字1,你说的是真的啊?,,,,Is what you're saying really true? +c02_议论文字2,你听谁说的?,,,,Who did you hear that from? +c02_议论文字3,姓李的那个女人讲的,,,,That woman surnamed Li told me +c02_议论文字4,好多人都在传呢,,,,Lots of people are talking about it +c02_议论文字5,我也听说了,,,,I heard about it too +c02_议论文字6,不是有人已经看到过了吗,,,,Didn't someone already see it? +c02_议论文字7,谁看到了?,,,,Who saw it? +c02_议论文字8,谁啊,,,,Who? +c02_议论文字9,听说是她老公看到的呀,,,,I heard it was her husband who saw it +c02_议论文字10,这么多人找他们看过病呢,,,,So many people have gone to them for treatment +c02_议论文字11,你十三点啊,,,,You're being foolish +c02_议论文字12,谁知道这病是不是他们搞得,,,,Who knows if they're the ones causing the illness +c02_议论文字13,这钱不就来了吗,,,,That's how the money comes rolling in +c02_议论文字14,啧,有道理的呀,,,,"Tsk, that makes sense" +c02_议论文字15,想钱想疯了,,,,Gone mad from wanting money +c02_议论文字16,开始用怪路子赚钱了,,,,Started using strange methods to make money +c02_议论文字17,他们家住了只妖怪?,,,,There's a demon living in their house? +c02_议论文字18,啊?妖怪?,,,,Huh? A demon? +c02_议论文字19,你们在说什么妖怪?,,,,What demon are you talking about? +c02_议论文字20,谁家有妖怪?,,,,Which family has a demon? +c02_议论文字21,啥妖怪,,,,What demon? +c02_议论文字22,真的假的妖怪,,,,Is it a real or fake demon? +c02_议论文字23,三〇一二那家有妖怪,,,,The family in 3012 has a demon +c02_议论文字24,要死了,,,,We're doomed +c02_议论文字25,养妖怪,,,,Keeping a demon diff --git a/asset/dialogue/inspect_content.dialogue b/asset/dialogue/inspect_content.dialogue index 460db3e7..ce38c5e8 100644 --- a/asset/dialogue/inspect_content.dialogue +++ b/asset/dialogue/inspect_content.dialogue @@ -46,3 +46,31 @@ ~ c02_小猫纸条 大哥!今晚老地方见 /井\[ID:c02_小猫纸条] => END + +~ c02_裂缝议论 +你说的是真的啊? [ID:c02_议论文字1] +你听谁说的? [ID:c02_议论文字2] +姓李的那个女人讲的 [ID:c02_议论文字3] +好多人都在传呢 [ID:c02_议论文字4] +我也听说了 [ID:c02_议论文字5] +不是有人已经看到过了吗 [ID:c02_议论文字6] +谁看到了? [ID:c02_议论文字7] +谁啊 [ID:c02_议论文字8] +听说是她老公看到的呀 [ID:c02_议论文字9] +这么多人找他们看过病呢 [ID:c02_议论文字10] +你十三点啊 [ID:c02_议论文字11] +谁知道这病是不是他们搞得 [ID:c02_议论文字12] +这钱不就来了吗 [ID:c02_议论文字13] +啧,有道理的呀 [ID:c02_议论文字14] +想钱想疯了 [ID:c02_议论文字15] +开始用怪路子赚钱了 [ID:c02_议论文字16] +他们家住了只妖怪? [ID:c02_议论文字17] +啊?妖怪? [ID:c02_议论文字18] +你们在说什么妖怪? [ID:c02_议论文字19] +谁家有妖怪? [ID:c02_议论文字20] +啥妖怪 [ID:c02_议论文字21] +真的假的妖怪 [ID:c02_议论文字22] +三〇一二那家有妖怪 [ID:c02_议论文字23] +要死了 [ID:c02_议论文字24] +养妖怪 [ID:c02_议论文字25] +=> END \ No newline at end of file diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv index c141280b..59dde01c 100644 --- a/asset/dialogue/item_description.csv +++ b/asset/dialogue/item_description.csv @@ -100,7 +100,7 @@ prop_船票,船票,,,[#texture=c02/船票.png],,Boat Ticket prop_船票_说明,民国二十一年十月十七日{br}上海-南京-济南-北平-林西-满洲里{br}三等舱 3-23 号铺位{br}船票早已订好,我本已不抱任何希望,直到院长给我回信。若今晚没能找到真相,我将带着这张通往未知的船票,在浪涛中打捞被时光吞噬的答案。{br}我的亲生父母是谁?当初他们为何要把我送到浦育院?,,,,,"October 17th, Year 21 of the Republic{br}Shanghai-Nanjing-Jinan-Beiping-Linxi-Manzhouli{br}Third Class Berth 3-23{br}The ticket was booked long ago. I had given up all hope until the director replied to my letter. If I cannot find the truth tonight, I will take this ticket to the unknown and salvage answers devoured by time from the waves.{br}Who are my birth parents? Why did they send me to Puyu Orphanage?" prop_眼镜盒,眼镜盒,,,[#texture=c02/眼镜盒.png],,Glasses Case prop_眼镜盒_说明,这副眼镜对我很重要。{br}记得小时候在浦育院的日子,我经常会在半夜时听到奇怪的说话声,还时不时能看见其他小孩子看不见的东西。{br}院长不知从哪儿找来了这样一副眼镜,戴上它后那些怪事就很少发生。{br}随着年龄增长,我几乎已用不到这副眼镜。现在它对我来说似乎有了新的意义。,,,,,"These glasses are very important to me.{br}I remember during my childhood at Puyu Orphanage, I would often hear strange voices at midnight and sometimes see things other children couldn't see.{br}The director found these glasses somewhere. After wearing them, those strange occurrences rarely happened.{br}As I grew older, I hardly needed these glasses anymore. Now they seem to have taken on new meaning for me." -prop_小蝉人偶,小蝉人偶,,,[#texture=c02/小蝉人偶.png],,Little Cicada Doll +prop_小蝉人偶,小蝉人偶,,,[#texture=c02/小蝉人偶.png],,Little Chan Doll prop_小蝉人偶_说明,小小的人儿,小小的鞋子,小小的友情啊——像蝶依偎着花。,,,,,"Little person, little shoes, little friendship—like a butterfly nestled against a flower." prop_单只小鞋子,一只小鞋子,,,[#texture=c02/小鞋子1.png],,A Single Small Shoe prop_单只小鞋子_说明,这只小鞋子曾经属于一个裹了小脚的女孩。{br}鞋不成双,祸事难防。,,,,,"This small shoe once belonged to a girl with bound feet.{br}When shoes don't come in pairs, misfortune is hard to prevent." @@ -187,7 +187,7 @@ c02_小蝉盒子特写,我会在盒子里一直陪着你 :3,,,,,I'll stay with y c02_小蝉恨他们,我恨他们!,,,,,I hate them! c02_火灾等待准备,还没准备好点火呢,,,,,Not ready to start the fire yet c02_霸凌救小蝉开始,啊!我得想办法帮帮她...,,,,,Ah! I need to find a way to help her... -c02_点火前阻止右移,没时间浪费了!想想办法救出小蝉...,,,,,No time to waste! Think of a way to save Little Cicada... +c02_点火前阻止右移,没时间浪费了!想想办法救出小蝉...,,,,,No time to waste! Think of a way to save Little Chan... c02_看到小蝉上楼,?!,,,,,?! c02_看到杂物堆消失,楼梯口的杂物消失了...,,,,,The clutter at the stairway has disappeared... c02_demo感谢试玩,感谢试玩,,,,,Thank you for playing diff --git a/asset/dialogue/纯中文_无需本地化.csv b/asset/dialogue/纯中文_无需本地化.csv deleted file mode 100644 index 43415b89..00000000 --- a/asset/dialogue/纯中文_无需本地化.csv +++ /dev/null @@ -1,26 +0,0 @@ -keys,zh_CN,_character,_notes,_tags -c02_议论文字1,你说的是真的啊?,,, -c02_议论文字2,你听谁说的?,,, -c02_议论文字3,姓李的那个女人讲的,,, -c02_议论文字4,好多人都在传呢,,, -c02_议论文字5,我也听说了,,, -c02_议论文字6,不是有人已经看到过了吗,,, -c02_议论文字7,谁看到了?,,, -c02_议论文字8,谁啊,,, -c02_议论文字9,听说是她老公看到的呀,,, -c02_议论文字10,这么多人找他们看过病呢,,, -c02_议论文字11,你十三点啊,,, -c02_议论文字12,谁知道这病是不是他们搞得,,, -c02_议论文字13,这钱不就来了吗,,, -c02_议论文字14,啧,有道理的呀,,, -c02_议论文字15,想钱想疯了,,, -c02_议论文字16,开始用怪路子赚钱了,,, -c02_议论文字17,他们家住了只妖怪?,,, -c02_议论文字18,啊?妖怪?,,, -c02_议论文字19,你们在说什么妖怪?,,, -c02_议论文字20,谁家有妖怪?,,, -c02_议论文字21,啥妖怪,,, -c02_议论文字22,真的假的妖怪,,, -c02_议论文字23,三〇一二那家有妖怪,,, -c02_议论文字24,要死了,,, -c02_议论文字25,养妖怪,,, diff --git a/asset/dialogue/纯中文_无需本地化.csv.import b/asset/dialogue/纯中文_无需本地化.csv.import deleted file mode 100644 index be873f9f..00000000 --- a/asset/dialogue/纯中文_无需本地化.csv.import +++ /dev/null @@ -1,17 +0,0 @@ -[remap] - -importer="csv_translation" -type="Translation" -uid="uid://rlhjdcvlinvt" - -[deps] - -files=["res://asset/dialogue/纯中文_无需本地化.zh_CN.translation"] - -source_file="res://asset/dialogue/纯中文_无需本地化.csv" -dest_files=["res://asset/dialogue/纯中文_无需本地化.zh_CN.translation"] - -[params] - -compress=true -delimiter=0 diff --git a/asset/dialogue/纯中文_无需本地化.dialogue b/asset/dialogue/纯中文_无需本地化.dialogue deleted file mode 100644 index b82847a3..00000000 --- a/asset/dialogue/纯中文_无需本地化.dialogue +++ /dev/null @@ -1,27 +0,0 @@ -~ c02_裂缝议论 -你说的是真的啊? [ID:c02_议论文字1] -你听谁说的? [ID:c02_议论文字2] -姓李的那个女人讲的 [ID:c02_议论文字3] -好多人都在传呢 [ID:c02_议论文字4] -我也听说了 [ID:c02_议论文字5] -不是有人已经看到过了吗 [ID:c02_议论文字6] -谁看到了? [ID:c02_议论文字7] -谁啊 [ID:c02_议论文字8] -听说是她老公看到的呀 [ID:c02_议论文字9] -这么多人找他们看过病呢 [ID:c02_议论文字10] -你十三点啊 [ID:c02_议论文字11] -谁知道这病是不是他们搞得 [ID:c02_议论文字12] -这钱不就来了吗 [ID:c02_议论文字13] -啧,有道理的呀 [ID:c02_议论文字14] -想钱想疯了 [ID:c02_议论文字15] -开始用怪路子赚钱了 [ID:c02_议论文字16] -他们家住了只妖怪? [ID:c02_议论文字17] -啊?妖怪? [ID:c02_议论文字18] -你们在说什么妖怪? [ID:c02_议论文字19] -谁家有妖怪? [ID:c02_议论文字20] -啥妖怪 [ID:c02_议论文字21] -真的假的妖怪 [ID:c02_议论文字22] -三〇一二那家有妖怪 [ID:c02_议论文字23] -要死了 [ID:c02_议论文字24] -养妖怪 [ID:c02_议论文字25] -=> END \ No newline at end of file diff --git a/asset/dialogue/纯中文_无需本地化.dialogue.import b/asset/dialogue/纯中文_无需本地化.dialogue.import deleted file mode 100644 index fac79fb6..00000000 --- a/asset/dialogue/纯中文_无需本地化.dialogue.import +++ /dev/null @@ -1,16 +0,0 @@ -[remap] - -importer="dialogue_manager" -importer_version=15 -type="Resource" -uid="uid://cw6fqhsayj2mx" -path="res://.godot/imported/纯中文_无需本地化.dialogue-926494d2ab389072cb5bff08a3b44b6a.tres" - -[deps] - -source_file="res://asset/dialogue/纯中文_无需本地化.dialogue" -dest_files=["res://.godot/imported/纯中文_无需本地化.dialogue-926494d2ab389072cb5bff08a3b44b6a.tres"] - -[params] - -defaults=true diff --git a/project.godot b/project.godot index 289a25f2..2a3dc652 100644 --- a/project.godot +++ b/project.godot @@ -222,8 +222,8 @@ panel={ locale/translation_remaps={ "res://asset/art/ui/note/c02_slices.png": PackedStringArray("res://asset/art/ui/note/c02_slices_en.png:en") } -locale/translations=PackedStringArray("res://asset/dialogue/c01.zh_CN.translation", "res://asset/dialogue/c02.zh_CN.translation", "res://asset/dialogue/inspect_content.zh_CN.translation", "res://asset/dialogue/item_description.zh_CN.translation", "res://asset/dialogue/names.zh_CN.translation", "res://asset/dialogue/npc.zh_CN.translation", "res://asset/dialogue/c01.zh_SH.translation", "res://asset/dialogue/纯中文_无需本地化.zh_CN.translation", "res://asset/dialogue/c01.en.translation", "res://asset/dialogue/c03.zh_CN.translation", "res://asset/dialogue/c04.zh_CN.translation", "res://asset/dialogue/c05.zh_CN.translation", "res://asset/dialogue/c06.zh_CN.translation", "res://asset/dialogue/item_description.en.translation", "res://asset/dialogue/item_description.zh_SH.translation", "res://asset/dialogue/c02.zh_SH.translation", "res://asset/dialogue/npc.zh_SH.translation", "res://asset/dialogue/c02.en.translation", "res://asset/dialogue/inspect_content.en.translation", "res://asset/dialogue/names.en.translation", "res://asset/dialogue/npc.en.translation") -locale/translations_pot_files=PackedStringArray("res://asset/dialogue/item_description.dialogue", "res://asset/dialogue/c01.dialogue", "res://asset/dialogue/c02.dialogue", "res://asset/dialogue/inspect_content.dialogue", "res://asset/dialogue/npc.dialogue", "res://asset/dialogue/c03.dialogue", "res://asset/dialogue/c04.dialogue", "res://asset/dialogue/c05.dialogue", "res://asset/dialogue/c06.dialogue", "res://asset/dialogue/纯中文_无需本地化.dialogue", "res://asset/dialogue/event_stage.dialogue") +locale/translations=PackedStringArray("res://asset/dialogue/c01.zh_CN.translation", "res://asset/dialogue/c02.zh_CN.translation", "res://asset/dialogue/inspect_content.zh_CN.translation", "res://asset/dialogue/item_description.zh_CN.translation", "res://asset/dialogue/names.zh_CN.translation", "res://asset/dialogue/npc.zh_CN.translation", "res://asset/dialogue/c01.zh_SH.translation", "res://asset/dialogue/c01.en.translation", "res://asset/dialogue/c03.zh_CN.translation", "res://asset/dialogue/c04.zh_CN.translation", "res://asset/dialogue/c05.zh_CN.translation", "res://asset/dialogue/c06.zh_CN.translation", "res://asset/dialogue/item_description.en.translation", "res://asset/dialogue/item_description.zh_SH.translation", "res://asset/dialogue/c02.zh_SH.translation", "res://asset/dialogue/npc.zh_SH.translation", "res://asset/dialogue/c02.en.translation", "res://asset/dialogue/inspect_content.en.translation", "res://asset/dialogue/names.en.translation", "res://asset/dialogue/npc.en.translation") +locale/translations_pot_files=PackedStringArray("res://asset/dialogue/item_description.dialogue", "res://asset/dialogue/c01.dialogue", "res://asset/dialogue/c02.dialogue", "res://asset/dialogue/inspect_content.dialogue", "res://asset/dialogue/npc.dialogue", "res://asset/dialogue/c03.dialogue", "res://asset/dialogue/c04.dialogue", "res://asset/dialogue/c05.dialogue", "res://asset/dialogue/c06.dialogue", "res://asset/dialogue/event_stage.dialogue") locale/test="zh-Hans" locale/fallback="zh" diff --git a/scene/entity/inspectable.tscn b/scene/entity/inspectable.tscn index 0bcb7911..748392c5 100644 --- a/scene/entity/inspectable.tscn +++ b/scene/entity/inspectable.tscn @@ -133,7 +133,6 @@ custom_minimum_size = Vector2(150, 0) layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 6 -mouse_filter = 1 text = "tdb119a3714,据闻奉贤县分水墩有两人染受鼠疫毙命,医官拟将死者尸骸解剖以观受病之原因及其情状,竟未得死者家属之同意,以该处风气闭塞,闻解剖之说,地方人民甚为惊骇,闻已有聚众滋闹之事,并闻医官已被人殴打,政府以防疫事宜关系紧要拟改令赴沪南区一带调查防疫事宜云。,,,,\"It is reported that two people in Fenshuidun, Fengxian County have died from plague. Medical officials proposed to autopsy the bodies to examine the cause and nature of the disease, but failed to obtain consent from the families of the deceased. Due to the conservative local customs, the mention of autopsy has greatly alarmed the local people. There are reports of crowds gathering to cause trouble, and medical officials have been assaulted. Given the critical importance of epidemic prevention, the government plans to redirect orders to investigate epidemic prevention matters in the southern Shanghai area.\" " vertical_alignment = 1 diff --git a/scene/ground/script/c02/花名册.gd b/scene/ground/script/c02/花名册.gd index 513d4e2e..94ee34ba 100644 --- a/scene/ground/script/c02/花名册.gd +++ b/scene/ground/script/c02/花名册.gd @@ -23,3 +23,4 @@ func _on_button_pressed() -> void: button.texture_normal = texture_dict["1"] button.set_anchors_preset(Control.PRESET_CENTER) $ContentInspector.visible = true + button.disabled = true From 2f5e2128e3ad7b0bb8f93f3b8a815c4b189dc5ca Mon Sep 17 00:00:00 2001 From: cakipaul Date: Sun, 6 Jul 2025 04:10:18 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=9B=B8=E6=9C=BA?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E9=97=AE=E9=A2=98=EF=BC=8C=E4=B8=9D=E6=BB=91?= =?UTF-8?q?=E8=BF=90=E9=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/dialogue/names.csv | 2 +- manager/scene/scene_manager.gd | 7 ++- scene/entity/inspectable.gd | 8 ++-- scene/entity/inspectable.tscn | 2 +- scene/entity/note.gd | 1 - scene/ground/camera/camera_focus_marker.gd | 47 ++++++------------- scene/ground/scene/c01/s06_孤儿院长廊围墙.gd | 6 +-- .../ground/scene/c01/s06_孤儿院长廊围墙.tscn | 1 + scene/ground/scene/c01/s12_书店外_诡异版.gd | 6 +-- scene/ground/scene/debug_archive.txt | 42 +++++++++++++++++ 10 files changed, 70 insertions(+), 52 deletions(-) diff --git a/asset/dialogue/names.csv b/asset/dialogue/names.csv index 75499caf..1d412b5e 100644 --- a/asset/dialogue/names.csv +++ b/asset/dialogue/names.csv @@ -9,7 +9,7 @@ keys,zh_CN,en 方启钊,方启钊,"Fang Qizhao" 方小蝉,方小蝉,"Fang Xiaochan" 小男孩,小男孩,"Little Boy" -小蝉,小蝉,"Little Cicada" +小蝉,小蝉,"Little Chan" 男孩黄,男孩黄,"Boy in Yellow" 男孩蓝,男孩蓝,"Boy in Blue" 小肉圆,小肉圆,"Pudgy" diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index c277d7ff..1145651d 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -69,13 +69,12 @@ func focus_node(node: Node2D, duration := 0.0) -> void: marker.focus_node(node, duration) -func focus_player_and_reset_zoom(duration := 1.2) -> void: +func focus_player_and_reset_zoom(duration := 1.0) -> void: var marker = get_camera_marker() if marker: - # marker.force_offset = Vector2.ZERO + # 延长可更丝滑 marker.tween_zoom(1.0, duration) - # 运镜更平滑一些 - marker.focus_node(get_player(), duration + .3) + marker.focus_node(get_player(), duration) func get_lock() -> PlayerReenterLock: diff --git a/scene/entity/inspectable.gd b/scene/entity/inspectable.gd index 14087f81..80f8280a 100644 --- a/scene/entity/inspectable.gd +++ b/scene/entity/inspectable.gd @@ -164,11 +164,11 @@ func _do_action() -> void: status = STATUS_TRANSITIONING icount += 1 sfx.play() - SceneManager.focus_node(self) - SceneManager.get_camera_marker().tween_zoom(2.0) + SceneManager.focus_node(self, 0.5) + SceneManager.get_camera_marker().tween_zoom(1.5, 1.2) var tween = create_tween() - tween.tween_interval(0.8) - tween.tween_property(container, "modulate:a", 1.0, 0.7) + tween.tween_interval(0.5) + tween.tween_property(container, "modulate:a", 1.0, 0.8) tween.tween_callback(func(): status = STATUS_INSPECTING_COVER) # 改变信号源 sign_mark.interacted.connect(_on_interacted) diff --git a/scene/entity/inspectable.tscn b/scene/entity/inspectable.tscn index 748392c5..d729dedc 100644 --- a/scene/entity/inspectable.tscn +++ b/scene/entity/inspectable.tscn @@ -155,6 +155,6 @@ layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 8 theme_override_fonts/font = ExtResource("7_ianbs") -text = "Q: Exit E: Read" +text = "Q: ui_退出 E: ui_阅读" horizontal_alignment = 1 vertical_alignment = 1 diff --git a/scene/entity/note.gd b/scene/entity/note.gd index fbb4ab0a..a4cbfa26 100644 --- a/scene/entity/note.gd +++ b/scene/entity/note.gd @@ -122,7 +122,6 @@ func _show_os(): func _show_balloon(res, title): - # SceneManager.focus_node(self) DialogueManager.show_dialogue_balloon(res, title) # note viewing animation SceneManager.lock_player(0, action) diff --git a/scene/ground/camera/camera_focus_marker.gd b/scene/ground/camera/camera_focus_marker.gd index 40345294..4ccd5c18 100644 --- a/scene/ground/camera/camera_focus_marker.gd +++ b/scene/ground/camera/camera_focus_marker.gd @@ -4,9 +4,6 @@ class_name CameraFocusMarker extends Camera2D @export var force_offset := Vector2.ZERO # @export_group("Status") # @export var lock_horizontal = true -@export_group("Config") -@export var half_screen_size := Vector2(564, 240) / 2.0 -@export var shaded_height := 38 @export_group("Shake", "shake_") @export var shake_strength := 0.0 @export var shake_recovery_speed := 4.0 @@ -16,7 +13,6 @@ var speed := 2.0 var _tweeked_position := Vector2.ZERO var zoom_tween: Tween -var _focus_offset := Vector2.ZERO var shake_ignore_boundary := false @@ -33,7 +29,7 @@ func shake_camera(strength := 6.0, recovery_speed := 2.0, ignore_boundary := tru func reset_position_immediately(): if focusing_node: - progressing_position = focusing_node.global_position + _tweeked_position + force_offset + progressing_position = (focusing_node.global_position + _tweeked_position + force_offset) global_position = progressing_position print("CameraFocusMarker reset_position_immediately to:", global_position) @@ -45,10 +41,10 @@ func tweak_position(velocity, facing_direction): if abs(delta) > 10.0: _tweeked_position.x = move_toward(current_x, ideal_x, speed * 2.0) # if lock_horizontal: - # global_position.y = 0 - # _tweeked_position.y = 0 + # global_position.y = 0 + # _tweeked_position.y = 0 # else: - # _tweeked_position.y = facing_direction.y * abs(velocity.y) * 0.2 + # _tweeked_position.y = facing_direction.y * abs(velocity.y) * 0.2 # 处理过程的当下理想位置 @@ -72,6 +68,7 @@ func _physics_process(delta: float) -> void: # handle shake if shake_strength > 0.0: # 让 shake_strength 逐帧衰减 + shake_recovery_speed = min(0.1, shake_recovery_speed) shake_strength = lerpf(shake_strength, 0.0, shake_recovery_speed * delta) # [-shake_strength, +shake_strength] 范围内的同时,尽可能偏离中心 # 在 0 – 2π 之间随机一个方向,在 _last_shake_angle 的对角范围 @@ -93,9 +90,13 @@ func _physics_process(delta: float) -> void: zoom = Vector2(zoom_ratio, zoom_ratio) +var half_screen_size := Vector2(564, 240) / 2.0 +var shading_y := 38.0 + + func _clamp_boundary(target: Vector2) -> Vector2: var margin = half_screen_size / zoom_ratio - margin.y += shaded_height + margin.y += shading_y target.x = clamp(target.x, limit_left + margin.x, limit_right - margin.x) target.y = clamp(target.y, limit_top + margin.y, limit_bottom - margin.y) return target @@ -134,33 +135,13 @@ func focus_node(node: Node2D, duration := 0.0) -> void: focusing_node = null return if duration > 0.0: - _focus_offset = global_position - node.global_position if tween_focus and tween_focus.is_running(): tween_focus.kill() tween_focus = create_tween() - ( - tween_focus - . tween_property(self, "_focus_offset", Vector2.ZERO, duration) - . set_trans(Tween.TRANS_SINE) - . set_ease(Tween.EASE_IN_OUT) - ) + tween_focus.tween_method(_update_focus_progress, 0.0, 1.0, duration) + _update_focus_progress(0.0) focusing_node = node -# var exited := false -# var exit_position: Vector2 -# var enter_tree_tween: Tween -# func _exit_tree() -> void: -# exit_position = global_position -# exited = true - -# func _enter_tree() -> void: -# if exited and is_node_ready(): -# exited = false -# if enter_tree_tween and enter_tree_tween.is_running(): -# enter_tree_tween.kill() -# enter_tree_tween = create_tween() -# global_position = exit_position -# enter_tree_tween.tween_property(self, "position", Vector2.ZERO, 0.2).set_trans( -# Tween.TRANS_CUBIC -# ) +func _update_focus_progress(progress: float): + speed = 0.2 + 1.8 * smoothstep(0.0, 1.0, progress) diff --git a/scene/ground/scene/c01/s06_孤儿院长廊围墙.gd b/scene/ground/scene/c01/s06_孤儿院长廊围墙.gd index 391debec..8a7f65a3 100644 --- a/scene/ground/scene/c01/s06_孤儿院长廊围墙.gd +++ b/scene/ground/scene/c01/s06_孤儿院长廊围墙.gd @@ -90,15 +90,15 @@ func _dean_flip_book() -> void: func pre_game_intro(): SceneManager.lock_player() var camera = SceneManager.get_camera_marker() as CameraFocusMarker - camera.tween_zoom(1.5, 3.0) + camera.tween_zoom(1.5, 3.5) var p = $"../DeployLayer/四小孩画鬼差的对话ambush/FocusPoint" camera.focus_node(p, 3.0) - await Util.wait(1.5) + await Util.wait(2.0) DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s06_四个小孩画鬼差的对话") await DialogueManager.dialogue_ended # 重置镜头 SceneManager.focus_player_and_reset_zoom(2.5) - await Util.wait(1.5) + await Util.wait(2.5) await SceneManager.pop_os_with_str("c01_s06_熟悉的墙画") SceneManager.unlock_player() diff --git a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn index ee0b25f6..b808ea85 100644 --- a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn +++ b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn @@ -139,6 +139,7 @@ animations = [{ }] [node name="S06" type="Node2D"] +position = Vector2(-1, 0) metadata/_edit_horizontal_guides_ = [158.0, 91.0, 81.0] [node name="Ground" parent="." instance=ExtResource("1_bitx7")] diff --git a/scene/ground/scene/c01/s12_书店外_诡异版.gd b/scene/ground/scene/c01/s12_书店外_诡异版.gd index 8aa95bc9..28b6f462 100644 --- a/scene/ground/scene/c01/s12_书店外_诡异版.gd +++ b/scene/ground/scene/c01/s12_书店外_诡异版.gd @@ -55,16 +55,12 @@ func _on_ground_ready() -> void: func intro() -> void: begger.play("杂戏团夜晚_小孩举碗呼吸") # SceneManager.freeze_player(0) - # SceneManager.focus_node(begger, 5.) + # SceneManager.focus_node(begger, 5.0) Util.timer(1., _intro_dialog) func _intro_dialog() -> void: DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s12_诡异的书店外发钱") - # DialogueManager.dialogue_ended.connect(_on_intro_dialogue_ended, CONNECT_ONE_SHOT) - # func _on_intro_dialogue_ended(_res) -> void: - # SceneManager.focus_player_and_reset_zoom(5.) - # SceneManager.release_player() func ambush_begger_interacted(): diff --git a/scene/ground/scene/debug_archive.txt b/scene/ground/scene/debug_archive.txt index 96d4bf51..d3bd2794 100644 --- a/scene/ground/scene/debug_archive.txt +++ b/scene/ground/scene/debug_archive.txt @@ -19,6 +19,48 @@ } } }, +"c01_s06_孤儿院长廊围墙": { +"global": { +"enabled_items": {}, +"player_x": 1300.0 +}, +"ground": { +&"AnimationPlayer": {}, +&"Interactable桌椅": { +"interacted_times": 0 +}, +&"四小孩画鬼差的对话ambush": { +"played": false +}, +&"桌椅ambush1": { +"played": false +}, +&"桌椅ambush2": { +"played": false +}, +&"桌椅ambush3": { +"played": false +}, +&"猫鼠游戏失败ambush": { +"played": false +}, +&"猫鼠游戏开始ambush": { +"played": false +}, +&"猫鼠游戏胜利ambush": { +"played": false +}, +&"猫鼠游戏重置ambush": { +"played": false +}, +&"门口ambush": { +"played": false +}, +&"门口对话ambush": { +"played": false +} +} +}, "c01_s08_书店": { "global": { "c01_shelf_game_success": false,