//TODO put these strings in TacoModels public void ModalClicked() { if (ModalButtonEnabled) { if (Callback != null) { switch (Callback) { case ModalFunctions.ReturnToGame: TacoManager.CloseTaco(); break; case ModalFunctions.TournamentGamePosted: // They finished the game, after modal closed - show past tournaments TacoManager.ShowPanel(PanelNames.MyPrivatePanel); break; case ModalFunctions.RegisterResult: // when they close the modal, show login TacoManager.ShowPanel(PanelNames.LoginPanel); break; case ModalFunctions.TournamentSubmit: TournamentManager.Instance.TournamentSubmit(); break; case ModalFunctions.TournamentSubmitComplete: // close the creation panel - remove from stack TacoManager.ClosePanel(); // refresh and show the current tournaments TacoManager.ShowPanel(PanelNames.MyTournamentsPanel); break; case ModalFunctions.LogoutUser: TacoManager.LogoutUser(); break; case ModalFunctions.JoinTournament: TournamentManager.Instance.Join(); break; case ModalFunctions.InviteFriends: TournamentManager.Instance.InviteFriend(); break; case ModalFunctions.InviteFriendsFromCreate: TournamentManager.Instance.InviteFriendsFromCreate(); break; case ModalFunctions.JoinPublicSuccess: // close the join panel - remove from stack TacoManager.ClosePanel(); // refresh and show the current tournaments TacoManager.ShowPanel(PanelNames.MyTournamentsPanel); break; case ModalFunctions.StartPlay: GameManager.Instance.StartPlay(TacoManager.Target); break; case ModalFunctions.SawIntro: TacoManager.SetPreference(UserPreferences.sawIntro, 1); TacoManager.ShowPanel(PanelNames.LoginPanel); break; case ModalFunctions.ForfeitTournamentGame: //TacoManager.Instance.ForfeitTournamentGame(); break; case ModalFunctions.ReturnToTournaments: // refresh and show the current tournaments TacoManager.ShowPanel(PanelNames.MyTournamentsPanel); break; case ModalFunctions.ReturnToMenu: TacoSetup.Instance.ReturnMenu(); break; case ModalFunctions.TacoEndTournament: { TacoSetup.Instance.TacoEndTournament(); break; } case ModalFunctions.TacoFreePlayGiftToken: { TacoSetup.Instance.TacoSigninWithTokenFree(); break; } } } TacoConfig.print("DismissModals"); DismissModal(); } }