diff --git a/README.md b/README.md
index e72fe45..39d768d 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
- 支持导出所有类别的成就
- 支持官服,渠道服与国际服
-- 支持导出至[椰羊](https://cocogoat.work/achievement)、[SnapGenshin](https://github.com/DGP-Studio/Snap.Genshin)、[Paimon.moe](https://paimon.moe/achievement/)、[Seelie.me](https://seelie.me/achievements)、[寻空](https://github.com/xunkong/xunkong)[^1]和表格文件(csv)
+- 支持导出至[椰羊](https://cocogoat.work/achievement)、[SnapGenshin](https://github.com/DGP-Studio/Snap.Genshin)、[Paimon.moe](https://paimon.moe/achievement/)、[Seelie.me](https://seelie.me/achievements)、[寻空](https://github.com/xunkong/xunkong)和表格文件(csv)
- 没有窗口大小、游戏语言等要求
## 使用说明
@@ -28,5 +28,3 @@
1. Q: 原神启动时报错: 数据异常(31-4302)
A: 不要把软件和原神主程序放一起
-
-[^1]: 由寻空开发者维护,仓库地址: [YaeAchievement](https://github.com/xunkong/YaeAchievement)
diff --git a/YaeAchievement.csproj b/YaeAchievement.csproj
index c4eb518..f06a77f 100644
--- a/YaeAchievement.csproj
+++ b/YaeAchievement.csproj
@@ -5,6 +5,7 @@
net6.0
enable
enable
+ preview
true
res\app.manifest
2.0.0
@@ -13,8 +14,8 @@
-
-
+
+
diff --git a/src/Export.cs b/src/Export.cs
index 1d31405..91d2cf4 100644
--- a/src/Export.cs
+++ b/src/Export.cs
@@ -10,14 +10,17 @@ namespace YaeAchievement;
public static class Export {
public static void Choose(AchievementAllDataNotify data) {
- Console.Write(@"导出至:
- [0] 椰羊 (https://cocogoat.work/achievement, 默认)
- [1] SnapGenshin
- [2] Paimon.moe
- [3] Seelie.me
- [4] 表格文件
- [5] 原魔工具箱
- 输入一个数字(0-4): ".Split("\n").Select(s => s.Trim()).JoinToString("\n") + " ");
+ Console.Write("""
+ 导出至:
+ [0] 椰羊 (https://cocogoat.work/achievement, 默认)
+ [1] SnapGenshin
+ [2] Paimon.moe
+ [3] Seelie.me
+ [4] 表格文件
+ [5] 原魔工具箱
+ [6] 寻空
+ 输入一个数字(0-6):
+ """);
if (!int.TryParse(Console.ReadLine(), out var num)) num = 0;
((Action) (num switch {
1 => ToSnapGenshin,
@@ -25,6 +28,7 @@ public static class Export {
3 => ToSeelie,
4 => ToCSV,
5 => ToWxApp1,
+ 6 => ToXunkong,
7 => ToRawJson,
_ => ToCocogoat
})).Invoke(data);
@@ -139,6 +143,17 @@ public static class Export {
Console.WriteLine($"成就数据已导出至 {path}");
}
+ private static void ToXunkong(AchievementAllDataNotify data) {
+ if (CheckXunkongScheme()) {
+ Utils.CopyToClipboard(JsonConvert.SerializeObject(ExportToUIAFApp(data)));
+ Utils.ShellOpen("xunkong://import-achievement?caller=YaeAchievement&from=clipboard");
+ Console.WriteLine("在寻空中进行下一步操作");
+ } else {
+ Console.WriteLine("更新寻空至最新版本后重试");
+ Utils.ShellOpen("ms-windows-store://pdp/?productid=9N2SVG0JMT12");
+ }
+ }
+
private static void ToRawJson(AchievementAllDataNotify data) {
var path = Path.GetFullPath($"export-{DateTime.Now:yyyyMMddHHmmss}-raw.json");
File.WriteAllText(path, JsonConvert.SerializeObject(data, Formatting.Indented));
@@ -148,7 +163,7 @@ public static class Export {
// ReSharper disable once InconsistentNaming
private static Dictionary ExportToUIAFApp(AchievementAllDataNotify data) {
var output = data.List
- .Where(a => a.Status is Status.Finished or Status.RewardTaken)
+ .Where(a => (uint)a.Status > 1 || a.Current > 0)
.Select(ach => new Dictionary {
["id"] = ach.Id,
["status"] = (uint) ach.Status,
@@ -171,8 +186,12 @@ public static class Export {
private static bool CheckSnapScheme() {
return (string?)Registry.ClassesRoot.OpenSubKey("snapgenshin")?.GetValue("") == "URL:snapgenshin";
}
+
+ private static bool CheckXunkongScheme() {
+ return (string?)Registry.ClassesRoot.OpenSubKey("xunkong")?.GetValue("") == "URL:xunkong";
+ }
#pragma warning restore CA1416
-
+
private static string JoinToString(this IEnumerable