-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathAdaptFuckingPM.cs
More file actions
44 lines (43 loc) · 2.12 KB
/
AdaptFuckingPM.cs
File metadata and controls
44 lines (43 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.IO;
using System.Windows;
namespace LLC_MOD_Toolbox
{
/// <summary>
/// 尝试修复:1.74.0版本的适配问题
/// </summary>
public static class AdaptFuckingPM
{
public static void CheckAdapt(string LimbusCompanyPath)
{
string fontPath = Path.Combine(LimbusCompanyPath, "LimbusCompany_Data", "Lang", "LLC_zh-CN", "Font");
string fontFile = Path.Combine(fontPath, "ChineseFont.ttf");
if (!Path.Exists(fontPath)) return;
if (!File.Exists(fontFile)) return;
string contextPath = Path.Combine(fontPath, "Context");
string titlePath = Path.Combine(fontPath, "Title");
if (Path.Exists(contextPath) && Path.Exists(titlePath)) return;
Log.logger.Info("发现旧版本版本文件夹。");
bool result = UniversalDialog.ShowConfirm("警告!\n发现您可能使用了旧版本的汉化补丁结构,该结构会导致汉化失效。\n按“确定”尝试修复,如果您确定这不是一个问题,请按“取消”。", "适配警告", null);
if (result)
{
Log.logger.Info("用户取消适配。");
return;
}
else
{
Log.logger.Info("开始适配。");
TryFixAdaptFont(LimbusCompanyPath);
}
}
public static void TryFixAdaptFont(string LimbusCompanyPath)
{
string fontPath = Path.Combine(LimbusCompanyPath, "LimbusCompany_Data", "Lang", "LLC_zh-CN", "Font");
string fontFile = Path.Combine(fontPath, "ChineseFont.ttf");
Directory.CreateDirectory(Path.Combine(LimbusCompanyPath, "LimbusCompany_Data", "Lang", "LLC_zh-CN", "Font", "Context"));
Directory.CreateDirectory(Path.Combine(LimbusCompanyPath, "LimbusCompany_Data", "Lang", "LLC_zh-CN", "Font", "Title"));
File.Move(fontFile, Path.Combine(fontPath, "Context", "ChineseFont.ttf"));
Log.logger.Info("适配成功。");
UniversalDialog.ShowMessage("适配成功!", "适配完成", null, null);
}
}
}