Merge branch 'main' into bugfix/you-forgot-to-use-strings-resx

This commit is contained in:
pizzaboxer 2024-09-21 19:26:17 +01:00 committed by GitHub
commit c6a6ab2dd6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 32 additions and 21 deletions

View File

@ -753,8 +753,7 @@ namespace Bloxstrap
List<string> modFolderFiles = new(); List<string> modFolderFiles = new();
if (!Directory.Exists(Paths.Modifications)) Directory.CreateDirectory(Paths.Modifications);
Directory.CreateDirectory(Paths.Modifications);
// check custom font mod // check custom font mod
// instead of replacing the fonts themselves, we'll just alter the font family manifests // instead of replacing the fonts themselves, we'll just alter the font family manifests

View File

@ -36,7 +36,6 @@
public event EventHandler? OnAppClose; public event EventHandler? OnAppClose;
public event EventHandler<Message>? OnRPCMessage; public event EventHandler<Message>? OnRPCMessage;
private readonly Dictionary<string, string> GeolocationCache = new();
private DateTime LastRPCRequest; private DateTime LastRPCRequest;
public string LogLocation = null!; public string LogLocation = null!;

View File

@ -60,7 +60,21 @@ namespace Bloxstrap
App.Logger.WriteLine(LOG_IDENT, $"Saving to {FileLocation}..."); App.Logger.WriteLine(LOG_IDENT, $"Saving to {FileLocation}...");
Directory.CreateDirectory(Path.GetDirectoryName(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!"); App.Logger.WriteLine(LOG_IDENT, "Save complete!");
} }

View File

@ -170,6 +170,15 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Failed to save {0}: {1}.
/// </summary>
public static string Bootstrapper_JsonManagerSaveFailed {
get {
return ResourceManager.GetString("Bootstrapper.JsonManagerSaveFailed", resourceCulture);
}
}
/// <summary> /// <summary>
/// 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.. /// 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..
/// </summary> /// </summary>

View File

@ -1195,4 +1195,7 @@ Please manually delete Bloxstrap.exe from the install location or try restarting
<data name="Installer.ShouldCancel" xml:space="preserve"> <data name="Installer.ShouldCancel" xml:space="preserve">
<value>Are you sure you want to cancel the installation?</value> <value>Are you sure you want to cancel the installation?</value>
</data> </data>
<data name="Bootstrapper.JsonManagerSaveFailed" xml:space="preserve">
<value>Failed to save {0}: {1}</value>
</data>
</root> </root>

View File

@ -89,7 +89,7 @@
</Style> </Style>
</StackPanel.Style> </StackPanel.Style>
<TextBlock Text="{x:Static resources:Strings.Common_Name}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" /> <TextBlock Text="{x:Static resources:Strings.Common_Name}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<ui:TextBox Margin="0,4,0,0" Text="{Binding SelectedCustomIntegration.Name}" /> <ui:TextBox Margin="0,4,0,0" Text="{Binding SelectedCustomIntegration.Name, UpdateSourceTrigger=PropertyChanged}" />
<TextBlock Margin="0,8,0,0" Text="{x:Static resources:Strings.Menu_Integrations_Custom_AppLocation}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" /> <TextBlock Margin="0,8,0,0" Text="{x:Static resources:Strings.Menu_Integrations_Custom_AppLocation}" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
<Grid Margin="0,4,0,0"> <Grid Margin="0,4,0,0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

@ -17,20 +17,7 @@ namespace Bloxstrap.UI
if (App.LaunchSettings.QuietFlag.Active) if (App.LaunchSettings.QuietFlag.Active)
return defaultResult; return defaultResult;
if (App.LaunchSettings.RobloxLaunchMode != LaunchMode.None) return ShowFluentMessageBox(message, icon, buttons);
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);
}
} }
public static void ShowPlayerErrorDialog(bool crash = false) public static void ShowPlayerErrorDialog(bool crash = false)

View File

@ -57,6 +57,7 @@ namespace Bloxstrap.UI.ViewModels.Settings
if (dialog.ShowDialog() != true) if (dialog.ShowDialog() != true)
return; return;
SelectedCustomIntegration.Name = dialog.SafeFileName;
SelectedCustomIntegration.Location = dialog.FileName; SelectedCustomIntegration.Location = dialog.FileName;
OnPropertyChanged(nameof(SelectedCustomIntegration)); OnPropertyChanged(nameof(SelectedCustomIntegration));
} }

View File

@ -108,7 +108,7 @@ namespace Bloxstrap.UI.ViewModels.Settings
string path = new RobloxPlayerData().ExecutablePath; string path = new RobloxPlayerData().ExecutablePath;
if (File.Exists(path)) 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 else
Frontend.ShowMessageBox(Strings.Common_RobloxNotInstalled, MessageBoxImage.Error); Frontend.ShowMessageBox(Strings.Common_RobloxNotInstalled, MessageBoxImage.Error);

View File

@ -50,7 +50,6 @@ namespace Bloxstrap
public static string GetRobloxVersion(bool studio) 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 fileName = studio ? "Studio/RobloxStudioBeta.exe" : "Player/RobloxPlayerBeta.exe";
string playerLocation = Path.Combine(Paths.Roblox, fileName); string playerLocation = Path.Combine(Paths.Roblox, fileName);