夜行船中英排版;回忆功能(井+偷听);prop/local inspector 文本可滚动查看&居中,并且滚轮不影响切换道具

This commit is contained in:
cakipaul 2025-07-06 01:04:35 +08:00
parent e8408967fd
commit fb21480880
33 changed files with 572 additions and 259 deletions

View File

@ -27,6 +27,7 @@ ui_new_archive,已创建新存档,,,,,New save file created
ui_auto_saved,自动保存成功,,,,,Auto save successful ui_auto_saved,自动保存成功,,,,,Auto save successful
ui_notify_important_item_update,重要物品已更新,,,,,Important items updated ui_notify_important_item_update,重要物品已更新,,,,,Important items updated
ui_notify_note_update,线索笔记已更新,,,,,Clue notes 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_e_to_interact,按 E 可与场景互动,,,,,Press E to interact
ui_center_notify_press_q_to_exit,按 Q 可退出,,,,,Press Q to exit ui_center_notify_press_q_to_exit,按 Q 可退出,,,,,Press Q to exit
ui_center_notify_use_prop,按 E 使用道具,,,,,Press E to use item ui_center_notify_use_prop,按 E 使用道具,,,,,Press E to use item
@ -46,7 +47,6 @@ ui_检阅,检阅,,,,,Examine
ui_收起,收起,,,,,Put away ui_收起,收起,,,,,Put away
ui_夜行船1,百岁光阴一梦蝶。,,,,,"A hundred years of life, like a butterfly's dream." ui_夜行船1,百岁光阴一梦蝶。,,,,,"A hundred years of life, like a butterfly's dream."
ui_夜行船2,重回首往事堪嗟。,,,,,"Looking back, past events are cause for lament." 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_夜行船4,今日春来,明朝花谢。,,,,,"Spring comes today, tomorrow the flowers will wither."
ui_夜行船5,急罚盏夜阑灯灭。,,,,,Hastily draining cups as night deepens and lamps fade. ui_夜行船5,急罚盏夜阑灯灭。,,,,,Hastily draining cups as night deepens and lamps fade.
ui_夜行船6,夜行船,,,,,Night Voyage 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 finished the work the boss assigned. I can't slack off.
c01_s08_书店工钱,这个月的工钱还没拿。,,,,,I haven't collected this month's wages yet. c01_s08_书店工钱,这个月的工钱还没拿。,,,,,I haven't collected this month's wages yet.
mem_偷听对话,偷听对话,,,,,Eavesdropping mem_偷听对话,偷听对话,,,,,Eavesdropping
mem_疯子看井,疯子看井,,,,,Madman Looking at Well mem_疯子看井,疯子看井,,,,,Madman Guards Well
c01_鸡毛掸子,这是鸡毛掸子吗?,,,,,Is this a feather duster? 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}「得著生命的,將要失喪生命...」,,,,,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? c01_院长床,这本书已经看过了。{br}...那些句子是什么意思呢?,,,,,I've already read this book.{br}...What do those sentences mean?

1 keys zh_CN _character _notes _tags zh_SH en
27 ui_auto_saved 自动保存成功 Auto save successful
28 ui_notify_important_item_update 重要物品已更新 Important items updated
29 ui_notify_note_update 线索笔记已更新 Clue notes updated
30 ui_notify_mem_update 回忆已更新 Memories updated
31 ui_center_notify_press_e_to_interact 按 E 可与场景互动 Press E to interact
32 ui_center_notify_press_q_to_exit 按 Q 可退出 Press Q to exit
33 ui_center_notify_use_prop 按 E 使用道具 Press E to use item
47 ui_收起 收起 Put away
48 ui_夜行船1 百岁光阴一梦蝶。 A hundred years of life, like a butterfly's dream.
49 ui_夜行船2 重回首往事堪嗟。 Looking back, past events are cause for lament.
ui_夜行船3 今日春来。 Spring comes today.
50 ui_夜行船4 今日春来,明朝花谢。 Spring comes today, tomorrow the flowers will wither.
51 ui_夜行船5 急罚盏夜阑灯灭。 Hastily draining cups as night deepens and lamps fade.
52 ui_夜行船6 夜行船 Night Voyage
109 c01_s08_书店工作 老板交代的工作还没做完,不能偷懒。 I haven't finished the work the boss assigned. I can't slack off.
110 c01_s08_书店工钱 这个月的工钱还没拿。 I haven't collected this month's wages yet.
111 mem_偷听对话 偷听对话 Eavesdropping
112 mem_疯子看井 疯子看井 Madman Looking at Well Madman Guards Well
113 c01_鸡毛掸子 这是鸡毛掸子吗? Is this a feather duster?
114 c01_院长书桌 桌上放着一本《圣经》。{br}「得著生命的,將要失喪生命...」 There's a Bible on the desk.{br}'Whoever finds their life will lose it...'
115 c01_院长床 这本书已经看过了。{br}...那些句子是什么意思呢? I've already read this book.{br}...What do those sentences mean?

