This commit is contained in:
pizzaboxer 2024-09-21 19:30:36 +01:00
commit f8d3c9618e
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
11 changed files with 46 additions and 22 deletions

View File

@ -753,7 +753,6 @@ namespace Bloxstrap
List<string> modFolderFiles = new();
if (!Directory.Exists(Paths.Modifications))
Directory.CreateDirectory(Paths.Modifications);
// check custom font mod

View File

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

View File

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

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>
/// 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>
@ -1520,6 +1529,15 @@ namespace Bloxstrap.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to cancel the installation?.
/// </summary>
public static string Installer_ShouldCancel {
get {
return ResourceManager.GetString("Installer.ShouldCancel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bloxstrap Installer.
/// </summary>

View File

@ -1192,4 +1192,10 @@ Please manually delete Bloxstrap.exe from the install location or try restarting
<data name="Common.RobloxNotInstalled" xml:space="preserve">
<value>Roblox has not yet been installed. Please launch Roblox using Bloxstrap at least once before trying to use this option.</value>
</data>
<data name="Installer.ShouldCancel" xml:space="preserve">
<value>Are you sure you want to cancel the installation?</value>
</data>
<data name="Bootstrapper.JsonManagerSaveFailed" xml:space="preserve">
<value>Failed to save {0}: {1}</value>
</data>
</root>

View File

@ -9,6 +9,7 @@ using Bloxstrap.UI.Elements.Installer.Pages;
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 @@ namespace Bloxstrap.UI.Elements.Installer
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;

View File

@ -89,7 +89,7 @@
</Style>
</StackPanel.Style>
<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}" />
<Grid Margin="0,4,0,0">
<Grid.ColumnDefinitions>

View File

@ -17,20 +17,7 @@ namespace Bloxstrap.UI
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);
}
}
public static void ShowPlayerErrorDialog(bool crash = false)

View File

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

View File

@ -50,7 +50,6 @@ namespace Bloxstrap
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);