File tree 4 files changed +34
-5
lines changed
4 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,17 @@ public static void Prefix(ScenarioComponent __instance, ref string str)
111
111
Logger . Log ( $ "Translated:{ str } ") ;
112
112
}
113
113
}
114
+
115
+ [ HarmonyPatch ( typeof ( ScenarioComponent ) , nameof ( ScenarioComponent . WriteAdd ) ) ]
116
+ public static class ScenarioFix2
117
+ {
118
+ public static void Prefix ( ScenarioComponent __instance , ref string str )
119
+ {
120
+ Logger . Log ( $ "Translate:{ str } ") ;
121
+ str = TranslationDB . ScenarioInfo . GetValueOrDefault ( str , str ) ;
122
+ Logger . Log ( $ "Translated:{ str } ") ;
123
+ }
124
+ }
114
125
115
126
[ HarmonyPatch ( typeof ( Lang ) , nameof ( Lang . ToText ) ) ]
116
127
public static class LangFix
Original file line number Diff line number Diff line change 431
431
"translation" : " 「・・・。" ,
432
432
"context" : null
433
433
},
434
+ {
435
+ "key" : " afterwarp.txt.はぐれてしまった。」" ,
436
+ "original" : " はぐれてしまった。」" ,
437
+ "translation" : " はぐれてしまった。」" ,
438
+ "context" : null
439
+ },
434
440
{
435
441
"key" : " afterwarp.txt.「私が転移させられたのだとすれば、合流すべきか。いや、場所が分からない。」" ,
436
442
"original" : " 「私が転移させられたのだとすれば、合流すべきか。いや、場所が分からない。」" ,
1151
1157
"translation" : " (スミルナとのダンジョン攻略、とても充実していた。" ,
1152
1158
"context" : null
1153
1159
},
1160
+ {
1161
+ "key" : " gameclearnormal.txt.だが・・・)" ,
1162
+ "original" : " だが・・・)" ,
1163
+ "translation" : " だが・・・)" ,
1164
+ "context" : null
1165
+ },
1154
1166
{
1155
1167
"key" : " gameclearnormal.txt.(今回も外れか。)" ,
1156
1168
"original" : " (今回も外れか。)" ,
2417
2429
"translation" : " 「あなたは・・・" ,
2418
2430
"context" : null
2419
2431
},
2432
+ {
2433
+ "key" : " epiloguetrue.txt.誰ですか?」" ,
2434
+ "original" : " 誰ですか?」" ,
2435
+ "translation" : " 誰ですか?」" ,
2436
+ "context" : null
2437
+ },
2420
2438
{
2421
2439
"key" : " epiloguetrue.txt.「というよりなぜここに人が?ダンジョン探索者ですか?」" ,
2422
2440
"original" : " 「というよりなぜここに人が?ダンジョン探索者ですか?」" ,
Original file line number Diff line number Diff line change 1627
1627
},
1628
1628
{
1629
1629
"key" : " 0.225.xml.context" ,
1630
- "original" : " 距離2マス以内の最も近い敵に<color=#870011>28</color>ダメージを与える。ダメージを与えた敵に <color=#004711>毒+6</color>を与え、2マス<b><color=#352F00>ノックバック</color></b>させる。" ,
1631
- "translation" : " 距離2マス以内の最も近い敵に<color=#870011>28</color>ダメージを与える。ダメージを与えた敵に <color=#004711>毒+6</color>を与え、2マス<b><color=#352F00>ノックバック</color></b>させる。" ,
1630
+ "original" : " 距離2マス以内の最も近い敵に<color=#870011>28</color>ダメージと <color=#004711>毒+6</color>を与え、2マス<b><color=#352F00>ノックバック</color></b>させる。" ,
1631
+ "translation" : " 距離2マス以内の最も近い敵に<color=#870011>28</color>ダメージと <color=#004711>毒+6</color>を与え、2マス<b><color=#352F00>ノックバック</color></b>させる。" ,
1632
1632
"context" : null
1633
1633
},
1634
1634
{
Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ public static void ExtractScenario(string directoryPath, string outJsonPath)
14
14
{
15
15
var fi = new FileInfo ( filePath ) ;
16
16
var fileContent = File . ReadAllText ( filePath ) ;
17
- var matches = Regex . Matches ( fileContent , @"Write\(""(.*?)""\);" ) ;
17
+ var matches = Regex . Matches ( fileContent , @"Write(Add)* \(""(.*?)""\);" ) ;
18
18
19
19
foreach ( Match match in matches )
20
20
{
21
- if ( match . Groups . Count > 1 ) // 确保有捕获组
21
+ if ( match . Groups . Count > 2 ) // 确保有捕获组
22
22
{
23
- var text = match . Groups [ 1 ] . Value ; // 获取Write函数中的字符串参数
23
+ var text = match . Groups [ 2 ] . Value ; // 获取Write函数中的字符串参数
24
24
jsonList . Add ( new Dictionary < string , object >
25
25
{
26
26
{ "key" , $ "{ fi . Name } .{ text } " } ,
You can’t perform that action at this time.
0 commit comments