View File

@ -34,6 +34,8 @@
重要物品已更新 [ID:ui_notify_important_item_update] 重要物品已更新 [ID:ui_notify_important_item_update]
线索笔记已更新 [ID:ui_notify_note_update] 线索笔记已更新 [ID:ui_notify_note_update]
回忆已更新 [ID:ui_notify_mem_update]
按 E 可与场景互动 [ID:ui_center_notify_press_e_to_interact] 按 E 可与场景互动 [ID:ui_center_notify_press_e_to_interact]
按 Q 可退出 [ID:ui_center_notify_press_q_to_exit] 按 Q 可退出 [ID:ui_center_notify_press_q_to_exit]
@ -56,7 +58,7 @@
百岁光阴一梦蝶。 [ID:ui_夜行船1] 百岁光阴一梦蝶。 [ID:ui_夜行船1]
重回首往事堪嗟。 [ID:ui_夜行船2] 重回首往事堪嗟。 [ID:ui_夜行船2]
今日春来 [ID:ui_夜行船3] #今日春来 [ID:ui_夜行船3]
今日春来,明朝花谢。 [ID:ui_夜行船4] 今日春来,明朝花谢。 [ID:ui_夜行船4]
急罚盏夜阑灯灭。 [ID:ui_夜行船5] 急罚盏夜阑灯灭。 [ID:ui_夜行船5]
夜行船 [ID:ui_夜行船6] 夜行船 [ID:ui_夜行船6]

View File

@ -1,7 +1,7 @@
keys,zh_CN,en keys,zh_CN,en
老师,老师,"Teacher" 老师,老师,"Teacher"
大胖,大胖,"Big Fatty" 大胖,大胖,"Tubby"
监督小孩,监督小孩,"Supervising Child" 监督小孩,监督小孩,"Monitor Kid"
书店老板,书店老板,"Bookstore Owner" 书店老板,书店老板,"Bookstore Owner"
车夫,车夫,"Rickshaw Puller" 车夫,车夫,"Rickshaw Puller"
李兰,李兰,"Li Lan" 李兰,李兰,"Li Lan"
@ -12,13 +12,13 @@ keys,zh_CN,en
小蝉,小蝉,"Little Cicada" 小蝉,小蝉,"Little Cicada"
男孩黄,男孩黄,"Boy in Yellow" 男孩黄,男孩黄,"Boy in Yellow"
男孩蓝,男孩蓝,"Boy in Blue" 男孩蓝,男孩蓝,"Boy in Blue"
小肉圆,小肉圆,"Little Meatball" 小肉圆,小肉圆,"Pudgy"
小竹竿,小竹竿,"Little Bamboo Pole" 小竹竿,小竹竿,"Skinny"
孩子王,孩子王,"King of the Kids" 孩子王,孩子王,"Boss Kid"
小丁,小丁,"Xiao Ding" 小丁,小丁,"Xiao Ding"
蛋蛋,蛋蛋,"Dan Dan" 蛋蛋,蛋蛋,"Eggy"
沫儿,沫儿,"Mo'er" 沫儿,沫儿,"Bubbles"
陆仁,陆仁,"Lu Ren" 陆仁,陆仁,"Lu Ren"
吕萍,吕萍,"Lu Ping" 吕萍,吕萍,"Lu Ping"
,,"???" ,,"???"
小蝶,小蝶,"Little Butterfly" 小蝶,小蝶,"Little Die"
1 keys zh_CN en
2 老师 老师 Teacher
3 大胖 大胖 Big Fatty Tubby
4 监督小孩 监督小孩 Supervising Child Monitor Kid
5 书店老板 书店老板 Bookstore Owner
6 车夫 车夫 Rickshaw Puller
7 李兰 李兰 Li Lan
12 小蝉 小蝉 Little Cicada
13 男孩黄 男孩黄 Boy in Yellow
14 男孩蓝 男孩蓝 Boy in Blue
15 小肉圆 小肉圆 Little Meatball Pudgy
16 小竹竿 小竹竿 Little Bamboo Pole Skinny
17 孩子王 孩子王 King of the Kids Boss Kid
18 小丁 小丁 Xiao Ding
19 蛋蛋 蛋蛋 Dan Dan Eggy
20 沫儿 沫儿 Mo'er Bubbles
21 陆仁 陆仁 Lu Ren
22 吕萍 吕萍 Lu Ping
23 ??? ??? ???
24 小蝶 小蝶 Little Butterfly Little Die

View File

@ -285,3 +285,14 @@ func set_chapter_if_greater(c: int) -> void:
archive.current_chapter = c archive.current_chapter = c
# 笔记也进入下一章 # 笔记也进入下一章
EventManager.set_stage_if_greater("handnote_chapter_stage", 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)

View File

