Skip to content

Commit d5b663b

Browse files
committed
v2.0.8
1 parent df88a22 commit d5b663b

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

Diff for: DungeonArtifactTrans/Hooks.cs

+11
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ public static void Prefix(ScenarioComponent __instance, ref string str)
111111
Logger.Log($"Translated:{str}");
112112
}
113113
}
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+
}
114125

115126
[HarmonyPatch(typeof(Lang), nameof(Lang.ToText))]
116127
public static class LangFix

Diff for: ExtractTranslations/Extracted/scenario.json

+18
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,12 @@
431431
"translation": "「・・・。",
432432
"context": null
433433
},
434+
{
435+
"key": "afterwarp.txt.はぐれてしまった。」",
436+
"original": "はぐれてしまった。」",
437+
"translation": "はぐれてしまった。」",
438+
"context": null
439+
},
434440
{
435441
"key": "afterwarp.txt.「私が転移させられたのだとすれば、合流すべきか。いや、場所が分からない。」",
436442
"original": "「私が転移させられたのだとすれば、合流すべきか。いや、場所が分からない。」",
@@ -1151,6 +1157,12 @@
11511157
"translation": "(スミルナとのダンジョン攻略、とても充実していた。",
11521158
"context": null
11531159
},
1160+
{
1161+
"key": "gameclearnormal.txt.だが・・・)",
1162+
"original": "だが・・・)",
1163+
"translation": "だが・・・)",
1164+
"context": null
1165+
},
11541166
{
11551167
"key": "gameclearnormal.txt.(今回も外れか。)",
11561168
"original": "(今回も外れか。)",
@@ -2417,6 +2429,12 @@
24172429
"translation": "「あなたは・・・",
24182430
"context": null
24192431
},
2432+
{
2433+
"key": "epiloguetrue.txt.誰ですか?」",
2434+
"original": "誰ですか?」",
2435+
"translation": "誰ですか?」",
2436+
"context": null
2437+
},
24202438
{
24212439
"key": "epiloguetrue.txt.「というよりなぜここに人が?ダンジョン探索者ですか?」",
24222440
"original": "「というよりなぜここに人が?ダンジョン探索者ですか?」",

Diff for: ExtractTranslations/Extracted/spell.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1627,8 +1627,8 @@
16271627
},
16281628
{
16291629
"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>させる。",
16321632
"context": null
16331633
},
16341634
{

Diff for: ExtractTranslations/ScenarioTrans.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public static void ExtractScenario(string directoryPath, string outJsonPath)
1414
{
1515
var fi = new FileInfo(filePath);
1616
var fileContent = File.ReadAllText(filePath);
17-
var matches = Regex.Matches(fileContent, @"Write\(""(.*?)""\);");
17+
var matches = Regex.Matches(fileContent, @"Write(Add)*\(""(.*?)""\);");
1818

1919
foreach (Match match in matches)
2020
{
21-
if (match.Groups.Count > 1) // 确保有捕获组
21+
if (match.Groups.Count > 2) // 确保有捕获组
2222
{
23-
var text = match.Groups[1].Value; // 获取Write函数中的字符串参数
23+
var text = match.Groups[2].Value; // 获取Write函数中的字符串参数
2424
jsonList.Add(new Dictionary<string, object>
2525
{
2626
{ "key", $"{fi.Name}.{text}" },

0 commit comments

Comments
 (0)