}   // end of UpdateObj c'tor

            public override void Update()
            {
                foreach (UpdateObject obj in updateList)
                {
                    obj.Update();
                }

                if (done && !parent.logonDialog.Active)
                {
                    // Switch to MainMenu.
                    parent.DismissAndShowMain(null, null);
                }

                if (parent.progress != null && parent.progressMessage != null)
                {
                    lock (parent.progressMessage)
                    {
                        parent.progress.Message = parent.progressMessage;
                    }
                }
            }   // end of UpdateObj Update()
Esempio n. 2
0
            }   // end of UpdateObj c'tor

            public override void Update()
            {
                foreach (UpdateObject obj in updateList)
                {
                    obj.Update();
                }

                if (done && !parent.logonDialog.Active)
                {
                    // Done loading, should we show the intro video?
                    if (XmlOptionsData.ShowIntroVideo)
                    {
                        try
                        {
#if NETFX_CORE
                            // Switch to MainMenu.
                            parent.DismissAndShowMain(null, null);
#else
                            if (shared.video == null)
                            {
                                // Start video.
                                shared.video           = BokuGame.Load <Video>(BokuGame.Settings.MediaPath + @"Video\Intro");
                                shared.player          = new VideoPlayer();
                                shared.player.IsLooped = false;
                                shared.player.Play(shared.video);
                            }

                            // Check if we're done with the video or the user hit escape to skip.
                            if (shared.player.State != MediaState.Playing ||
                                Actions.Cancel.WasPressed ||
                                TouchInput.WasLastReleased)
                            {
                                Actions.Cancel.ClearAllWasPressedState();
                                shared.player.Stop();

                                shared.player.Dispose();
                                shared.video = null;

                                XmlOptionsData.ShowIntroVideo = false;

                                // Switch to MainMenu.
                                parent.DismissAndShowMain(null, null);
                            }
#endif
                        }
                        catch (Exception e)
                        {
                            if (e != null)
                            {
                            }

                            // Something failed with the video so just pretend
                            // we never intended to go there anyway.
                            XmlOptionsData.ShowIntroVideo = false;

                            // Switch to MainMenu.
                            parent.DismissAndShowMain(null, null);
                        }
                    }
                    else
                    {
                        // Switch to MainMenu.
                        parent.DismissAndShowMain(null, null);
                    }
                }

                if (parent.progress != null && parent.progressMessage != null)
                {
                    lock (parent.progressMessage)
                    {
                        parent.progress.Message = parent.progressMessage;
                    }
                }
            }   // end of UpdateObj Update()