@ -39,6 +39,8 @@ class_name AssembledArchive extends Resource
@export var player_running_locked := true @export var player_running_locked := true
# prop hud 显示道具 # prop hud 显示道具
@export var prop_inventory: PropInventory @export var prop_inventory: PropInventory
# mem 展示 dict, 1-16 号
@export var mem_display_dict: Dictionary[int, bool] = {}
@export_group("八音盒", "bayinhe") @export_group("八音盒", "bayinhe")
@export var bayinhe_current_answer := [0, 0, 0, 0, 0, 0, 0, 0, 0] @export var bayinhe_current_answer := [0, 0, 0, 0, 0, 0, 0, 0, 0]

View File

@ -31,9 +31,6 @@ func set_stage(event_name: StringName, stage := 1) -> void:
if stage == 1: if stage == 1:
SceneManager.lock_player(3.0, 16, true) SceneManager.lock_player(3.0, 16, true)
SceneManager.pop_notification("ui_notify_note_update") 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 时更新,相等或小于时不更新 # 仅在设置的 stage > 当前 stage 时更新,相等或小于时不更新

View File

@ -202,6 +202,7 @@ func enable_prop_item(prop_key: String) -> void:
else: else:
printerr("enable_prop_item PropHud node not found") printerr("enable_prop_item PropHud node not found")
# display_inspector 的时候会伴随音效 # display_inspector 的时候会伴随音效
func enable_important_item(prop_key: String, display_inspector = true) -> void: func enable_important_item(prop_key: String, display_inspector = true) -> void:
var prop_hud = get_prop_hud() var prop_hud = get_prop_hud()

View File

