Skip to content

Commit

Permalink
Merge branch 'pizzaboxer:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Roblox-Thot authored Jun 20, 2024
2 parents 3c19646 + 69a059e commit 0af12c4
Show file tree
Hide file tree
Showing 17 changed files with 92 additions and 164 deletions.
19 changes: 12 additions & 7 deletions Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public partial class App : Application

public static LaunchSettings LaunchSettings { get; private set; } = null!;

public static CultureInfo CurrentCulture { get; private set; } = CultureInfo.InvariantCulture;

public static BuildMetadataAttribute BuildMetadata = Assembly.GetExecutingAssembly().GetCustomAttribute<BuildMetadataAttribute>()!;
public static string Version = Assembly.GetExecutingAssembly().GetName().Version!.ToString()[..^2];

Expand Down Expand Up @@ -110,7 +112,10 @@ private void StartupFinished()
protected override async void OnStartup(StartupEventArgs e)
{
const string LOG_IDENT = "App::OnStartup";


CultureInfo.DefaultThreadCurrentUICulture = CurrentCulture;
Thread.CurrentThread.CurrentUICulture = CurrentCulture;

base.OnStartup(e);

Logger.WriteLine(LOG_IDENT, $"Starting {ProjectName} v{Version}");
Expand Down Expand Up @@ -204,13 +209,13 @@ protected override async void OnStartup(StartupEventArgs e)
if (!IsFirstRun)
ShouldSaveConfigs = true;

if (Mutex.TryOpenExisting("ROBLOX_singletonMutex", out var _))
if (Settings.Prop.ConfirmLaunches && Mutex.TryOpenExisting("ROBLOX_singletonMutex", out var _))
{
var result = Frontend.ShowMessageBox(
"Roblox is currently running, and launching another instance will close it. Are you sure you want to continue launching?",
MessageBoxImage.Warning,
MessageBoxButton.YesNo
);
// this currently doesn't work very well since it relies on checking the existence of the singleton mutex
// which often hangs around for a few seconds after the window closes
// it would be better to have this rely on the activity tracker when we implement IPC in the planned refactoring

var result = Frontend.ShowMessageBox(Bloxstrap.Resources.Strings.Bootstrapper_ConfirmLaunch, MessageBoxImage.Warning, MessageBoxButton.YesNo);

if (result != MessageBoxResult.Yes)
{
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/Bloxstrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<UseWPF>true</UseWPF>
<UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
<Version>2.6.1</Version>
<FileVersion>2.6.1.0</FileVersion>
<Version>2.6.2</Version>
<FileVersion>2.6.2.0</FileVersion>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/FastFlagManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public class FastFlagManager : JsonManager<Dictionary<string, object>>
public static IReadOnlyDictionary<RenderingMode, string> RenderingModes => new Dictionary<RenderingMode, string>
{
{ RenderingMode.Default, "None" },
{ RenderingMode.Vulkan, "Vulkan" },
// { RenderingMode.Vulkan, "Vulkan" },
{ RenderingMode.D3D11, "D3D11" },
{ RenderingMode.D3D10, "D3D10" },
{ RenderingMode.OpenGL, "OpenGL" }
// { RenderingMode.OpenGL, "OpenGL" }
};

public static IReadOnlyDictionary<LightingMode, string> LightingModes => new Dictionary<LightingMode, string>
Expand Down
3 changes: 2 additions & 1 deletion Bloxstrap/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ private void WriteLine(string message)

public void WriteException(string identifier, Exception ex)
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

WriteLine($"[{identifier}] {ex}");

Thread.CurrentThread.CurrentUICulture = App.CurrentCulture;
}

private async void WriteToLog(string message)
Expand Down
1 change: 1 addition & 0 deletions Bloxstrap/Models/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Settings
public Theme Theme { get; set; } = Theme.Default;
public bool CheckForUpdates { get; set; } = true;
public bool CreateDesktopIcon { get; set; } = true;
public bool ConfirmLaunches { get; set; } = false;

// channel configuration
public string Channel { get; set; } = RobloxDeployment.DefaultChannel;
Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/Models/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
public class State
{
public string LastEnrolledChannel { get; set; } = "";
public bool ShowFFlagEditorWarning { get; set; } = true;

[Obsolete("Use PlayerVersionGuid instead", true)]
Expand Down
1 change: 0 additions & 1 deletion Bloxstrap/ProtocolHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public static void ChangeChannel(string channel)
public static void EnrollChannel(string channel)
{
ChangeChannel(channel);
App.State.Prop.LastEnrolledChannel = channel;
App.State.Save();
}

Expand Down
128 changes: 36 additions & 92 deletions Bloxstrap/Resources/Strings.Designer.cs

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

44 changes: 12 additions & 32 deletions Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@
<data name="Bootstrapper.AutoUpdateFailed" xml:space="preserve">
<value>Bloxstrap was unable to auto-update to {0}. Please update it manually by downloading and running the latest release from the GitHub page.</value>
</data>
<data name="Bootstrapper.ConfirmLaunch" xml:space="preserve">
<value>Roblox is currently running, and launching another instance will close it. Are you sure you want to continue launching?</value>
</data>
<data name="Bootstrapper.Connectivity.Preventing" xml:space="preserve">
<value>It's possible that something is preventing Bloxstrap from connecting to the internet. Please check and try again.</value>
</data>
Expand Down Expand Up @@ -199,6 +202,9 @@ Your ReShade configuration files will still be saved, and you can locate them by
<data name="Bootstrapper.WMFNotFound" xml:space="preserve">
<value>Roblox requires the use of Windows Media Foundation components. You appear to be missing them, likely because you are using an N edition of Windows. Please install them first, and then launch Roblox.</value>
</data>
<data name="Common.AddSingle" xml:space="preserve">
<value>Add single</value>
</data>
<data name="Common.Browse" xml:space="preserve">
<value>Browse</value>
</data>
Expand Down Expand Up @@ -300,11 +306,6 @@ Click for more information</value>
<data name="Dialog.AddFastFlag.Title" xml:space="preserve">
<value>Add FastFlag</value>
</data>
<data name="Dialog.BulkAddFastFlag.Paste" xml:space="preserve">
<value>{
"FFlagDebugDisplayFPS": "True"
}</value>
</data>
<data name="Dialog.Connectivity.MoreInfo" xml:space="preserve">
<value>More information:</value>
</data>
Expand Down Expand Up @@ -386,15 +387,6 @@ Click for more information</value>
<data name="Enums.BootstrapperStyle.VistaDialog" xml:space="preserve">
<value>Vista (2008 - 2011)</value>
</data>
<data name="Enums.ChannelChangeMode.Automatic" xml:space="preserve">
<value>Change automatically</value>
</data>
<data name="Enums.ChannelChangeMode.Ignore" xml:space="preserve">
<value>Never change</value>
</data>
<data name="Enums.ChannelChangeMode.Prompt" xml:space="preserve">
<value>Always prompt</value>
</data>
<data name="Enums.CursorType.Default" xml:space="preserve">
<value>Default</value>
</data>
Expand Down Expand Up @@ -521,21 +513,6 @@ While Bloxstrap will continue to work, it's recommended that you change the driv
<value>The version of Bloxstrap you've launched is different to the version you currently have installed.
Would you like to upgrade your currently installed version?</value>
</data>
<data name="Menu.About.BuildCommitHash" xml:space="preserve">
<value>Commit Hash</value>
</data>
<data name="Menu.About.BuildInformation" xml:space="preserve">
<value>Build Information</value>
</data>
<data name="Menu.About.BuildMachine" xml:space="preserve">
<value>Machine</value>
</data>
<data name="Menu.About.BuildRef" xml:space="preserve">
<value>Commit Ref</value>
</data>
<data name="Menu.About.BuildTimestamp" xml:space="preserve">
<value>Timestamp</value>
</data>
<data name="Menu.About.Contributors" xml:space="preserve">
<value>Contributors</value>
</data>
Expand Down Expand Up @@ -581,9 +558,6 @@ Would you like to upgrade your currently installed version?</value>
<data name="Menu.About.Title" xml:space="preserve">
<value>About</value>
</data>
<data name="Menu.About.UnreleasedVersion" xml:space="preserve">
<value>Using an unreleased version, I see?</value>
</data>
<data name="Menu.About.Version" xml:space="preserve">
<value>Version {0}</value>
</data>
Expand Down Expand Up @@ -650,6 +624,12 @@ Would you like to upgrade your currently installed version?</value>
<data name="Menu.Behaviour.AutoUpdate.Title" xml:space="preserve">
<value>Automatically update Bloxstrap</value>
</data>
<data name="Menu.Behaviour.ConfirmLaunches.Description" xml:space="preserve">
<value>Prevent against closures of your existing game from accidentally launching another one.</value>
</data>
<data name="Menu.Behaviour.ConfirmLaunches.Title" xml:space="preserve">
<value>Prompt to confirm when launching another Roblox instance</value>
</data>
<data name="Menu.Behaviour.CreateDesktopIcon.Description" xml:space="preserve">
<value>Bloxstrap will place an icon on the desktop that launches Roblox the next time it launches.</value>
</data>
Expand Down
3 changes: 2 additions & 1 deletion Bloxstrap/UI/Elements/Bootstrapper/ProgressDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public ProgressDialog()
this.BackColor = Color.FromArgb(25, 27, 29);
}

this.labelMessage.Text = Resources.Strings.Common_Cancel;
this.labelMessage.Text = Resources.Strings.Bootstrapper_StylePreview_TextCancel;
this.buttonCancel.Text = Resources.Strings.Common_Cancel;
this.IconBox.BackgroundImage = App.Settings.Prop.BootstrapperIcon.GetIcon().GetSized(128, 128).ToBitmap();

SetupDialog();
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/UI/Elements/Dialogs/AddFastFlagDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ui:TitleBar Grid.Row="0" Grid.ColumnSpan="2" Padding="8" Title="{x:Static resources:Strings.Dialog_AddFastFlag_Title}" ShowMinimize="False" ShowMaximize="False" CanMaximize="False" KeyboardNavigation.TabNavigation="None" />

<TabControl x:Name="Tabs" Grid.Row="1" Margin="16">
<TabItem Header="Add single">
<TabItem Header="{x:Static resources:Strings.Common_AddSingle}">
<Grid Grid.Row="1" Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -51,7 +51,7 @@
<TabItem Header="{x:Static resources:Strings.Common_ImportJson}">
<Grid Margin="11">
<TextBox x:Name="JsonTextBox" Margin="5" AcceptsTab="True" AcceptsReturn="True" MinHeight="80" MaxHeight="480" />
<TextBlock IsHitTestVisible="False" Margin="18,14,0,0" Foreground="DarkGray" Text="{x:Static resources:Strings.Dialog_BulkAddFastFlag_Paste}">
<TextBlock IsHitTestVisible="False" Margin="18,14,0,0" Foreground="DarkGray" Text="{}{&#10; &quot;FFlagDebugDisplayFPS&quot;: &quot;True&quot;&#10;}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Visibility" Value="Collapsed"/>
Expand Down
Loading

0 comments on commit 0af12c4

Please sign in to comment.