From 5cdb720d37a33da4772c2be801c71fa8ebb13e8e Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Thu, 9 May 2024 21:07:14 +0800 Subject: [PATCH] =?UTF-8?q?Add=20Japanese=20translation=20to=20improve=20i?= =?UTF-8?q?tem=20picking=20logic.=20=E5=A2=9E=E5=8A=A0=E6=97=A5=E8=AF=AD?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=EF=BC=8C=E6=94=B9=E5=96=84=E7=89=A9=E5=93=81?= =?UTF-8?q?=E7=9A=84=E6=8B=BE=E6=8D=A1=E9=80=BB=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locals/Error.csv | 16 +- locals/Error.csv.import | 4 +- locals/Error.en.translation | Bin 710 -> 798 bytes locals/Error.jp.translation | Bin 0 -> 1073 bytes locals/Error.zh.translation | Bin 765 -> 877 bytes locals/InputMapping.csv | 4 +- locals/InputMapping.csv.import | 4 +- locals/InputMapping.en.translation | Bin 438 -> 438 bytes locals/InputMapping.jp.translation | Bin 0 -> 465 bytes locals/InputMapping.zh.translation | Bin 449 -> 449 bytes locals/Log.csv | 12 +- locals/Log.csv.import | 4 +- locals/Log.en.translation | Bin 862 -> 338 bytes locals/Log.jp.translation | Bin 0 -> 338 bytes locals/Log.zh.translation | Bin 973 -> 338 bytes locals/UI.csv | 29 ++-- locals/UI.csv.import | 4 +- locals/UI.en.translation | Bin 1046 -> 986 bytes locals/UI.jp.translation | Bin 0 -> 1093 bytes locals/UI.zh.translation | Bin 1057 -> 997 bytes locals/Weapon.csv | 6 +- locals/Weapon.csv.import | 4 +- locals/Weapon.en.translation | Bin 494 -> 494 bytes locals/Weapon.jp.translation | Bin 0 -> 573 bytes locals/Weapon.zh.translation | Bin 525 -> 525 bytes locals/slogan.csv | 19 +-- locals/slogan.csv.import | 4 +- locals/slogan.en.translation | Bin 958 -> 650 bytes locals/slogan.jp.translation | Bin 0 -> 769 bytes locals/slogan.zh.translation | Bin 1097 -> 481 bytes project.godot | 3 +- scenes/game.tscn | 18 ++- scripts/Config.cs | 7 + scripts/GameSceneNodeHolder.cs | 2 +- scripts/SloganProvider.cs | 2 +- scripts/character/CharacterTemplate.cs | 82 ++++++++-- scripts/character/Player.cs | 141 +++++++----------- scripts/loader/sceneLoader/GameSceneLoader.cs | 2 +- scripts/utils/NodeUtils.cs | 58 ++++++- 39 files changed, 249 insertions(+), 176 deletions(-) create mode 100644 locals/Error.jp.translation create mode 100644 locals/InputMapping.jp.translation create mode 100644 locals/Log.jp.translation create mode 100644 locals/UI.jp.translation create mode 100644 locals/Weapon.jp.translation create mode 100644 locals/slogan.jp.translation diff --git a/locals/Error.csv b/locals/Error.csv index d2d7e68..fca2966 100644 --- a/locals/Error.csv +++ b/locals/Error.csv @@ -1,7 +1,9 @@ -id,zh,en -Object reference not set to an instance of an object.,尝试在空对象上调用虚拟方法。,Object reference not set to an instance of an object. -missing_parameters,缺少参数。,Missing parameters. -room_root_node_must_be_node2d,房间根节点必须是 Node2D。,Room root node must be Node2D. -width_or_height_of_room_slot_must_be_1,房间槽的宽度或高度必须为1。,The width or height of the room slot must be 1. -connected_room_timeout,连接房间超时。,Connecting the room timed out. -projectiles_is_empty,未设置抛射体。,The projectile is not set. \ No newline at end of file +id,zh,en,jp +Object reference not set to an instance of an object.,尝试在空对象上调用虚拟方法。,Object reference not set to an instance of an object.,空のオブジェクト上で仮想メソッドを呼び出してみます。 +missing_parameters,缺少参数。,Missing parameters.,パラメータが不足しています。 +room_root_node_must_be_node2d,房间根节点必须是 Node2D。,Room root node must be Node2D.,ルートノードはNode2Dでなければなりません。 +width_or_height_of_room_slot_must_be_1,房间槽的宽度或高度必须为1。,The width or height of the room slot must be 1.,部屋の溝の幅または高さは1でなければなりません。 +connected_room_timeout,连接房间超时。,Connecting the room timed out.,接続部屋はタイムアウトです。 +projectiles_is_empty,未设置抛射体。,The projectile is not set.,射出体は設置されていません。 +map_generator_is_not_set_up,未设置地图生成器。,Map generator is not set up.,マップ生成器は設置されていません。 +map_generator_is_not_configured,地图生成器没有有效配置。,Map Generator is not configured.,地図生成器は機能していません。 \ No newline at end of file diff --git a/locals/Error.csv.import b/locals/Error.csv.import index cce320f..0745731 100644 --- a/locals/Error.csv.import +++ b/locals/Error.csv.import @@ -6,10 +6,10 @@ uid="uid://nmtkvo0t7p7n" [deps] -files=["res://locals/Error.zh.translation", "res://locals/Error.en.translation"] +files=["res://locals/Error.zh.translation", "res://locals/Error.en.translation", "res://locals/Error.jp.translation"] source_file="res://locals/Error.csv" -dest_files=["res://locals/Error.zh.translation", "res://locals/Error.en.translation"] +dest_files=["res://locals/Error.zh.translation", "res://locals/Error.en.translation", "res://locals/Error.jp.translation"] [params] diff --git a/locals/Error.en.translation b/locals/Error.en.translation index 3c0ac4bff4eb43cc8cea1cfd6c33fd983f778910..9d1983d651e0db4499296afc5edac391b5cabc8a 100644 GIT binary patch delta 161 zcmX@cI*)CGG$X4?S$0M8WCcbyO&$gYhW|hy1f?Z_v>Xtt0I?PjvjVXK5F1SHXSC)O zR$efBE|4b<#EO&mGb;1SU%7g>6UY+*V%f>p8G{+OOx9-VG5_bwV#DyWyGg{mq{WU& nSK90K_Vj`x&h#KVp=a aEX3r&*f}|xsfQmZ%nrniKpYetgR}jp4r%(3+tB(0oE=27f7s*ahV7tEx)Jq; z1{-O*C+dwfhTVptc7#>wTvyj-o4WlyK7W995EtJ+4?@?XV>r?mVRXng1da5|eyFnD zwtc{sM{G&=IDt5cIEA26ZHR6JwI|%Hbgz$~ykNuecm7x(??vBf8;<{I`+PEnMko3S zj{nP>?>ByK!f*Zf>1!X7&SH$<@DKX}m(XO?gW&jQj>kLbHh=g1{LMG_7I{}~(9W%h zB64e)6%bjFOQ0TsEP-4EnFAH8lnOCS;; z;~?^+OB@HABtcG5pAD5ZUytMD)s-jsX}-H{g;Q8!V|fO|LsZUeU8XwmvQ~WT6wA@X z@&%}Qkk3Ib&}=k`wV9b8#g!}NDXd&izp9n9)P?553pCbph6DA~I@WaUL8=;?G-uOW f=a_SOGg)X(sAf`iRsQpEP6uZF=;(WQ;h)8CLQa`- literal 0 HcmV?d00001 diff --git a/locals/Error.zh.translation b/locals/Error.zh.translation index 0d86bf95c261d5086f6f0798f2ecb101299acb10..1a786bb6d805379d249f0f1e658741804fb5832c 100644 GIT binary patch delta 183 zcmey%`j%~jG$U(bfpLl9WCg}hO&$gYhW|hy1f?Z_v>Xtt0I?PjvjVXK5F1RM$7szf zth`|Mc_2>}geRY4ROXexa`oK90K_Vj=P_DO{>UgX aS&_+uar5LXrfs|o>_7=dAPx!+as~j5i5>|6 diff --git a/locals/InputMapping.csv b/locals/InputMapping.csv index 3d6f152..3b44d06 100644 --- a/locals/InputMapping.csv +++ b/locals/InputMapping.csv @@ -1,2 +1,2 @@ -id,zh,en -Left Mouse Button,鼠标左键,Left Mouse Button \ No newline at end of file +id,zh,en,jp +Left Mouse Button,鼠标左键,Left Mouse Button,マウスの左ボタンです \ No newline at end of file diff --git a/locals/InputMapping.csv.import b/locals/InputMapping.csv.import index a2fd069..9699663 100644 --- a/locals/InputMapping.csv.import +++ b/locals/InputMapping.csv.import @@ -6,10 +6,10 @@ uid="uid://dvvc7sup2d2ii" [deps] -files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation"] +files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.jp.translation"] source_file="res://locals/InputMapping.csv" -dest_files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation"] +dest_files=["res://locals/InputMapping.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.jp.translation"] [params] diff --git a/locals/InputMapping.en.translation b/locals/InputMapping.en.translation index c05dfe9d1702ecd7a787c762959df1be0a5ab3d4..17efddb152ce2480dc4b78e6305574ac30d7eece 100644 GIT binary patch delta 17 YcmdnSyp4H-G$U(iR$+S9WCg})05jkPuK)l5 delta 17 YcmdnSyp4H-G$U(zdWA*BWCg})05Ycqga7~l diff --git a/locals/InputMapping.jp.translation b/locals/InputMapping.jp.translation new file mode 100644 index 0000000000000000000000000000000000000000..2ee4573bfc27b408c15a544b6d703d94421fc361 GIT binary patch literal 465 zcmWFv4svFI0u~_61jMXBEDFT_1tpoenN_JNAw`LK#W{&3nfZA@VF+LbQrzjTk8LHd zN5jO3p*etxB!IXmwK%`DC^~Yi1$BpZrZeRAedCude{g0bBKW<$9 QxN#-}I8Z=l1OX!x0Pr(#xc~qF literal 0 HcmV?d00001 diff --git a/locals/InputMapping.zh.translation b/locals/InputMapping.zh.translation index 1182def7181194fdb2d62bb0c5cbb2311bfd87f2..83a2f68872db597769114c9ffb3390e60d523546 100644 GIT binary patch delta 17 YcmX@ee2{sAG$X5dsd=L5WCg~B05GxzC;$Ke delta 17 YcmX@ee2{sAG$U(~u}N|1WCg~B05VJkZ~y=R diff --git a/locals/Log.csv b/locals/Log.csv index b9250da..1c60c93 100644 --- a/locals/Log.csv +++ b/locals/Log.csv @@ -1,11 +1 @@ -id,zh,en -data_packet_missing_id,位于{0}的数据包,缺少Id,无法加载。,"Packet at {0}, missing Id, unable to load." -index_is_up_to_date,位于{0}的数据包索引已是最新。,"The packet index at {0} is up to date." -build_an_index,为{0}构建索引。,"Build an index for {0}." -add_file_index,添加文件索引{0}。,"Add file index {0}." -index_updated,{0}索引已更新。,"{0} Index has been updated." -no_manifest_file,位于{0}的数据包,没有清单文件,无法加载。,"Packet located in {0}, no manifest file, cannot be loaded." -duplicate_at_path_id,位于{0}路径{1}的Id({2})已被占用,无法加载。,"Id({2}) in {0} path {1} is occupied and cannot be loaded." -duplicate_at_path_id,位于{0}路径{1}的Id({2})已被占用,无法加载。,"Id({2}) in {0} path {1} is occupied and cannot be loaded." -map_generator_is_not_set_up,未设置地图生成器。,Map generator is not set up. -map_generator_is_not_configured,地图生成器没有有效配置。,Map Generator is not configured. \ No newline at end of file +id,zh,en,jp \ No newline at end of file diff --git a/locals/Log.csv.import b/locals/Log.csv.import index e814e5a..15aea1e 100644 --- a/locals/Log.csv.import +++ b/locals/Log.csv.import @@ -6,10 +6,10 @@ uid="uid://btmjafjh5r6bk" [deps] -files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation"] +files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.jp.translation"] source_file="res://locals/Log.csv" -dest_files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation"] +dest_files=["res://locals/Log.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.jp.translation"] [params] diff --git a/locals/Log.en.translation b/locals/Log.en.translation index 9e1a3983aefb3b1c0c3923128c75d135922f00ad..0b1c04fd0f919c03540a50d13565083702ba7817 100644 GIT binary patch delta 34 lcmcb|c8O_&G$U)JL1tdgWCcbg0Y(M}26i9@(LupM&H$9!2A==` literal 862 zcmaKrPiPZC7{$jlrisNr&}!B+CY6nw22*Plq_nGOMQbRw5(PnuVY3;UZIVsd-5hMq zMFNVR^->Uf@Z!mvHwAA!sFz0cP!KWb&44I2=*IVL5-g$){CJu7y>DiBW|O>_Jk8p} z4RwL7U^kdqu(X1<$TOD=MK|+`r4@D9t=gf_Uep9&aI;u4RG!Kg zRVAOYiYZg&I%hjJ*L0=8nGa5Zo2D|yP1cQx)4^E}er6Rjo3fO2p0n+krb}v$TWy1O zGA%>X=UQ#1YG?}2Bb#9{%3}QUKbg zb-aU6>HcC)hV}xw0J=cxFT9<6Lw)@q3eH}Cer5(rxjqnHeU?c>Y5gFe9wNL}U4IFs z%s${D4{QMY!e=|@5^pwLONYymp#y8Goe(1L+*d9qUwA(0Hak~#0z2m$dqpQS>X+o? z!x~EVgj5d&rso^gDW^i#DIpZE_aMzWmZQv09CtNV{j;wmS*Qt=Y;C;96Rd?aClh({ z-RF%T6XW%-!9e8^wx6I}LTI`NmyVQU)2$`T(c6fRlt=FdgOcn$*`3%FKJS*<#+@5| mQKOO#|3ov-XZ-?U9O-EQ diff --git a/locals/Log.jp.translation b/locals/Log.jp.translation new file mode 100644 index 0000000000000000000000000000000000000000..1ba2594ab13b3d93dcf47c8c1eb39d5aa1eb271e GIT binary patch literal 338 zcma)2y9xp^5L{oVh<1v-g;?1OR(^nR+J_j|GkBMiY!1X<@Z)U#949`&LcxJyc4v3< z*kqL~=!H783O2w#xI6}%+cR(1UOUNju!V#DL=AEojBnRnIe&ZqXbVk4(6bb!H>|S4 z=uCw|iDAdo`>Z*gGqvI5ETU5uY9e_|Fm({_wd_^Un~bT8bW@rGhnEp=lHjdNpJQUY lJqDOW6>tPTPMS@p-+rpnGCu{H#9rX%LSj9>Dr$ml-T^(4NHYKc literal 0 HcmV?d00001 diff --git a/locals/Log.zh.translation b/locals/Log.zh.translation index bfd8740df667579efcee45e75cf624ffe47989d0..72fed090cb126d6a46ca49f83e30f28cc69248d0 100644 GIT binary patch delta 34 lcmX@heu-&=G$X57a(-pvWCcbg0Y(M}26i9@(LupM&H#~t2893s literal 973 zcma)*OK1~O6o#+X`a}^#@dYUar9rUOS_H+FXz4Bymanw-5YK#XiYf3~9DTW%2KyIxLn1Rl>U)*ngUU0Pkv6~UJ7ie6Mj%j}G z3q}1($Y(@-x}Qfl+wu2VLgj2BQ(s^IiT+;Zp;)Xn2SU@LVK_DxWHiVw zKrQ`RwIH#rU?*A54vs4J`-lnnwo2qDzi@; s`I=SDi)=w;YSz>vnYtq$%u%PSB)b)KlTLk3n#iFbdJyyvym-jJ0eZ`7WB>pF diff --git a/locals/UI.csv b/locals/UI.csv index a86021a..6b9a0cb 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -1,15 +1,14 @@ -id,zh,en -product_name,异界旅人,A traveler from another world -start_game,开始游戏,Start game -settings,设置,Settings -pick_up,拾捡,Pick up -move_left,向左移动,Move left -move_right,向右移动,Move right -jump,跳跃,Jump -throw,抛出,Throw a -must_be_thrown,必须先抛出{0}才能拾捡{1},{0} must be thrown before {1} can be picked up. -use_item,使用,Use -jump_down,跳下平台,Jump off platform -de,的,'s -default_player_name,白纸,blankPaper -item_prompt_debug,ID:{0}\n名称:{1}\n数量:{2}\n最大叠加数量:{3}\n数据类型:{4}\n描述:{5},ID: {0}\nName: {1}\nQuantity: {2}\nMaximum stacking quantity: {3}\nData type: {4}\nDescription:{5} \ No newline at end of file +id,zh,en,jp +product_name,异界旅人,A traveler from another world,異界の旅人です +start_game,开始游戏,Start game,ゲームを始めます +settings,设置,Settings,備え付け +pick_up,拾捡,Pick up ,拾います +move_left,向左移动,Move left,左に移動します +move_right,向右移动,Move right,右に移動します +jump,跳跃,Jump,飛 +throw,抛出,Throw a ,ほうしゅつ +use_item,使用,Use,しよう +jump_down,跳下平台,Jump off platform,踊り場から飛び降ります +de,的,'s,の +default_player_name,白纸,blankPaper,しらかみ +item_prompt_debug,ID:{0}\n名称:{1}\n数量:{2}\n最大叠加数量:{3}\n数据类型:{4}\n描述:{5},ID: {0}\nName: {1}\nQuantity: {2}\nMaximum stacking quantity: {3}\nData type: {4}\nDescription:{5},id:{0}\n名称:{1}\nの数は最大{2}\nシナジー数:{3}\nデータタイプ:{4}\n述べ表わす:{5} \ No newline at end of file diff --git a/locals/UI.csv.import b/locals/UI.csv.import index 19185df..b698255 100644 --- a/locals/UI.csv.import +++ b/locals/UI.csv.import @@ -6,10 +6,10 @@ uid="uid://bpdkorm7lprma" [deps] -files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation"] +files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.jp.translation"] source_file="res://locals/UI.csv" -dest_files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation"] +dest_files=["res://locals/UI.zh.translation", "res://locals/UI.en.translation", "res://locals/UI.jp.translation"] [params] diff --git a/locals/UI.en.translation b/locals/UI.en.translation index 139b2f5444d9d244ab363c6b6a01475054040498..9ea560e60b23e22e1a28bc224f9154686410e555 100644 GIT binary patch delta 140 zcmbQnaf^L}G$U(zdU00LWCg}L$^SrL!@$7c1jHUd%nHN`KXKv(S N2l7B>1O*2<0{~6u8bkm9 delta 199 zcmcb`K8<68G$U(aW}ac*WCg}LNgDtHJ=rmTKs`xNTs?Z>AuH|4h{ewbe_MV|a@lHDg@3fqcVSPpMV4&Hu6;)NJx5dowo!b+Q9BfQ%0c H4sr$n+f*jn diff --git a/locals/UI.jp.translation b/locals/UI.jp.translation new file mode 100644 index 0000000000000000000000000000000000000000..2bff39c05945809f77bcae0e7f9f4bb7e5697863 GIT binary patch literal 1093 zcma)++iMd+6vjvErN#>)Y7|jxErk!vM>!DrH#h4Kc2XFG0%W*BDhcqJ?jQ}r?3WV{ttIz$7_I8*3PppJ#4;1HmG!YMQ zH53hKA=QYgdVohb+g3go(ZZZ<0ts_n*IK#GHlkQs!P#b{ZJOSu8d`IRv#ltb6M^g8 zZ~&d88}VSIb$OW{hzDZ^AY*Hw!_d-Bir>H5P1Sf^JCCxX1_8cHadRaknFv z*Bt7<2J{ynJl6cZ3*6(#_1FJYXQ#lZtt6KpIez8K4b=3~NiHAxQTo+@dgZx!Z$)|> zoO(iX{k}-gCqL?y`+u$W^dwgC@4uD(HVfY3$ld2jL&Hbv$;y2yhrBjD%U(yWf9H#R zDg{>!XHOwjIDX`Rix~NrH`VGreRxwW}Jqraaomv=rEv;T$TQTdB=ofv6 K)YB&Xf&2kBuS@>` literal 0 HcmV?d00001 diff --git a/locals/UI.zh.translation b/locals/UI.zh.translation index 4596dbc6df409a3bdc34f47bafc01b6fa23a4bac..4c1a73f4a5b8a947aad20f2e441f4c45c7de53e5 100644 GIT binary patch delta 157 zcmZ3;@sxdnEr;?Zd7a4$j`uhLO+LnGFBt%2u|qK9I`=RG65+GqG?LYh`}9QTk*B#$HJq1_lNvAoc)aKOklW zVg(=$nS6}VUa|s?rFSUWj}xt0&&4v_gl!9mUdzeG1@ diff --git a/locals/Weapon.csv b/locals/Weapon.csv index 61dcf12..ae007bc 100644 --- a/locals/Weapon.csv +++ b/locals/Weapon.csv @@ -1,3 +1,3 @@ -id,zh,en -staff_of_the_undead,死灵法杖,StaffOfTheUndead -staff_of_the_undead_desc,发射诅咒,可将敌人转化为邪恶的怪物。,Cast a curse that transforms enemies into evil monsters. \ No newline at end of file +id,zh,en,jp +staff_of_the_undead,死灵法杖,StaffOfTheUndead,ネクロポリスの杖です +staff_of_the_undead_desc,发射诅咒,可将敌人转化为邪恶的怪物。,Cast a curse that transforms enemies into evil monsters.,呪いを発射して、敵を邪悪な怪物に変えることができます。 \ No newline at end of file diff --git a/locals/Weapon.csv.import b/locals/Weapon.csv.import index d3b3678..e60bdb6 100644 --- a/locals/Weapon.csv.import +++ b/locals/Weapon.csv.import @@ -6,10 +6,10 @@ uid="uid://dmhmjvtquyu16" [deps] -files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation"] +files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.jp.translation"] source_file="res://locals/Weapon.csv" -dest_files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation"] +dest_files=["res://locals/Weapon.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.jp.translation"] [params] diff --git a/locals/Weapon.en.translation b/locals/Weapon.en.translation index 2940b55bb45954fb6583636f5c66aec18d8da563..6128bb4b6af8e1a04c56e6355275dbad81b4dd33 100644 GIT binary patch delta 17 YcmaFI{Em5pG$U)edA?cYWCg}^05};1@&Et; delta 17 YcmaFI{Em5pG$X5dv0=8!WCg}^05*IDumAu6 diff --git a/locals/Weapon.jp.translation b/locals/Weapon.jp.translation new file mode 100644 index 0000000000000000000000000000000000000000..addf7685c6038549267d9899ebf6aba665945a29 GIT binary patch literal 573 zcma))ze@u#6vyLlMeQc&WI+%dq^r1!vv9f}=^5J7>s`I1i&K*;sAvZjl@8sCKTiCy zDCi*0{sT@j6WNqyQQ1a(X}GcjZ7!j7X}WA*8W6wY8n|qba{>Wa{oGsY9w_0 ziPXn5T12mDbPcT=2n1D7HxOJwP=_D{^#JlZsvmjaq4}=DNMS-4mBZG~1<1>0V+Z6ms9lhUAkRVW#f7RMpRgR16&@Ksfc`cEf1Gbd C3#R}8 literal 0 HcmV?d00001 diff --git a/locals/Weapon.zh.translation b/locals/Weapon.zh.translation index 415e422e952432e3de477478fe57f05a9238e88e..d6e578828f903de10a1c65a04d5e6ee5dacc773d 100644 GIT binary patch delta 17 YcmeBW>1Ej<&B&UcXlz1Ej<&B$s{YL=2aS%L8_04sn6K>z>% diff --git a/locals/slogan.csv b/locals/slogan.csv index b59d711..9cc5764 100644 --- a/locals/slogan.csv +++ b/locals/slogan.csv @@ -1,13 +1,6 @@ -id,zh,en -slogan_1,如果是你,你会选择金钱还是荣誉?,"If it were you, would you choose money or honor?" -slogan_2,游戏属于每一个人。,The game belongs to everyone. -slogan_3,如果你想要得到爱,你就播种爱。,"If you want love, you sow love." -slogan_4,作为自然法则,死亡是每一个人人生的最终归宿。,"As a law of nature, everyone will end up dead." -slogan_5,光阴似箭。,tempus fugit. -slogan_6,快乐?伤心?痛苦?,Happy? Sad? Pain? -slogan_7,在图像和音乐中酝酿感情。,Brewing emotions in images and music. -slogan_8,罪与罚。,crime and punishment. -slogan_9,高桥李依!,Rie Takahashi! -slogan_10,0001 0011 0001 0101 0100 1111 0100,0001 0011 0001 0101 0100 1111 0100 -slogan_11,恋愛偏差値上昇中!-P丸様。,恋愛偏差値上昇中!-P丸様。 -slogan_12,kaWaYi!,kaWaYi! \ No newline at end of file +id,zh,en,jp +slogan_1,游戏属于每一个人。,The game belongs to everyone.,ゲームはすべての人のものです。 +slogan_2,如果你想要得到爱,你就播种爱。,"If you want love, you sow love.",愛を手に入れたければ、愛の種をまきます。 +slogan_3,快乐?伤心?痛苦?,Happy? Sad? Pain?,楽しいですか?悲しいですか?苦しいですか? +slogan_4,0001 0011 0001 0101 0100 1111 0100,0001 0011 0001 0101 0100 1111 0100,0001 0011 0001 0101 0100 1111 0100 +slogan_5,kaWaYi!,kaWaYi!,kaWaYi! \ No newline at end of file diff --git a/locals/slogan.csv.import b/locals/slogan.csv.import index 2bf66b4..f9d7def 100644 --- a/locals/slogan.csv.import +++ b/locals/slogan.csv.import @@ -6,10 +6,10 @@ uid="uid://cjtdm8ddsrd7e" [deps] -files=["res://locals/slogan.zh.translation", "res://locals/slogan.en.translation"] +files=["res://locals/slogan.zh.translation", "res://locals/slogan.en.translation", "res://locals/slogan.jp.translation"] source_file="res://locals/slogan.csv" -dest_files=["res://locals/slogan.zh.translation", "res://locals/slogan.en.translation"] +dest_files=["res://locals/slogan.zh.translation", "res://locals/slogan.en.translation", "res://locals/slogan.jp.translation"] [params] diff --git a/locals/slogan.en.translation b/locals/slogan.en.translation index 337e5ea673a207516f8bfcd396f8b5d2542f5f7d..d62e5db31b4135d9d75224a9651169ca3f7bf6e9 100644 GIT binary patch delta 264 zcmdnT-o?5>nvvBgwLGnGvI3(~{eLvT00eA6j4aFp0@1XP?ANGkxb91t@?F;~yN zS5`o_G8Dtaxq;%bKrs#|hKch7#eqUDV1tnj;sHv4EE5A_1t5lL;020n0Qn#}5C%C? z9*9#J7$%=)(iHSaEGVe7R|rl_u~!I4%*?Z&9LKC8o}Cz;7@4UERL8&$#2~|hf`gm^ D&kaAS delta 577 zcmX|;%S!@L6o;>tkIE8U^q{b@(%P66K~U0QPg^BU5aA*&6gVkiFDQgc3W5q+7$LMO zj21q!l|qmIpk4bS)F^@$Q4odpyD-y*k8{py^Wg5VAq) zQP_Y6;uKLYArGj4r*IX34UxST-jCWKA^S4;bvX7g3y{4Y9wjk?&VP^nb!afj2C*o= zVI_PAYBq=i7ufIzQ7a)2j>F%>wMwwB*a%8+p)l5Kdsz@XEe=n$QSgjisi%X<(bQF1 zS5)xCN&3QdO7mR75x*;SaBr(1?R$cwE_H z&xiK%+sC=kK`x!lZAP=1-F##xn@PN1hpet_CX+vpyx*J5Qf`C^WjH?Kp+>Bm7KijEWwK)9{d4;jUb+ecG9fl?#?dL<3Uf>tR7_b z5HBI*pqEuaFd?@{;@P8rz*Ct`@K5MlvooNJf(1`i*W1-!MHfC6rd4X)h>t)Icm+Px zBERCVm`^jI4s2ORel>vHw#Nv;xli?>=zXR=BtApYYY-Y+T?#$pmaCpFyHVA(o(YV4 zadR%v6{DU*sTgZ@(OC5qNwUJIJ`5MMU2r2kUp8t0>HLycGEpkXNj3`opx9n!z0j{k z5S8iz??AHC#MszfFLj;b^7yhEky_Zj4Uuk1GqSi?Q_{#BkSkqv7$o(iL+?la5=dX9 zT(-)AH$aXTdN)rln}~94A=CSypCXsn3Yk6#9jO{k$@G5cqD`h``T+D2w22hC<6CeB zIR44?-(25i`p)!~=@-);)6vE8F+9hyc-oh#)mXLGzHz+W+GsEx{#|c!yvek~^f?*) z;8l_WI{J5jmD@}wOk0U>FK+%}`ogr9?njNO7EbSw{x@*^?JDIsPCf_3$td4;PA(6V T)KMiptLOaTpp+i4Y9Fpq49vKfPU)9h!Z0fBtj4isM2yf zZv=HlEFBQ#0|PH0V1hwLb_dl3*gE_<5I$FoFeKiII6KkW38R(SN-vsiOX5j`Y>NJPvAK#>I)*u3_q?_f2$gFeQd2`il?l+` literal 1097 zcma)+%}*0S7>Cy{J_N*z#si5}W7I^YHO7MnFL*T=G%?0Qv(ybVl$LahCXkqxwxP&J zwQ8tPs6+%U7HBZKmTmhV=pW(CY}ZR~UiJ63y9ozPoaEV=_nDb@zS8#H>FbfKauD@? za0na&y(1y-uy;&(csD5fRi7O42K>;CasXB5l^5Sz^v4fu_dj(D2Au#wMGcGwJ&M~G z@W?)QDBxB-ieHhA?CtZ*!-~`jGpwkpJfNsjGlKdIMQTHHP*w-sA-UhDNF50KM?FJI z$P%=Y8VY*-1C42_C+HmsK}ym-a0b*fUGMJx+ezJ{eqZ34bb-dA{PRNSw&*hKdTdal zi*x|m5|!UpX+pal90y(CG@!2Ys4s)7;0B;n4sa9D@?(r*jiqINu{oqE{pA`5)nX5uAe~=nhYUCvbdiLM&%QdW)6b)btsAnZ96# zr^NIJbMm>FDpV_J^j2rzR&!G|Ju3-K6Nw}*EVJUA*h(@j%(NUU7Jq~%tYpX`qC3^K z2rtj`#I}(rG!paef=K0!^;sAi%}N=j6|0juBlcPByyA)17$@?(thj;|_vS`=<7L)Z zh>1+t*iGlx3&y9+^e3k4#%8`AS2oz!XV@mwS9v9hhB3cbonE7j^UQm`Smx0r zPtBOw9gJgI-i$Aq@rsCLMKn$cj8cwib4F=_0&^oRR^ExFIaXe(=@H54bh;dXKGbqG zK2C=Vg+iw!BGV$a$RkPqWs`?jnf6qqC$SEuU%Jh3b?fO`X+;{6@5%SQr|<^!W2ATL H!=K0>jgxMg diff --git a/project.godot b/project.godot index 8165990..93617b2 100644 --- a/project.godot +++ b/project.godot @@ -146,7 +146,8 @@ hotbar_previous={ [internationalization] -locale/translations=PackedStringArray("res://locals/UI.en.translation", "res://locals/UI.zh.translation", "res://locals/Error.zh.translation", "res://locals/Error.en.translation", "res://locals/slogan.en.translation", "res://locals/slogan.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.zh.translation") +locale/translations=PackedStringArray("res://locals/UI.en.translation", "res://locals/UI.zh.translation", "res://locals/Error.zh.translation", "res://locals/Error.en.translation", "res://locals/slogan.en.translation", "res://locals/slogan.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.zh.translation", "res://locals/Error.jp.translation", "res://locals/InputMapping.jp.translation", "res://locals/Log.jp.translation", "res://locals/slogan.jp.translation", "res://locals/UI.jp.translation", "res://locals/Weapon.jp.translation") +locale/test="jp" [layer_names] diff --git a/scenes/game.tscn b/scenes/game.tscn index 3dedd33..3c2e326 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -22,13 +22,15 @@ grow_vertical = 2 [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control"] layout_mode = 1 -anchors_preset = 2 +anchors_preset = 12 anchor_top = 1.0 +anchor_right = 1.0 anchor_bottom = 1.0 -offset_left = 10.0 -offset_top = -95.0 -offset_right = 178.0 -offset_bottom = -10.0 +offset_left = 20.0 +offset_top = -85.0 +offset_right = -20.0 +offset_bottom = -20.0 +grow_horizontal = 2 grow_vertical = 0 [node name="HealthBarUi" type="HBoxContainer" parent="CanvasLayer/Control/VBoxContainer"] @@ -47,9 +49,11 @@ script = ExtResource("2_owrhq") layout_mode = 2 texture = ExtResource("2_n1yht") -[node name="OperationTip" type="Label" parent="CanvasLayer/Control/VBoxContainer"] +[node name="OperationTip" type="RichTextLabel" parent="CanvasLayer/Control/VBoxContainer"] layout_mode = 2 -text = "32323" +bbcode_enabled = true +text = "OperationTip" +fit_content = true [node name="ProjectileContainer" type="Node2D" parent="."] diff --git a/scripts/Config.cs b/scripts/Config.cs index c981fdf..c5d343e 100644 --- a/scripts/Config.cs +++ b/scripts/Config.cs @@ -79,6 +79,13 @@ public static class Config /// 单个物品栏最大堆叠的物品数量 /// public const int MaxStackQuantity = 99; + + /// + /// Operation prompts, function key text color + /// 操作提示内,功能键文本颜色 + /// + public const string OperationTipActionColor = "#2b8a3e"; + /// /// Company/Creator name diff --git a/scripts/GameSceneNodeHolder.cs b/scripts/GameSceneNodeHolder.cs index c1d1c80..32c21a5 100644 --- a/scripts/GameSceneNodeHolder.cs +++ b/scripts/GameSceneNodeHolder.cs @@ -26,5 +26,5 @@ public static class GameSceneNodeHolder public static HealthBarUi? HealthBarUi { get; set; } - public static Label? OperationTipLabel { get; set; } + public static RichTextLabel? OperationTipLabel { get; set; } } \ No newline at end of file diff --git a/scripts/SloganProvider.cs b/scripts/SloganProvider.cs index 38c524b..2e2650f 100644 --- a/scripts/SloganProvider.cs +++ b/scripts/SloganProvider.cs @@ -12,7 +12,7 @@ public static class SloganProvider /// Define how many banners you want to display /// 定义共有多少条标语需要展示 /// - private const int Total = 12; + private const int Total = 5; /// /// Swipe the machine to get a slogan diff --git a/scripts/character/CharacterTemplate.cs b/scripts/character/CharacterTemplate.cs index 0db123a..72ddc62 100644 --- a/scripts/character/CharacterTemplate.cs +++ b/scripts/character/CharacterTemplate.cs @@ -4,6 +4,7 @@ using ColdMint.scripts.camp; using ColdMint.scripts.damage; using ColdMint.scripts.health; using ColdMint.scripts.inventory; +using ColdMint.scripts.utils; using ColdMint.scripts.weapon; using Godot; @@ -43,7 +44,29 @@ public partial class CharacterTemplate : CharacterBody2D //Items currently held //当前持有的物品 - public Node2D? CurrentItem; + private Node2D? _currentItem; + + public Node2D? CurrentItem + { + get => _currentItem; + set + { + _currentItem = value; + WhenUpdateCurrentItem(_currentItem); + } + } + + /// + /// When the items the character holds are updated + /// 当角色持有的物品更新时 + /// + /// + ///Update finished items + ///更新完成后的物品 + /// + protected virtual void WhenUpdateCurrentItem(Node2D? currentItem) + { + } //Define a pick up range //定义一个拾起范围 @@ -92,9 +115,32 @@ public partial class CharacterTemplate : CharacterBody2D /// Pick up all items within range /// 拾捡范围内的所有物品 /// - private List? _pickingRangeBodies; + protected List? PickingRangeBodiesList; - public Node[] PickingRangeBodies => _pickingRangeBodies?.ToArray() ?? Array.Empty(); + public Node[] PickingRangeBodies => PickingRangeBodiesList?.ToArray() ?? Array.Empty(); + + /// + /// Find the nearest item within the pick up area(Does not include items currently held) + /// 在拾捡范围内查找距离最近的物品(不包括当前持有的物品) + /// + /// + public Node2D? FindTheNearestItem() + { + if (PickingRangeBodiesList == null || PickingRangeBodiesList.Count == 0) + { + return null; + } + + HashSet? exclude = null; + if (_currentItem != null) + { + //Prevent picking up objects in your hands again. + //防止再次捡起自己手上的物品。 + exclude = new HashSet { _currentItem }; + } + + return NodeUtils.GetTheNearestNode(this, PickingRangeBodiesList.ToArray(), exclude); + } /// @@ -122,7 +168,7 @@ public partial class CharacterTemplate : CharacterBody2D public override void _Ready() { base._Ready(); - _pickingRangeBodies = new List(); + PickingRangeBodiesList = new List(); CharacterName = GetMeta("Name", Name).AsString(); CampId = GetMeta("CampId", Config.CampId.Default).AsString(); MaxHp = GetMeta("MaxHp", Config.DefaultMaxHp).AsInt32(); @@ -232,7 +278,7 @@ public partial class CharacterTemplate : CharacterBody2D weaponTemplate.Sleeping = true; } - if (itemSlotNode.GetItem() != null && itemSlotNode.GetItem() == item && CurrentItem == null) + if (itemSlotNode.GetItem() != null && itemSlotNode.GetItem() == item && _currentItem == null) { //If the selected item slot in the item container is a newly picked item, and there is no item in the hand, then we put the selected item into the hand. //如果物品容器内选中的物品槽是刚刚捡到的物品,且手里没有物品持有,那么我们将选中的物品放到手上。 @@ -256,12 +302,12 @@ public partial class CharacterTemplate : CharacterBody2D /// public bool UseItem(Vector2 position) { - if (CurrentItem == null) + if (_currentItem == null) { return false; } - if (CurrentItem is WeaponTemplate weaponTemplate) + if (_currentItem is WeaponTemplate weaponTemplate) { weaponTemplate.Fire(this, position); } @@ -397,7 +443,12 @@ public partial class CharacterTemplate : CharacterBody2D /// protected virtual void EnterThePickingRangeBody(Node node) { - _pickingRangeBodies?.Add(node); + if (node is not IItem) + { + return; + } + + PickingRangeBodiesList?.Add(node); } /// @@ -407,7 +458,12 @@ public partial class CharacterTemplate : CharacterBody2D /// protected virtual void ExitThePickingRangeBody(Node node) { - _pickingRangeBodies?.Remove(node); + if (node is not IItem) + { + return; + } + + PickingRangeBodiesList?.Remove(node); } /// @@ -429,9 +485,9 @@ public partial class CharacterTemplate : CharacterBody2D { //We continuously set the position of the items to prevent them from changing as we zoom in and out of the window. //我们持续设置物品的位置,为了防止放大缩小窗口时物品位置的变化。 - if (CurrentItem != null) + if (_currentItem != null) { - CurrentItem.Position = Vector2.Zero; + _currentItem.Position = Vector2.Zero; } var velocity = Velocity; @@ -453,7 +509,7 @@ public partial class CharacterTemplate : CharacterBody2D /// public void AimTheCurrentItemAtAPoint(Vector2 position) { - if (CurrentItem == null) + if (_currentItem == null) { //Do not currently hold any items. //当前没有持有任何物品。 @@ -462,7 +518,7 @@ public partial class CharacterTemplate : CharacterBody2D // Apply the rotation Angle to the node // 将旋转角度应用于节点 - CurrentItem.LookAt(position); + _currentItem.LookAt(position); } diff --git a/scripts/character/Player.cs b/scripts/character/Player.cs index cf4b49a..f8f3a41 100644 --- a/scripts/character/Player.cs +++ b/scripts/character/Player.cs @@ -26,13 +26,9 @@ public partial class Player : CharacterTemplate //用于检测玩家是否站在平台上的射线 private RayCast2D? _platformDetectionRayCast2D; - //在拾捡范围内,可拾起的物品数量 - private int _totalNumberOfPickups; private const float PromptTextDistance = 50; - //玩家可拾捡的物品 - private Node2D? _pickAbleItem; //抛出物品的飞行速度 private float _throwingVelocity = Config.CellSize * 13; @@ -77,99 +73,73 @@ public partial class Player : CharacterTemplate } var operationTipBuilder = new StringBuilder(); - if (_totalNumberOfPickups > 0) - { - //If there's anything around to pick up - //如果周围有能捡的东西 - if (CurrentItem == null) - { - if (_pickAbleItem != null) - { - string? name = null; - if (_pickAbleItem is WeaponTemplate weaponTemplate) - { - //When the weapon has no owner, a pick up prompt is displayed. - //当武器没有主人时,显示捡起提示。 - if (weaponTemplate.Owner == null || weaponTemplate.Owner == this) - { - name = TranslationServer.Translate(weaponTemplate.Name); - } - } - - if (name != null) - { - operationTipBuilder.Append( - TranslationServer.Translate(InputMap.ActionGetEvents("pick_up")[0].AsText())); - operationTipBuilder.Append(TranslationServer.Translate("pick_up")); - operationTipBuilder.Append(name); - } - } - } - else - { - string? pickAbleItemName = null; - string? currentItemName = null; - string mustBeThrown = TranslationServer.Translate("must_be_thrown"); - if (_pickAbleItem != null) - { - //可捡的物品是武器 - if (_pickAbleItem is WeaponTemplate weaponTemplate) - { - pickAbleItemName = TranslationServer.Translate(weaponTemplate.Name); - } - } - - if (CurrentItem != null) - { - //当前持有的物品是武器 - if (CurrentItem is WeaponTemplate weaponTemplate) - { - currentItemName = TranslationServer.Translate(weaponTemplate.Name); - } - } - - if (pickAbleItemName != null && currentItemName != null && mustBeThrown != "must_be_thrown") - { - operationTipBuilder.Append(string.Format(mustBeThrown, currentItemName, pickAbleItemName)); - operationTipBuilder.Append(' '); - operationTipBuilder.Append( - TranslationServer.Translate(InputMap.ActionGetEvents("throw")[0].AsText())); - operationTipBuilder.Append(TranslationServer.Translate("throw")); - operationTipBuilder.Append(currentItemName); - } - } - - operationTipLabel.Text = operationTipBuilder.ToString(); - return; - } + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServer.Translate(InputMap.ActionGetEvents("ui_left")[0].AsText())); + operationTipBuilder.Append("[/color]"); operationTipBuilder.Append(TranslationServer.Translate("move_left")); operationTipBuilder.Append(' '); + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServer.Translate(InputMap.ActionGetEvents("ui_right")[0].AsText())); + operationTipBuilder.Append("[/color]"); operationTipBuilder.Append(TranslationServer.Translate("move_right")); operationTipBuilder.Append(' '); + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServer.Translate(InputMap.ActionGetEvents("ui_up")[0].AsText())); + operationTipBuilder.Append("[/color]"); operationTipBuilder.Append(TranslationServer.Translate("jump")); if (_collidingWithPlatform) { operationTipBuilder.Append(' '); + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServer.Translate(InputMap.ActionGetEvents("ui_down")[0].AsText())); + operationTipBuilder.Append("[/color]"); operationTipBuilder.Append(TranslationServer.Translate("jump_down")); } + //If the PickingRangeBodiesList is not null and the length is greater than 0 + //如果PickingRangeBodiesList不是null,且长度大于0 + if (PickingRangeBodiesList is { Count: > 0 }) + { + operationTipBuilder.Append(' '); + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); + operationTipBuilder.Append( + TranslationServer.Translate(InputMap.ActionGetEvents("pick_up")[0].AsText())); + operationTipBuilder.Append("[/color]"); + operationTipBuilder.Append(TranslationServer.Translate("pick_up")); + operationTipLabel.Text = operationTipBuilder.ToString(); + } + if (CurrentItem != null) { operationTipBuilder.Append(' '); + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); operationTipBuilder.Append(TranslationServer.Translate(InputMap.ActionGetEvents("throw")[0].AsText())); + operationTipBuilder.Append("[/color]"); operationTipBuilder.Append(TranslationServer.Translate("throw")); if (CurrentItem is WeaponTemplate weaponTemplate) { operationTipBuilder.Append(TranslationServer.Translate(weaponTemplate.Name)); //提示武器攻击 operationTipBuilder.Append(' '); + operationTipBuilder.Append("[color="); + operationTipBuilder.Append(Config.OperationTipActionColor); + operationTipBuilder.Append(']'); operationTipBuilder.Append( TranslationServer.Translate(InputMap.ActionGetEvents("use_item")[0].AsText())); + operationTipBuilder.Append("[/color]"); operationTipBuilder.Append(TranslationServer.Translate("use_item")); operationTipBuilder.Append(TranslationServer.Translate(weaponTemplate.Name)); } @@ -212,18 +182,20 @@ public partial class Player : CharacterTemplate //捡起物品 if (Input.IsActionJustPressed("pick_up")) { - var success = PickItem(_pickAbleItem); + var pickAbleItem = FindTheNearestItem(); + var success = PickItem(pickAbleItem); if (success) { - _pickAbleItem = null; - _totalNumberOfPickups--; + if (pickAbleItem != null) + { + PickingRangeBodiesList?.Remove(pickAbleItem); + } + if (_floatLabel != null) { _floatLabel.QueueFree(); _floatLabel = null; } - - UpdateOperationTip(); } } @@ -278,6 +250,7 @@ public partial class Player : CharacterTemplate { return; } + if (_parabola != null) { _parabola.Points = new[] { Vector2.Zero }; @@ -319,16 +292,16 @@ public partial class Player : CharacterTemplate rigidBody2D.LinearVelocity = GetThrowVelocity(); break; } - CurrentItem = null; - _totalNumberOfPickups++; var hotBar = GameSceneNodeHolder.HotBar; hotBar?.RemoveItemFromItemSlotBySelectIndex(1); - - UpdateOperationTip(); } } + protected override void WhenUpdateCurrentItem(Node2D? currentItem) + { + UpdateOperationTip(); + } private Vector2 GetThrowVelocity() { @@ -392,6 +365,7 @@ public partial class Player : CharacterTemplate protected override void EnterThePickingRangeBody(Node node) { + base.EnterThePickingRangeBody(node); if (CurrentItem == node) { //If the node entering the pick range is the node held by the player, then return. @@ -404,8 +378,6 @@ public partial class Player : CharacterTemplate return; } - _totalNumberOfPickups++; - _pickAbleItem = node2D; if (_floatLabelPackedScene != null) { //If there is a scene of floating text, then we generate floating text. @@ -440,19 +412,12 @@ public partial class Player : CharacterTemplate protected override void ExitThePickingRangeBody(Node node) { + base.ExitThePickingRangeBody(node); if (node is not Node2D) { return; } - _totalNumberOfPickups--; - if (_totalNumberOfPickups == 0) - { - //Set to null if there are no more items to pick up - //如果没有可捡的物品了,设置为null - _pickAbleItem = null; - } - if (_floatLabel != null) { _floatLabel.QueueFree(); diff --git a/scripts/loader/sceneLoader/GameSceneLoader.cs b/scripts/loader/sceneLoader/GameSceneLoader.cs index 96fafd9..d8745f7 100644 --- a/scripts/loader/sceneLoader/GameSceneLoader.cs +++ b/scripts/loader/sceneLoader/GameSceneLoader.cs @@ -27,7 +27,7 @@ public partial class GameSceneLoader : SceneLoaderTemplate var hotBar = GetNode("CanvasLayer/Control/VBoxContainer/HotBar"); GameSceneNodeHolder.HotBar = hotBar; //加载操作提示 - var operationTip = GetNode