From 263617e40918b52165b5a9615f7143d14af5cbce Mon Sep 17 00:00:00 2001 From: Flikter <83476766+Flikter@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:25:14 +0200 Subject: [PATCH 1/9] Autofill file name --- Bloxstrap/UI/ViewModels/Settings/IntegrationsViewModel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Bloxstrap/UI/ViewModels/Settings/IntegrationsViewModel.cs b/Bloxstrap/UI/ViewModels/Settings/IntegrationsViewModel.cs index aed332ed..042b1382 100644 --- a/Bloxstrap/UI/ViewModels/Settings/IntegrationsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Settings/IntegrationsViewModel.cs @@ -57,6 +57,7 @@ private void BrowseIntegrationLocation() if (dialog.ShowDialog() != true) return; + SelectedCustomIntegration.Name = dialog.SafeFileName; SelectedCustomIntegration.Location = dialog.FileName; OnPropertyChanged(nameof(SelectedCustomIntegration)); } From 18093590257d3f4e09002ac4bc6b6354cba43b22 Mon Sep 17 00:00:00 2001 From: Flikter <83476766+Flikter@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:25:42 +0200 Subject: [PATCH 2/9] Update integration name while typing --- Bloxstrap/UI/Elements/Settings/Pages/IntegrationsPage.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/UI/Elements/Settings/Pages/IntegrationsPage.xaml b/Bloxstrap/UI/Elements/Settings/Pages/IntegrationsPage.xaml index 8bafca94..9f409a9d 100644 --- a/Bloxstrap/UI/Elements/Settings/Pages/IntegrationsPage.xaml +++ b/Bloxstrap/UI/Elements/Settings/Pages/IntegrationsPage.xaml @@ -89,7 +89,7 @@ - + From 3f438e99b1adcab35e615b483ccdc4b27cd12bee Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 14:18:14 +0100 Subject: [PATCH 3/9] add exception handling to jsonmanager save --- Bloxstrap/JsonManager.cs | 16 +++++++++++++++- Bloxstrap/Resources/Strings.Designer.cs | 9 +++++++++ Bloxstrap/Resources/Strings.resx | 3 +++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/JsonManager.cs b/Bloxstrap/JsonManager.cs index 8e786bee..58a1e257 100644 --- a/Bloxstrap/JsonManager.cs +++ b/Bloxstrap/JsonManager.cs @@ -60,7 +60,21 @@ public virtual void Save() App.Logger.WriteLine(LOG_IDENT, $"Saving to {FileLocation}..."); Directory.CreateDirectory(Path.GetDirectoryName(FileLocation)!); - File.WriteAllText(FileLocation, JsonSerializer.Serialize(Prop, new JsonSerializerOptions { WriteIndented = true })); + + try + { + File.WriteAllText(FileLocation, JsonSerializer.Serialize(Prop, new JsonSerializerOptions { WriteIndented = true })); + } + catch (IOException ex) + { + App.Logger.WriteLine(LOG_IDENT, "Failed to save"); + App.Logger.WriteException(LOG_IDENT, ex); + + string errorMessage = string.Format(Resources.Strings.Bootstrapper_JsonManagerSaveFailed, ClassName, ex.Message); + Frontend.ShowMessageBox(errorMessage, System.Windows.MessageBoxImage.Warning); + + return; + } App.Logger.WriteLine(LOG_IDENT, "Save complete!"); } diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 7911c5ba..e78fd909 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -170,6 +170,15 @@ public static string Bootstrapper_HyperionUpdateInfo { } } + /// + /// Looks up a localized string similar to Failed to save {0}: {1}. + /// + public static string Bootstrapper_JsonManagerSaveFailed { + get { + return ResourceManager.GetString("Bootstrapper.JsonManagerSaveFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to Bloxstrap does not have enough disk space to download and install Roblox. Please free up some disk space and try again.. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 0a04ef21..942a9323 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -1192,4 +1192,7 @@ Please manually delete Bloxstrap.exe from the install location or try restarting Roblox has not yet been installed. Please launch Roblox using Bloxstrap at least once before trying to use this option. + + Failed to save {0}: {1} + \ No newline at end of file From 15904ff51f870b74e8a9ae62bf86217ab3cab109 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:51:32 +0100 Subject: [PATCH 4/9] removed unused variable --- Bloxstrap/Utilities.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Bloxstrap/Utilities.cs b/Bloxstrap/Utilities.cs index 327f7340..6d16a276 100644 --- a/Bloxstrap/Utilities.cs +++ b/Bloxstrap/Utilities.cs @@ -50,7 +50,6 @@ public static VersionComparison CompareVersions(string versionStr1, string versi public static string GetRobloxVersion(bool studio) { - string versionGuid = studio ? App.State.Prop.Studio.VersionGuid : App.State.Prop.Player.VersionGuid; string fileName = studio ? "Studio/RobloxStudioBeta.exe" : "Player/RobloxPlayerBeta.exe"; string playerLocation = Path.Combine(Paths.Roblox, fileName); From 2c3a4b4e5e4de819fa96820e9dc77adc35a1d780 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:52:02 +0100 Subject: [PATCH 5/9] remove unused value in activity watcher --- Bloxstrap/Integrations/ActivityWatcher.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Bloxstrap/Integrations/ActivityWatcher.cs b/Bloxstrap/Integrations/ActivityWatcher.cs index 673e1959..b1d13d4f 100644 --- a/Bloxstrap/Integrations/ActivityWatcher.cs +++ b/Bloxstrap/Integrations/ActivityWatcher.cs @@ -36,7 +36,6 @@ public class ActivityWatcher : IDisposable public event EventHandler? OnAppClose; public event EventHandler? OnRPCMessage; - private readonly Dictionary GeolocationCache = new(); private DateTime LastRPCRequest; public string LogLocation = null!; From 7e8b699adf7fe24262eb6297b3b0806b918d4a4a Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:55:43 +0100 Subject: [PATCH 6/9] remove unnecessary directory check --- Bloxstrap/Bootstrapper.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 62116b9c..8cd32f49 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -753,8 +753,7 @@ private async Task ApplyModifications() List modFolderFiles = new(); - if (!Directory.Exists(Paths.Modifications)) - Directory.CreateDirectory(Paths.Modifications); + Directory.CreateDirectory(Paths.Modifications); // check custom font mod // instead of replacing the fonts themselves, we'll just alter the font family manifests From 724677be6442259fad520be3129433990be7fde4 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:07:43 +0100 Subject: [PATCH 7/9] remove win32 message boxes --- Bloxstrap/UI/Frontend.cs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Bloxstrap/UI/Frontend.cs b/Bloxstrap/UI/Frontend.cs index f1dfab20..21cca14f 100644 --- a/Bloxstrap/UI/Frontend.cs +++ b/Bloxstrap/UI/Frontend.cs @@ -17,20 +17,7 @@ public static MessageBoxResult ShowMessageBox(string message, MessageBoxImage ic if (App.LaunchSettings.QuietFlag.Active) return defaultResult; - if (App.LaunchSettings.RobloxLaunchMode != LaunchMode.None) - return ShowFluentMessageBox(message, icon, buttons); - - switch (App.Settings.Prop.BootstrapperStyle) - { - case BootstrapperStyle.FluentDialog: - case BootstrapperStyle.ClassicFluentDialog: - case BootstrapperStyle.FluentAeroDialog: - case BootstrapperStyle.ByfronDialog: - return ShowFluentMessageBox(message, icon, buttons); - - default: - return MessageBox.Show(message, App.ProjectName, buttons, icon); - } + return ShowFluentMessageBox(message, icon, buttons); } public static void ShowPlayerErrorDialog(bool crash = false) From ab8034c13b76b4d9f7bf59cee90e5de973267a1f Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:16:38 +0100 Subject: [PATCH 8/9] add string to translations --- Bloxstrap/Resources/Strings.Designer.cs | 9 +++++++++ Bloxstrap/Resources/Strings.resx | 3 +++ Bloxstrap/UI/Elements/Installer/MainWindow.xaml.cs | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 7911c5ba..e8df8ffe 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -1520,6 +1520,15 @@ public static string Installer_Install_Title { } } + /// + /// Looks up a localized string similar to Are you sure you want to cancel the installation?. + /// + public static string Installer_ShouldCancel { + get { + return ResourceManager.GetString("Installer.ShouldCancel", resourceCulture); + } + } + /// /// Looks up a localized string similar to Bloxstrap Installer. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 0a04ef21..f0f1a4fd 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -1192,4 +1192,7 @@ Please manually delete Bloxstrap.exe from the install location or try restarting Roblox has not yet been installed. Please launch Roblox using Bloxstrap at least once before trying to use this option. + + Are you sure you want to cancel the installation? + \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/Installer/MainWindow.xaml.cs b/Bloxstrap/UI/Elements/Installer/MainWindow.xaml.cs index 90108bea..49e262c9 100644 --- a/Bloxstrap/UI/Elements/Installer/MainWindow.xaml.cs +++ b/Bloxstrap/UI/Elements/Installer/MainWindow.xaml.cs @@ -9,6 +9,7 @@ using Bloxstrap.UI.Elements.Base; using System.Windows.Media.Animation; using System.Reflection.Metadata.Ecma335; +using Bloxstrap.Resources; namespace Bloxstrap.UI.Elements.Installer { @@ -102,7 +103,7 @@ void MainWindow_Closing(object? sender, CancelEventArgs e) if (Finished) return; - var result = Frontend.ShowMessageBox("Are you sure you want to cancel the installation?", MessageBoxImage.Warning, MessageBoxButton.YesNo); + var result = Frontend.ShowMessageBox(Strings.Installer_ShouldCancel, MessageBoxImage.Warning, MessageBoxButton.YesNo); if (result != MessageBoxResult.Yes) e.Cancel = true; From d8b259ace6d018fbac19870842ce8927c3842c0d Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 21 Sep 2024 19:17:36 +0100 Subject: [PATCH 9/9] fix indentation --- Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs b/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs index f235af0b..fa2b9841 100644 --- a/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs @@ -108,7 +108,7 @@ private void OpenCompatSettings() string path = new RobloxPlayerData().ExecutablePath; if (File.Exists(path)) - PInvoke.SHObjectProperties(HWND.Null, SHOP_TYPE.SHOP_FILEPATH, path, "Compatibility"); + PInvoke.SHObjectProperties(HWND.Null, SHOP_TYPE.SHOP_FILEPATH, path, "Compatibility"); else Frontend.ShowMessageBox(Strings.Common_RobloxNotInstalled, MessageBoxImage.Error);