diff --git a/Qwilight/System/BaseUI/BaseUI.cs b/Qwilight/System/BaseUI/BaseUI.cs index d6e41c3..080fefa 100644 --- a/Qwilight/System/BaseUI/BaseUI.cs +++ b/Qwilight/System/BaseUI/BaseUI.cs @@ -46,7 +46,7 @@ var yamlFilePath = value.GetYamlFilePath(); if (File.Exists(yamlFilePath)) { - zipFile.AddEntry(yamlFilePath, Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, Path.GetDirectoryName(yamlFilePath)))); + zipFile.AddEntry(Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, yamlFilePath)), yamlFilePath); var ys = new YamlStream(); using (var sr = File.OpenText(yamlFilePath)) { @@ -56,12 +56,12 @@ var zipFilePath = Path.Combine(QwilightComponent.UIEntryPath, value.UIEntry, Path.ChangeExtension($"@{Utility.GetText(formatNode, "zip")}", "zip")); if (File.Exists(zipFilePath)) { - zipFile.AddEntry(zipFilePath, Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, Path.GetDirectoryName(zipFilePath)))); + zipFile.AddEntry(Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, zipFilePath)), zipFilePath); } var luaFilePath = Path.Combine(QwilightComponent.UIEntryPath, value.UIEntry, Path.ChangeExtension($"@{Utility.GetText(formatNode, "lua")}", "lua")); if (File.Exists(luaFilePath)) { - zipFile.AddEntry(luaFilePath, Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, Path.GetDirectoryName(luaFilePath)))); + zipFile.AddEntry(Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, luaFilePath)), luaFilePath); } } } diff --git a/Qwilight/System/TwilightSystem.cs b/Qwilight/System/TwilightSystem.cs index de03492..4d7fa45 100644 --- a/Qwilight/System/TwilightSystem.cs +++ b/Qwilight/System/TwilightSystem.cs @@ -830,12 +830,12 @@ var levelFilePath = Path.Combine(LevelSystem.EntryPath, $"{Configure.Instance.LastWantLevelName}.json"); if (File.Exists(levelFilePath)) { - zipFile.AddEntry(levelFilePath, "Level"); + zipFile.AddEntry(Path.Combine(Path.GetFileName(LevelSystem.EntryPath), Path.GetFileName(levelFilePath)), levelFilePath); } levelFilePath = Path.Combine(LevelSystem.EntryPath, $"#{Configure.Instance.LastWantLevelName}.json"); if (File.Exists(levelFilePath)) { - zipFile.AddEntry(levelFilePath, "Level"); + zipFile.AddEntry(Path.Combine(Path.GetFileName(LevelSystem.EntryPath), Path.GetFileName(levelFilePath)), levelFilePath); } if (Configure.Instance.BaseUIItemValue.UIEntry != "@Default" || Configure.Instance.BaseUIItemValue.YamlName != "@Default") { @@ -845,10 +845,10 @@ { UI.ZipUIFile(zipFile, Configure.Instance.UIItemValue, "UI"); } - zipFile.AddEntry(Path.Combine(QwilightComponent.QwilightEntryPath, "#.json"), string.Empty); - zipFile.AddEntry(Path.Combine(QwilightComponent.QwilightEntryPath, "Configure.json"), string.Empty); - zipFile.AddEntry(Path.Combine(QwilightComponent.QwilightEntryPath, "GPU Configure.json"), string.Empty); - zipFile.AddEntry(Path.Combine(QwilightComponent.QwilightEntryPath, "DB.db"), string.Empty); + zipFile.AddEntry("#.json", Path.Combine(QwilightComponent.QwilightEntryPath, "#.json")); + zipFile.AddEntry("Configure.json", Path.Combine(QwilightComponent.QwilightEntryPath, "Configure.json")); + zipFile.AddEntry("GPU Configure.json", Path.Combine(QwilightComponent.QwilightEntryPath, "GPU Configure.json")); + zipFile.AddEntry("DB.db", Path.Combine(QwilightComponent.QwilightEntryPath, "DB.db")); zipFile.SaveTo(rms, new(CompressionType.Deflate) { ArchiveEncoding = new ArchiveEncoding(Encoding.UTF8, Encoding.UTF8) @@ -860,7 +860,7 @@ break; case BundleItem.BundleVariety.NoteFile: twilightSaveAsBundle.bundleEntryPath = Path.GetDirectoryName(bundleEntryPath)!; - zipFile.AddEntry(bundleEntryPath, string.Empty); + zipFile.AddEntry(Path.GetFileName(bundleEntryPath), bundleEntryPath); zipFile.SaveTo(rms, new(CompressionType.Deflate) { ArchiveEncoding = new ArchiveEncoding(Encoding.UTF8, Encoding.UTF8) diff --git a/Qwilight/System/UI/UI.cs b/Qwilight/System/UI/UI.cs index f84d049..e2a290c 100644 --- a/Qwilight/System/UI/UI.cs +++ b/Qwilight/System/UI/UI.cs @@ -37,7 +37,7 @@ var yamlFilePath = value.GetYamlFilePath(); if (File.Exists(yamlFilePath)) { - zipFile.AddEntry(yamlFilePath, Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, Path.GetDirectoryName(yamlFilePath)))); + zipFile.AddEntry(Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, yamlFilePath)), yamlFilePath); var ys = new YamlStream(); using (var sr = File.OpenText(yamlFilePath)) { @@ -47,12 +47,12 @@ var zipFilePath = Path.Combine(QwilightComponent.UIEntryPath, value.UIEntry, Path.ChangeExtension(Utility.GetText(formatNode, "zip", value.YamlName), "zip")); if (File.Exists(zipFilePath)) { - zipFile.AddEntry(zipFilePath, Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, Path.GetDirectoryName(zipFilePath)))); + zipFile.AddEntry(Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, zipFilePath)), zipFilePath); } var luaFilePath = Path.Combine(QwilightComponent.UIEntryPath, value.UIEntry, Path.ChangeExtension(Utility.GetText(formatNode, "lua", value.YamlName), "lua")); if (File.Exists(luaFilePath)) { - zipFile.AddEntry(luaFilePath, Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, Path.GetDirectoryName(luaFilePath)))); + zipFile.AddEntry(Path.Combine(entryPath, Path.GetRelativePath(QwilightComponent.UIEntryPath, luaFilePath)), luaFilePath); } } }