Skip to content

Commit

Permalink
Update MainPage.xaml.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-nyan committed May 3, 2022
1 parent 2420d9c commit a10e6d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CollapseLauncher/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public MainPage()

LauncherUpdateWatcher.StartCheckUpdate();

Task.Run(() => CheckRunningGameInstance());

InitializeStartup().GetAwaiter();
}
catch (Exception ex)
Expand All @@ -52,6 +54,16 @@ public MainPage()
}
}

private async void CheckRunningGameInstance()
{
while (true && !App.IsAppKilled)
{
string execName = Path.GetFileNameWithoutExtension(CurrentRegion.GameExecutableName);
App.IsGameRunning = Process.GetProcessesByName(execName).Length != 0 && !App.IsAppKilled;
await Task.Delay(3000);
}
}

private void NotificationInvoker_EventInvoker(object sender, NotificationInvokerProp e)
{
SpawnNotificationPush(e.Notification.Title, e.Notification.Message, e.Notification.Severity,
Expand Down

0 comments on commit a10e6d8

Please sign in to comment.