diff --git a/C#/MainWindow.xaml.cs b/C#/MainWindow.xaml.cs index 87c2f8e8..afbf4df9 100644 --- a/C#/MainWindow.xaml.cs +++ b/C#/MainWindow.xaml.cs @@ -39,7 +39,7 @@ public partial class MainWindow : Window { public static int MajorV = 1; public static int MinorV = 16; - public static int PatchV = 3; + public static int PatchV = 4; public static bool Preview = false; public static bool log = false; @@ -653,7 +653,6 @@ public void StartBMBFUpdate() { txtbox.AppendText("\n\n" + globalLanguage.processer.ReturnProcessed(globalLanguage.mainMenu.code.playlistBackup, exe + "\\Backup\\Playlists.json")); txtbox.ScrollToEnd(); - Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); if (!aDBI.adb("pull /sdcard/BMBFData/Playlists/ \"" + exe + "\\Backup\"", txtbox)) return; @@ -663,7 +662,6 @@ public void StartBMBFUpdate() File.WriteAllText(exe + "\\Backup\\Playlists.json", j["Config"].ToString()); txtbox.AppendText("\n\n" + globalLanguage.processer.ReturnProcessed(globalLanguage.mainMenu.code.playlistBackupFinished, exe + "\\Backup\\Playlists.json")); txtbox.ScrollToEnd(); - Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); } catch { diff --git a/C#/ModObjects.cs b/C#/ModObjects.cs index 87a33792..c1c0ba2b 100644 --- a/C#/ModObjects.cs +++ b/C#/ModObjects.cs @@ -93,7 +93,7 @@ public List MergeModLists(ModList primary, ModList secondary, BMBFC BMBF, i } } - if (!d.download.EndsWith(".zip")) tmp[i - removed].downloads[tmp[i - removed].MatchingDownload].forward = true; + if (!d.download.EndsWith(".zip") && !d.download.ToLower().EndsWith(".qmod")) tmp[i - removed].downloads[tmp[i - removed].MatchingDownload].forward = true; break; } gv++; diff --git a/C#/Mods.xaml.cs b/C#/Mods.xaml.cs index 7f86c75b..a66818b5 100644 --- a/C#/Mods.xaml.cs +++ b/C#/Mods.xaml.cs @@ -41,6 +41,9 @@ public partial class Mods : Window BMBFC BMBF = new BMBFC(); int C = 0; int Index = 0; + int major = 0; + int minor = 0; + int patch = 0; public Mods() { @@ -113,9 +116,9 @@ public void getMods() } String[] GameVersion = MainWindow.config.GameVersion.ToString().Replace("\"", "").Split('.'); //String[] GameVersion = "1.13.2".Replace("\"", "").Split('.'); - int major = Convert.ToInt32(GameVersion[0]); - int minor = Convert.ToInt32(GameVersion[1]); - int patch = Convert.ToInt32(GameVersion[2]); + major = Convert.ToInt32(GameVersion[0]); + minor = Convert.ToInt32(GameVersion[1]); + patch = Convert.ToInt32(GameVersion[2]); ModList QB = new ModList(); @@ -167,7 +170,6 @@ private void updatemodlist(Boolean downloadbmbf = true) { if(downloadbmbf) { - WebClient client = new WebClient(); try { BMBF = BMBFUtils.GetBMBFConfig(); @@ -178,6 +180,19 @@ private void updatemodlist(Boolean downloadbmbf = true) txtbox.ScrollToEnd(); } } + for (int ii = 0; ii < AllModList.Count; ii++) + { + foreach (BMBF.Config.Mod m in BMBF.Config.Mods) + { + if (m.Id == AllModList[ii].ModID) + { + AllModList[ii].installed = true; + AllModList[ii].Version = m.Version; + AllModList[ii].GameVersion = m.Version; + break; + } + } + } ModList.Items.Clear(); foreach (ModObjects.Mod cmod in AllModList) { @@ -366,7 +381,7 @@ public void InstallMod() DownloadLable.Text = MainWindow.globalLanguage.processer.ReturnProcessed(MainWindow.globalLanguage.mods.code.downloadingMod, AllModList[Index].name); c.DownloadFileCompleted += new AsyncCompletedEventHandler(finished_download); c.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); - c.DownloadFileAsync(uri, exe + "\\tmp\\" + AllModList[Index].name + C + ".zip"); + c.DownloadFileAsync(uri, exe + "\\tmp\\" + AllModList[Index].name + C + "." + System.IO.Path.GetExtension(Download)); })); } catch @@ -489,7 +504,7 @@ private void finished_download(object sender, AsyncCompletedEventArgs e) txtbox.AppendText("\n" + MainWindow.globalLanguage.processer.ReturnProcessed(MainWindow.globalLanguage.mods.code.downloadedMod, AllModList[Index].name)); txtbox.ScrollToEnd(); })); - upload(exe + "\\tmp\\" + AllModList[Index].name + C + ".zip"); + upload(exe + "\\tmp\\" + AllModList[Index].name + C + "." + System.IO.Path.GetExtension(AllModList[Index].downloads[AllModList[Index].MatchingDownload].download)); } public void upload(String path) @@ -589,18 +604,25 @@ public ModItem(String Name, String Creator, String GameVersion, String ModVersio } else { this.ModVersion = ModVersion; - if(!downloadable) - { - newColor.Color = Colors.Yellow; - } - else if (new Version(ModVersion).CompareTo(new Version(latest)) != -1) + try { - newColor.Color = Colors.Green; - } - else + if (!downloadable) + { + newColor.Color = Colors.Yellow; + } + else if (new Version(ModVersion).CompareTo(new Version(latest)) != -1) + { + newColor.Color = Colors.Green; + } + else + { + newColor.Color = Colors.Red; + } + } catch { - newColor.Color = Colors.Red; + newColor.Color = Colors.Yellow; } + } this.Color = newColor; } diff --git a/C#/Support.xaml.cs b/C#/Support.xaml.cs index e34e9bfd..ff062426 100644 --- a/C#/Support.xaml.cs +++ b/C#/Support.xaml.cs @@ -460,14 +460,7 @@ public async void StartSupport(String Link) s.InstallSong(bsr); this.Close(); } - else if(section.StartsWith("support/resetassets")) - { - BackupPlaylists(); - resetassets(); - reloadsongsfolder(); - RestorePlaylists(); - this.Close(); - } else if(section.StartsWith("support/quickfix")) + else if(section.StartsWith("support/quickfix")) { BackupPlaylists(); resetassets();