Skip to content

Commit

Permalink
Fix start event handler + launch menu title bar
Browse files Browse the repository at this point in the history
turns out you need to call Reset() on the event even when you set its initial state to false
  • Loading branch information
pizzaboxer committed Aug 30, 2024
1 parent 2791cb0 commit 4d9a0ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions Bloxstrap/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,25 @@ private void StartRoblox()
return;
}

using var startEvent = new EventWaitHandle(false, EventResetMode.ManualReset, AppData.StartEvent);

// v2.2.0 - byfron will trip if we keep a process handle open for over a minute, so we're doing this now
int gameClientPid;
using (var gameClient = Process.Start(startInfo)!)
bool startEventSignalled;

using (var startEvent = new EventWaitHandle(false, EventResetMode.ManualReset, AppData.StartEvent))
{
gameClientPid = gameClient.Id;
}
startEvent.Reset();

// v2.2.0 - byfron will trip if we keep a process handle open for over a minute, so we're doing this now
using (var process = Process.Start(startInfo)!)
{
gameClientPid = process.Id;
}

App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {gameClientPid}), waiting for start event");
App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {gameClientPid}), waiting for start event");

startEventSignalled = startEvent.WaitOne(TimeSpan.FromSeconds(10));
}

if (!startEvent.WaitOne(TimeSpan.FromSeconds(10)))
if (!startEventSignalled)
{
Frontend.ShowPlayerErrorDialog();
return;
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/Elements/Dialogs/LaunchMenuDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<ui:TitleBar Grid.Row="0" Grid.ColumnSpan="2" Padding="8" ShowMinimize="False" ShowMaximize="False" CanMaximize="False" KeyboardNavigation.TabNavigation="None" />
<ui:TitleBar Grid.Row="0" Grid.ColumnSpan="2" Padding="8" ShowMinimize="False" ShowMaximize="False" Title="Bloxstrap" Icon="pack://application:,,,/Bloxstrap.ico" CanMaximize="False" KeyboardNavigation.TabNavigation="None" />

<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
Expand Down

0 comments on commit 4d9a0ee

Please sign in to comment.