Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Sep 21, 2024
2 parents 0b20720 + 5977b1b commit f8d3c96
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 22 deletions.
3 changes: 1 addition & 2 deletions Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,7 @@ private async Task ApplyModifications()

List<string> 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
Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/Integrations/ActivityWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class ActivityWatcher : IDisposable
public event EventHandler? OnAppClose;
public event EventHandler<Message>? OnRPCMessage;

private readonly Dictionary<string, string> GeolocationCache = new();
private DateTime LastRPCRequest;

public string LogLocation = null!;
Expand Down
16 changes: 15 additions & 1 deletion Bloxstrap/JsonManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
Expand Down
18 changes: 18 additions & 0 deletions Bloxstrap/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
3 changes: 2 additions & 1 deletion Bloxstrap/UI/Elements/Installer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/Elements/Settings/Pages/IntegrationsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
15 changes: 1 addition & 14 deletions Bloxstrap/UI/Frontend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Bloxstrap/UI/ViewModels/Settings/IntegrationsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private void BrowseIntegrationLocation()
if (dialog.ShowDialog() != true)
return;

SelectedCustomIntegration.Name = dialog.SafeFileName;
SelectedCustomIntegration.Location = dialog.FileName;
OnPropertyChanged(nameof(SelectedCustomIntegration));
}
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/ViewModels/Settings/ModsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f8d3c96

Please sign in to comment.