diff --git a/CHANGELOG.md b/CHANGELOG.md index 2971ab96..7aa68987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2021.512.1742 +## Launcher +• FIX: CTRL+G is now working again to swap between client and launcher. +• FIX: Clients can now be relaunched again after it get closed. + # 2021.511.2300 ## Launcher + Authentification with Discord. diff --git a/PataNext.Export.Desktop/BringIntegratedClientInFrontSystem.cs b/PataNext.Export.Desktop/BringIntegratedClientInFrontSystem.cs index 0d7ff183..56d775d6 100644 --- a/PataNext.Export.Desktop/BringIntegratedClientInFrontSystem.cs +++ b/PataNext.Export.Desktop/BringIntegratedClientInFrontSystem.cs @@ -21,6 +21,8 @@ public override bool CanUpdate() var val = !World.Mgr.Get().IsEmpty && !World.Mgr.Get().IsEmpty && base.CanUpdate(); if (!val) { + EnableWindow(visualHwnd.Value, true); + timeBeforeEnablingMainWindow = Environment.TickCount + 500; return false; } diff --git a/PataNext.Export.Desktop/Features/AddReceiveGameHostClientFeature.cs b/PataNext.Export.Desktop/Features/AddReceiveGameHostClientFeature.cs index 5fcc541f..8ccad203 100644 --- a/PataNext.Export.Desktop/Features/AddReceiveGameHostClientFeature.cs +++ b/PataNext.Export.Desktop/Features/AddReceiveGameHostClientFeature.cs @@ -87,9 +87,12 @@ protected override void OnUpdate() FileName = client.ExecutablePath, CreateNoWindow = true, UseShellExecute = false, - RedirectStandardOutput = true - } + RedirectStandardOutput = true, + }, + + EnableRaisingEvents = true }; + process.Start(); process.WaitForInputIdle(); @@ -105,7 +108,14 @@ protected override void OnUpdate() }; var clientEntity = World.Mgr.CreateEntity(); clientEntity.Set(gameClient); - + + process.Exited += (_, _) => + { + Console.WriteLine("Dispose client"); + if (clientEntity.IsAlive) + clientEntity.Dispose(); + }; + TaskRunUtility.StartUnwrap(async cc => { logger.ZLogInformation("Tryin' to get MainWindowHandle"); diff --git a/PataNext.Export.Desktop/PataNext.Export.Desktop.csproj b/PataNext.Export.Desktop/PataNext.Export.Desktop.csproj index 6b87517a..60256549 100644 --- a/PataNext.Export.Desktop/PataNext.Export.Desktop.csproj +++ b/PataNext.Export.Desktop/PataNext.Export.Desktop.csproj @@ -1,7 +1,7 @@ WinExe - 2021.511.2300 + 2021.512.1742 PataNext PataNext guerro @@ -9,7 +9,7 @@ game.ico game.ico true - 2021.511.2300 + 2021.512.1742 PataNext PataNext https://github.com/guerro323/patanext/blob/master/PataNext.Export.Desktop/game.ico diff --git a/PataNext.Export.Desktop/Visual/VisualGame.cs b/PataNext.Export.Desktop/Visual/VisualGame.cs index 1ec0243f..0feb6595 100644 --- a/PataNext.Export.Desktop/Visual/VisualGame.cs +++ b/PataNext.Export.Desktop/Visual/VisualGame.cs @@ -233,12 +233,17 @@ protected override void Update() ShowIntegratedWindows = showIntegrated && begin.AddSeconds(2) < DateTime.Now }); + if (gameBootstrap.Global.World.Get().IsEmpty) + { + showIntegrated = true; + } + kb.Capture(); // TODO: fix issues with swapping // - Sometimes the keyboard is stuck on one window // - Sometimes it doesn't even want to swap (even though SWAP is being printed) - /*var listener = kb.EventListener as SharpDxInputSystem.KeyboardListenerSimple; + var listener = kb.EventListener as SharpDxInputSystem.KeyboardListenerSimple; if (listener.ControlMap[KeyCode.Key_G].IsPressed && kb.IsShiftState(Keyboard.ShiftState.Ctrl)) { showIntegrated = !showIntegrated; @@ -246,7 +251,7 @@ protected override void Update() } foreach (var c in listener.ControlMap) - c.Value.IsPressed = false;*/ + c.Value.IsPressed = false; } protected override bool OnKeyDown(KeyDownEvent e)