@ -179,13 +179,11 @@ cancel={
prop_left={ prop_left={
"deadzone": 0.5, "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) "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={ prop_right={
"deadzone": 0.5, "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) "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={ escape={
@ -224,7 +222,7 @@ panel={
locale/translation_remaps={ locale/translation_remaps={
"res://asset/art/ui/note/c02_slices.png": PackedStringArray("res://asset/art/ui/note/c02_slices_en.png:en") "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/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/test="zh-Hans"
locale/fallback="zh" locale/fallback="zh"

View File

@ -25,8 +25,6 @@ func display() -> void:
if current_child: if current_child:
return return
if packed_scene: if packed_scene:
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.lock_player(0, action_key) SceneManager.lock_player(0, action_key)
# 展示时,禁用 sign_mark 的输入 # 展示时,禁用 sign_mark 的输入
sign_mark.pass_unhandled_input = true sign_mark.pass_unhandled_input = true
@ -40,8 +38,6 @@ func display() -> void:
func _exit(arg = null): func _exit(arg = null):
if current_child: if current_child:
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.unlock_player() SceneManager.unlock_player()
if current_child: if current_child:
remove_child(current_child) remove_child(current_child)

View File

@ -56,3 +56,4 @@ grow_vertical = 2
vertical_alignment = 1 vertical_alignment = 1
autowrap_mode = 3 autowrap_mode = 3
script = ExtResource("5_ik70a") script = ExtResource("5_ik70a")
vertical = null

View File

@ -9,7 +9,7 @@ signal sign_mark_offset_updated
# set(value): # set(value):
# entity_config = 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: @export var enabled := true:
set(val): set(val):
@ -51,18 +51,28 @@ var content_key: String = ""
@onready var sfx = %Sfx @onready var sfx = %Sfx
@onready var container = %Container @onready var container = %Container
@onready var cover_rect = %Cover as TextureRect @onready var cover_rect = %Cover as TextureRect
@onready var content_area = %ContentArea as Control
@onready var content_label = %ContentLabel as Label @onready var content_label = %ContentLabel as Label
@onready var tip_label = %TipLabel 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_检阅") func tip_cover_hide_notes() -> String:
var tip_notes = "Q: " + tr("ui_退出") + " " + "E: " + tr("ui_收起") 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 = ( static var content_dialogue = (
preload("res://asset/dialogue/inspect_content.dialogue") as DialogueResource preload("res://asset/dialogue/inspect_content.dialogue") as DialogueResource
) )
var status := STATUS_NORAML var status := STATUS_HIDDEN
var blinking_tween: Tween var blinking_tween: Tween
var ground_archive: GroundArchive var ground_archive: GroundArchive
@ -81,9 +91,8 @@ func _ready() -> void:
shape.size.x = collision_width_and_x.x shape.size.x = collision_width_and_x.x
area2d.position.x = collision_width_and_x.y area2d.position.x = collision_width_and_x.y
container.modulate.a = 0.0 container.modulate.a = 0.0
content_label.modulate.a = 0.0 content_area.modulate.a = 0.0
content_label.text = _get_tr_content() tip_label.text = tip_cover_hide_notes()
tip_label.text = tip_cover_hide_notes
cover_rect.texture = texture_cover cover_rect.texture = texture_cover
if Engine.is_editor_hint(): if Engine.is_editor_hint():
return return
@ -113,7 +122,7 @@ func _get_tr_content():
while line_id and line_id != "end": while line_id and line_id != "end":
var line = content_dialogue.lines[line_id] var line = content_dialogue.lines[line_id]
if line.has("text"): 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") line_id = line.get("next_id")
return inspection_note return inspection_note
@ -134,10 +143,14 @@ func _on_interacted() -> void:
func _do_action() -> 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 进行继续交互 # 不使用 lock player, 因为需要用 sign 进行继续交互
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.freeze_player(0, action_key) SceneManager.freeze_player(0, action_key)
status = STATUS_TRANSITIONING status = STATUS_TRANSITIONING
icount += 1 icount += 1
@ -154,28 +167,28 @@ func _do_action() -> void:
sign_mark.display_sign = false sign_mark.display_sign = false
cover_rect.texture = texture_cover cover_rect.texture = texture_cover
if content_key == "": if content_key == "":
tip_label.text = tip_cover_without_notes tip_label.text = tip_cover_without_notes()
else: else:
tip_label.text = tip_cover_hide_notes tip_label.text = tip_cover_hide_notes()
_blink_label(true) _blink_label(true)
start_inspecting.emit() start_inspecting.emit()
elif status == STATUS_INSPECTING_COVER: elif status == STATUS_INSPECTING_COVER:
sfx.play() sfx.play()
status = STATUS_INSPECTING_NOTES status = STATUS_INSPECTING_NOTES
tip_label.text = tip_notes tip_label.text = tip_notes()
create_tween().tween_property(content_label, "modulate:a", 1.0, 0.15) create_tween().tween_property(content_area, "modulate:a", 1.0, 0.15)
elif status == STATUS_INSPECTING_NOTES: elif status == STATUS_INSPECTING_NOTES:
sfx.play() sfx.play()
status = STATUS_INSPECTING_COVER status = STATUS_INSPECTING_COVER
if content_key == "": if content_key == "":
tip_label.text = tip_cover_without_notes tip_label.text = tip_cover_without_notes()
else: else:
tip_label.text = tip_cover_hide_notes tip_label.text = tip_cover_hide_notes()
create_tween().tween_property(content_label, "modulate:a", 0.0, 0.15) create_tween().tween_property(content_area, "modulate:a", 0.0, 0.15)
func _blink_label(init := true): func _blink_label(init := true):
if status == STATUS_NORAML: if status == STATUS_HIDDEN:
return return
blinking_tween = create_tween() blinking_tween = create_tween()
if init: if init:
@ -187,7 +200,7 @@ func _blink_label(init := true):
func _on_cancel(_body = null): func _on_cancel(_body = null):
if STATUS_TRANSITIONING == status or status == STATUS_NORAML: if STATUS_TRANSITIONING == status or status == STATUS_HIDDEN:
return return
quit_inspecting.emit() quit_inspecting.emit()
status = STATUS_TRANSITIONING status = STATUS_TRANSITIONING
@ -197,11 +210,9 @@ func _on_cancel(_body = null):
blinking_tween.kill() blinking_tween.kill()
tween.parallel().tween_property(tip_label, "modulate:a", 0.0, 0.15) tween.parallel().tween_property(tip_label, "modulate:a", 0.0, 0.15)
tween.tween_interval(1.0) tween.tween_interval(1.0)
tween.tween_callback(func(): status = STATUS_NORAML) tween.tween_callback(func(): status = STATUS_HIDDEN)
tween.tween_callback(func(): content_label.modulate.a = 0.0) tween.tween_callback(func(): content_area.modulate.a = 0.0)
SceneManager.focus_player_and_reset_zoom() SceneManager.focus_player_and_reset_zoom()
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.release_player() SceneManager.release_player()
sign_mark.display_sign = true sign_mark.display_sign = true
# 改变信号源 # 改变信号源
@ -212,7 +223,6 @@ func _on_cancel(_body = null):
func _set(property: StringName, value: Variant) -> bool: func _set(property: StringName, value: Variant) -> bool:
if property == "content_key": if property == "content_key":
content_key = value content_key = value
content_label.text = _get_tr_content()
return true return true
return false return false
@ -246,3 +256,17 @@ func _get_property_list() -> Array[Dictionary]:
func _filter_property(property: StringName) -> bool: func _filter_property(property: StringName) -> bool:
return property.find(editor_filter) >= 0 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")

View File

@ -82,19 +82,14 @@ size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
mouse_filter = 2 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 unique_name_in_owner = true
modulate = Color(1, 1, 1, 0) modulate = Color(1, 1, 1, 0)
z_index = 100
custom_minimum_size = Vector2(130, 0)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 mouse_filter = 2
vertical_alignment = 1
autowrap_mode = 3
[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) self_modulate = Color(1, 1, 1, 0.733333)
show_behind_parent = true
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -104,6 +99,36 @@ grow_vertical = 2
mouse_filter = 2 mouse_filter = 2
texture = ExtResource("7_xawjo") 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"] [node name="MarginContainer" type="MarginContainer" parent="InspectLayer/Root"]
layout_mode = 2 layout_mode = 2
offset_top = 263.0 offset_top = 263.0
@ -121,7 +146,7 @@ layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 8 size_flags_vertical = 8
theme_override_fonts/font = ExtResource("7_ianbs") theme_override_fonts/font = ExtResource("7_ianbs")
text = "Q: 退出 E: 阅读" text = "Q: Exit E: Read"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1

View File

@ -125,12 +125,8 @@ func _show_balloon(res, title):
# SceneManager.focus_node(self) # SceneManager.focus_node(self)
DialogueManager.show_dialogue_balloon(res, title) DialogueManager.show_dialogue_balloon(res, title)
# note viewing animation # note viewing animation
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.lock_player(0, action) SceneManager.lock_player(0, action)
await DialogueManager.dialogue_ended await DialogueManager.dialogue_ended
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.unlock_player() SceneManager.unlock_player()

View File

@ -2,6 +2,8 @@
class_name Npc2D extends AnimatedSprite2D class_name Npc2D extends AnimatedSprite2D
signal interacted signal interacted
# 在 unlock player 之前发射
signal talk_finished
# <0 means no walk to edge # <0 means no walk to edge
@export var snap_to_edge := true @export var snap_to_edge := true
@ -140,8 +142,6 @@ func _on_toggle_active(activated: bool) -> void:
func _on_interacted() -> void: func _on_interacted() -> void:
# play dialogue # play dialogue
if dialogue_title: if dialogue_title:
if GlobalConfig.DEBUG:
print("[" + name + "] call lock")
SceneManager.lock_player(0, action_key) SceneManager.lock_player(0, action_key)
icount += 1 icount += 1
ground_archive.set_pair(name, "icount", icount) ground_archive.set_pair(name, "icount", icount)
@ -150,8 +150,8 @@ func _on_interacted() -> void:
speaking_sign_mode = 2 speaking_sign_mode = 2
await DialogueManager.dialogue_ended await DialogueManager.dialogue_ended
speaking_sign_mode = 1 speaking_sign_mode = 1
if GlobalConfig.DEBUG: # 在 unlock 之前发射
print("[" + name + "] call lock") talk_finished.emit()
SceneManager.unlock_player() SceneManager.unlock_player()

View File

@ -326,10 +326,10 @@ func _find_props(props: Dictionary, node: Node) -> void:
if child.prop_key != &"": if child.prop_key != &"":
props[child.prop_key] = true props[child.prop_key] = true
print("Find Interactable2D prop1: " + child.prop_key) print("Find Interactable2D prop1: " + child.prop_key)
elif child.prop_key2 != &"": if child.prop_key2 != &"":
props[child.prop_key2] = true props[child.prop_key2] = true
print("Find Interactable2D prop2: " + child.prop_key2) print("Find Interactable2D prop2: " + child.prop_key2)
elif child.prop_key3 != &"": if child.prop_key3 != &"":
props[child.prop_key3] = true props[child.prop_key3] = true
print("Find Interactable2D prop3: " + child.prop_key3) print("Find Interactable2D prop3: " + child.prop_key3)
elif child is Pickable2D: elif child is Pickable2D:

View File

@ -10,16 +10,27 @@ var piano: Interactable2D
# 覆盖该方法 # 覆盖该方法
func _default_data() -> Dictionary: func _default_data() -> Dictionary:
return {"frame_relocated": false, return {"frame_relocated": false, "intro_played": false}
"intro_played": false
}
func _ready() -> void: func _ready() -> void:
super._ready() 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(): func intro_start():
_setup_display_on_locale()
SceneManager.lock_player() SceneManager.lock_player()
await animation_finished await animation_finished
SceneManager.unlock_player() SceneManager.unlock_player()
@ -28,6 +39,7 @@ func intro_start():
show_interact_help() show_interact_help()
set_data("intro_played", true) set_data("intro_played", true)
func play_intro_dialogue(): func play_intro_dialogue():
# 直接使用 sfx防止下方字幕与全屏文字重复 # 直接使用 sfx防止下方字幕与全屏文字重复
$intro_audio_player.play() $intro_audio_player.play()
@ -99,10 +111,12 @@ func _on_ambush_triggered():
# 鸡毛掸子 4.5s,再等待 3s 后掉落纸片 # 鸡毛掸子 4.5s,再等待 3s 后掉落纸片
Util.timer(8, _play_paper_animation) Util.timer(8, _play_paper_animation)
func lock_on_use_stick(): func lock_on_use_stick():
SceneManager.lock_player(4.0) SceneManager.lock_player(4.0)
SceneManager.get_player().walk_to_x(261.0) SceneManager.get_player().walk_to_x(261.0)
func _play_paper_animation(): func _play_paper_animation():
# 播放纸片动画 # 播放纸片动画
paper.enabled = true paper.enabled = true

View File

@ -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="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"] [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://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="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="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="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"] [sub_resource type="Animation" id="Animation_c6mhi"]
length = 0.001 length = 0.001
@ -95,7 +96,7 @@ tracks/4/keys = {
tracks/5/type = "value" tracks/5/type = "value"
tracks/5/imported = false tracks/5/imported = false
tracks/5/enabled = true tracks/5/enabled = true
tracks/5/path = NodePath("Intro:visible") tracks/5/path = NodePath("AnimationPlayer/Intro:visible")
tracks/5/interp = 1 tracks/5/interp = 1
tracks/5/loop_wrap = true tracks/5/loop_wrap = true
tracks/5/keys = { tracks/5/keys = {
@ -107,7 +108,7 @@ tracks/5/keys = {
tracks/6/type = "value" tracks/6/type = "value"
tracks/6/imported = false tracks/6/imported = false
tracks/6/enabled = true tracks/6/enabled = true
tracks/6/path = NodePath("Intro:modulate") tracks/6/path = NodePath("AnimationPlayer/Intro:modulate")
tracks/6/interp = 1 tracks/6/interp = 1
tracks/6/loop_wrap = true tracks/6/loop_wrap = true
tracks/6/keys = { tracks/6/keys = {
@ -263,7 +264,7 @@ tracks/18/keys = {
tracks/19/type = "value" tracks/19/type = "value"
tracks/19/imported = false tracks/19/imported = false
tracks/19/enabled = true 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/interp = 1
tracks/19/loop_wrap = true tracks/19/loop_wrap = true
tracks/19/keys = { tracks/19/keys = {
@ -292,7 +293,7 @@ capture_included = true
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("Intro:visible") tracks/0/path = NodePath("AnimationPlayer/Intro:visible")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
@ -304,7 +305,7 @@ tracks/0/keys = {
tracks/1/type = "value" tracks/1/type = "value"
tracks/1/imported = false tracks/1/imported = false
tracks/1/enabled = true tracks/1/enabled = true
tracks/1/path = NodePath("Intro:modulate") tracks/1/path = NodePath("AnimationPlayer/Intro:modulate")
tracks/1/interp = 1 tracks/1/interp = 1
tracks/1/loop_wrap = true tracks/1/loop_wrap = true
tracks/1/keys = { tracks/1/keys = {
@ -372,7 +373,7 @@ tracks/5/keys = {
tracks/6/type = "method" tracks/6/type = "method"
tracks/6/imported = false tracks/6/imported = false
tracks/6/enabled = true tracks/6/enabled = true
tracks/6/path = NodePath("Intro") tracks/6/path = NodePath("AnimationPlayer/Intro")
tracks/6/interp = 1 tracks/6/interp = 1
tracks/6/loop_wrap = true tracks/6/loop_wrap = true
tracks/6/keys = { tracks/6/keys = {
@ -422,7 +423,7 @@ tracks/9/keys = {
tracks/10/type = "value" tracks/10/type = "value"
tracks/10/imported = false tracks/10/imported = false
tracks/10/enabled = true 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/interp = 1
tracks/10/loop_wrap = true tracks/10/loop_wrap = true
tracks/10/keys = { tracks/10/keys = {
@ -643,33 +644,198 @@ libraries = {
} }
script = ExtResource("2_j5oim") 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") stream = ExtResource("3_sluu3")
volume_db = -10.0 volume_db = -10.0
bus = &"game_sfx" bus = &"game_sfx"
script = ExtResource("4_1jor4") script = ExtResource("4_1jor4")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m" 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" bus = &"game_sfx"
script = ExtResource("4_1jor4") script = ExtResource("4_1jor4")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m" 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") stream = ExtResource("3_jk3np")
volume_db = -6.933 volume_db = -6.933
bus = &"game_sfx" bus = &"game_sfx"
script = ExtResource("4_1jor4") script = ExtResource("4_1jor4")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m" 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") stream = ExtResource("5_1jor4")
volume_db = -2.0 volume_db = -2.0
bus = &"game_sfx" bus = &"game_sfx"
script = ExtResource("4_1jor4") script = ExtResource("4_1jor4")
metadata/_custom_type_script = "uid://rq6w1vuhuq1m" 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") stream = SubResource("AudioStreamSynchronized_sluu3")
bus = &"game_sfx" bus = &"game_sfx"
script = ExtResource("4_1jor4") script = ExtResource("4_1jor4")
@ -830,137 +996,6 @@ rotation = -0.000622023
energy = 0.3 energy = 0.3
blend_mode = 1 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="."] [node name="参考" type="Sprite2D" parent="."]
visible = false visible = false
modulate = Color(1, 1, 1, 0.219608) modulate = Color(1, 1, 1, 0.219608)

View File

@ -90,11 +90,11 @@ func _on_envolope_table_interacted() -> void:
func first_enter_door() -> void: func first_enter_door() -> void:
SceneManager.freeze_player(0) SceneManager.lock_player()
await Util.wait(1.5) await Util.wait(1.5)
DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s08_书店进门老板台词") DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s08_书店进门老板台词")
await DialogueManager.dialogue_ended await DialogueManager.dialogue_ended
SceneManager.release_player() SceneManager.unlock_player()
func assign_tasks() -> void: func assign_tasks() -> void:

View File

@ -17,8 +17,10 @@ func _ready() -> void:
func _on_ground_ready() -> void: func _on_ground_ready() -> void:
SceneManager.get_player().set_facing_direction(Vector2.RIGHT) SceneManager.get_player().set_facing_direction(Vector2.RIGHT)
SceneManager.get_player().update_x_with_camera_followed(78.0) 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_眼镜盒")
SceneManager.enable_important_item("prop_船票") SceneManager.enable_important_item("prop_船票")
await SceneManager.pop_os_with_str("c02_s01_下黄包车") SceneManager.pop_os_with_str("c02_s01_下黄包车")
ArchiveManager.set_chapter_if_greater(2)
EventManager.set_stage_if_greater(&"handnote_c02_road_address", 1)

View File

@ -73,6 +73,10 @@ func _on_ground_ready() -> void:
$"../DeployLayer/Closeup井".exit.connect(func(_arg): madman_npc.visible = true) $"../DeployLayer/Closeup井".exit.connect(func(_arg): madman_npc.visible = true)
else: else:
madman_npc.visible = true madman_npc.visible = true
madman_npc.talk_finished.connect(func():
# 2 号为井边记忆
ArchiveManager.unlock_memory(2)
)
if ArchiveManager.get_global_value(&"c02_show_grounded_coins"): if ArchiveManager.get_global_value(&"c02_show_grounded_coins"):
# 奠字 + 纸钱 # 奠字 + 纸钱
@ -191,6 +195,8 @@ func eavesdrop() -> void:
await Util.wait(1.5) await Util.wait(1.5)
await SceneManager.pop_os_with_str("c02_偷听李癞对话后") await SceneManager.pop_os_with_str("c02_偷听李癞对话后")
EventManager.set_stage_if_greater(&"handnote_c02_meat_knockDoor", 1) EventManager.set_stage_if_greater(&"handnote_c02_meat_knockDoor", 1)
# 1 号为偷听对话
ArchiveManager.unlock_memory(1)
SceneManager.unlock_player() SceneManager.unlock_player()

View File

@ -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_一楼内侧楼道": { "c02_s05_一楼内侧楼道": {
"global": { "global": {
"c02_madman_hitwall": true, "c02_madman_hitwall": true,

View File

@ -20,13 +20,6 @@ script = ExtResource("1_pks84")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource("9_jsof5") 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="."] [node name="UILayer" type="CanvasLayer" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
layer = 12 layer = 12
@ -80,3 +73,10 @@ scale = Vector2(0.24, 0.24)
item_key = "prop_令牌" item_key = "prop_令牌"
display_time = 1.5 display_time = 1.5
metadata/_edit_use_anchors_ = true 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

View File

@ -80,6 +80,7 @@ offset_bottom = 261.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
horizontal_scroll_mode = 0 horizontal_scroll_mode = 0
vertical_scroll_mode = 3
[node name="ButtonsVBox" type="VBoxContainer" parent="Bag/Book/ScrollContainer"] [node name="ButtonsVBox" type="VBoxContainer" parent="Bag/Book/ScrollContainer"]
unique_name_in_owner = true unique_name_in_owner = true
@ -135,7 +136,13 @@ texture = ExtResource("8_j146j")
expand_mode = 1 expand_mode = 1
stretch_mode = 5 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 unique_name_in_owner = true
custom_minimum_size = Vector2(164, 90) custom_minimum_size = Vector2(164, 90)
layout_mode = 2 layout_mode = 2
@ -161,4 +168,5 @@ text = "浦育院院长秦阳
公寓地址 芦昌路26弄3号" 公寓地址 芦昌路26弄3号"
editable = false editable = false
wrap_mode = 1 wrap_mode = 1
scroll_smooth = true indent_wrapped_lines = true
scroll_fit_content_height = true

View File

@ -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="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://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"] [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"] [node name="Button" type="Button"]
custom_minimum_size = Vector2(130, 26) custom_minimum_size = Vector2(130, 26)
offset_right = 20.0 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_constants/icon_max_width = 8
theme_override_fonts/font = ExtResource("1_5nv8m") theme_override_fonts/font = ExtResource("1_5nv8m")
theme_override_font_sizes/font_size = 15 theme_override_font_sizes/font_size = 15
theme_override_styles/focus = SubResource("StyleBoxEmpty_dck1d")
toggle_mode = true toggle_mode = true
text = "院长的信" text = "院长的信"
icon = ExtResource("1_jf0g1") icon = ExtResource("1_jf0g1")

View File

@ -1,9 +1,10 @@
extends CanvasLayer class_name Memory extends CanvasLayer
func _ready() -> void: func _ready() -> void:
layer = GlobalConfig.CANVAS_LAYER_UX_PANEL layer = GlobalConfig.CANVAS_LAYER_UX_PANEL
SceneManager.toggle_pause_counter(true) SceneManager.toggle_pause_counter(true)
update_display()
func _unhandled_input(event: InputEvent) -> void: func _unhandled_input(event: InputEvent) -> void:
@ -20,3 +21,24 @@ func _unhandled_input(event: InputEvent) -> void:
func quit() -> void: func quit() -> void:
SceneManager.toggle_pause_counter(false) SceneManager.toggle_pause_counter(false)
queue_free() 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]

View File

@ -65,7 +65,7 @@ texture = ExtResource("3_mydtv")
expand_mode = 5 expand_mode = 5
stretch_mode = 5 stretch_mode = 5
[node name="GridContainer" type="GridContainer" parent="Mem"] [node name="P1" type="GridContainer" parent="Mem"]
z_index = 10 z_index = 10
layout_mode = 2 layout_mode = 2
offset_left = 90.0 offset_left = 90.0
@ -76,47 +76,55 @@ theme_override_constants/h_separation = 19
theme_override_constants/v_separation = 7 theme_override_constants/v_separation = 7
columns = 2 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" title = "mem_疯子看井"
[node name="GridContainer2" type="GridContainer" parent="Mem"] [node name="P2" type="GridContainer" parent="Mem"]
z_index = 10 z_index = 10
layout_mode = 2 layout_mode = 2
offset_left = 320.0 offset_left = 320.0
@ -127,42 +135,50 @@ theme_override_constants/h_separation = 19
theme_override_constants/v_separation = 7 theme_override_constants/v_separation = 7
columns = 2 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" 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 layout_mode = 2
packed_scene = ExtResource("5_7f8pt") packed_scene = ExtResource("5_7f8pt")
title = "mem_偷听对话" 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 layout_mode = 2
packed_scene = ExtResource("6_dp1y4") packed_scene = ExtResource("6_dp1y4")
title = "mem_疯子看井" title = "mem_疯子看井"

View File

@ -419,6 +419,13 @@ func _unhandled_input(event: InputEvent) -> void:
elif event.is_action_pressed("prop_right"): elif event.is_action_pressed("prop_right"):
on_right_pressed() on_right_pressed()
get_viewport().set_input_as_handled() 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: func _input(event: InputEvent) -> void:

View File

@ -186,6 +186,17 @@ func _show_prop_words(line_id: String):
func _unhandled_input(event: InputEvent) -> void: func _unhandled_input(event: InputEvent) -> void:
if status == STATUS_HIDDEN: if status == STATUS_HIDDEN:
return 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"): if event.is_action_pressed("cancel"):
get_viewport().set_input_as_handled() get_viewport().set_input_as_handled()
_hide() _hide()

View File

@ -90,16 +90,22 @@ theme_override_constants/margin_top = 60
theme_override_constants/margin_right = 200 theme_override_constants/margin_right = 200
theme_override_constants/margin_bottom = 60 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 unique_name_in_owner = true
custom_minimum_size = Vector2(150, 0) custom_minimum_size = Vector2(150, 0)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 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 vertical_alignment = 1
autowrap_mode = 3 autowrap_mode = 3
@ -123,6 +129,6 @@ modulate = Color(1, 1, 1, 0)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
theme_override_fonts/font = ExtResource("4_opug5") theme_override_fonts/font = ExtResource("4_opug5")
text = "Q: 退出 E: 阅读" text = "Q: Exit E: Read"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1

View File

@ -3,6 +3,7 @@ extends Node
@export var property_name := "text" @export var property_name := "text"
@export var translation_key := "" @export var translation_key := ""
@export var vertical := false
@export_tool_button("刷新") var refresh = _refresh.bind(true) @export_tool_button("刷新") var refresh = _refresh.bind(true)
@ -19,4 +20,15 @@ func _refresh(from_tool := false):
var msg = tr(translation_key) var msg = tr(translation_key)
if from_tool: if from_tool:
msg = items_translation.get_message(translation_key) 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()

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://dw0s23v7qmj28"] [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"] [ext_resource type="Script" uid="uid://c0l6vgrnqr2ge" path="res://ui/vertical_label.gd" id="2_vs1gg"]
[node name="VerticalLabel" type="Label"] [node name="VerticalLabel" type="Label"]