public void OnClientNewGame(CoopLobbyInfo lobby) { if (CoopLobby.IsInLobby) { CoopLobby.LeaveActive(); } TitleScreen.StartGameSetup.Type = TitleScreen.GameSetup.InitTypes.New; TitleScreen.StartGameSetup.MpType = TitleScreen.GameSetup.MpTypes.Client; this.RefreshUI(); if (this._currentScreen == CoopSteamNGUI.Screens.InviteReceivedScreen) { this._currentScreen = this._prevScreen; this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser); } this.SetLoadingText(string.Format("Joining Lobby {0} ...", lobby.Name)); lobby.UpdateData(); CoopLobbyManager.Join(lobby, delegate { lobby.UpdateData(); this.ClearLoadingAndError(); }, delegate { this.ClearLoadingAndError(); this.SetErrorText("Could not join Steam lobby."); }); }
public void OpenScreen(CoopSteamNGUI.Screens screen) { this.ClearLoadingAndError(); this._prevScreen = this._currentScreen; this._modalScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.ModalScreen && !ForestVR.Enabled); this._inviteReceivedScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.InviteReceivedScreen); this._lobbySetupScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.LobbySetup); this._lobbyScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.Lobby); this._gameBrowserScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser); if (this._gameBrowserScreenDS._screen) { this._gameBrowserScreenDS._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowserDS); } this._gameBrowserScreen._sources.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser || screen == CoopSteamNGUI.Screens.GameBrowserDS); if (this._joinDsScreen._screen) { this._joinDsScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.JoinDS); } if (this._joinP2PScreen._screen) { this._joinP2PScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.JoinP2P); } this._currentScreen = screen; if (screen == CoopSteamNGUI.Screens.GameBrowser || screen == CoopSteamNGUI.Screens.GameBrowserDS) { this._previouslyPlayedServers = SaveSlotUtils.GetPreviouslyPlayedServers(); } }
private void OpenScreen(CoopSteamNGUI.Screens screen) { this.ClearLoadingAndError(); this._prevScreen = this._currentScreen; this._modalScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.ModalScreen); this._inviteReceivedScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.InviteReceivedScreen); this._lobbySetupScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.LobbySetup); this._lobbyScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.Lobby); this._gameBrowserScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser); this._currentScreen = screen; if (screen == CoopSteamNGUI.Screens.GameBrowser) { this._previouslyPlayedServers = SaveSlotUtils.GetPreviouslyPlayedServers(); } }
private void LateUpdate() { CoopSteamNGUI.Screens screens = (this._currentScreen != CoopSteamNGUI.Screens.ModalScreen) ? this._currentScreen : this._prevScreen; if (screens != CoopSteamNGUI.Screens.LobbySetup) { if (screens != CoopSteamNGUI.Screens.Lobby) { if (screens == CoopSteamNGUI.Screens.GameBrowser) { this.UpdateGameBrowser(); } } else { this.UpdateLobby(); } } }
public void OnBack() { switch (this._currentScreen) { case CoopSteamNGUI.Screens.ModalScreen: if (TitleScreen.StartGameSetup.MpType == TitleScreen.GameSetup.MpTypes.Client) { CoopLobby.LeaveActive(); if (this._prevScreen == CoopSteamNGUI.Screens.Lobby) { this._prevScreen = CoopSteamNGUI.Screens.GameBrowser; this.OnClientRefreshGameList(); } } else { if (CoopLobby.Instance != null) { CoopLobby.Instance.Destroy(); } CoopLobby.LeaveActive(); CoopSteamServer.Shutdown(); if (this._prevScreen == CoopSteamNGUI.Screens.Lobby) { this._prevScreen = CoopSteamNGUI.Screens.LobbySetup; } } this.OpenScreen(this._prevScreen); this._prevScreen = this._currentScreen; return; case CoopSteamNGUI.Screens.LobbySetup: CoopSteamClient.Shutdown(); UnityEngine.Object.Destroy(base.gameObject); Application.LoadLevel("TitleScene"); return; case CoopSteamNGUI.Screens.Lobby: if (TitleScreen.StartGameSetup.MpType == TitleScreen.GameSetup.MpTypes.Client) { CoopLobby.LeaveActive(); if (this._prevScreen == CoopSteamNGUI.Screens.GameBrowser) { this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser); this.OnClientRefreshGameList(); } else if (this._prevScreen == CoopSteamNGUI.Screens.LobbySetup) { this.OpenScreen(CoopSteamNGUI.Screens.LobbySetup); } else { UnityEngine.Object.Destroy(base.gameObject); Application.LoadLevel("TitleScene"); } } else { CoopLobby.Instance.Destroy(); CoopLobby.LeaveActive(); CoopSteamServer.Shutdown(); this.OpenScreen(CoopSteamNGUI.Screens.LobbySetup); } return; } UnityEngine.Object.Destroy(base.gameObject); Application.LoadLevel("TitleScene"); }
private void OpenScreen(CoopSteamNGUI.Screens screen) { this.ClearLoadingAndError(); this._prevScreen = this._currentScreen; this._modalScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.ModalScreen); this._inviteReceivedScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.InviteReceivedScreen); this._lobbySetupScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.LobbySetup); this._lobbyScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.Lobby); this._gameBrowserScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser); this._currentScreen = screen; if (screen == CoopSteamNGUI.Screens.GameBrowser) { this._previouslyPlayedServers = SaveSlotUtils.GetPreviouslyPlayedServers(); } }
public void OnClientNewGame(CoopLobbyInfo lobby) { if (CoopLobby.IsInLobby) { CoopLobby.LeaveActive(); } TitleScreen.StartGameSetup.Type = TitleScreen.GameSetup.InitTypes.New; TitleScreen.StartGameSetup.MpType = TitleScreen.GameSetup.MpTypes.Client; this.RefreshUI(); if (this._currentScreen == CoopSteamNGUI.Screens.InviteReceivedScreen) { this._currentScreen = this._prevScreen; this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser); } this.SetLoadingText(string.Format("Joining Lobby {0} ...", lobby.Name)); lobby.UpdateData(); CoopLobbyManager.Join(lobby, delegate { lobby.UpdateData(); this.ClearLoadingAndError(); }, delegate { this.ClearLoadingAndError(); this.SetErrorText("Could not join Steam lobby."); }); }
public void OnBack() { switch (this._currentScreen) { case CoopSteamNGUI.Screens.ModalScreen: if (TitleScreen.StartGameSetup.MpType == TitleScreen.GameSetup.MpTypes.Client) { CoopLobby.LeaveActive(); if (this._prevScreen == CoopSteamNGUI.Screens.Lobby) { this._prevScreen = CoopSteamNGUI.Screens.GameBrowser; this.OnClientRefreshGameList(); } } else { if (CoopLobby.Instance != null) { CoopLobby.Instance.Destroy(); } CoopLobby.LeaveActive(); CoopSteamServer.Shutdown(); if (this._prevScreen == CoopSteamNGUI.Screens.Lobby) { this._prevScreen = CoopSteamNGUI.Screens.LobbySetup; } } this.OpenScreen(this._prevScreen); this._prevScreen = this._currentScreen; return; case CoopSteamNGUI.Screens.LobbySetup: CoopSteamClient.Shutdown(); UnityEngine.Object.Destroy(base.gameObject); Application.LoadLevel("TitleScene"); return; case CoopSteamNGUI.Screens.Lobby: if (TitleScreen.StartGameSetup.MpType == TitleScreen.GameSetup.MpTypes.Client) { CoopLobby.LeaveActive(); if (this._prevScreen == CoopSteamNGUI.Screens.GameBrowser) { this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser); this.OnClientRefreshGameList(); } else if (this._prevScreen == CoopSteamNGUI.Screens.LobbySetup) { this.OpenScreen(CoopSteamNGUI.Screens.LobbySetup); } else { UnityEngine.Object.Destroy(base.gameObject); Application.LoadLevel("TitleScene"); } } else { CoopLobby.Instance.Destroy(); CoopLobby.LeaveActive(); CoopSteamServer.Shutdown(); this.OpenScreen(CoopSteamNGUI.Screens.LobbySetup); } return; } UnityEngine.Object.Destroy(base.gameObject); Application.LoadLevel("TitleScene"); }