public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
        {
            // Lazy load it
            if (achievementController == null)
            {
                achievementController = new GKAchievementViewController();
            }

            if (achievementController != null)
            {
                achievementController.DidFinish += delegate(object sender, EventArgs e)
                {
                    achievementController.DismissModalViewControllerAnimated(true);
                };
                dvc.PresentModalViewController(achievementController, true);
            }
        }
Beispiel #2
0
        public static void ShowAchievements()
        {
            AssertInitialised();

            if ((Gamer.SignedInGamers.Count > 0) && (Gamer.SignedInGamers[0].IsSignedInToLive))
            {
                // Lazy load it
                if (achievementController == null)
                {
                    achievementController = new GKAchievementViewController();
                }

                if (achievementController != null)
                {
                    achievementController.DidFinish += delegate(object sender, EventArgs e)
                    {
                        achievementController.DismissModalViewControllerAnimated(true);
                        IsVisible = false;
                        TouchPanel.EnabledGestures = prevGestures;
                    };

                    if (_window != null)
                    {
                        if (viewController == null)
                        {
                            viewController = new GuideViewController(_gameViewController);
                            _window.Add(viewController.View);
                            viewController.View.Hidden = true;
                        }

                        prevGestures = TouchPanel.EnabledGestures;
                        TouchPanel.EnabledGestures = GestureType.None;
                        viewController.PresentModalViewController(achievementController, true);
                        IsVisible = true;
                    }
                }
            }
            else
            {
                UIAlertView alert = new UIAlertView("Error", "You need to be logged into Game Center to view Achievements.", null, "Ok");
                alert.Show();
                ShowSignIn(1, true);
            }
        }