mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix start event handler + launch menu title bar
turns out you need to call Reset() on the event even when you set its initial state to false
This commit is contained in:
parent
2791cb0b2e
commit
4d9a0ee410
@ -328,18 +328,25 @@ namespace Bloxstrap
|
|||||||
return;
|
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;
|
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");
|
||||||
|
|
||||||
|
startEventSignalled = startEvent.WaitOne(TimeSpan.FromSeconds(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Started Roblox (PID {gameClientPid}), waiting for start event");
|
if (!startEventSignalled)
|
||||||
|
|
||||||
if (!startEvent.WaitOne(TimeSpan.FromSeconds(10)))
|
|
||||||
{
|
{
|
||||||
Frontend.ShowPlayerErrorDialog();
|
Frontend.ShowPlayerErrorDialog();
|
||||||
return;
|
return;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</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 Grid.Row="1">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
Loading…
Reference in New Issue
Block a user