实现基本的背包功能
This commit is contained in:
parent
594cf599f9
commit
2e11908b57
@ -110,6 +110,7 @@ func to_data() -> Dictionary:
|
|||||||
d.siblings = siblings
|
d.siblings = siblings
|
||||||
|
|
||||||
DMConstants.TYPE_RESPONSE:
|
DMConstants.TYPE_RESPONSE:
|
||||||
|
# d.text = text.replace("<br>", "\n")
|
||||||
d.text = text
|
d.text = text
|
||||||
|
|
||||||
if not responses.is_empty():
|
if not responses.is_empty():
|
||||||
@ -131,6 +132,7 @@ func to_data() -> Dictionary:
|
|||||||
d.notes = notes
|
d.notes = notes
|
||||||
|
|
||||||
DMConstants.TYPE_DIALOGUE:
|
DMConstants.TYPE_DIALOGUE:
|
||||||
|
# d.text = text.replace("<br>", "\n")
|
||||||
d.text = text
|
d.text = text
|
||||||
|
|
||||||
if translation_key != text:
|
if translation_key != text:
|
||||||
|
@ -14,6 +14,7 @@ static func compile_string(text: String, path: String) -> DMCompilerResult:
|
|||||||
result.titles = compilation.titles
|
result.titles = compilation.titles
|
||||||
result.first_title = compilation.first_title
|
result.first_title = compilation.first_title
|
||||||
result.errors = compilation.errors
|
result.errors = compilation.errors
|
||||||
|
# result.lines = compilation.lines
|
||||||
result.lines = compilation.data
|
result.lines = compilation.data
|
||||||
result.raw_text = text
|
result.raw_text = text
|
||||||
|
|
||||||
|
@ -563,9 +563,9 @@ func generate_translations_keys() -> void:
|
|||||||
# Add a translation file to the project settings
|
# Add a translation file to the project settings
|
||||||
func add_path_to_project_translations(path: String) -> void:
|
func add_path_to_project_translations(path: String) -> void:
|
||||||
var translations: PackedStringArray = ProjectSettings.get_setting("internationalization/locale/translations")
|
var translations: PackedStringArray = ProjectSettings.get_setting("internationalization/locale/translations")
|
||||||
if not path in translations:
|
# if not path in translations:
|
||||||
translations.append(path)
|
# translations.append(path)
|
||||||
ProjectSettings.save()
|
# ProjectSettings.save()
|
||||||
|
|
||||||
|
|
||||||
# Export dialogue and responses to CSV
|
# Export dialogue and responses to CSV
|
||||||
@ -615,11 +615,12 @@ func export_translations_to_csv(path: String) -> void:
|
|||||||
notes_column = column_count
|
notes_column = column_count
|
||||||
column_count += 1
|
column_count += 1
|
||||||
existing_csv["keys"].append("_notes")
|
existing_csv["keys"].append("_notes")
|
||||||
# include tags
|
|
||||||
if tags_coloumn == -1:
|
# include tags
|
||||||
tags_coloumn = column_count
|
if tags_coloumn == -1:
|
||||||
column_count += 1
|
tags_coloumn = column_count
|
||||||
existing_csv["keys"].append("_tags")
|
column_count += 1
|
||||||
|
existing_csv["keys"].append("_tags")
|
||||||
|
|
||||||
# Start a new file
|
# Start a new file
|
||||||
file = FileAccess.open(path, FileAccess.WRITE)
|
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
|
line_to_save[default_locale_column] = line.text
|
||||||
if character_column > -1:
|
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:
|
if notes_column > -1:
|
||||||
line_to_save[notes_column] = line.notes
|
line_to_save[notes_column] = line.get("notes","")
|
||||||
if tags_coloumn > -1 and line.tags.size() > 0:
|
var tags = line.get("tags",[]) as Array
|
||||||
line_to_save[tags_coloumn] = "[#" + "][#".join(line.tags) + "]"
|
if tags_coloumn > -1 and tags.size() > 0:
|
||||||
|
line_to_save[tags_coloumn] = "[#" + "][#".join(tags) + "]"
|
||||||
|
|
||||||
lines_to_save.append(line_to_save)
|
lines_to_save.append(line_to_save)
|
||||||
|
|
||||||
|
34
asset/art/prop/c01/信.png.import
Normal file
34
asset/art/prop/c01/信.png.import
Normal file
@ -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
|
BIN
asset/art/prop/c01/信件右上.png
Executable file
BIN
asset/art/prop/c01/信件右上.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
34
asset/art/prop/c01/信件右上.png.import
Normal file
34
asset/art/prop/c01/信件右上.png.import
Normal file
@ -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
|
BIN
asset/art/prop/c01/信件左上.png
Executable file
BIN
asset/art/prop/c01/信件左上.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
34
asset/art/prop/c01/信件左上.png.import
Normal file
34
asset/art/prop/c01/信件左上.png.import
Normal file
@ -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
|
BIN
asset/art/prop/c01/信件碎片.png
Executable file
BIN
asset/art/prop/c01/信件碎片.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
34
asset/art/prop/c01/信件碎片.png.import
Normal file
34
asset/art/prop/c01/信件碎片.png.import
Normal file
@ -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
|
BIN
asset/art/prop/c01/院长的信.png
Normal file
BIN
asset/art/prop/c01/院长的信.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
34
asset/art/prop/c01/院长的信.png.import
Normal file
34
asset/art/prop/c01/院长的信.png.import
Normal file
@ -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
|
@ -2,8 +2,8 @@ keys,zh_CN,_character,_notes,_tags,en
|
|||||||
t89c0f4a8de,x年,,,,
|
t89c0f4a8de,x年,,,,
|
||||||
t356af5308e,下午一点,,,,
|
t356af5308e,下午一点,,,,
|
||||||
c01_信件全文,"小蝶:
|
c01_信件全文,"小蝶:
|
||||||
【信件正文内容...】
|
信件正文内容...
|
||||||
【落款】",,,,
|
落款",,,,
|
||||||
t344c97cf2c,据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。,,,,
|
t344c97cf2c,据闻奉贤县分水墩又有七人染受鼠疫,病状可怖,闻医官药治无用,免职。,,,,
|
||||||
tdb119a3714,有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。,,,,
|
tdb119a3714,有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。,,,,
|
||||||
ta750647b12,《申报》,,,,
|
ta750647b12,《申报》,,,,
|
||||||
|
|
@ -1,137 +1,124 @@
|
|||||||
keys,zh_CN,en,_character,_notes,_tags
|
keys,zh_CN,_character,_notes,_tags
|
||||||
c01_纸包钥匙,一张纸条包着钥匙,,,,
|
说明文本,说明文本,,,
|
||||||
c02_寻人启事1,似乎是一张寻人启事,,,,
|
ui_press_b,按 B 打开背包,,,
|
||||||
c02_寻人启事2,脸的部分被撕掉了,看不清,,,,
|
5,5,,,
|
||||||
=>en,=>en,,,,
|
index_新游戏,新游戏,,,
|
||||||
c01_获得令牌,令牌,,获得,,[#item]
|
index_继续游戏,继续游戏,,,
|
||||||
c01_获得灵魂令牌,带有灵魂的令牌,,获得,,[#item]
|
index_退出游戏,退出游戏,,,
|
||||||
c01_获得院长信件,院长的信件,,获得,,[#item]
|
setting_总音量,总音量,,,
|
||||||
c02_获得1012钥匙,1012钥匙,,获得,,[#item]
|
setting_音效音量,音效音量,,,
|
||||||
c02_获得老虎钳,老虎钳,,获得,,[#item]
|
setting_对话音量,对话音量,,,
|
||||||
c02_获得绳子,绳子,,获得,,[#item]
|
setting_全屏游戏,全屏游戏,,,
|
||||||
c02_获得小猫玩具脑袋,小猫玩具脑袋,,获得,,[#item]
|
setting_窗口置顶,窗口置顶,,,
|
||||||
c02_获得小猫玩具,小猫玩具,,获得,,[#item]
|
setting_自动保存,自动保存,,,
|
||||||
c02_获得钥匙,钥匙,,获得,,[#item]
|
setting_主界面,回到主界面,,,
|
||||||
c02_获得火柴,火柴,,获得,,[#item]
|
setting_退出,保存并退出,,,
|
||||||
c02_1014钥匙,1014钥匙,,获得,,[#item]
|
setting_日志,打开日志,,,
|
||||||
c02_老鼠洞1,一个老鼠洞,,,,
|
ui_秒,秒,,,
|
||||||
c02_老鼠洞2,在这种楼里挺常见的,,,,
|
ui_saved_all,已保存所有数据,,,
|
||||||
ui_新游戏,新游戏,,,,
|
ui_new_archive,已创建新存档,,,
|
||||||
ui_继续游戏,继续游戏,,,,
|
ui_auto_saved,自动保存成功,,,
|
||||||
ui_退出游戏,退出游戏,,,,
|
ui_press_e,按 E 与场景互动,,,
|
||||||
c02_寻人启事,"似乎是一张寻人启事
|
ui_important_item_update,重要物品已更新(按 B 打开背包),,,
|
||||||
脸的部分被撕掉了,看不清",,,,
|
ui_press_shift,按住 Shift 奔跑,,,
|
||||||
prop_报纸,报纸,,,,[#texture=c01/信碎片1.png]
|
input_拼凑信件,点击选择信件碎片,方向键移动,按 E 旋转,,,
|
||||||
index_新游戏,新游戏,,,,
|
ui_获得,获得,,,
|
||||||
index_继续游戏,继续游戏,,,,
|
ui_退出,退出,,,
|
||||||
index_退出游戏,退出游戏,,,,
|
ui_阅读,阅读,,,
|
||||||
setting_总音量,总音量,,,,
|
ui_检阅,检阅,,,
|
||||||
setting_音效音量,音效音量,,,,
|
ui_收起,收起,,,
|
||||||
setting_对话音量,对话音量,,,,
|
ui_夜行船1,百岁光阴一梦蝶。,,,
|
||||||
setting_全屏游戏,全屏游戏,,,,
|
ui_夜行船2,重回⾸往事堪嗟。,,,
|
||||||
setting_窗口置顶,窗口置顶,,,,
|
ui_夜行船3,今⽇春来。明朝花谢。,,,
|
||||||
setting_自动保存,自动保存,,,,
|
ui_夜行船4,急罚盏夜阑灯灭。,,,
|
||||||
setting_主界面,回到主界面,,,,
|
ui_夜行船5,夜行船,,,
|
||||||
setting_退出,保存并退出,,,,
|
prop_空手,空手,,,
|
||||||
setting_日志,打开日志,,,,
|
prop_信碎片1,信碎片(一),,,[#texture=c01/信件左上.png]
|
||||||
ui_秒,秒,,,,
|
prop_信碎片2,信碎片(二),,,[#texture=c01/信件右上.png]
|
||||||
ui_saved_all,已保存所有数据,,,,
|
prop_银元,银元,,,[#texture=c01/银元.png]
|
||||||
ui_new_archive,已创建新存档,,,,
|
prop_院长的信,院长的信,,,[#texture=c01/院长的信.png]
|
||||||
ui_auto_saved,自动保存成功,,,,
|
prop_重要物品示例,重要物品示例,,,[#texture=c01/银元.png]
|
||||||
ui_press_e,按 E 与场景互动,,,,
|
prop_令牌,令牌,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
|
||||||
ui_press_b,按 B 打开背包,,,,
|
prop_装有灵魂的令牌,装有灵魂的令牌,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png]
|
||||||
ui_press_shift,按住 Shift 奔跑,,,,
|
prop_火柴,火柴,,,[#texture=c02/火柴.png]
|
||||||
input_拼凑信件,点击选择信件碎片,方向键移动,按 E 旋转,,,,
|
prop_小猫玩具的脑袋,小猫玩具的脑袋,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png]
|
||||||
ui_获得,获得,,,,
|
prop_绳子,绳子,,,[#texture=c02/绳子物品.png][#inspect=c02/绳子.png]
|
||||||
ui_退出,退出,Exit,,,
|
prop_1012钥匙,1012钥匙,,,[#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png]
|
||||||
ui_阅读,阅读,Read,,,
|
prop_老虎钳,老虎钳,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png]
|
||||||
ui_检阅,检阅,,,,
|
prop_3014旋转锁钥匙,3014旋转锁钥匙,,,[#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png]
|
||||||
ui_收起,收起,Hold,,,
|
prop_小猫玩具完整,小猫玩具,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png]
|
||||||
ui_夜行船1,百岁光阴一梦蝶。,,,,
|
院长的信...,院长的信...,,,
|
||||||
ui_夜行船2,重回⾸往事堪嗟。,,,,
|
1,1,,,
|
||||||
ui_夜行船3,今⽇春来。明朝花谢。,,,,
|
2,2,,,
|
||||||
ui_夜行船4,急罚盏夜阑灯灭。,,,,
|
3,3,,,
|
||||||
ui_夜行船5,夜行船,,,,
|
重要物品示例,重要物品示例,,,
|
||||||
prop_空手,空手,,,,
|
4,4,,,
|
||||||
prop_信碎片1,信碎片(一),,,,[#texture=c01/信碎片1.png]
|
c01_s07_需要报纸,我想先在周围看看,,,
|
||||||
prop_信碎片2,信碎片(二),,,,[#texture=c01/信碎片1.png]
|
c01_s08_书店工作,我还有工作要做,,,
|
||||||
prop_院长的信,院长的信,,,,[#texture=c01/信碎片1.png]
|
c01_s08_书店工钱,我还有⼯钱没拿,,,
|
||||||
prop_银元,银元,,,,[#texture=c01/银元.png]
|
notes_纸条,纸条,,,
|
||||||
prop_令牌,令牌,,,,[#texture=c01/令牌物品.png][#inspect=c01/令牌.png]
|
notes_锁住了,锁住了,,,
|
||||||
prop_装有灵魂的令牌,装有灵魂的令牌,,,,[#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png]
|
notes_打不开,打不开,,,
|
||||||
prop_火柴,火柴,,,,[#texture=c02/火柴.png]
|
notes_干掉的血迹,干掉的血迹,,,
|
||||||
prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png]
|
notes_有什么东西,有什么东西,,,
|
||||||
prop_绳子,绳子,Rope,,,[#texture=c02/绳子物品.png][#inspect=c02/绳子.png]
|
notes_无法触碰,无法触碰,,,
|
||||||
prop_1012钥匙,1012钥匙,1012 Key,,,[#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png]
|
notes_挂画,挂画,,,
|
||||||
prop_老虎钳,老虎钳,,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png]
|
notes_相框,相框,,,
|
||||||
prop_3014旋转锁钥匙,3014旋转锁钥匙,,,,[#texture=c02/3014旋转锁钥匙物品.png][#inspect=c02/3014旋转锁钥匙.png]
|
notes_寻人启事,寻人启事,,,
|
||||||
prop_小猫玩具完整,小猫玩具,,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png]
|
c01_鸡毛掸子,这是鸡毛掸子吗?,,,
|
||||||
c01_s07_需要报纸,我想先在周围看看,,,,
|
c01_院长书桌,桌上放着纸笔,,,
|
||||||
c01_s08_书店工作,我还有工作要做,,,,
|
c01_院长床,这本书已经看过了,,,
|
||||||
c01_s08_书店工钱,我还有⼯钱没拿,,,,
|
|
||||||
notes_纸条,纸条,,,,
|
|
||||||
notes_锁住了,锁住了,,,,
|
|
||||||
notes_打不开,打不开,,,,
|
|
||||||
notes_干掉的血迹,干掉的血迹,,,,
|
|
||||||
notes_有什么东西,有什么东西,,,,
|
|
||||||
notes_无法触碰,无法触碰,,,,
|
|
||||||
notes_挂画,挂画,,,,
|
|
||||||
notes_相框,相框,,,,
|
|
||||||
notes_寻人启事,寻人启事,,,,
|
|
||||||
c01_鸡毛掸子,这是鸡毛掸子吗?,,,,
|
|
||||||
c01_院长书桌,桌上放着纸笔,,,,
|
|
||||||
c01_院长床,这本书已经看过了,,,,
|
|
||||||
c01_院长座钟,"1917年10⽉28⽇...
|
c01_院长座钟,"1917年10⽉28⽇...
|
||||||
时间停在16\:30",,,,
|
时间停在16\:30",,,
|
||||||
c01_倾斜的洋相片,洋相片,,,,
|
c01_倾斜的洋相片,洋相片,,,
|
||||||
c01_摆正的洋相片,是院长的女儿吗,,,,
|
c01_摆正的洋相片,是院长的女儿吗,,,
|
||||||
c01_s06_院长房间,这是院长的房间,,,,
|
c01_s06_院长房间,这是院长的房间,,,
|
||||||
c01_s06_小朋友房间,这是其他小朋友的房间,,,,
|
c01_s06_小朋友房间,这是其他小朋友的房间,,,
|
||||||
c01_s07_钱碗,碗⾥是铜钱,,,,
|
c01_s07_钱碗,碗⾥是铜钱,,,
|
||||||
c01_s07_获得报纸,这是什么?,,,,
|
c01_s07_获得报纸,这是什么?,,,
|
||||||
c01_s07_书店展柜,"好多书...
|
c01_s07_书店展柜,"好多书...
|
||||||
要是能在这里工作就好了",,,,
|
要是能在这里工作就好了",,,
|
||||||
c01_s08_书架游戏完成,"这些书怎么变成这样了?
|
c01_s08_书架游戏完成,"这些书怎么变成这样了?
|
||||||
好可惜...我可能需要离开了",,,,
|
好可惜...我可能需要离开了",,,
|
||||||
c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事
|
c02_小蝉寻人启事_脸部破碎,"似乎是一张寻人启事
|
||||||
脸的部分被撕掉了,看不清",,,,
|
脸的部分被撕掉了,看不清",,,
|
||||||
c02_卫生宣传画,几张卫生宣传画,,,,
|
c02_卫生宣传画,几张卫生宣传画,,,
|
||||||
c02_老鼠洞,"一个老鼠洞
|
c02_老鼠洞,"一个老鼠洞
|
||||||
在这种楼里挺常见的",,,,
|
在这种楼里挺常见的",,,
|
||||||
c02_十几年前的报纸,十几年前的报纸,,,,
|
c02_十几年前的报纸,十几年前的报纸,,,
|
||||||
c02_绳子剪刀,绳子和剪刀,,,,
|
c02_绳子剪刀,绳子和剪刀,,,
|
||||||
c02_玩具缺脑袋,这个玩具缺了个脑袋,,,,
|
c02_玩具缺脑袋,这个玩具缺了个脑袋,,,
|
||||||
c02_又是寻人启示,又是那张寻人启示,,,,
|
c02_又是寻人启示,又是那张寻人启示,,,
|
||||||
c02_墙上的海报被撕掉了,墙上的海报被撕掉了,,,,
|
c02_墙上的海报被撕掉了,墙上的海报被撕掉了,,,
|
||||||
c02_井臭,井里有一股臭味,,,,
|
c02_井臭,井里有一股臭味,,,
|
||||||
c02_中药材,车上放了一些中药材,,,,
|
c02_中药材,车上放了一些中药材,,,
|
||||||
c02_排队,排队的人堵住了上楼的路,,,,
|
c02_排队,排队的人堵住了上楼的路,,,
|
||||||
c02_不要出去,最好还是先不要出去,,,,
|
c02_不要出去,最好还是先不要出去,,,
|
||||||
c02_太阳,太阳快落山了,,,,
|
c02_太阳,太阳快落山了,,,
|
||||||
c02_民国六年1015,民国六年十月十五日,,,,
|
c02_民国六年1015,民国六年十月十五日,,,
|
||||||
c02_一个洞,一个洞,里面好像还有空间,,,,
|
c02_一个洞,一个洞,里面好像还有空间,,,
|
||||||
c02_工具箱,工具箱,,,,
|
c02_工具箱,工具箱,,,
|
||||||
c02_找到有用的东西,应该能找到有用的东西,,,,
|
c02_找到有用的东西,应该能找到有用的东西,,,
|
||||||
c02_公寓告示,公寓告示,,,,
|
c02_公寓告示,公寓告示,,,
|
||||||
c02_通往里间的门,通往里间的门,,,,
|
c02_通往里间的门,通往里间的门,,,
|
||||||
c02_花名册,花名册,,,,
|
c02_花名册,花名册,,,
|
||||||
c02_罪,罪,,,,
|
c02_罪,罪,,,
|
||||||
c02_门上有什么东西,门上有什么东西,,,,
|
c02_门上有什么东西,门上有什么东西,,,
|
||||||
c02_奠,奠,,,,
|
c02_奠,奠,,,
|
||||||
c02_寻夏小蝉,失踪的小孩名叫夏小蝉,,,,
|
c02_寻夏小蝉,失踪的小孩名叫夏小蝉,,,
|
||||||
c02_小猫干尸,小猫的尸体已经干了,,,,
|
c02_小猫干尸,小猫的尸体已经干了,,,
|
||||||
c02_几块大洋,几块大洋,,,,
|
c02_几块大洋,几块大洋,,,
|
||||||
c02_死老鼠,死掉的老鼠,,,,
|
c02_死老鼠,死掉的老鼠,,,
|
||||||
c02_石缝开花,石缝里开了几束花,,,,
|
c02_石缝开花,石缝里开了几束花,,,
|
||||||
c02_石壁空间,石壁另一头好像还有空间,,,,
|
c02_石壁空间,石壁另一头好像还有空间,,,
|
||||||
c02_民国六年1221,民国六年十二月二十一日,,,,
|
c02_民国六年1221,民国六年十二月二十一日,,,
|
||||||
c02_患者感谢信,一些患者的感谢信,,,,
|
c02_患者感谢信,一些患者的感谢信,,,
|
||||||
c02_被撕掉的书,一本被撕掉的书,,,,
|
c02_被撕掉的书,一本被撕掉的书,,,
|
||||||
c02_里面有什么东西,里面有什么东西,,,,
|
c02_里面有什么东西,里面有什么东西,,,
|
||||||
c02_戏台上的诗,戏台上面刻了一首诗,,,,
|
c02_戏台上的诗,戏台上面刻了一首诗,,,
|
||||||
c02_锁开了,锁开了,,,,
|
c02_锁开了,锁开了,,,
|
||||||
c02_口袋里有东西,口袋里有东西,,,,
|
c02_口袋里有东西,口袋里有东西,,,
|
||||||
c02_雾太大,雾太大了,看不清路,,,,
|
c02_雾太大,雾太大了,看不清路,,,
|
||||||
c02_八音盒,是个八音盒,,,,
|
c02_八音盒,是个八音盒,,,
|
||||||
c02_祝女儿早日康复,祝女儿早日康复,,,,
|
c02_祝女儿早日康复,祝女儿早日康复,,,
|
||||||
c02_图案一样,这图案和我手臂上的一摸一样,,,,
|
c02_图案一样,这图案和我手臂上的一摸一样,,,
|
||||||
|
|
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
importer="csv_translation"
|
importer="csv_translation"
|
||||||
type="Translation"
|
type="Translation"
|
||||||
uid="uid://bd5qbimcnpkb5"
|
uid="uid://hx4e4wd1tfeg"
|
||||||
|
|
||||||
[deps]
|
[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"
|
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]
|
[params]
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
自动保存成功 [ID:ui_auto_saved]
|
自动保存成功 [ID:ui_auto_saved]
|
||||||
|
|
||||||
按 E 与场景互动 [ID:ui_press_e]
|
按 E 与场景互动 [ID:ui_press_e]
|
||||||
按 B 打开背包 [ID:ui_press_b]
|
重要物品已更新(按 B 打开背包) [ID:ui_important_item_update]
|
||||||
按住 Shift 奔跑 [ID:ui_press_shift]
|
按住 Shift 奔跑 [ID:ui_press_shift]
|
||||||
点击选择信件碎片,方向键移动,按 E 旋转 [ID:input_拼凑信件]
|
点击选择信件碎片,方向键移动,按 E 旋转 [ID:input_拼凑信件]
|
||||||
|
|
||||||
@ -43,11 +43,13 @@
|
|||||||
空手 [ID:prop_空手]
|
空手 [ID:prop_空手]
|
||||||
# texture 路径从 "res://asset/art/prop/" 之后算起
|
# texture 路径从 "res://asset/art/prop/" 之后算起
|
||||||
# c01
|
# 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_银元]
|
银元 [#texture=c01/银元.png] [ID:prop_银元]
|
||||||
# TODO 美术资源更换
|
院长的信 [#texture=c01/院长的信.png] [ID:prop_院长的信]
|
||||||
信碎片(二) [#texture=c01/信碎片1.png] [ID:prop_信碎片2]
|
重要物品示例 [#texture=c01/银元.png] [ID:prop_重要物品示例]
|
||||||
院长的信 [#texture=c01/信碎片1.png] [ID:prop_院长的信]
|
|
||||||
令牌 [#texture=c01/令牌物品.png][#inspect=c01/令牌.png] [ID:prop_令牌]
|
令牌 [#texture=c01/令牌物品.png][#inspect=c01/令牌.png] [ID:prop_令牌]
|
||||||
装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [ID:prop_装有灵魂的令牌]
|
装有灵魂的令牌 [#texture=c01/装有灵魂的令牌物品.png][#inspect=c01/装有灵魂的令牌.png] [ID:prop_装有灵魂的令牌]
|
||||||
# c02
|
# c02
|
||||||
@ -60,6 +62,21 @@
|
|||||||
小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] [ID:prop_小猫玩具完整]
|
小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] [ID:prop_小猫玩具完整]
|
||||||
=> END
|
=> END
|
||||||
|
|
||||||
|
~ prop_院长的信
|
||||||
|
院长的信...
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
=> END
|
||||||
|
|
||||||
|
~ prop_重要物品示例
|
||||||
|
重要物品示例
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
4
|
||||||
|
=> END
|
||||||
|
|
||||||
~ HoldingReason
|
~ HoldingReason
|
||||||
我想先在周围看看 [ID:c01_s07_需要报纸]
|
我想先在周围看看 [ID:c01_s07_需要报纸]
|
||||||
我还有工作要做 [ID:c01_s08_书店工作]
|
我还有工作要做 [ID:c01_s08_书店工作]
|
||||||
|
@ -72,9 +72,7 @@ func unlock_player():
|
|||||||
|
|
||||||
# action_freezed 对应 freeze 与 release 方法
|
# 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.
|
# 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(
|
func freeze_player(lock_time: float, action := 3, auto_quit := false) -> void:
|
||||||
lock_time: float, action := 3, auto_quit := false
|
|
||||||
) -> void:
|
|
||||||
var player = get_player()
|
var player = get_player()
|
||||||
if player:
|
if player:
|
||||||
player.freeze_player(lock_time, action, auto_quit)
|
player.freeze_player(lock_time, action, auto_quit)
|
||||||
@ -116,6 +114,7 @@ func set_player_boundary(rect: Rect2) -> void:
|
|||||||
|
|
||||||
var balloon_node
|
var balloon_node
|
||||||
|
|
||||||
|
|
||||||
func pop_debug_dialog_info(character: String, content: String):
|
func pop_debug_dialog_info(character: String, content: String):
|
||||||
if GlobalConfig.DEBUG:
|
if GlobalConfig.DEBUG:
|
||||||
if not is_instance_valid(balloon_node):
|
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")
|
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:
|
func disable_prop_item(prop_key: String) -> void:
|
||||||
var prop_hud = get_prop_hud()
|
var prop_hud = get_prop_hud()
|
||||||
if prop_hud:
|
if prop_hud:
|
||||||
@ -260,9 +267,7 @@ var prop_bag = preload("res://scene/prop/prop_bag.tscn")
|
|||||||
|
|
||||||
|
|
||||||
func show_bag():
|
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():
|
func quit_game():
|
||||||
|
@ -101,12 +101,12 @@ func _on_paper_interacted():
|
|||||||
right_door.enabled = true
|
right_door.enabled = true
|
||||||
SceneManager.pop_debug_dialog_info("音效", "开门声")
|
SceneManager.pop_debug_dialog_info("音效", "开门声")
|
||||||
$"../sfx_door_open".play()
|
$"../sfx_door_open".play()
|
||||||
var inspector = SceneManager.get_inspector() as PropInspector
|
# var inspector = SceneManager.get_inspector() as PropInspector
|
||||||
if inspector:
|
# if inspector:
|
||||||
# 显示互动提示
|
# # 显示互动提示
|
||||||
inspector.quit_and_hidden.connect(
|
# inspector.quit_and_hidden.connect(
|
||||||
SceneManager.pop_center_notification.bind(tr("ui_press_b")), CONNECT_ONE_SHOT
|
# SceneManager.pop_center_notification.bind(tr("ui_prop_update")), CONNECT_ONE_SHOT
|
||||||
)
|
# )
|
||||||
|
|
||||||
|
|
||||||
# 钢琴音效,每次按下播放不同音符
|
# 钢琴音效,每次按下播放不同音符
|
||||||
|
@ -107,6 +107,7 @@ height = -10.0
|
|||||||
dialogue_title = "c01_s07_吉祥话2"
|
dialogue_title = "c01_s07_吉祥话2"
|
||||||
|
|
||||||
[node name="陆仁擦刀" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="6"]
|
[node name="陆仁擦刀" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="6"]
|
||||||
|
visible = false
|
||||||
position = Vector2(199, 0)
|
position = Vector2(199, 0)
|
||||||
sprite_frames = ExtResource("6_thm8f")
|
sprite_frames = ExtResource("6_thm8f")
|
||||||
animation = &"陆仁擦刀"
|
animation = &"陆仁擦刀"
|
||||||
|
@ -177,11 +177,11 @@ func _on_envelope_game_exiting() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_envelope_game_success() -> void:
|
func _on_envelope_game_success() -> void:
|
||||||
|
SceneManager.release_player()
|
||||||
envolope_table.enabled = false
|
envolope_table.enabled = false
|
||||||
create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0)
|
create_tween().tween_property(mask, "color:a", 0.0, 1.0).from(1.0)
|
||||||
ArchiveManager.archive.set_global_entry("envelope_game_success", true)
|
ArchiveManager.archive.set_global_entry("envelope_game_success", true)
|
||||||
envelope_game_success = true
|
envelope_game_success = true
|
||||||
SceneManager.enable_prop_item("prop_院长的信")
|
|
||||||
_check_portal()
|
_check_portal()
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ offset = Vector2(0, 40)
|
|||||||
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
|
[node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"]
|
||||||
points = PackedVector2Array(30, 150, 545, 150)
|
points = PackedVector2Array(30, 150, 545, 150)
|
||||||
|
|
||||||
[node name="参考" type="Sprite2D" parent="Ground"]
|
[node name="参考" type="Sprite2D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
modulate = Color(1, 1, 1, 0.580392)
|
modulate = Color(1, 1, 1, 0.580392)
|
||||||
position = Vector2(20, 0)
|
position = Vector2(20, 0)
|
||||||
|
@ -29,7 +29,7 @@ func _ready() -> void:
|
|||||||
_display_selected()
|
_display_selected()
|
||||||
content_rect.modulate.a = 0.0
|
content_rect.modulate.a = 0.0
|
||||||
content_rect.visible = true
|
content_rect.visible = true
|
||||||
%Label.text = tr("c01_信件全文")
|
# %Label.text = tr("c01_信件全文")
|
||||||
SceneManager.pop_center_notification(tr("input_拼凑信件"))
|
SceneManager.pop_center_notification(tr("input_拼凑信件"))
|
||||||
|
|
||||||
|
|
||||||
@ -132,8 +132,16 @@ func _check_answer() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _post_success():
|
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:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
@ -175,4 +183,4 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
if handled:
|
if handled:
|
||||||
$SfxMove.play()
|
$SfxMove.play()
|
||||||
_display_selected()
|
_display_selected()
|
||||||
_check_answer()
|
_check_answer()
|
||||||
|
@ -1,15 +1,61 @@
|
|||||||
extends Panel
|
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():
|
func _ready():
|
||||||
get_parent().layer = GlobalConfig.CANVAS_LAYER_BAG
|
get_parent().layer = GlobalConfig.CANVAS_LAYER_BAG
|
||||||
_load_inventory()
|
# SceneManager.lock_player()
|
||||||
SceneManager.lock_player()
|
|
||||||
get_tree().paused = true
|
get_tree().paused = true
|
||||||
|
_load_item_buttons()
|
||||||
|
|
||||||
|
|
||||||
func _load_inventory():
|
func _load_item_buttons() -> void:
|
||||||
pass
|
# 移除 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:
|
func _unhandled_input(event: InputEvent) -> void:
|
||||||
@ -20,5 +66,5 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
):
|
):
|
||||||
get_viewport().set_input_as_handled()
|
get_viewport().set_input_as_handled()
|
||||||
get_tree().paused = false
|
get_tree().paused = false
|
||||||
SceneManager.unlock_player()
|
# SceneManager.unlock_player()
|
||||||
queue_free()
|
queue_free()
|
||||||
|
@ -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="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="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"]
|
[node name="PropBag" type="CanvasLayer"]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
@ -28,82 +35,69 @@ texture = ExtResource("2_3s314")
|
|||||||
expand_mode = 5
|
expand_mode = 5
|
||||||
stretch_mode = 2
|
stretch_mode = 2
|
||||||
|
|
||||||
[node name="GridContainer" type="GridContainer" parent="Bag"]
|
[node name="ScrollContainer" type="ScrollContainer" parent="Bag"]
|
||||||
custom_minimum_size = Vector2(270, 120)
|
custom_minimum_size = Vector2(120, 160)
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 8
|
anchors_preset = 8
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
anchor_top = 0.5
|
anchor_top = 0.5
|
||||||
anchor_right = 0.5
|
anchor_right = 0.5
|
||||||
anchor_bottom = 0.5
|
anchor_bottom = 0.5
|
||||||
offset_left = -20.0
|
offset_left = -139.0
|
||||||
offset_top = -20.0
|
offset_top = -82.0
|
||||||
offset_right = 20.0
|
offset_right = -19.0
|
||||||
offset_bottom = 20.0
|
offset_bottom = 78.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
columns = 9
|
horizontal_scroll_mode = 0
|
||||||
|
|
||||||
[node name="Panel" type="Panel" parent="Bag/GridContainer"]
|
[node name="ButtonsVBox" type="VBoxContainer" parent="Bag/ScrollContainer"]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
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
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="Panel2" type="Panel" parent="Bag/GridContainer"]
|
[node name="Button2" parent="Bag/ScrollContainer/ButtonsVBox" instance=ExtResource("3_wlvs1")]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
text = "示例按钮"
|
||||||
|
|
||||||
[node name="Panel3" type="Panel" parent="Bag/GridContainer"]
|
[node name="Button3" parent="Bag/ScrollContainer/ButtonsVBox" instance=ExtResource("3_wlvs1")]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
text = "示例按钮"
|
||||||
|
|
||||||
[node name="Panel4" type="Panel" parent="Bag/GridContainer"]
|
[node name="DisplayVBox" type="VBoxContainer" parent="Bag"]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
layout_mode = 0
|
||||||
layout_mode = 2
|
offset_left = 300.0
|
||||||
|
offset_top = 64.0
|
||||||
|
offset_right = 440.0
|
||||||
|
offset_bottom = 248.0
|
||||||
|
|
||||||
[node name="Panel5" type="Panel" parent="Bag/GridContainer"]
|
[node name="TextureRect" type="TextureRect" parent="Bag/DisplayVBox"]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
unique_name_in_owner = true
|
||||||
|
custom_minimum_size = Vector2(100, 100)
|
||||||
layout_mode = 2
|
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"]
|
[node name="Content" type="TextEdit" parent="Bag/DisplayVBox"]
|
||||||
custom_minimum_size = Vector2(30, 30)
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
custom_minimum_size = Vector2(140, 90)
|
||||||
|
|
||||||
[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)
|
|
||||||
layout_mode = 2
|
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
|
||||||
|
47
scene/prop/prop_bag_button.tscn
Normal file
47
scene/prop/prop_bag_button.tscn
Normal file
@ -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")
|
@ -48,6 +48,7 @@ const PROP_CONTAINER_X = 130.0
|
|||||||
const PROP_CONTROL_X = 110.0
|
const PROP_CONTROL_X = 110.0
|
||||||
|
|
||||||
var items_dict := {}
|
var items_dict := {}
|
||||||
|
var important_items_dict = {}
|
||||||
# 从配置文件加载 prop items
|
# 从配置文件加载 prop items
|
||||||
var item_config_res = preload("res://asset/dialogue/item_description.dialogue")
|
var item_config_res = preload("res://asset/dialogue/item_description.dialogue")
|
||||||
var path_prefix = "res://asset/art/prop/"
|
var path_prefix = "res://asset/art/prop/"
|
||||||
@ -123,10 +124,27 @@ func _load_items():
|
|||||||
if inspect_path:
|
if inspect_path:
|
||||||
item.inspect_path = path_prefix + inspect_path
|
item.inspect_path = path_prefix + inspect_path
|
||||||
items_dict[item.key] = item
|
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":
|
if not current_line.has("next_id") or current_line.next_id == "end":
|
||||||
break
|
break
|
||||||
current_line = item_config_res.lines[current_line.next_id]
|
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:
|
func _load_from_archive() -> void:
|
||||||
if ArchiveManager.archive:
|
if ArchiveManager.archive:
|
||||||
|
@ -12,7 +12,15 @@ signal current_item_changed(prop_key: String)
|
|||||||
current_item_changed.emit(enabled_items[current_index])
|
current_item_changed.emit(enabled_items[current_index])
|
||||||
else:
|
else:
|
||||||
current_item_changed.emit("")
|
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:
|
func current_item_key() -> String:
|
||||||
if enabled_items.size() == 0:
|
if enabled_items.size() == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user