From 2c36cc16eafafca8c9967ffb50e8a3d42cee36ba Mon Sep 17 00:00:00 2001 From: moonshadow565 Date: Mon, 4 Jan 2021 01:56:55 +0100 Subject: [PATCH] switch to .fantome --- Fantome/MVVM/ViewModels/MainWindowViewModel.cs | 4 ++-- Fantome/MainWindow.xaml.cs | 2 +- Fantome/ModManagement/IO/ModFile.cs | 4 ++-- Fantome/ModManagement/ModDatabase.cs | 2 +- Fantome/ModManagement/ModManager.cs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Fantome/MVVM/ViewModels/MainWindowViewModel.cs b/Fantome/MVVM/ViewModels/MainWindowViewModel.cs index 73dd210..2f4d320 100644 --- a/Fantome/MVVM/ViewModels/MainWindowViewModel.cs +++ b/Fantome/MVVM/ViewModels/MainWindowViewModel.cs @@ -151,7 +151,7 @@ public async Task AddMod() Multiselect = false }; - dialog.Filters.Add(new CommonFileDialogFilter("ZIP Files", "*.zip")); + dialog.Filters.Add(new CommonFileDialogFilter("Fantome mod Files", "*.fantome;*.zip")); if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { @@ -166,7 +166,7 @@ public async Task AddMod(string modOriginalPath) { using (ModFile originalMod = new ModFile(modOriginalPath)) { - modPath = string.Format(@"{0}\{1}.zip", ModManager.MOD_FOLDER, originalMod.GetID()); + modPath = string.Format(@"{0}\{1}.fantome", ModManager.MOD_FOLDER, originalMod.GetID()); } } catch (Exception exception) diff --git a/Fantome/MainWindow.xaml.cs b/Fantome/MainWindow.xaml.cs index bf609ef..8ca7a69 100644 --- a/Fantome/MainWindow.xaml.cs +++ b/Fantome/MainWindow.xaml.cs @@ -131,7 +131,7 @@ private async void OnDrop(object sender, System.Windows.DragEventArgs e) string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); for (int i = 0; i < files.Length; i++) { - if (Path.GetExtension(files[i]) == ".zip") + if (Path.GetExtension(files[i]) == ".zip" || Path.GetExtension(files[i]) == ".fantome") { await this.ViewModel.AddMod(files[i]); } diff --git a/Fantome/ModManagement/IO/ModFile.cs b/Fantome/ModManagement/IO/ModFile.cs index 54efeef..3e4c201 100644 --- a/Fantome/ModManagement/IO/ModFile.cs +++ b/Fantome/ModManagement/IO/ModFile.cs @@ -59,7 +59,7 @@ public ModFile(string fileLocation) } public ModFile(LeagueFileIndex index, IEnumerable wadFilePaths, IEnumerable wadFolderPaths, ModInfo info, Image image) { - using (FileStream fileStream = new FileStream(string.Format(@"{0}\{1}.zip", ModManager.MOD_FOLDER, info.CreateID()), FileMode.Create)) + using (FileStream fileStream = new FileStream(string.Format(@"{0}\{1}.fantome", ModManager.MOD_FOLDER, info.CreateID()), FileMode.Create)) { using (this.Content = new ZipArchive(fileStream, ZipArchiveMode.Update)) { @@ -100,7 +100,7 @@ public ModFile(LeagueFileIndex index, IEnumerable wadFilePaths, IEnumera } } - this.Content = ZipFile.OpenRead(string.Format(@"{0}\{1}.zip", ModManager.MOD_FOLDER, this.GetID())); + this.Content = ZipFile.OpenRead(string.Format(@"{0}\{1}.fantome", ModManager.MOD_FOLDER, this.GetID())); } public void AddFolder(string path, string folderLocation) diff --git a/Fantome/ModManagement/ModDatabase.cs b/Fantome/ModManagement/ModDatabase.cs index 8c741c4..d1ac2b5 100644 --- a/Fantome/ModManagement/ModDatabase.cs +++ b/Fantome/ModManagement/ModDatabase.cs @@ -50,7 +50,7 @@ public void MountMods() { foreach (var mod in this.Mods) { - string modPath = Path.Combine(ModManager.MOD_FOLDER, mod.Key + ".zip"); + string modPath = Path.Combine(ModManager.MOD_FOLDER, mod.Key + ".fantome"); if(File.Exists(modPath)) { try diff --git a/Fantome/ModManagement/ModManager.cs b/Fantome/ModManagement/ModManager.cs index c3f0c99..29a006a 100644 --- a/Fantome/ModManagement/ModManager.cs +++ b/Fantome/ModManagement/ModManager.cs @@ -164,7 +164,7 @@ public void RemoveMod(ModFile mod) mod.Content.Dispose(); this.Database.RemoveMod(modId); - File.Delete(string.Format(@"{0}\{1}.zip", MOD_FOLDER, modId)); + File.Delete(string.Format(@"{0}\{1}.fantome", MOD_FOLDER, modId)); } public void InstallMod(ModFile mod) @@ -351,7 +351,7 @@ public void SyncWithModFolder() foreach (KeyValuePair mod in this.Database.Mods) { //Remove mods which are not present in the Mods folder anymore - string modPath = string.Format(@"{0}\{1}.zip", MOD_FOLDER, mod.Key); + string modPath = string.Format(@"{0}\{1}.fantome", MOD_FOLDER, mod.Key); if (!File.Exists(modPath)) { this.Database.RemoveMod(mod.Key);