player内心os悬浮文本;规范化prop资源导入流程

This commit is contained in:
cakipaul 2025-01-12 14:02:00 +08:00
parent c5cbf263ee
commit e0a746d2fa
24 changed files with 379 additions and 230 deletions

View File

@ -1,3 +1,7 @@
# xiandie
《衔蝶》开发代码
# 说明
- [DialogueManager 使用与维护说明](https://docs.qq.com/doc/DWG5vaEZ1Qk9EdVVw)

View File

@ -3,6 +3,10 @@
# command example: ffmpeg -i input.mp3 -c:a libvorbis -qscale:a 5 output.ogg
# ffmpeg -i "c02_吕萍_01_梦楼.mp3" -c:a libvorbis -qscale:a 8 "./ogg/c02_吕萍_01_梦楼.ogg"
# makdir ogg if not exist
if [ ! -d "./ogg" ]; then
mkdir ogg

View File

@ -3,4 +3,5 @@
有地方人称鼠疫为妖邪作祟,甚为惊骇,一时人心惶惶,竟有聚众滋闹之事,政府以防疫事宜关系紧要,拟赴分水墩一带调查防疫事宜云。 [ID:tdb119a3714]
《申报》 [ID:ta750647b12]
民国五年一月十三日 [ID:t736cca4563]
=> END
=> END

View File

@ -2,62 +2,67 @@ keys,zh_Hans,en,_character,_notes,_tags
ui_退出,退出,Exit,,,
ui_阅读,阅读,Read,,,
ui_收起,收起,Hold,,,
prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,
prop_绳子,绳子,Rope,,,
prop_1012钥匙,1012钥匙,1012 Key,,,
notes_纸条,(纸条),,,,
notes_锁住了,(锁住了),,,,
notes_打不开,(打不开),,,,
notes_干掉的血迹,(干掉的血迹),,,,
notes_有什么东西,(有什么东西),,,,
notes_无法触碰,(无法触碰),,,,
notes_挂画,(挂画),,,,
notes_相框,(相框),,,,
notes_寻人启事,(寻人启事),,,,
c01_纸包钥匙,(一张纸条包着钥匙),,,,
c02_绳子剪刀,(绳子和剪刀),,,,
c02_寻人启事1,(似乎是一张寻人启事),,,,
c02_寻人启事2,(脸的部分被撕掉了,看不清),,,,
c02_玩具缺脑袋,(这个玩具缺了个脑袋),,,,
c02_卫生宣传画,(几张卫生宣传画),,,,
c02_老鼠洞1,(一个老鼠洞),,,,
c02_老鼠洞2,(在这种楼里挺常见的),,,,
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_八音盒,(是个八音盒),,,,
prop_令牌,令牌,,,,[#texture=c01/令牌物品.png]
prop_装有灵魂的令牌,装有灵魂的令牌,,,,[#texture=c01/装有灵魂的令牌物品.png]
prop_小猫玩具的脑袋,小猫玩具的脑袋,Catty's Head,,,[#texture=c02/小猫玩具脑袋物品.png]
prop_绳子,绳子,Rope,,,[#texture=c02/绳子物品.png]
prop_1012钥匙,1012钥匙,1012 Key,,,[#texture=c02/1012钥匙物品.png]
prop_老虎钳,老虎钳,,,,[#texture=c02/老虎钳物品.png]
prop_3014旋转锁钥匙,3014旋转锁钥匙,,,,[#texture=c02/3014旋转锁钥匙物品.png]
prop_小猫玩具完整,小猫玩具,,,,[#texture=c02/小猫玩具完整物品.png]
notes_纸条,纸条,,,,
notes_锁住了,锁住了,,,,
notes_打不开,打不开,,,,
notes_干掉的血迹,干掉的血迹,,,,
notes_有什么东西,有什么东西,,,,
notes_无法触碰,无法触碰,,,,
notes_挂画,挂画,,,,
notes_相框,相框,,,,
notes_寻人启事,寻人启事,,,,
c01_纸包钥匙,一张纸条包着钥匙,,,,
c02_绳子剪刀,绳子和剪刀,,,,
c02_寻人启事1,似乎是一张寻人启事,,,,
c02_寻人启事2,脸的部分被撕掉了,看不清,,,,
c02_玩具缺脑袋,这个玩具缺了个脑袋,,,,
c02_卫生宣传画,几张卫生宣传画,,,,
c02_老鼠洞1,一个老鼠洞,,,,
c02_老鼠洞2,在这种楼里挺常见的,,,,
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_八音盒,是个八音盒,,,,
=>en,=>en,,,,
c02_祝女儿早日康复,(祝女儿早日康复),,,,
c02_图案一样,(这图案和我手臂上的一摸一样),,,,
c02_祝女儿早日康复,祝女儿早日康复,,,,
c02_图案一样,这图案和我手臂上的一摸一样,,,,
c01_获得令牌,令牌,,获得,,[#item]
c01_获得灵魂令牌,带有灵魂的令牌,,获得,,[#item]
c01_获得院长信件,院长的信件,,获得,,[#item]

1 keys zh_Hans en _character _notes _tags
2 ui_退出 退出 Exit
3 ui_阅读 阅读 Read
4 ui_收起 收起 Hold
5 prop_小猫玩具的脑袋 prop_令牌 小猫玩具的脑袋 令牌 Catty's Head [#texture=c01/令牌物品.png]
6 prop_绳子 prop_装有灵魂的令牌 绳子 装有灵魂的令牌 Rope [#texture=c01/装有灵魂的令牌物品.png]
7 prop_1012钥匙 prop_小猫玩具的脑袋 1012钥匙 小猫玩具的脑袋 1012 Key Catty's Head [#texture=c02/小猫玩具脑袋物品.png]
8 notes_纸条 prop_绳子 (纸条) 绳子 Rope [#texture=c02/绳子物品.png]
9 notes_锁住了 prop_1012钥匙 (锁住了) 1012钥匙 1012 Key [#texture=c02/1012钥匙物品.png]
10 notes_打不开 prop_老虎钳 (打不开) 老虎钳 [#texture=c02/老虎钳物品.png]
11 notes_干掉的血迹 prop_3014旋转锁钥匙 (干掉的血迹) 3014旋转锁钥匙 [#texture=c02/3014旋转锁钥匙物品.png]
12 notes_有什么东西 prop_小猫玩具完整 (有什么东西) 小猫玩具 [#texture=c02/小猫玩具完整物品.png]
13 notes_无法触碰 notes_纸条 (无法触碰) 纸条
14 notes_挂画 notes_锁住了 (挂画) 锁住了
15 notes_相框 notes_打不开 (相框) 打不开
16 notes_寻人启事 notes_干掉的血迹 (寻人启事) 干掉的血迹
17 c01_纸包钥匙 notes_有什么东西 (一张纸条包着钥匙) 有什么东西
18 c02_绳子剪刀 notes_无法触碰 (绳子和剪刀) 无法触碰
19 c02_寻人启事1 notes_挂画 (似乎是一张寻人启事) 挂画
20 c02_寻人启事2 notes_相框 (脸的部分被撕掉了,看不清) 相框
21 c02_玩具缺脑袋 notes_寻人启事 (这个玩具缺了个脑袋) 寻人启事
22 c02_卫生宣传画 c01_纸包钥匙 (几张卫生宣传画) 一张纸条包着钥匙
23 c02_老鼠洞1 c02_绳子剪刀 (一个老鼠洞) 绳子和剪刀
24 c02_老鼠洞2 c02_寻人启事1 (在这种楼里挺常见的) 似乎是一张寻人启事
25 c02_十几年前的报纸 c02_寻人启事2 (十几年前的报纸) 脸的部分被撕掉了,看不清
26 c02_又是寻人启示 c02_玩具缺脑袋 (又是那张寻人启示) 这个玩具缺了个脑袋
27 c02_墙上的海报被撕掉了 c02_卫生宣传画 (墙上的海报被撕掉了) 几张卫生宣传画
28 c02_井臭 c02_老鼠洞1 (井里有一股臭味) 一个老鼠洞
29 c02_中药材 c02_老鼠洞2 (车上放了一些中药材) 在这种楼里挺常见的
30 c02_排队 c02_十几年前的报纸 (排队的人堵住了上楼的路) 十几年前的报纸
31 c02_不要出去 c02_又是寻人启示 (最好还是先不要出去) 又是那张寻人启示
32 c02_太阳 c02_墙上的海报被撕掉了 (太阳快落山了) 墙上的海报被撕掉了
33 c02_民国六年1015 c02_井臭 (民国六年十月十五日) 井里有一股臭味
34 c02_一个洞 c02_中药材 (一个洞,里面好像还有空间) 车上放了一些中药材
35 c02_工具箱 c02_排队 (工具箱) 排队的人堵住了上楼的路
36 c02_找到有用的东西 c02_不要出去 (应该能找到有用的东西) 最好还是先不要出去
37 c02_公寓告示 c02_太阳 (公寓告示) 太阳快落山了
38 c02_通往里间的门 c02_民国六年1015 (通往里间的门) 民国六年十月十五日
39 c02_花名册 c02_一个洞 (花名册) 一个洞,里面好像还有空间
40 c02_罪 c02_工具箱 (罪) 工具箱
41 c02_门上有什么东西 c02_找到有用的东西 (门上有什么东西) 应该能找到有用的东西
42 c02_奠 c02_公寓告示 (奠) 公寓告示
43 c02_寻夏小蝉 c02_通往里间的门 (失踪的小孩名叫夏小蝉) 通往里间的门
44 c02_小猫干尸 c02_花名册 (小猫的尸体已经干了) 花名册
45 c02_几块大洋 c02_罪 (几块大洋)
46 c02_死老鼠 c02_门上有什么东西 (死掉的老鼠) 门上有什么东西
47 c02_石缝开花 c02_奠 (石缝里开了几束花)
48 c02_石壁空间 c02_寻夏小蝉 (石壁另一头好像还有空间) 失踪的小孩名叫夏小蝉
49 c02_民国六年1221 c02_小猫干尸 (民国六年十二月二十一日) 小猫的尸体已经干了
50 c02_患者感谢信 c02_几块大洋 (一些患者的感谢信) 几块大洋
51 c02_被撕掉的书 c02_死老鼠 (一本被撕掉的书) 死掉的老鼠
52 c02_里面有什么东西 c02_石缝开花 (里面有什么东西) 石缝里开了几束花
53 c02_戏台上的诗 c02_石壁空间 (戏台上面刻了一首诗) 石壁另一头好像还有空间
54 c02_锁开了 c02_民国六年1221 (锁开了) 民国六年十二月二十一日
55 c02_口袋里有东西 c02_患者感谢信 (口袋里有东西) 一些患者的感谢信
56 c02_雾太大 c02_被撕掉的书 (雾太大了,看不清路) 一本被撕掉的书
57 c02_八音盒 c02_里面有什么东西 (是个八音盒) 里面有什么东西
58 c02_戏台上的诗 戏台上面刻了一首诗
59 c02_锁开了 锁开了
60 c02_口袋里有东西 口袋里有东西
61 c02_雾太大 雾太大了,看不清路
62 c02_八音盒 是个八音盒
63 =>en =>en
64 c02_祝女儿早日康复 (祝女儿早日康复) 祝女儿早日康复
65 c02_图案一样 (这图案和我手臂上的一摸一样) 这图案和我手臂上的一摸一样
66 c01_获得令牌 令牌 获得 [#item]
67 c01_获得灵魂令牌 带有灵魂的令牌 获得 [#item]
68 c01_获得院长信件 院长的信件 获得 [#item]

View File

@ -5,215 +5,223 @@
收起 [ID:ui_收起]
=> END
~ Prop
小猫玩具的脑袋 [ID:prop_小猫玩具的脑袋]
绳子 [ID:prop_绳子]
1012钥匙 [ID:prop_1012钥匙]
~ PropItems
# texture 路径从 "res://asset/art/prop/" 之后算起
# c01
令牌[#texture=c01/令牌物品.png] [ID:prop_令牌]
装有灵魂的令牌[#texture=c01/装有灵魂的令牌物品.png] [ID:prop_装有灵魂的令牌]
# c02
小猫玩具的脑袋[#texture=c02/小猫玩具脑袋物品.png] [ID:prop_小猫玩具的脑袋]
绳子[#texture=c02/绳子物品.png] [ID:prop_绳子]
1012钥匙[#texture=c02/1012钥匙物品.png] [ID:prop_1012钥匙]
老虎钳[#texture=c02/老虎钳物品.png] [ID:prop_老虎钳]
3014旋转锁钥匙[#texture=c02/3014旋转锁钥匙物品.png] [ID:prop_3014旋转锁钥匙]
小猫玩具[#texture=c02/小猫玩具完整物品.png] [ID:prop_小猫玩具完整]
=> END!
# notes 通用
~ notes_纸条
(纸条) [ID:notes_纸条]
纸条 [ID:notes_纸条]
=> END
~ notes_锁住了
锁住了[ID:notes_锁住了]
锁住了[ID:notes_锁住了]
=> END
~ notes_打不开
打不开[ID:notes_打不开]
打不开[ID:notes_打不开]
=> END
~ notes_干掉的血迹
干掉的血迹 [ID:notes_干掉的血迹]
干掉的血迹 [ID:notes_干掉的血迹]
=> END
~ notes_有什么东西
有什么东西 [ID:notes_有什么东西]
有什么东西 [ID:notes_有什么东西]
=> END
~ notes_无法触碰
无法触碰 [ID:notes_无法触碰]
无法触碰 [ID:notes_无法触碰]
=> END
~ notes_挂画
挂画 [ID:notes_挂画]
挂画 [ID:notes_挂画]
=> END
~ notes_相框
相框 [ID:notes_相框]
相框 [ID:notes_相框]
=> END
~ notes_寻人启事
寻人启事 [ID:notes_寻人启事]
寻人启事 [ID:notes_寻人启事]
=> END
# c01
~ c01_纸包钥匙
一张纸条包着钥匙 [ID:c01_纸包钥匙]
一张纸条包着钥匙 [ID:c01_纸包钥匙]
=> END
# c02
~ c02_绳子剪刀
绳子和剪刀 [ID:c02_绳子剪刀]
绳子和剪刀 [ID:c02_绳子剪刀]
=> END
~ c02_寻人启事
似乎是一张寻人启事 [ID:c02_寻人启事1]
脸的部分被撕掉了,看不清 [ID:c02_寻人启事2]
似乎是一张寻人启事 [ID:c02_寻人启事1]
脸的部分被撕掉了,看不清 [ID:c02_寻人启事2]
=> END
~ c02_玩具缺脑袋
这个玩具缺了个脑袋 [ID:c02_玩具缺脑袋]
这个玩具缺了个脑袋 [ID:c02_玩具缺脑袋]
=> END
~ c02_卫生宣传画
几张卫生宣传画 [ID:c02_卫生宣传画]
几张卫生宣传画 [ID:c02_卫生宣传画]
=> END
~ c02_老鼠洞
一个老鼠洞[ID:c02_老鼠洞1]
在这种楼里挺常见的 [ID:c02_老鼠洞2]
一个老鼠洞[ID:c02_老鼠洞1]
在这种楼里挺常见的 [ID:c02_老鼠洞2]
=> END
~ c02_十几年前的报纸
十几年前的报纸 [ID:c02_十几年前的报纸]
十几年前的报纸 [ID:c02_十几年前的报纸]
=> END
~ c02_又是寻人启示
又是那张寻人启示 [ID:c02_又是寻人启示]
又是那张寻人启示 [ID:c02_又是寻人启示]
=> END
~ c02_墙上的海报被撕掉了
墙上的海报被撕掉了 [ID:c02_墙上的海报被撕掉了]
墙上的海报被撕掉了 [ID:c02_墙上的海报被撕掉了]
=> END
~ c02_井臭
井里有一股臭味 [ID:c02_井臭]
井里有一股臭味 [ID:c02_井臭]
=> END
~ c02_中药材
车上放了一些中药材 [ID:c02_中药材]
车上放了一些中药材 [ID:c02_中药材]
=> END
~ c02_排队
排队的人堵住了上楼的路 [ID:c02_排队]
排队的人堵住了上楼的路 [ID:c02_排队]
=> END
~ c02_不要出去
最好还是先不要出去 [ID:c02_不要出去]
最好还是先不要出去 [ID:c02_不要出去]
=> END
~ c02_太阳
太阳快落山了 [ID:c02_太阳]
太阳快落山了 [ID:c02_太阳]
=> END
~ c02_民国六年1015
民国六年十月十五日 [ID:c02_民国六年1015]
民国六年十月十五日 [ID:c02_民国六年1015]
=> END
~ c02_一个洞
一个洞,里面好像还有空间 [ID:c02_一个洞]
一个洞,里面好像还有空间 [ID:c02_一个洞]
=> END
~ c02_工具箱
工具箱 [ID:c02_工具箱]
工具箱 [ID:c02_工具箱]
=> END
~ c02_找到有用的东西
应该能找到有用的东西 [ID:c02_找到有用的东西]
应该能找到有用的东西 [ID:c02_找到有用的东西]
=> END
~ c02_公寓告示
公寓告示 [ID:c02_公寓告示]
公寓告示 [ID:c02_公寓告示]
=> END
~ c02_通往里间的门
通往里间的门 [ID:c02_通往里间的门]
通往里间的门 [ID:c02_通往里间的门]
=> END
~ c02_花名册
花名册 [ID:c02_花名册]
花名册 [ID:c02_花名册]
=> END
~ c02_罪
[ID:c02_罪]
罪 [ID:c02_罪]
=> END
~ c02_门上有什么东西
门上有什么东西 [ID:c02_门上有什么东西]
门上有什么东西 [ID:c02_门上有什么东西]
=> END
~ c02_奠
[ID:c02_奠]
奠 [ID:c02_奠]
=> END
~ c02_寻夏小蝉
失踪的小孩名叫夏小蝉 [ID:c02_寻夏小蝉]
失踪的小孩名叫夏小蝉 [ID:c02_寻夏小蝉]
=> END
~ c02_小猫干尸
小猫的尸体已经干了 [ID:c02_小猫干尸]
小猫的尸体已经干了 [ID:c02_小猫干尸]
=> END
~ c02_几块大洋
几块大洋 [ID:c02_几块大洋]
几块大洋 [ID:c02_几块大洋]
=> END
~ c02_死老鼠
死掉的老鼠 [ID:c02_死老鼠]
死掉的老鼠 [ID:c02_死老鼠]
=> END
~ c02_石缝开花
石缝里开了几束花 [ID:c02_石缝开花]
石缝里开了几束花 [ID:c02_石缝开花]
=> END
~ c02_石壁空间
石壁另一头好像还有空间 [ID:c02_石壁空间]
石壁另一头好像还有空间 [ID:c02_石壁空间]
=> END
~ c02_民国六年1221
民国六年十二月二十一日 [ID:c02_民国六年1221]
民国六年十二月二十一日 [ID:c02_民国六年1221]
=> END
~ c02_患者感谢信
一些患者的感谢信 [ID:c02_患者感谢信]
一些患者的感谢信 [ID:c02_患者感谢信]
=> END
~ c02_被撕掉的书
一本被撕掉的书 [ID:c02_被撕掉的书]
一本被撕掉的书 [ID:c02_被撕掉的书]
=> END
~ c02_里面有什么东西
里面有什么东西 [ID:c02_里面有什么东西]
里面有什么东西 [ID:c02_里面有什么东西]
=> END
~ c02_戏台上的诗
戏台上面刻了一首诗 [ID:c02_戏台上的诗]
戏台上面刻了一首诗 [ID:c02_戏台上的诗]
=> END
~ c02_锁开了
锁开了 [ID:c02_锁开了]
锁开了 [ID:c02_锁开了]
=> END
~ c02_口袋里有东西
口袋里有东西 [ID:c02_口袋里有东西]
口袋里有东西 [ID:c02_口袋里有东西]
=> END
~ c02_雾太大
雾太大了,看不清路 [ID:c02_雾太大]
雾太大了,看不清路 [ID:c02_雾太大]
=> END
~ c02_八音盒
是个八音盒 [ID:c02_八音盒]
是个八音盒 [ID:c02_八音盒]
=>en
~ c02_祝女儿早日康复
祝女儿早日康复 [ID:c02_祝女儿早日康复]
祝女儿早日康复 [ID:c02_祝女儿早日康复]
=> END
~ c02_图案一样
这图案和我手臂上的一摸一样 [ID:c02_图案一样]
这图案和我手臂上的一摸一样 [ID:c02_图案一样]
=> END

Binary file not shown.

BIN
asset/font/Lyusung-210618.ttf Executable file

Binary file not shown.

BIN
asset/font/MPLUS中文像素.TTF Executable file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -20,6 +20,14 @@ func get_prop_hud() -> PropHud:
return get_node_or_null("/root/Main/UILayer/PropHUD") as PropHud
func pop_os(lines := []):
var player = get_player()
if player:
player.pop_os(lines)
else:
printerr("Player node not found")
# 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, animation := ""):
var player = get_player()
@ -28,6 +36,7 @@ func freeze_player(lock_time: float, animation := ""):
else:
printerr("Player node not found")
func release_player():
var player = get_player()
if player:
@ -35,6 +44,7 @@ func release_player():
else:
printerr("Player node not found")
func set_camera_boundary(rect: Rect2) -> void:
var camera_marker = CameraFocusMarker
camera_marker.limit_left = rect.position.x

View File

@ -47,15 +47,31 @@ func _on_interacted() -> void:
printerr("Note key is not set")
return
%Sfx.play()
SceneManager.focus_node(self)
CameraFocusMarker.tween_zoom(1.1, 1.5)
DialogueManager.show_dialogue_balloon(dialogue_res, note_key)
# TODO note viewing animation
SceneManager.freeze_player(0, "")
interacting = true
DialogueManager.dialogue_ended.connect(_on_dialogue_ended, CONNECT_ONE_SHOT)
# for note in notes:
# SceneManager.pop_note(note, "white", 2.0)
# SceneManager.focus_node(self)
# CameraFocusMarker.tween_zoom(1.1, 1.5)
# DialogueManager.show_dialogue_balloon(dialogue_res, note_key)
# # TODO note viewing animation
# SceneManager.freeze_player(0, "")
# interacting = true
# DialogueManager.dialogue_ended.connect(_on_dialogue_ended, CONNECT_ONE_SHOT)
# var player = SceneManager.get_player()
# DialogueManager.show_dialogue_balloon_scene(player, dialogue_res, note_key)
var lines = []
var current_line = await dialogue_res.get_next_dialogue_line(note_key)
while current_line:
lines.append(current_line)
if current_line.next_id != "end":
current_line = await dialogue_res.get_next_dialogue_line(current_line.next_id)
else:
break
# if current_line.has("text"):
# lines.append(current_line)
# if current_line.has("next_id") and current_line.next_id != "end":
# current_line = dialogue_res.lines[current_line.next_id]
# else:
# break
SceneManager.pop_os(lines)
SceneManager.freeze_player(1.0, "")
func _set(property: StringName, value: Variant) -> bool:
@ -95,10 +111,10 @@ func _filter_property(property: StringName) -> bool:
return property.find(editor_filter) >= 0
func _on_dialogue_ended(_res):
interacting = false
SceneManager.release_player()
SceneManager.focus_player_and_reset_zoom()
# func _on_dialogue_ended(_res):
# interacting = false
# SceneManager.release_player()
# SceneManager.focus_player_and_reset_zoom()
func _on_cancel(_body = null):

View File

@ -78,7 +78,7 @@ size = Vector2(61, 112.75)
[node name="Npc" type="AnimatedSprite2D"]
sprite_frames = ExtResource("3_1e8sl")
animation = &"c02_张胖子_idle"
frame_progress = 0.311606
frame_progress = 0.195431
script = ExtResource("1_jegr2")
dialogue_title = ""

View File

@ -55,26 +55,27 @@ func _reset(_body):
activated = true
func _input(event: InputEvent) -> void:
# 长按自动传送
if activated:
if portal_name == "left" and target_portal == "right":
if event.is_action("left"):
action_times += 1
elif event.is_action("right"):
action_times = 0
if action_times >= 7:
activated = false
action_times = 0
%Sfx.play()
_on_interacted()
if portal_name == "right" and target_portal == "left":
if event.is_action("right"):
action_times += 1
elif event.is_action("left"):
action_times = 0
if action_times >= 7:
activated = false
action_times = 0
%Sfx.play()
_on_interacted()
# 暂时不启用自动传送
# func _input(event: InputEvent) -> void:
# # 长按自动传送
# if activated:
# if portal_name == "left" and target_portal == "right":
# if event.is_action("left"):
# action_times += 1
# elif event.is_action("right"):
# action_times = 0
# if action_times >= 7:
# activated = false
# action_times = 0
# %Sfx.play()
# _on_interacted()
# if portal_name == "right" and target_portal == "left":
# if event.is_action("right"):
# action_times += 1
# elif event.is_action("left"):
# action_times = 0
# if action_times >= 7:
# activated = false
# action_times = 0
# %Sfx.play()
# _on_interacted()

View File

@ -46,7 +46,6 @@ position = Vector2(135, 56)
hook_animation = null
lock_player_on_playing_dialogue = null
hook_dialogue_res = null
hook_dialogue_title = ""
[node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"]
texture = null

View File

@ -45,7 +45,8 @@ target_portal = "left"
[node name="几张卫生宣传画" parent="Ground/DeployLayer" index="2" instance=ExtResource("3_fy0o1")]
position = Vector2(275, -30)
editor_filter = "c01"
editor_filter = "c02"
note_key = "c02_卫生宣传画"
[node name="鼠疫海报" parent="Ground/DeployLayer" index="3" instance=ExtResource("12_0fckv")]
position = Vector2(440, -21)
@ -66,8 +67,6 @@ shape = SubResource("RectangleShape2D_0xrg2")
[node name="Ambush" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_70vqn")]
position = Vector2(502, 56)
one_shot = null
freeze_time = null
hook_animation = null
lock_player_on_playing_dialogue = null
hook_dialogue_res = null

View File

@ -2,13 +2,12 @@
class_name PropHud extends Control
@export_group("DebugItem")
@export var add_item := false:
@export var enable_item := false:
set(value):
if value:
add_item = false
add_prop_item(item_key, item_texture)
enable_item = false
enable_prop_item(item_key)
@export var item_key: String
@export_file("*.png") var item_texture: String
@export_group("Inventory")
@export var inventory: PropInventory
@export_group("UI-UX")
@ -31,6 +30,10 @@ class_name PropHud extends Control
@onready var mark = %Mark as TextureRect
@onready var title_label = %TitleLabel as Label
var items_dict := {}
var item_config_res = preload("res://asset/dialogue/item_description.dialogue")
var item_config_title = "PropItems"
var texture_path_prefix = "res://asset/art/prop/"
var cached_inventory_textures := {}
var listen_mouse = false
@ -41,6 +44,7 @@ var container_tween: Tween
func _ready() -> void:
_load_items()
_load_from_archive()
if Engine.is_editor_hint():
return
@ -65,12 +69,23 @@ func _ready() -> void:
selected = selected
func _load_items():
var current_line = await item_config_res.get_next_dialogue_line(item_config_title)
while current_line:
var texture_path = current_line.get_tag_value("texture")
if texture_path:
var item = PropItem.new()
item.key = current_line.translation_key
item.texture_path = texture_path_prefix + texture_path
items_dict[item.key] = item
if current_line.next_id == "end":
break
current_line = await item_config_res.get_next_dialogue_line(current_line.next_id)
func _load_from_archive() -> void:
if ArchiveManager.archive:
inventory = ArchiveManager.archive.prop_inventory
if not inventory:
return
inventory.current_index = wrapi(inventory.current_index, 0, inventory.items.size())
_load_texture_cache()
_update_prop_display_with_texture()
@ -79,18 +94,25 @@ func _load_texture_cache() -> void:
if not inventory:
return
cached_inventory_textures.clear()
for i in inventory.items:
if i and i.key and i.texture_path:
cached_inventory_textures[i.key] = load(i.texture_path)
for key in inventory.enabled_items:
# 以 items_dict 为准,如果 enabled_items 中的 key 不存在,则删除
if not key in items_dict:
inventory.enabled_items.erase(key)
continue
var texture = load(items_dict[key].texture_path) as Texture2D
if texture:
cached_inventory_textures[key] = texture
# wrap index
inventory.current_index = wrapi(inventory.current_index, 0, inventory.enabled_items.size())
func _update_prop_display_with_texture():
if not inventory:
return
if inventory.items.size() == 0:
if inventory.enabled_items.size() == 0:
prop.texture = null
return
var item = inventory.items[inventory.current_index] as PropItem
var item = items_dict[inventory.current_item_key()]
if not item:
prop.texture = null
push_error("PropItem is null! index=" + str(inventory.current_index))
@ -202,9 +224,12 @@ func _toggle_btn_ability(v: bool) -> void:
right_btn.disabled = !v
func add_prop_item(prop_key: String, texture_path: String) -> void:
if not inventory or not prop_key or not texture_path:
func enable_prop_item(prop_key: String) -> void:
if not inventory or not prop_key:
return
inventory.add_item(prop_key, texture_path)
if not items_dict.has(prop_key):
push_error("PropItem not found! key=" + prop_key)
return
inventory.enable_item(prop_key)
_load_texture_cache()
_update_prop_display_with_texture()

View File

@ -21,6 +21,7 @@ offset_bottom = 504.0
scale = Vector2(0.3, 0.3)
mouse_filter = 1
script = ExtResource("1_bbv0a")
enable_item = false
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 0

View File

@ -1,18 +1,22 @@
class_name PropInventory extends Resource
@export var items := [] as Array[PropItem]
@export var enabled_items := [] as Array[String]
@export var current_index := 0
func add_item(prop_key: String, texture_path: String) -> void:
var item = PropItem.new()
item.key = prop_key
item.texture_path = texture_path
items.push_back(item)
emit_changed()
func current_item_key():
if enabled_items.size() == 0:
return null
return enabled_items[current_index]
func enable_item(prop_key: String) -> void:
if not enabled_items.has(prop_key):
enabled_items.append(prop_key)
# emit_changed()
func index_wrap_add(delta: int) -> void:
current_index += delta
current_index = wrapi(current_index, 0, items.size())
emit_changed()
current_index = wrapi(current_index, 0, enabled_items.size())
# emit_changed()

View File

@ -74,6 +74,7 @@ metadata/_edit_use_anchors_ = true
[node name="PropHUD" parent="UILayer" instance=ExtResource("4_t7gb2")]
scale = Vector2(0.24, 0.24)
enable_item = null
metadata/_edit_use_anchors_ = true
[node name="Journal" parent="." instance=ExtResource("10_durpa")]

View File

@ -43,6 +43,8 @@ enum MOVEMENT_STATUS {
@onready var footstep_timer = %FootstepTimer as Timer
@onready var sprite = %AnimatedSprite2D as AnimatedSprite2D
@onready var os_pivot = %OSPivot as Control
@onready var os_label = %OSLabel as DialogueLabel
func _ready() -> void:
@ -50,6 +52,7 @@ func _ready() -> void:
footstep_timer.timeout.connect(_on_footstep_timer_timeout)
footstep_timer.stop()
SceneManager.focus_player()
os_label.modulate.a = 0.0
func _on_footstep_timer_timeout():
@ -114,6 +117,8 @@ func set_facing_direction(direction: Vector2) -> void:
func _play_animation() -> void:
# reset the os label position on animation changed.
_reset_os_position()
match current_status:
MOVEMENT_STATUS.IDLE:
if facing_direction.x > 0.0:
@ -232,3 +237,30 @@ func release_player():
# velocity_ratio = 1.0
lock_mutex.unlock()
_play_animation()
func _reset_os_position():
if sprite.animation:
var size = sprite.sprite_frames.get_frame_texture(sprite.animation, 0).get_size()
os_pivot.position.y = -size.y * 0.5 - 4.0
var os_tween: Tween
func pop_os(lines := []):
if os_tween:
os_tween.kill()
os_tween = create_tween()
os_label.text = ""
os_tween.tween_property(os_label, "modulate:a", 1.0, 0.1)
for line in lines:
var duration = max(min(4.0, line.text.length() * 0.2), 2.0)
os_tween.tween_callback(_os_load_line.bind(line))
os_tween.tween_callback(os_label.type_out)
os_tween.tween_interval(duration)
os_tween.tween_property(os_label, "modulate:a", 0.0, 0.1)
func _os_load_line(line):
os_label.dialogue_line = line

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://cjhw5ecygrqty"]
[gd_scene load_steps=7 format=3 uid="uid://cjhw5ecygrqty"]
[ext_resource type="Script" path="res://scene/player/main_player.gd" id="1_3a78y"]
[ext_resource type="SpriteFrames" uid="uid://c3s8u4ifaucpj" path="res://config/animation/entity_sprite_frames.tres" id="2_3w63u"]
[ext_resource type="Texture2D" uid="uid://may55b2uerbw" path="res://asset/art/neutral_point_light.png" id="3_h4uja"]
[ext_resource type="FontFile" uid="uid://coy0c115cjmv5" path="res://asset/font/MPLUS中文像素.TTF" id="4_4jk1c"]
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_label.gd" id="5_tclgd"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_fno82"]
size = Vector2(78.25, 205.062)
@ -29,3 +31,40 @@ energy = 0.2
texture = ExtResource("3_h4uja")
texture_scale = 2.0
height = 20.0
[node name="OSPivot" type="Control" parent="."]
unique_name_in_owner = true
layout_mode = 3
anchors_preset = 0
offset_top = -20.0
offset_bottom = -20.0
[node name="MarginContainer" type="MarginContainer" parent="OSPivot"]
custom_minimum_size = Vector2(100, 0)
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -25.0
offset_top = -6.0
offset_right = 25.0
offset_bottom = 6.0
grow_horizontal = 2
grow_vertical = 2
[node name="OSLabel" type="RichTextLabel" parent="OSPivot/MarginContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(50, 0)
layout_mode = 2
mouse_filter = 2
theme_override_fonts/normal_font = ExtResource("4_4jk1c")
bbcode_enabled = true
text = "os:..."
fit_content = true
script = ExtResource("5_tclgd")
skip_action = &""
seconds_per_step = 0.05
skip_pause_at_abbreviations = PackedStringArray("Mr", "Mrs", "Ms", "Dr", "etc", "eg", "ex")
seconds_per_pause_step = 0.15