Skip to content

Commit

Permalink
feat: 支持直接打开vsqx.top的zip工程
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYunPlayer committed Feb 7, 2025
1 parent d91e451 commit 3ecc669
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions TuneLab/UI/MainWindow/Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,24 @@ void OnDrop(object? sender, DragEventArgs e)
{
tlxs.Add(file);
}
else if (extension == ".zip" && Path.GetFileName(file).StartsWith("【vsqx分享平台】"))
{
using ZipArchive zip = ZipFile.OpenRead(file);
foreach (ZipArchiveEntry entry in zip.Entries)
{
if (entry.FullName.StartsWith("【调音者:"))
{
using Stream stream = entry.Open();
var tempFilePath = Path.Combine(Path.GetTempPath(), entry.FullName);
using (var tempFileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write))
{
stream.CopyTo(tempFileStream);
}
LoadProject(tempFilePath);
break;
}
}
}
else if (FormatsManager.GetAllImportFormats().Contains(extension.TrimStart('.')))
{
projectFile = file;
Expand Down

0 comments on commit 3ecc669

Please sign in to comment.