Recreated controls after load to fix weird paint issues and possibly other issues
This commit is contained in:
@@ -166,15 +166,8 @@ namespace SeamlessClientPlugin
|
|||||||
//TryShow("Sending PluginVersion to Server!");
|
//TryShow("Sending PluginVersion to Server!");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ClientMessage PingServer = new ClientMessage(ClientMessageType.FirstJoin);
|
ClientMessage PingServer = new ClientMessage(ClientMessageType.FirstJoin);
|
||||||
MyAPIGateway.Multiplayer?.SendMessageToServer(SeamlessClientNetID, Utilities.Utility.Serialize(PingServer));
|
MyAPIGateway.Multiplayer?.SendMessageToServer(SeamlessClientNetID, Utilities.Utility.Serialize(PingServer));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -256,14 +249,10 @@ namespace SeamlessClientPlugin
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
TryShow("Restarting Client!");
|
TryShow("Restarting Client!");
|
||||||
|
|
||||||
string exe = Assembly.GetEntryAssembly().Location;
|
string exe = Assembly.GetEntryAssembly().Location;
|
||||||
|
|
||||||
|
|
||||||
Process currentProcess = Process.GetCurrentProcess();
|
Process currentProcess = Process.GetCurrentProcess();
|
||||||
|
|
||||||
string[] CommandArgs = Environment.GetCommandLineArgs();
|
string[] CommandArgs = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
string NewCommandLine = "";
|
string NewCommandLine = "";
|
||||||
for(int i = 1; i < CommandArgs.Length; i++)
|
for(int i = 1; i < CommandArgs.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -271,10 +260,7 @@ namespace SeamlessClientPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
TryShow(NewCommandLine);
|
TryShow(NewCommandLine);
|
||||||
|
|
||||||
Process.Start(exe, NewCommandLine);
|
Process.Start(exe, NewCommandLine);
|
||||||
|
|
||||||
|
|
||||||
currentProcess.Kill();
|
currentProcess.Kill();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@@ -54,6 +54,8 @@ namespace SeamlessClientPlugin.SeamlessTransfer
|
|||||||
private static readonly Type MySessionType = Type.GetType("Sandbox.Game.World.MySession, Sandbox.Game");
|
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 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 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 Harmony Patcher = new Harmony("SeamlessClientReUnload");
|
||||||
private static MyGameServerItem Server;
|
private static MyGameServerItem Server;
|
||||||
@@ -502,6 +504,10 @@ namespace SeamlessClientPlugin.SeamlessTransfer
|
|||||||
SeamlessClient.TryShow("OnlinePlayers: " + MySession.Static.Players.GetOnlinePlayers().Count);
|
SeamlessClient.TryShow("OnlinePlayers: " + MySession.Static.Players.GetOnlinePlayers().Count);
|
||||||
SeamlessClient.TryShow("Loading Complete!");
|
SeamlessClient.TryShow("Loading Complete!");
|
||||||
|
|
||||||
|
|
||||||
|
//Recreate all controls... Will fix weird gui/paint/crap
|
||||||
|
MyGuiScreenHudSpace.Static.RecreateControls(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception Ex)
|
catch (Exception Ex)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user