From 4ebc978a664b2a45143625cb1d3afba46b7ea5ec Mon Sep 17 00:00:00 2001 From: Bob Da Ross <52760019+BobDaRoss@users.noreply.github.com> Date: Tue, 13 Apr 2021 01:59:53 -0500 Subject: [PATCH] Recreated controls after load to fix weird paint issues and possibly other issues --- SeamlessClient.cs | 14 -------------- SeamlessTransfer/LoadServer.cs | 6 ++++++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/SeamlessClient.cs b/SeamlessClient.cs index 9e2ca9f..6b893e2 100644 --- a/SeamlessClient.cs +++ b/SeamlessClient.cs @@ -166,15 +166,8 @@ namespace SeamlessClientPlugin //TryShow("Sending PluginVersion to Server!"); try { - - - ClientMessage PingServer = new ClientMessage(ClientMessageType.FirstJoin); MyAPIGateway.Multiplayer?.SendMessageToServer(SeamlessClientNetID, Utilities.Utility.Serialize(PingServer)); - - - - } catch (Exception ex) { @@ -256,14 +249,10 @@ namespace SeamlessClientPlugin try { TryShow("Restarting Client!"); - string exe = Assembly.GetEntryAssembly().Location; - - Process currentProcess = Process.GetCurrentProcess(); string[] CommandArgs = Environment.GetCommandLineArgs(); - string NewCommandLine = ""; for(int i = 1; i < CommandArgs.Length; i++) { @@ -271,10 +260,7 @@ namespace SeamlessClientPlugin } TryShow(NewCommandLine); - Process.Start(exe, NewCommandLine); - - currentProcess.Kill(); } catch (Exception ex) diff --git a/SeamlessTransfer/LoadServer.cs b/SeamlessTransfer/LoadServer.cs index a7eaf6b..128f008 100644 --- a/SeamlessTransfer/LoadServer.cs +++ b/SeamlessTransfer/LoadServer.cs @@ -54,6 +54,8 @@ namespace SeamlessClientPlugin.SeamlessTransfer private static readonly Type MySessionType = Type.GetType("Sandbox.Game.World.MySession, Sandbox.Game"); private static readonly Type VirtualClientsType = Type.GetType("Sandbox.Engine.Multiplayer.MyVirtualClients, Sandbox.Game"); private static readonly Type GUIScreenChat = Type.GetType("Sandbox.Game.Gui.MyGuiScreenChat, Sandbox.Game"); + private static readonly Type GUIScreenDPAD = Type.GetType("Sandbox.Game.Screens.Helpers.MyGuiControlDPad, Sandbox.Game"); + private static Harmony Patcher = new Harmony("SeamlessClientReUnload"); private static MyGameServerItem Server; @@ -502,6 +504,10 @@ namespace SeamlessClientPlugin.SeamlessTransfer SeamlessClient.TryShow("OnlinePlayers: " + MySession.Static.Players.GetOnlinePlayers().Count); SeamlessClient.TryShow("Loading Complete!"); + + //Recreate all controls... Will fix weird gui/paint/crap + MyGuiScreenHudSpace.Static.RecreateControls(true); + } catch (Exception Ex) {