Ejemplo n.º 1
0
        private static void ProcessIntro()
        {
            if (ClientConfiguration.Instance.IntroImages.Count > 0)
            {
                GameTexture imageTex = Globals.ContentManager.GetTexture(
                    GameContentManager.TextureType.Image, ClientConfiguration.Instance.IntroImages[Globals.IntroIndex]
                    );

                if (imageTex != null)
                {
                    if (Globals.IntroStartTime == -1)
                    {
                        if (Fade.DoneFading())
                        {
                            if (Globals.IntroComing)
                            {
                                Globals.IntroStartTime = Globals.System.GetTimeMs();
                            }
                            else
                            {
                                Globals.IntroIndex++;
                                Fade.FadeIn();
                                Globals.IntroComing = true;
                            }
                        }
                    }
                    else
                    {
                        if (Globals.System.GetTimeMs() > Globals.IntroStartTime + Globals.IntroDelay)
                        {
                            //If we have shown an image long enough, fade to black -- keep track that the image is going
                            Fade.FadeOut();
                            Globals.IntroStartTime = -1;
                            Globals.IntroComing    = false;
                        }
                    }
                }
                else
                {
                    Globals.IntroIndex++;
                }

                if (Globals.IntroIndex >= ClientConfiguration.Instance.IntroImages.Count)
                {
                    Globals.GameState = GameStates.Menu;
                }
            }
            else
            {
                Globals.GameState = GameStates.Menu;
            }
        }
Ejemplo n.º 2
0
        public static void Logout(bool characterSelect)
        {
            Audio.PlayMusic(ClientConfiguration.Instance.MenuMusic, 3, 3, true);
            Fade.FadeOut();
            PacketSender.SendLogout(characterSelect);
            Globals.LoggedIn           = false;
            Globals.WaitingOnServer    = false;
            Globals.GameState          = GameStates.Menu;
            Globals.JoiningGame        = false;
            Globals.NeedsMaps          = true;
            Globals.Picture            = null;
            Interface.Interface.HideUi = false;

            //Dump Game Objects
            Globals.Me          = null;
            Globals.HasGameData = false;
            foreach (var map in MapInstance.Lookup)
            {
                var mp = (MapInstance)map.Value;
                mp.Dispose(false, true);
            }

            foreach (var en in Globals.Entities.ToArray())
            {
                en.Value.Dispose();
            }

            MapBase.Lookup.Clear();
            MapInstance.Lookup.Clear();

            Globals.Entities.Clear();
            Globals.MapGrid = null;
            Globals.GridMaps.Clear();
            Globals.EventDialogs.Clear();
            Globals.EventHolds.Clear();
            Globals.PendingEvents.Clear();

            Interface.Interface.InitGwen();
            Fade.FadeIn();
        }