public static void SelectPlayer(PlayerFileData data) { if (Main._pendingCharacterSelect != null) { Main._pendingCharacterSelect(data); Main._pendingCharacterSelect = null; return; } if (!Main.menuMultiplayer) { Main.ServerSideCharacter = false; Main.myPlayer = 0; data.SetAsActive(); Main.player[Main.myPlayer].position = Vector2.Zero; Main.LoadWorlds(); Main.menuMode = 6; return; } Main.ServerSideCharacter = false; data.SetAsActive(); if (Main.autoJoin) { if (Netplay.SetRemoteIP(Main.getIP)) { Main.menuMode = 10; Netplay.StartTcpClient(); } Main.autoJoin = false; return; } if (Main.menuServer) { Main.LoadWorlds(); Main.menuMode = 6; return; } Main.menuMode = 13; Main.ClearInput(); }
public static void OpenPlayerSelect(Main.OnPlayerSelected method) { if (Main.gameMenu && (Main.menuMode == 10 || Main.menuMode == 14)) { return; } Main._pendingCharacterSelect = method; if (Main.gameMenu) { Main.LoadPlayers(); Main.menuMode = 1; return; } WorldGen.SaveAndQuit(() => { Main.LoadPlayers(); Main.menuMode = 1; }); }