diff --git a/App.xaml.cs b/App.xaml.cs index 4b73cf0..7a62499 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -14,7 +14,7 @@ namespace BetterHI3Launcher { public partial class App : Application { - public static readonly LauncherVersion LocalLauncherVersion = new LauncherVersion("1.5.20231219.0"); + public static readonly LauncherVersion LocalLauncherVersion = new LauncherVersion("1.5.20240227.0"); public static readonly string LauncherRootPath = AppDomain.CurrentDomain.BaseDirectory; public static readonly string LocalLowPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}Low"; public static readonly string LauncherDataPath = Path.Combine(LocalLowPath, @"Bp\Better HI3 Launcher"); diff --git a/BetterHI3Launcher.csproj b/BetterHI3Launcher.csproj index f874b4b..2bf3d25 100644 --- a/BetterHI3Launcher.csproj +++ b/BetterHI3Launcher.csproj @@ -126,18 +126,19 @@ - - - - + + + + + @@ -316,7 +317,7 @@ 1.1.1 - 2.2.0 + 2.2.3 diff --git a/DialogWindow.xaml.cs b/DialogWindow.xaml.cs index d0325d0..969f941 100644 --- a/DialogWindow.xaml.cs +++ b/DialogWindow.xaml.cs @@ -72,9 +72,17 @@ public DialogWindow(string title, string message, DialogType type = DialogType.C CustomBackgroundDeleteLabel.Text = App.TextStrings["msgbox_custom_background_delete"]; break; } - if(App.LauncherLanguage != "en" && App.LauncherLanguage != "zh-CN" && App.LauncherLanguage != "ja") + switch(App.LauncherLanguage) { - Resources["Font"] = new FontFamily("Segoe UI Bold"); + case "en": + case "zh-CN": + break; + case "ja": + Resources["Font"] = new FontFamily("Meiryo UI Bold"); + break; + default: + Resources["Font"] = new FontFamily("Segoe UI Bold"); + break; } Application.Current.MainWindow.WindowState = WindowState.Normal; BpUtility.PlaySound(Properties.Resources.Window_Open); diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 4a6d2c4..6b9773c 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -69,6 +69,7 @@ void ToggleUI(bool val) } void ToggleProgressBar(bool val) { + ProgressText.Visibility = val ? Visibility.Visible : Visibility.Collapsed; ProgressBar.Visibility = val ? Visibility.Visible : Visibility.Collapsed; ProgressBar.IsIndeterminate = true; TaskbarItemInfo.ProgressState = val ? TaskbarItemProgressState.Indeterminate : TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None; @@ -1130,7 +1131,6 @@ private async void LaunchButton_Click(object sender, RoutedEventArgs e) if(new DialogWindow(App.TextStrings["msgbox_abort_title"], $"{App.TextStrings["msgbox_abort_2_msg"]}\n{App.TextStrings["msgbox_abort_3_msg"]}", DialogWindow.DialogType.Question).ShowDialog() == true) { token.Cancel(); - await httpclient.WaitUntilInstanceDisposed(); httpclient.DeleteMultisessionFiles(httpprop.Out, httpprop.Thread); try{Directory.Delete(Path.GetDirectoryName(GameArchiveTempPath));}catch{} DownloadPaused = false; @@ -1169,7 +1169,6 @@ private async void DownloadPauseButton_Click(object sender, RoutedEventArgs e) if(!DownloadPaused) { token.Cancel(); - await httpclient.WaitUntilInstanceDisposed(); Status = LauncherStatus.DownloadPaused; DownloadProgressBarStackPanel.Visibility = Visibility.Visible; DownloadETAText.Visibility = Visibility.Hidden; @@ -1201,7 +1200,7 @@ private async void DownloadPauseButton_Click(object sender, RoutedEventArgs e) token = new CancellationTokenSource(); httpclient.DownloadProgress += DownloadStatusChanged; await httpclient.Download(httpprop.URL, httpprop.Out, httpprop.Thread, false, token.Token); - await httpclient.Merge(); + await httpclient.Merge(token.Token); httpclient.DownloadProgress -= DownloadStatusChanged; await DownloadGameFile(); } @@ -1284,7 +1283,7 @@ private async void PreloadButton_Click(object sender, RoutedEventArgs e) httpclient.DownloadProgress += PreloadDownloadStatusChanged; PreloadPauseButton.IsEnabled = true; await httpclient.Download(httpprop.URL, httpprop.Out, httpprop.Thread, false, token.Token); - await httpclient.Merge(); + await httpclient.Merge(token.Token); httpclient.DownloadProgress -= PreloadDownloadStatusChanged; Log("Downloaded pre-download archive"); } @@ -1357,7 +1356,7 @@ await Task.Run(() => WindowState = WindowState.Normal; } - private async void PreloadPauseButton_Click(object sender, RoutedEventArgs e) + private void PreloadPauseButton_Click(object sender, RoutedEventArgs e) { if(LegacyBoxActive) { @@ -1368,7 +1367,6 @@ private async void PreloadPauseButton_Click(object sender, RoutedEventArgs e) { PreloadPauseButton.IsEnabled = false; token.Cancel(); - await httpclient.WaitUntilInstanceDisposed(); Log("Pre-download paused"); PreloadDownload = false; PreloadPauseButton.IsEnabled = true; diff --git a/Modules/ContextMenu.cs b/Modules/ContextMenu.cs index d875508..7284948 100644 --- a/Modules/ContextMenu.cs +++ b/Modules/ContextMenu.cs @@ -1015,9 +1015,17 @@ public void SetLanguage(string lang) BpUtility.RestartApp(); } } - if(App.LauncherLanguage != "en" && App.LauncherLanguage != "zh-CN" && App.LauncherLanguage != "ja") + switch(App.LauncherLanguage) { - Resources["Font"] = new FontFamily("Segoe UI Bold"); + case "en": + case "zh-CN": + break; + case "ja": + Resources["Font"] = new FontFamily("Meiryo UI Bold"); + break; + default: + Resources["Font"] = new FontFamily("Segoe UI Bold"); + break; } } diff --git a/Modules/GameUpdate.cs b/Modules/GameUpdate.cs index 95acc93..d487742 100644 --- a/Modules/GameUpdate.cs +++ b/Modules/GameUpdate.cs @@ -590,7 +590,7 @@ private async Task DownloadGameFile() LaunchButton.Content = App.TextStrings["button_cancel"]; }); await httpclient.Download(httpprop.URL, httpprop.Out, httpprop.Thread, false, token.Token); - await httpclient.Merge(); + await httpclient.Merge(token.Token); httpclient.DownloadProgress -= DownloadStatusChanged; Log("Successfully downloaded game archive"); } diff --git a/README.md b/README.md index 7d73159..5fcd41b 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ You can save and use it wherever you want, it's that simple! ## Compatibility Of course, a 64-bit version of Windows is required, since the game also requires it. -The launcher is confirmed to work on Windows 10 and Windows 11, but I personally develop and test on Windows 10. +The launcher is tested to work on modern versions of Windows (10 and 11). -Windows 8.1 and 7 should technically work if .NET Framework 4.6.2 or newer is installed, however they are no longer supported by Microsoft so I will not be accepting bug reports from those Windows versions. +Windows 8.1 and 7 should technically work if .NET Framework 4.6.2 or newer is installed, however they are no longer supported by Microsoft so I will not be accepting reports from those Windows versions. ## Is this safe? I started this project to help fellow Captains have a better experience with the game. Since the release in January of 2021 there have been no cases of banned accounts. @@ -40,8 +40,6 @@ Great question! This project is mainly supported by me alone, so I'd love to hea > [!NOTE] > * Set the merge branch to `dev` when creating a PR -> * The project is made with Visual Studio 2019, so there could be problems on a different version of Visual Studio -> * That said, if you do use a different version then you should not include any project changes in your PR You can also contribute by translating the launcher into a language you speak. **Please only contribute languages the launcher doesn't yet have! Check the issues for existing contributions.** diff --git a/Utility/Hi3Helper.Http b/Utility/Hi3Helper.Http index 61f21fc..62c356d 160000 --- a/Utility/Hi3Helper.Http +++ b/Utility/Hi3Helper.Http @@ -1 +1 @@ -Subproject commit 61f21fc7a1359e583c1ba2fc39d8d0ee30891fdf +Subproject commit 62c356da63244848c563c6b87c2dcc40d6d8c9c1