diff --git a/addons/dialogue_manager/compiler/compiled_line.gd b/addons/dialogue_manager/compiler/compiled_line.gd
index 972fd5cb..29863548 100644
--- a/addons/dialogue_manager/compiler/compiled_line.gd
+++ b/addons/dialogue_manager/compiler/compiled_line.gd
@@ -110,6 +110,7 @@ func to_data() -> Dictionary:
d.siblings = siblings
DMConstants.TYPE_RESPONSE:
+ # d.text = text.replace("
", "\n")
d.text = text
if not responses.is_empty():
@@ -131,6 +132,7 @@ func to_data() -> Dictionary:
d.notes = notes
DMConstants.TYPE_DIALOGUE:
+ # d.text = text.replace("
", "\n")
d.text = text
if translation_key != text:
diff --git a/addons/dialogue_manager/compiler/compiler.gd b/addons/dialogue_manager/compiler/compiler.gd
index a370ef6a..fe9c7f37 100644
--- a/addons/dialogue_manager/compiler/compiler.gd
+++ b/addons/dialogue_manager/compiler/compiler.gd
@@ -14,6 +14,7 @@ static func compile_string(text: String, path: String) -> DMCompilerResult:
result.titles = compilation.titles
result.first_title = compilation.first_title
result.errors = compilation.errors
+ # result.lines = compilation.lines
result.lines = compilation.data
result.raw_text = text
diff --git a/addons/dialogue_manager/views/main_view.gd b/addons/dialogue_manager/views/main_view.gd
index 00581dcd..9aad5e34 100644
--- a/addons/dialogue_manager/views/main_view.gd
+++ b/addons/dialogue_manager/views/main_view.gd
@@ -563,9 +563,9 @@ func generate_translations_keys() -> void:
# Add a translation file to the project settings
func add_path_to_project_translations(path: String) -> void:
var translations: PackedStringArray = ProjectSettings.get_setting("internationalization/locale/translations")
- if not path in translations:
- translations.append(path)
- ProjectSettings.save()
+ # if not path in translations:
+ # translations.append(path)
+ # ProjectSettings.save()
# Export dialogue and responses to CSV
@@ -615,11 +615,12 @@ func export_translations_to_csv(path: String) -> void:
notes_column = column_count
column_count += 1
existing_csv["keys"].append("_notes")
- # include tags
- if tags_coloumn == -1:
- tags_coloumn = column_count
- column_count += 1
- existing_csv["keys"].append("_tags")
+
+ # include tags
+ if tags_coloumn == -1:
+ tags_coloumn = column_count
+ column_count += 1
+ existing_csv["keys"].append("_tags")
# Start a new file
file = FileAccess.open(path, FileAccess.WRITE)
@@ -666,11 +667,12 @@ func export_translations_to_csv(path: String) -> void:
line_to_save[default_locale_column] = line.text
if character_column > -1:
- line_to_save[character_column] = "(response)" if line.type == DMConstants.TYPE_RESPONSE else line.character
+ line_to_save[character_column] = "(response)" if line.type == DMConstants.TYPE_RESPONSE else line.get("character","")
if notes_column > -1:
- line_to_save[notes_column] = line.notes
- if tags_coloumn > -1 and line.tags.size() > 0:
- line_to_save[tags_coloumn] = "[#" + "][#".join(line.tags) + "]"
+ line_to_save[notes_column] = line.get("notes","")
+ var tags = line.get("tags",[]) as Array
+ if tags_coloumn > -1 and tags.size() > 0:
+ line_to_save[tags_coloumn] = "[#" + "][#".join(tags) + "]"
lines_to_save.append(line_to_save)
diff --git a/asset/art/prop/c01/信.png.import b/asset/art/prop/c01/信.png.import
new file mode 100644
index 00000000..996ab867
--- /dev/null
+++ b/asset/art/prop/c01/信.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cpbtccuvtn1p2"
+path="res://.godot/imported/信.png-3a73e49fce8c47ae21f0125e66711462.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://asset/art/prop/c01/信.png"
+dest_files=["res://.godot/imported/信.png-3a73e49fce8c47ae21f0125e66711462.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/asset/art/prop/c01/信件右上.png b/asset/art/prop/c01/信件右上.png
new file mode 100755
index 00000000..33a4a0a7
Binary files /dev/null and b/asset/art/prop/c01/信件右上.png differ
diff --git a/asset/art/prop/c01/信件右上.png.import b/asset/art/prop/c01/信件右上.png.import
new file mode 100644
index 00000000..018665cf
--- /dev/null
+++ b/asset/art/prop/c01/信件右上.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://2bnmrhuxkuv3"
+path="res://.godot/imported/信件右上.png-63cefdf75c230b34502b61da1f84e602.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://asset/art/prop/c01/信件右上.png"
+dest_files=["res://.godot/imported/信件右上.png-63cefdf75c230b34502b61da1f84e602.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/asset/art/prop/c01/信件左上.png b/asset/art/prop/c01/信件左上.png
new file mode 100755
index 00000000..57670e2e
Binary files /dev/null and b/asset/art/prop/c01/信件左上.png differ
diff --git a/asset/art/prop/c01/信件左上.png.import b/asset/art/prop/c01/信件左上.png.import
new file mode 100644
index 00000000..d9a5df0e
--- /dev/null
+++ b/asset/art/prop/c01/信件左上.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://d24q8r6yklf1w"
+path="res://.godot/imported/信件左上.png-dfd85c03ddfdc23a6ddae9026ff8412e.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://asset/art/prop/c01/信件左上.png"
+dest_files=["res://.godot/imported/信件左上.png-dfd85c03ddfdc23a6ddae9026ff8412e.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/asset/art/prop/c01/信件碎片.png b/asset/art/prop/c01/信件碎片.png
new file mode 100755
index 00000000..4e75f923
Binary files /dev/null and b/asset/art/prop/c01/信件碎片.png differ
diff --git a/asset/art/prop/c01/信件碎片.png.import b/asset/art/prop/c01/信件碎片.png.import
new file mode 100644
index 00000000..f53abda5
--- /dev/null
+++ b/asset/art/prop/c01/信件碎片.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://oh4e48nxm4j6"
+path="res://.godot/imported/信件碎片.png-148d8c76f1c905d18bd18b04343030cd.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://asset/art/prop/c01/信件碎片.png"
+dest_files=["res://.godot/imported/信件碎片.png-148d8c76f1c905d18bd18b04343030cd.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/asset/art/prop/c01/院长的信.png b/asset/art/prop/c01/院长的信.png
new file mode 100644
index 00000000..679e3e42
Binary files /dev/null and b/asset/art/prop/c01/院长的信.png differ
diff --git a/asset/art/prop/c01/院长的信.png.import b/asset/art/prop/c01/院长的信.png.import
new file mode 100644
index 00000000..94791bb0
--- /dev/null
+++ b/asset/art/prop/c01/院长的信.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dl214l7im21sf"
+path="res://.godot/imported/院长的信.png-e512e10d022a04385e8eed120b757699.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://asset/art/prop/c01/院长的信.png"
+dest_files=["res://.godot/imported/院长的信.png-e512e10d022a04385e8eed120b757699.ctex"]
+
+[params]
+
+compress/mode=0
+compress/high_quality=false
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/normal_map=0
+compress/channel_pack=0
+mipmaps/generate=false
+mipmaps/limit=-1
+roughness/mode=0
+roughness/src_normal=""
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/normal_map_invert_y=false
+process/hdr_as_srgb=false
+process/hdr_clamp_exposure=false
+process/size_limit=0
+detect_3d/compress_to=1
diff --git a/asset/dialogue/inspect_content.csv b/asset/dialogue/inspect_content.csv
index 51766cd5..4428c028 100644
--- a/asset/dialogue/inspect_content.csv
+++ b/asset/dialogue/inspect_content.csv
@@ -2,8 +2,8 @@ keys,zh_CN,_character,_notes,_tags,en
t89c0f4a8de,x年,,,,
t356af5308e,下午一点,,,,
c01_信件全文,"小蝶:
-【信件正文内容...】
-【落款】",,,,
+信件正文内容...
+落款",,,,
t344c97cf2c,据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。,,,,
tdb119a3714,有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。,,,,
ta750647b12,《申报》,,,,
diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv
index 1a46f099..8a23adcb 100644
--- a/asset/dialogue/item_description.csv
+++ b/asset/dialogue/item_description.csv
@@ -1,137 +1,124 @@
-keys,zh_CN,en,_character,_notes,_tags
-c01_纸包钥匙,一张纸条包着钥匙,,,,
-c02_寻人启事1,似乎是一张寻人启事,,,,
-c02_寻人启事2,脸的部分被撕掉了,看不清,,,,
-=>en,=>en,,,,
-c01_获得令牌,令牌,,获得,,[#item]
-c01_获得灵魂令牌,带有灵魂的令牌,,获得,,[#item]
-c01_获得院长信件,院长的信件,,获得,,[#item]
-c02_获得1012钥匙,1012钥匙,,获得,,[#item]
-c02_获得老虎钳,老虎钳,,获得,,[#item]
-c02_获得绳子,绳子,,获得,,[#item]
-c02_获得小猫玩具脑袋,小猫玩具脑袋,,获得,,[#item]
-c02_获得小猫玩具,小猫玩具,,获得,,[#item]
-c02_获得钥匙,钥匙,,获得,,[#item]
-c02_获得火柴,火柴,,获得,,[#item]
-c02_1014钥匙,1014钥匙,,获得,,[#item]
-c02_老鼠洞1,一个老鼠洞,,,,
-c02_老鼠洞2,在这种楼里挺常见的,,,,
-ui_新游戏,新游戏,,,,
-ui_继续游戏,继续游戏,,,,
-ui_退出游戏,退出游戏,,,,
-c02_寻人启事,"似乎是一张寻人启事
-脸的部分被撕掉了,看不清",,,,
-prop_报纸,报纸,,,,[#texture=c01/信碎片1.png]
-index_新游戏,新游戏,,,,
-index_继续游戏,继续游戏,,,,
-index_退出游戏,退出游戏,,,,
-setting_总音量,总音量,,,,
-setting_音效音量,音效音量,,,,
-setting_对话音量,对话音量,,,,
-setting_全屏游戏,全屏游戏,,,,
-setting_窗口置顶,窗口置顶,,,,
-setting_自动保存,自动保存,,,,
-setting_主界面,回到主界面,,,,
-setting_退出,保存并退出,,,,
-setting_日志,打开日志,,,,
-ui_秒,秒,,,,
-ui_saved_all,已保存所有数据,,,,
-ui_new_archive,已创建新存档,,,,
-ui_auto_saved,自动保存成功,,,,
-ui_press_e,按 E 与场景互动,,,,
-ui_press_b,按 B 打开背包,,,,
-ui_press_shift,按住 Shift 奔跑,,,,
-input_拼凑信件,点击选择信件碎片,方向键移动,按 E 旋转,,,,
-ui_获得,获得,,,,
-ui_退出,退出,Exit,,,
-ui_阅读,阅读,Read,,,
-ui_检阅,检阅,,,,
-ui_收起,收起,Hold,,,
-ui_夜行船1,百岁光阴一梦蝶。,,,,
-ui_夜行船2,重回⾸往事堪嗟。,,,,
-ui_夜行船3,今⽇春来。明朝花谢。,,,,
-ui_夜行船4,急罚盏夜阑灯灭。,,,,
-ui_夜行船5,夜行船,,,,
-prop_空手,空手,,,,
-prop_信碎片1,信碎片(一),,,,[#texture=c01/信碎片1.png]
-prop_信碎片2,信碎片(二),,,,[#texture=c01/信碎片1.png]
-prop_院长的信,院长的信,,,,[#texture=c01/信碎片1.png]
-prop_银元,银元,,,,[#texture=c01/银元.png]
-prop_令牌,令牌,,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
-prop_装有灵魂的令牌,装有灵魂的令牌,,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png]
-prop_火柴,火柴,,,,[#texture=c02/火柴.png]
-prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png]
-prop_绳子,绳子,Rope,,,[#texture=c02/绳子物品.png][#inspect=c02/绳子.png]
-prop_1012钥匙,1012钥匙,1012 Key,,,[#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png]
-prop_老虎钳,老虎钳,,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png]
-prop_3014旋转锁钥匙,3014旋转锁钥匙,,,,[#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png]
-prop_小猫玩具完整,小猫玩具,,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png]
-c01_s07_需要报纸,我想先在周围看看,,,,
-c01_s08_书店工作,我还有工作要做,,,,
-c01_s08_书店工钱,我还有⼯钱没拿,,,,
-notes_纸条,纸条,,,,
-notes_锁住了,锁住了,,,,
-notes_打不开,打不开,,,,
-notes_干掉的血迹,干掉的血迹,,,,
-notes_有什么东西,有什么东西,,,,
-notes_无法触碰,无法触碰,,,,
-notes_挂画,挂画,,,,
-notes_相框,相框,,,,
-notes_寻人启事,寻人启事,,,,
-c01_鸡毛掸子,这是鸡毛掸子吗?,,,,
-c01_院长书桌,桌上放着纸笔,,,,
-c01_院长床,这本书已经看过了,,,,
+keys,zh_CN,_character,_notes,_tags
+说明文本,说明文本,,,
+ui_press_b,按 B 打开背包,,,
+5,5,,,
+index_新游戏,新游戏,,,
+index_继续游戏,继续游戏,,,
+index_退出游戏,退出游戏,,,
+setting_总音量,总音量,,,
+setting_音效音量,音效音量,,,
+setting_对话音量,对话音量,,,
+setting_全屏游戏,全屏游戏,,,
+setting_窗口置顶,窗口置顶,,,
+setting_自动保存,自动保存,,,
+setting_主界面,回到主界面,,,
+setting_退出,保存并退出,,,
+setting_日志,打开日志,,,
+ui_秒,秒,,,
+ui_saved_all,已保存所有数据,,,
+ui_new_archive,已创建新存档,,,
+ui_auto_saved,自动保存成功,,,
+ui_press_e,按 E 与场景互动,,,
+ui_important_item_update,重要物品已更新(按 B 打开背包),,,
+ui_press_shift,按住 Shift 奔跑,,,
+input_拼凑信件,点击选择信件碎片,方向键移动,按 E 旋转,,,
+ui_获得,获得,,,
+ui_退出,退出,,,
+ui_阅读,阅读,,,
+ui_检阅,检阅,,,
+ui_收起,收起,,,
+ui_夜行船1,百岁光阴一梦蝶。,,,
+ui_夜行船2,重回⾸往事堪嗟。,,,
+ui_夜行船3,今⽇春来。明朝花谢。,,,
+ui_夜行船4,急罚盏夜阑灯灭。,,,
+ui_夜行船5,夜行船,,,
+prop_空手,空手,,,
+prop_信碎片1,信碎片(一),,,[#texture=c01/信件左上.png]
+prop_信碎片2,信碎片(二),,,[#texture=c01/信件右上.png]
+prop_银元,银元,,,[#texture=c01/银元.png]
+prop_院长的信,院长的信,,,[#texture=c01/院长的信.png]
+prop_重要物品示例,重要物品示例,,,[#texture=c01/银元.png]
+prop_令牌,令牌,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
+prop_装有灵魂的令牌,装有灵魂的令牌,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png]
+prop_火柴,火柴,,,[#texture=c02/火柴.png]
+prop_小猫玩具的脑袋,小猫玩具的脑袋,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png]
+prop_绳子,绳子,,,[#texture=c02/绳子物品.png][#inspect=c02/绳子.png]
+prop_1012钥匙,1012钥匙,,,[#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png]
+prop_老虎钳,老虎钳,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png]
+prop_3014旋转锁钥匙,3014旋转锁钥匙,,,[#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png]
+prop_小猫玩具完整,小猫玩具,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png]
+院长的信...,院长的信...,,,
+1,1,,,
+2,2,,,
+3,3,,,
+重要物品示例,重要物品示例,,,
+4,4,,,
+c01_s07_需要报纸,我想先在周围看看,,,
+c01_s08_书店工作,我还有工作要做,,,
+c01_s08_书店工钱,我还有⼯钱没拿,,,
+notes_纸条,纸条,,,
+notes_锁住了,锁住了,,,
+notes_打不开,打不开,,,
+notes_干掉的血迹,干掉的血迹,,,
+notes_有什么东西,有什么东西,,,
+notes_无法触碰,无法触碰,,,
+notes_挂画,挂画,,,
+notes_相框,相框,,,
+notes_寻人启事,寻人启事,,,
+c01_鸡毛掸子,这是鸡毛掸子吗?,,,
+c01_院长书桌,桌上放着纸笔,,,
+c01_院长床,这本书已经看过了,,,
c01_院长座钟,"1917年10⽉28⽇...
-时间停在16\:30",,,,
-c01_倾斜的洋相片,洋相片,,,,
-c01_摆正的洋相片,是院长的女儿吗,,,,
-c01_s06_院长房间,这是院长的房间,,,,
-c01_s06_小朋友房间,这是其他小朋友的房间,,,,
-c01_s07_钱碗,碗⾥是铜钱,,,,
-c01_s07_获得报纸,这是什么?,,,,
+时间停在16\:30",,,
+c01_倾斜的洋相片,洋相片,,,
+c01_摆正的洋相片,是院长的女儿吗,,,
+c01_s06_院长房间,这是院长的房间,,,
+c01_s06_小朋友房间,这是其他小朋友的房间,,,
+c01_s07_钱碗,碗⾥是铜钱,,,
+c01_s07_获得报纸,这是什么?,,,
c01_s07_书店展柜,"好多书...
-要是能在这里工作就好了",,,,
+要是能在这里工作就好了",,,
c01_s08_书架游戏完成,"这些书怎么变成这样了?
-好可惜...我可能需要离开了",,,,
+好可惜...我可能需要离开了",,,
c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事
-脸的部分被撕掉了,看不清",,,,
-c02_卫生宣传画,几张卫生宣传画,,,,
+脸的部分被撕掉了,看不清",,,
+c02_卫生宣传画,几张卫生宣传画,,,
c02_老鼠洞,"一个老鼠洞
-在这种楼里挺常见的",,,,
-c02_十几年前的报纸,十几年前的报纸,,,,
-c02_绳子剪刀,绳子和剪刀,,,,
-c02_玩具缺脑袋,这个玩具缺了个脑袋,,,,
-c02_又是寻人启示,又是那张寻人启示,,,,
-c02_墙上的海报被撕掉了,墙上的海报被撕掉了,,,,
-c02_井臭,井里有一股臭味,,,,
-c02_中药材,车上放了一些中药材,,,,
-c02_排队,排队的人堵住了上楼的路,,,,
-c02_不要出去,最好还是先不要出去,,,,
-c02_太阳,太阳快落山了,,,,
-c02_民国六年1015,民国六年十月十五日,,,,
-c02_一个洞,一个洞,里面好像还有空间,,,,
-c02_工具箱,工具箱,,,,
-c02_找到有用的东西,应该能找到有用的东西,,,,
-c02_公寓告示,公寓告示,,,,
-c02_通往里间的门,通往里间的门,,,,
-c02_花名册,花名册,,,,
-c02_罪,罪,,,,
-c02_门上有什么东西,门上有什么东西,,,,
-c02_奠,奠,,,,
-c02_寻夏小蝉,失踪的小孩名叫夏小蝉,,,,
-c02_小猫干尸,小猫的尸体已经干了,,,,
-c02_几块大洋,几块大洋,,,,
-c02_死老鼠,死掉的老鼠,,,,
-c02_石缝开花,石缝里开了几束花,,,,
-c02_石壁空间,石壁另一头好像还有空间,,,,
-c02_民国六年1221,民国六年十二月二十一日,,,,
-c02_患者感谢信,一些患者的感谢信,,,,
-c02_被撕掉的书,一本被撕掉的书,,,,
-c02_里面有什么东西,里面有什么东西,,,,
-c02_戏台上的诗,戏台上面刻了一首诗,,,,
-c02_锁开了,锁开了,,,,
-c02_口袋里有东西,口袋里有东西,,,,
-c02_雾太大,雾太大了,看不清路,,,,
-c02_八音盒,是个八音盒,,,,
-c02_祝女儿早日康复,祝女儿早日康复,,,,
-c02_图案一样,这图案和我手臂上的一摸一样,,,,
+在这种楼里挺常见的",,,
+c02_十几年前的报纸,十几年前的报纸,,,
+c02_绳子剪刀,绳子和剪刀,,,
+c02_玩具缺脑袋,这个玩具缺了个脑袋,,,
+c02_又是寻人启示,又是那张寻人启示,,,
+c02_墙上的海报被撕掉了,墙上的海报被撕掉了,,,
+c02_井臭,井里有一股臭味,,,
+c02_中药材,车上放了一些中药材,,,
+c02_排队,排队的人堵住了上楼的路,,,
+c02_不要出去,最好还是先不要出去,,,
+c02_太阳,太阳快落山了,,,
+c02_民国六年1015,民国六年十月十五日,,,
+c02_一个洞,一个洞,里面好像还有空间,,,
+c02_工具箱,工具箱,,,
+c02_找到有用的东西,应该能找到有用的东西,,,
+c02_公寓告示,公寓告示,,,
+c02_通往里间的门,通往里间的门,,,
+c02_花名册,花名册,,,
+c02_罪,罪,,,
+c02_门上有什么东西,门上有什么东西,,,
+c02_奠,奠,,,
+c02_寻夏小蝉,失踪的小孩名叫夏小蝉,,,
+c02_小猫干尸,小猫的尸体已经干了,,,
+c02_几块大洋,几块大洋,,,
+c02_死老鼠,死掉的老鼠,,,
+c02_石缝开花,石缝里开了几束花,,,
+c02_石壁空间,石壁另一头好像还有空间,,,
+c02_民国六年1221,民国六年十二月二十一日,,,
+c02_患者感谢信,一些患者的感谢信,,,
+c02_被撕掉的书,一本被撕掉的书,,,
+c02_里面有什么东西,里面有什么东西,,,
+c02_戏台上的诗,戏台上面刻了一首诗,,,
+c02_锁开了,锁开了,,,
+c02_口袋里有东西,口袋里有东西,,,
+c02_雾太大,雾太大了,看不清路,,,
+c02_八音盒,是个八音盒,,,
+c02_祝女儿早日康复,祝女儿早日康复,,,
+c02_图案一样,这图案和我手臂上的一摸一样,,,
diff --git a/asset/dialogue/item_description.csv.import b/asset/dialogue/item_description.csv.import
index 7a8b931d..2e159042 100644
--- a/asset/dialogue/item_description.csv.import
+++ b/asset/dialogue/item_description.csv.import
@@ -2,14 +2,14 @@
importer="csv_translation"
type="Translation"
-uid="uid://bd5qbimcnpkb5"
+uid="uid://hx4e4wd1tfeg"
[deps]
-files=["res://asset/dialogue/item_description.zh_CN.translation", "res://asset/dialogue/item_description.en.translation"]
+files=["res://asset/dialogue/item_description.zh_CN.translation"]
source_file="res://asset/dialogue/item_description.csv"
-dest_files=["res://asset/dialogue/item_description.zh_CN.translation", "res://asset/dialogue/item_description.en.translation"]
+dest_files=["res://asset/dialogue/item_description.zh_CN.translation"]
[params]
diff --git a/asset/dialogue/item_description.dialogue b/asset/dialogue/item_description.dialogue
index 7e0e536c..ead35310 100644
--- a/asset/dialogue/item_description.dialogue
+++ b/asset/dialogue/item_description.dialogue
@@ -20,7 +20,7 @@
自动保存成功 [ID:ui_auto_saved]
按 E 与场景互动 [ID:ui_press_e]
-按 B 打开背包 [ID:ui_press_b]
+重要物品已更新(按 B 打开背包) [ID:ui_important_item_update]
按住 Shift 奔跑 [ID:ui_press_shift]
点击选择信件碎片,方向键移动,按 E 旋转 [ID:input_拼凑信件]
@@ -43,11 +43,13 @@
空手 [ID:prop_空手]
# texture 路径从 "res://asset/art/prop/" 之后算起
# c01
-信碎片(一) [#texture=c01/信碎片1.png] [ID:prop_信碎片1]
+#信碎片(一) [#texture=c01/信碎片1.png] [ID:prop_信碎片1]
+信碎片(一) [#texture=c01/信件左上.png] [ID:prop_信碎片1]
+信碎片(二) [#texture=c01/信件右上.png] [ID:prop_信碎片2]
银元 [#texture=c01/银元.png] [ID:prop_银元]
-# TODO 美术资源更换
-信碎片(二) [#texture=c01/信碎片1.png] [ID:prop_信碎片2]
-院长的信 [#texture=c01/信碎片1.png] [ID:prop_院长的信]
+院长的信 [#texture=c01/院长的信.png] [ID:prop_院长的信]
+重要物品示例 [#texture=c01/银元.png] [ID:prop_重要物品示例]
+
令牌 [#texture=c01/令牌物品.png][#inspect=c01/令牌.png] [ID:prop_令牌]
装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [ID:prop_装有灵魂的令牌]
# c02
@@ -60,6 +62,21 @@
小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] [ID:prop_小猫玩具完整]
=> END
+~ prop_院长的信
+院长的信...
+1
+2
+3
+=> END
+
+~ prop_重要物品示例
+重要物品示例
+1
+2
+3
+4
+=> END
+
~ HoldingReason
我想先在周围看看 [ID:c01_s07_需要报纸]
我还有工作要做 [ID:c01_s08_书店工作]
diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd
index 5b5458d8..74fd0b68 100644
--- a/manager/scene/scene_manager.gd
+++ b/manager/scene/scene_manager.gd
@@ -72,9 +72,7 @@ func unlock_player():
# action_freezed 对应 freeze 与 release 方法
# lock_time: the time to lock the player action. 0 means lock forever, thus the player will be locked until release_player is called.
-func freeze_player(
- lock_time: float, action := 3, auto_quit := false
-) -> void:
+func freeze_player(lock_time: float, action := 3, auto_quit := false) -> void:
var player = get_player()
if player:
player.freeze_player(lock_time, action, auto_quit)
@@ -116,6 +114,7 @@ func set_player_boundary(rect: Rect2) -> void:
var balloon_node
+
func pop_debug_dialog_info(character: String, content: String):
if GlobalConfig.DEBUG:
if not is_instance_valid(balloon_node):
@@ -157,6 +156,14 @@ func enable_prop_item(prop_key: String) -> void:
printerr("enable_prop_item PropHud node not found")
+func enable_important_item(prop_key: String) -> void:
+ var prop_hud = get_prop_hud()
+ if prop_hud:
+ prop_hud.inventory.enable_important_item(prop_key)
+ else:
+ printerr("enable_important_item PropHud node not found")
+
+
func disable_prop_item(prop_key: String) -> void:
var prop_hud = get_prop_hud()
if prop_hud:
@@ -260,9 +267,7 @@ var prop_bag = preload("res://scene/prop/prop_bag.tscn")
func show_bag():
- pass
- # 暂时不启用背包
- # get_node("/root/Main").add_child(prop_bag.instantiate())
+ get_node("/root/Main").add_child(prop_bag.instantiate())
func quit_game():
diff --git a/scene/ground/scene/c01/s05_animation.gd b/scene/ground/scene/c01/s05_animation.gd
index 0aea830f..e6962774 100644
--- a/scene/ground/scene/c01/s05_animation.gd
+++ b/scene/ground/scene/c01/s05_animation.gd
@@ -101,12 +101,12 @@ func _on_paper_interacted():
right_door.enabled = true
SceneManager.pop_debug_dialog_info("音效", "开门声")
$"../sfx_door_open".play()
- var inspector = SceneManager.get_inspector() as PropInspector
- if inspector:
- # 显示互动提示
- inspector.quit_and_hidden.connect(
- SceneManager.pop_center_notification.bind(tr("ui_press_b")), CONNECT_ONE_SHOT
- )
+ # var inspector = SceneManager.get_inspector() as PropInspector
+ # if inspector:
+ # # 显示互动提示
+ # inspector.quit_and_hidden.connect(
+ # SceneManager.pop_center_notification.bind(tr("ui_prop_update")), CONNECT_ONE_SHOT
+ # )
# 钢琴音效,每次按下播放不同音符
diff --git a/scene/ground/scene/c01/s07_书店外.tscn b/scene/ground/scene/c01/s07_书店外.tscn
index d5d8f2f0..448f6736 100644
--- a/scene/ground/scene/c01/s07_书店外.tscn
+++ b/scene/ground/scene/c01/s07_书店外.tscn
@@ -107,6 +107,7 @@ height = -10.0
dialogue_title = "c01_s07_吉祥话2"
[node name="陆仁擦刀" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="6"]
+visible = false
position = Vector2(199, 0)
sprite_frames = ExtResource("6_thm8f")
animation = &"陆仁擦刀"
diff --git a/scene/ground/scene/c01/s08_animation.gd b/scene/ground/scene/c01/s08_animation.gd
index cfa806c7..66efb546 100644
--- a/scene/ground/scene/c01/s08_animation.gd
+++ b/scene/ground/scene/c01/s08_animation.gd
@@ -177,11 +177,11 @@ func _on_envelope_game_exiting() -> void:
func _on_envelope_game_success() -> void:
+ SceneManager.release_player()
envolope_table.enabled = false
create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0)
ArchiveManager.archive.set_global_entry("envelope_game_success", true)
envelope_game_success = true
- SceneManager.enable_prop_item("prop_院长的信")
_check_portal()
diff --git a/scene/ground/scene/c01/s08_书店.tscn b/scene/ground/scene/c01/s08_书店.tscn
index 8dc7b0f6..cf1abecd 100644
--- a/scene/ground/scene/c01/s08_书店.tscn
+++ b/scene/ground/scene/c01/s08_书店.tscn
@@ -141,7 +141,7 @@ offset = Vector2(0, 40)
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
points = PackedVector2Array(30, 150, 545, 150)
-[node name="参考" type="Sprite2D" parent="Ground"]
+[node name="参考" type="Sprite2D" parent="."]
visible = false
modulate = Color(1, 1, 1, 0.580392)
position = Vector2(20, 0)
diff --git a/scene/little_game/拼凑信件.gd b/scene/little_game/拼凑信件.gd
index 9d77dce7..f7c215b4 100644
--- a/scene/little_game/拼凑信件.gd
+++ b/scene/little_game/拼凑信件.gd
@@ -29,7 +29,7 @@ func _ready() -> void:
_display_selected()
content_rect.modulate.a = 0.0
content_rect.visible = true
- %Label.text = tr("c01_信件全文")
+ # %Label.text = tr("c01_信件全文")
SceneManager.pop_center_notification(tr("input_拼凑信件"))
@@ -132,8 +132,16 @@ func _check_answer() -> void:
func _post_success():
- var tween = create_tween()
- tween.tween_property(content_rect, "modulate:a", 1.0, 1.0)
+ # 不显示文本,让玩家在重要物品栏去看(提示)
+ # var tween = create_tween()
+ # tween.tween_property(content_rect, "modulate:a", 1.0, 1.0)
+ SceneManager.pop_center_notification(tr("ui_important_item_update"))
+ SceneManager.enable_important_item("prop_院长的信")
+ # 1s 后退出
+ await get_tree().create_timer(1.0).timeout
+ if get_parent() != null:
+ success.emit()
+ get_parent().remove_child(self)
func _unhandled_input(event: InputEvent) -> void:
@@ -175,4 +183,4 @@ func _unhandled_input(event: InputEvent) -> void:
if handled:
$SfxMove.play()
_display_selected()
- _check_answer()
\ No newline at end of file
+ _check_answer()
diff --git a/scene/prop/prop_bag.gd b/scene/prop/prop_bag.gd
index 3fbcb98e..8e79584b 100644
--- a/scene/prop/prop_bag.gd
+++ b/scene/prop/prop_bag.gd
@@ -1,15 +1,61 @@
extends Panel
+@onready var buttons_vbox = %ButtonsVBox as VBoxContainer
+@onready var texture_rect = %TextureRect as TextureRect
+@onready var content_text_edit = %Content as TextEdit
+
func _ready():
get_parent().layer = GlobalConfig.CANVAS_LAYER_BAG
- _load_inventory()
- SceneManager.lock_player()
+ # SceneManager.lock_player()
get_tree().paused = true
+ _load_item_buttons()
-func _load_inventory():
- pass
+func _load_item_buttons() -> void:
+ # 移除 texture_rect 的纹理与 content_text_edit 的内容
+ texture_rect.texture = null
+ content_text_edit.text = ""
+ # 移除所有子节点
+ for child in buttons_vbox.get_children():
+ buttons_vbox.remove_child(child)
+ child.queue_free()
+ # 从 prop_hud 中读取
+ var hud = SceneManager.get_prop_hud()
+ if not hud:
+ printerr("PropHud node not found")
+ return
+ # prop keys
+ var inventory = hud.inventory
+ for prop_key in inventory.important_items:
+ var button = preload("res://scene/prop/prop_bag_button.tscn").instantiate()
+ button.text = tr(prop_key)
+ button.pressed.connect(_display_item.bind(prop_key, button))
+ buttons_vbox.add_child(button)
+ # 如果已读,消除 icon(默认都有 icon)
+ if not inventory.unviewed_important_items.has(prop_key):
+ button.icon = null
+ # # 选中第一个
+ # if buttons_vbox.get_child_count() > 0:
+ # (buttons_vbox.get_child(0) as Button).pres
+ # # _display_item(inventory.important_items[0])
+
+
+
+func _display_item(prop_key, button):
+ var hud = SceneManager.get_prop_hud()
+ if not hud:
+ printerr("PropHud node not found")
+ return
+ # 标记为已读:消除 icon + 写入 inventory
+ if hud.inventory.unviewed_important_items.has(prop_key):
+ hud.inventory.unviewed_important_items.erase(prop_key)
+ button.icon = null
+ # prop keys
+ var item_data = hud.items_dict[prop_key]
+ var content = hud.important_items_dict[prop_key]
+ content_text_edit.text = content
+ texture_rect.texture = load(item_data.texture_path)
func _unhandled_input(event: InputEvent) -> void:
@@ -20,5 +66,5 @@ func _unhandled_input(event: InputEvent) -> void:
):
get_viewport().set_input_as_handled()
get_tree().paused = false
- SceneManager.unlock_player()
+ # SceneManager.unlock_player()
queue_free()
diff --git a/scene/prop/prop_bag.tscn b/scene/prop/prop_bag.tscn
index 697ed85d..1e16700c 100644
--- a/scene/prop/prop_bag.tscn
+++ b/scene/prop/prop_bag.tscn
@@ -1,7 +1,14 @@
-[gd_scene load_steps=3 format=3 uid="uid://b6gbolo1o7wdf"]
+[gd_scene load_steps=7 format=3 uid="uid://b6gbolo1o7wdf"]
[ext_resource type="Script" uid="uid://cg7wdaw03bovq" path="res://scene/prop/prop_bag.gd" id="1_f3hpu"]
[ext_resource type="Texture2D" uid="uid://dsj3l0baqg1g7" path="res://asset/art/ui/小蝶笔记.png" id="2_3s314"]
+[ext_resource type="PackedScene" uid="uid://wxd25ec3cqyy" path="res://scene/prop/prop_bag_button.tscn" id="3_wlvs1"]
+[ext_resource type="Texture2D" uid="uid://dl214l7im21sf" path="res://asset/art/prop/c01/院长的信.png" id="4_wlvs1"]
+
+[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mnmsg"]
+bg_color = Color(0.6, 0.6, 0.6, 0)
+
+[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wlvs1"]
[node name="PropBag" type="CanvasLayer"]
process_mode = 3
@@ -28,82 +35,69 @@ texture = ExtResource("2_3s314")
expand_mode = 5
stretch_mode = 2
-[node name="GridContainer" type="GridContainer" parent="Bag"]
-custom_minimum_size = Vector2(270, 120)
+[node name="ScrollContainer" type="ScrollContainer" parent="Bag"]
+custom_minimum_size = Vector2(120, 160)
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
+offset_left = -139.0
+offset_top = -82.0
+offset_right = -19.0
+offset_bottom = 78.0
grow_horizontal = 2
grow_vertical = 2
-columns = 9
+horizontal_scroll_mode = 0
-[node name="Panel" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
+[node name="ButtonsVBox" type="VBoxContainer" parent="Bag/ScrollContainer"]
+unique_name_in_owner = true
+layout_mode = 2
+size_flags_horizontal = 4
+size_flags_vertical = 0
+
+[node name="Button" parent="Bag/ScrollContainer/ButtonsVBox" instance=ExtResource("3_wlvs1")]
layout_mode = 2
-[node name="Panel2" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
+[node name="Button2" parent="Bag/ScrollContainer/ButtonsVBox" instance=ExtResource("3_wlvs1")]
layout_mode = 2
+text = "示例按钮"
-[node name="Panel3" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
+[node name="Button3" parent="Bag/ScrollContainer/ButtonsVBox" instance=ExtResource("3_wlvs1")]
layout_mode = 2
+text = "示例按钮"
-[node name="Panel4" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
+[node name="DisplayVBox" type="VBoxContainer" parent="Bag"]
+layout_mode = 0
+offset_left = 300.0
+offset_top = 64.0
+offset_right = 440.0
+offset_bottom = 248.0
-[node name="Panel5" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
+[node name="TextureRect" type="TextureRect" parent="Bag/DisplayVBox"]
+unique_name_in_owner = true
+custom_minimum_size = Vector2(100, 100)
layout_mode = 2
+size_flags_horizontal = 4
+size_flags_vertical = 4
+texture = ExtResource("4_wlvs1")
+expand_mode = 3
-[node name="Panel6" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel7" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel8" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel9" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel10" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel11" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel12" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel13" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel14" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel15" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
-layout_mode = 2
-
-[node name="Panel16" type="Panel" parent="Bag/GridContainer"]
-custom_minimum_size = Vector2(30, 30)
+[node name="Content" type="TextEdit" parent="Bag/DisplayVBox"]
+unique_name_in_owner = true
+custom_minimum_size = Vector2(140, 90)
layout_mode = 2
+size_flags_horizontal = 3
+size_flags_vertical = 0
+theme_override_colors/font_readonly_color = Color(0.337438, 0.120804, 0.0401172, 1)
+theme_override_font_sizes/font_size = 9
+theme_override_styles/normal = SubResource("StyleBoxFlat_mnmsg")
+theme_override_styles/read_only = SubResource("StyleBoxEmpty_wlvs1")
+text = "1
+2
+3
+4
+5"
+editable = false
+scroll_smooth = true
diff --git a/scene/prop/prop_bag_button.tscn b/scene/prop/prop_bag_button.tscn
new file mode 100644
index 00000000..fa4bac53
--- /dev/null
+++ b/scene/prop/prop_bag_button.tscn
@@ -0,0 +1,47 @@
+[gd_scene load_steps=7 format=3 uid="uid://wxd25ec3cqyy"]
+
+[ext_resource type="Texture2D" uid="uid://b343nvvbtpglb" path="res://asset/art/ui/互动提示符/ui 像素版_纯白.png" id="1_cj3ky"]
+[ext_resource type="Texture2D" uid="uid://cehulj6qro08v" path="res://asset/art/ui/对话框.png" id="2_4yw4h"]
+
+[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rvhvk"]
+texture = ExtResource("2_4yw4h")
+texture_margin_left = 4.0
+texture_margin_top = 4.0
+texture_margin_right = 4.0
+texture_margin_bottom = 4.0
+region_rect = Rect2(22, 38, 40, 30)
+modulate_color = Color(0.877616, 0.877616, 0.877616, 1)
+
+[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_xo6jf"]
+texture = ExtResource("2_4yw4h")
+texture_margin_left = 4.0
+texture_margin_top = 4.0
+texture_margin_right = 4.0
+texture_margin_bottom = 4.0
+region_rect = Rect2(22, 38, 40, 30)
+
+[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_wlvs1"]
+texture = ExtResource("2_4yw4h")
+texture_margin_left = 4.0
+texture_margin_top = 4.0
+texture_margin_right = 4.0
+texture_margin_bottom = 4.0
+region_rect = Rect2(22, 38, 40, 30)
+modulate_color = Color(0.585062, 0.585062, 0.585062, 1)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_rvhvk"]
+atlas = ExtResource("1_cj3ky")
+region = Rect2(732, 546, 45, 48)
+
+[node name="Button" type="Button"]
+custom_minimum_size = Vector2(100, 15)
+theme_override_colors/icon_hover_color = Color(1, 1, 1, 0.913725)
+theme_override_colors/icon_pressed_color = Color(1, 1, 1, 1)
+theme_override_colors/icon_focus_color = Color(1, 1, 1, 0.819608)
+theme_override_colors/icon_normal_color = Color(1, 1, 1, 0.6)
+theme_override_constants/icon_max_width = 8
+theme_override_styles/focus = SubResource("StyleBoxTexture_rvhvk")
+theme_override_styles/hover = SubResource("StyleBoxTexture_xo6jf")
+theme_override_styles/normal = SubResource("StyleBoxTexture_wlvs1")
+text = "院长的信"
+icon = SubResource("AtlasTexture_rvhvk")
diff --git a/scene/prop/prop_hud.gd b/scene/prop/prop_hud.gd
index 983e071e..51b8ac1f 100644
--- a/scene/prop/prop_hud.gd
+++ b/scene/prop/prop_hud.gd
@@ -48,6 +48,7 @@ const PROP_CONTAINER_X = 130.0
const PROP_CONTROL_X = 110.0
var items_dict := {}
+var important_items_dict = {}
# 从配置文件加载 prop items
var item_config_res = preload("res://asset/dialogue/item_description.dialogue")
var path_prefix = "res://asset/art/prop/"
@@ -123,10 +124,27 @@ func _load_items():
if inspect_path:
item.inspect_path = path_prefix + inspect_path
items_dict[item.key] = item
+ # 检查是否是重要物品,如果是,则添加到 important_items_dict
+ if item_config_res.titles.has(item.key):
+ var important_item_line_id = item_config_res.titles[item.key]
+ important_items_dict[item.key] = get_import_item_content(important_item_line_id)
if not current_line.has("next_id") or current_line.next_id == "end":
break
current_line = item_config_res.lines[current_line.next_id]
+func get_import_item_content(line_id) -> String:
+ var current_line = item_config_res.lines[line_id]
+ var content = ""
+ while current_line:
+ if current_line.has("text"):
+ if current_line.has("translation_key"):
+ content += tr(current_line.translation_key) + "\n"
+ else:
+ content += current_line.text + "\n"
+ if not current_line.has("next_id") or current_line.next_id == "end":
+ break
+ current_line = item_config_res.lines[current_line.next_id]
+ return content
func _load_from_archive() -> void:
if ArchiveManager.archive:
diff --git a/scene/prop/prop_inventory_resource.gd b/scene/prop/prop_inventory_resource.gd
index 8b8a9a4b..40a5d6ba 100644
--- a/scene/prop/prop_inventory_resource.gd
+++ b/scene/prop/prop_inventory_resource.gd
@@ -12,7 +12,15 @@ signal current_item_changed(prop_key: String)
current_item_changed.emit(enabled_items[current_index])
else:
current_item_changed.emit("")
+# 重要物品,不可丢弃,在背包可见
+@export var important_items := []
+# 未查看的重要物品,红点效果
+@export var unviewed_important_items := []
+func enable_important_item(prop_key: String) -> void:
+ if not important_items.has(prop_key):
+ important_items.append(prop_key)
+ unviewed_important_items.append(prop_key)
func current_item_key() -> String:
if enabled_items.size() == 0: