prop 检阅可配置是否显示详情页;npc 。。。 大小调整;院长房间首次提示只显示一次

This commit is contained in:
cakipaul 2025-08-18 22:50:35 +08:00
parent 35ced6237b
commit 8422c7a614
7 changed files with 59 additions and 10 deletions

View File

@ -47,7 +47,7 @@ input_拼凑信件,点击选择信件碎片方向键移动E 旋转碎片
input_书架游戏,点击书本可选中或交换Q 退出,,,,,"Click books to select or swap, Q to exit" input_书架游戏,点击书本可选中或交换Q 退出,,,,,"Click books to select or swap, Q to exit"
ui_click_to_knock_door,鼠标点击可敲门,,,,,Click to knock the door. ui_click_to_knock_door,鼠标点击可敲门,,,,,Click to knock the door.
ui_click_to_knock_door_screen,点击可敲门,,,,,Click to knock the door. ui_click_to_knock_door_screen,点击可敲门,,,,,Click to knock the door.
ui_获得道具,获得道具,,,,,Item Obtained ui_获得,获得,,,,,Obtained
ui_退出,退出,,,,,Exit ui_退出,退出,,,,,Exit
ui_阅读,阅读,,,,,Read ui_阅读,阅读,,,,,Read
ui_检阅,检阅,,,,,Examine ui_检阅,检阅,,,,,Examine
@ -119,8 +119,10 @@ 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_眼镜盒_说明,这副眼镜对我很重要。{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 Chan Doll prop_小蝉人偶,小蝉人偶,,,[#texture=c02/小蝉人偶.png],,Little Chan Doll
prop_小蝉人偶_说明,小小的人儿,小小的鞋子,小小的友情啊——像蝶依偎着花。,,,,,"Little person, little shoes, little friendship—like a butterfly nestled against a flower." prop_小蝉人偶_说明,小小的人儿,小小的鞋子,小小的友情啊——像蝶依偎着花。,,,,,"Little person, little shoes, little friendship—like a butterfly nestled against a flower."
prop_小蝉人偶_详情,skip,,,,,
prop_单只小鞋子,一只小鞋子,,,[#texture=c02/小鞋子1.png],,A Single Small Shoe 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." 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."
prop_单只小鞋子_详情,skip,,,,,
c01_s05_检查院长房间,好像忘记了什么事情,再回去检查一遍吧。,,ID格式 prop_xx_说明,,,I feel like I've forgotten something. Let me go back and check again. c01_s05_检查院长房间,好像忘记了什么事情,再回去检查一遍吧。,,ID格式 prop_xx_说明,,,I feel like I've forgotten something. Let me go back and check again.
c01_s07_需要报纸,书店还没开门。,,,,,The bookstore isn't open yet. 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.

1 keys zh_CN _character _notes _tags zh_SH en
47 input_书架游戏 点击书本可选中或交换,Q 退出 Click books to select or swap, Q to exit
48 ui_click_to_knock_door 鼠标点击可敲门 Click to knock the door.
49 ui_click_to_knock_door_screen 点击可敲门 Click to knock the door.
50 ui_获得道具 ui_获得 获得道具 获得 Item Obtained Obtained
51 ui_退出 退出 Exit
52 ui_阅读 阅读 Read
53 ui_检阅 检阅 Examine
119 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.
120 prop_小蝉人偶 小蝉人偶 [#texture=c02/小蝉人偶.png] Little Chan Doll
121 prop_小蝉人偶_说明 小小的人儿,小小的鞋子,小小的友情啊——像蝶依偎着花。 Little person, little shoes, little friendship—like a butterfly nestled against a flower.
122 prop_小蝉人偶_详情 skip
123 prop_单只小鞋子 一只小鞋子 [#texture=c02/小鞋子1.png] A Single Small Shoe
124 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.
125 prop_单只小鞋子_详情 skip
126 c01_s05_检查院长房间 好像忘记了什么事情,再回去检查一遍吧。 ID格式: prop_xx_说明 I feel like I've forgotten something. Let me go back and check again.
127 c01_s07_需要报纸 书店还没开门。 The bookstore isn't open yet.
128 c01_s08_书店工作 老板交代的工作还没做完,不能偷懒。 I haven't finished the work the boss assigned. I can't slack off.

View File

@ -58,7 +58,7 @@
鼠标点击可敲门[ID:ui_click_to_knock_door] 鼠标点击可敲门[ID:ui_click_to_knock_door]
点击可敲门[ID:ui_click_to_knock_door_screen] 点击可敲门[ID:ui_click_to_knock_door_screen]
获得道具[ID:ui_获得道具] 获得[ID:ui_获得]
退出[ID:ui_退出] 退出[ID:ui_退出]
阅读[ID:ui_阅读] 阅读[ID:ui_阅读]
检阅[ID:ui_检阅] 检阅[ID:ui_检阅]
@ -157,8 +157,10 @@
这副眼镜对我很重要。{br}记得小时候在浦育院的日子,我经常会在半夜时听到奇怪的说话声,还时不时能看见其他小孩子看不见的东西。{br}院长不知从哪儿找来了这样一副眼镜,戴上它后那些怪事就很少发生。{br}随着年龄增长,我几乎已用不到这副眼镜。现在它对我来说似乎有了新的意义。[ID:prop_眼镜盒_说明] 这副眼镜对我很重要。{br}记得小时候在浦育院的日子,我经常会在半夜时听到奇怪的说话声,还时不时能看见其他小孩子看不见的东西。{br}院长不知从哪儿找来了这样一副眼镜,戴上它后那些怪事就很少发生。{br}随着年龄增长,我几乎已用不到这副眼镜。现在它对我来说似乎有了新的意义。[ID:prop_眼镜盒_说明]
小蝉人偶[#texture=c02/小蝉人偶.png][ID:prop_小蝉人偶] 小蝉人偶[#texture=c02/小蝉人偶.png][ID:prop_小蝉人偶]
小小的人儿,小小的鞋子,小小的友情啊——像蝶依偎着花。[ID:prop_小蝉人偶_说明] 小小的人儿,小小的鞋子,小小的友情啊——像蝶依偎着花。[ID:prop_小蝉人偶_说明]
skip[ID:prop_小蝉人偶_详情]
一只小鞋子[#texture=c02/小鞋子1.png][ID:prop_单只小鞋子] 一只小鞋子[#texture=c02/小鞋子1.png][ID:prop_单只小鞋子]
这只小鞋子曾经属于一个裹了小脚的女孩。{br}鞋不成双,祸事难防。[ID:prop_单只小鞋子_说明] 这只小鞋子曾经属于一个裹了小脚的女孩。{br}鞋不成双,祸事难防。[ID:prop_单只小鞋子_说明]
skip[ID:prop_单只小鞋子_详情]
=> END => END
#~ prop说明 #~ prop说明

View File

@ -30,6 +30,8 @@ var archives_dict: Dictionary[int, AssembledArchive] = {}
var archives_notes_dict: Dictionary[int, String] = {} var archives_notes_dict: Dictionary[int, String] = {}
var autosave_timer := Timer.new() var autosave_timer := Timer.new()
# 供运行时缓存跨场景数据
var _runtime_global_dictionary: Dictionary[String, Variant] = {}
func _ready() -> void: func _ready() -> void:
# 禁用默认退出行为,在 _notification 处理 NOTIFICATION_WM_CLOSE_REQUEST 时保存数据 # 禁用默认退出行为,在 _notification 处理 NOTIFICATION_WM_CLOSE_REQUEST 时保存数据
@ -369,3 +371,20 @@ func unlock_memory(id: int) -> void:
return return
archive.mem_display_dict[id] = true archive.mem_display_dict[id] = true
SceneManager.pop_notification("ui_notify_mem_update") SceneManager.pop_notification("ui_notify_mem_update")
# 供运行时缓存跨场景数据
func runtime_set(key: String, value: Variant) -> void:
_runtime_global_dictionary[key] = value
func runtime_get(key: String, default_value: Variant = null) -> Variant:
return _runtime_global_dictionary.get(key, default_value)
func runtime_has(key: String) -> bool:
return _runtime_global_dictionary.has(key)
func runtime_remove(key: String) -> void:
_runtime_global_dictionary.erase(key)

View File

@ -136,7 +136,7 @@ unique_name_in_owner = true
modulate = Color(0.753984, 0.753984, 0.753984, 1) modulate = Color(0.753984, 0.753984, 0.753984, 1)
z_index = 100 z_index = 100
position = Vector2(0, -60) position = Vector2(0, -60)
scale = Vector2(0.07, 0.07) scale = Vector2(0.05, 0.05)
[node name="Sprite2D" type="AnimatedSprite2D" parent="SpeakingSign2D"] [node name="Sprite2D" type="AnimatedSprite2D" parent="SpeakingSign2D"]
light_mask = 16 light_mask = 16

View File

@ -189,6 +189,10 @@ var help_tween_paused := false
func show_interact_help(): func show_interact_help():
const shown_key = "c02_s05_has_shown_tip"
if ArchiveManager.runtime_get(shown_key):
return
ArchiveManager.runtime_set(shown_key, true)
tip.modulate.a = 0.0 tip.modulate.a = 0.0
tip.show() tip.show()
SceneManager.lock_player() SceneManager.lock_player()

View File

@ -174,6 +174,15 @@ func get_item_description(prop_key: String) -> String:
return tr(prop_key + "_说明").replace("{br}", "\n") return tr(prop_key + "_说明").replace("{br}", "\n")
func get_bag_item_description(prop_key: String) -> String:
# 优先访问 _背包说明, if null then _说明
var tr_key = prop_key + "_背包说明"
var content = tr(tr_key)
if content == tr_key:
return tr(prop_key + "_说明").replace("{br}", "\n")
return content.replace("{br}", "\n")
func _reload_cache_and_realign_display() -> void: func _reload_cache_and_realign_display() -> void:
if ArchiveManager.archive: if ArchiveManager.archive:
inventory = ArchiveManager.archive.prop_inventory inventory = ArchiveManager.archive.prop_inventory
@ -592,13 +601,24 @@ func inspect_item(prop_key: String, display_obtained := true, as_important_item
printerr("prophud inspect_item invalid texture for key:", prop_key) printerr("prophud inspect_item invalid texture for key:", prop_key)
return return
if as_important_item: if as_important_item:
# skip | show
var display_mode = tr(prop_key + "_详情")
inspector.pop_prop_inspection(prop_key, texture, true)
# 重要物品可能展示检阅界面
if display_mode == "show":
var content = get_item_description(prop_key) var content = get_item_description(prop_key)
var wide = len(content) > 150 inspector.hiding_tween_started.connect(_post_display_detail.bind(texture, content), CONNECT_ONE_SHOT)
inspector.pop_standard_inspection(texture, null, content, false, wide)
else: else:
inspector.pop_prop_inspection(prop_key, texture, display_obtained) inspector.pop_prop_inspection(prop_key, texture, display_obtained)
# 重要物品可能展示检阅界面
func _post_display_detail(texture, content) -> void:
var wide = len(content) > 150
var inspector = SceneManager.get_inspector() as PropInspector
inspector.pop_standard_inspection(texture, null, content, false, wide)
func disable_prop_item(prop_key: String) -> void: func disable_prop_item(prop_key: String) -> void:
if not inventory or not prop_key: if not inventory or not prop_key:
return return

View File

@ -8,6 +8,7 @@ enum {
STATUS_INSPECTING_NOTES STATUS_INSPECTING_NOTES
} }
signal hiding_tween_started
signal quit_and_hidden signal quit_and_hidden
@onready var mouse_mask = %MouseMask as Control @onready var mouse_mask = %MouseMask as Control
@ -64,11 +65,10 @@ func _hide():
blinking_tween.kill() blinking_tween.kill()
hiding_tween.parallel().tween_property(tip_label, "modulate:a", 0.0, 0.15) hiding_tween.parallel().tween_property(tip_label, "modulate:a", 0.0, 0.15)
hiding_tween.tween_callback(_post_hide) hiding_tween.tween_callback(_post_hide)
# 在状态设置后发送信号
hiding_tween_started.emit()
func _post_hide(): func _post_hide():
# hiding_tween 被 kill 的时候需要调用 _post_hide 或 quit_and_hidden.emit()
quit_and_hidden.emit()
scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE scroll_container.mouse_filter = Control.MOUSE_FILTER_IGNORE
locking = false locking = false
full_texture.texture = null full_texture.texture = null
@ -78,6 +78,8 @@ func _post_hide():
tip_label.text = tip_cover tip_label.text = tip_cover
notes_bg.visible = false notes_bg.visible = false
visible = false visible = false
# hiding_tween 被 kill 的时候需要调用 _post_hide 或 quit_and_hidden.emit()
quit_and_hidden.emit()
func _blink_label(init := true): func _blink_label(init := true):
@ -169,7 +171,7 @@ func pop_prop_inspection(
# 缩略只要第一行 # 缩略只要第一行
var content = original_word_lines[0] + ("..." if len(original_word_lines) > 1 else "") var content = original_word_lines[0] + ("..." if len(original_word_lines) > 1 else "")
if display_obtained: if display_obtained:
var obtain_str = tr("ui_获得道具") var obtain_str = tr("ui_获得")
inspector_balloon.show_prop_balloon(obtain_str, prop_title, content) inspector_balloon.show_prop_balloon(obtain_str, prop_title, content)
else: else:
inspector_balloon.show_prop_content(content) inspector_balloon.show_prop_content(content)