public static void StartLoading(Action loadingAction) { var newGameplayScreen = new MyGuiScreenGamePlay(); newGameplayScreen.OnLoadingAction += loadingAction; var loadScreen = new MyGuiScreenLoading(newGameplayScreen, MyGuiScreenGamePlay.Static); loadScreen.OnScreenLoadingFinished += delegate { MyModAPIHelper.OnSessionLoaded(); MyGuiSandbox.AddScreen(MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.HUDScreen)); }; MyGuiSandbox.AddScreen(loadScreen); }
private void ForceClientConnection() { // Set the new SyncLayer to the MySession.Static.SyncLayer Patches.MySessionLayer.SetValue(MySession.Static, MyMultiplayer.Static.SyncLayer); LoadConnectedClients(); LoadOnlinePlayers(); SetWorldSettings(); RemoveOldEntities(); StartEntitySync(); MyModAPIHelper.Initialize(); // Allow the game to start proccessing incoming messages in the buffer MyMultiplayer.Static.StartProcessingClientMessages(); }
public static void StartLoading(Action loadingAction, string customLoadingBackground = null, string customLoadingtext = null) { MyAnalyticsHelper.LoadingStarted(); var newGameplayScreen = new MyGuiScreenGamePlay(); newGameplayScreen.OnLoadingAction += loadingAction; var loadScreen = new MyGuiScreenLoading(newGameplayScreen, MyGuiScreenGamePlay.Static, customLoadingBackground, customLoadingtext); loadScreen.OnScreenLoadingFinished += delegate { MyModAPIHelper.OnSessionLoaded(); MyGuiSandbox.AddScreen(MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.HUDScreen)); }; MyGuiSandbox.AddScreen(loadScreen); }