Ejemplo n.º 1
0
        public bool DoEvent(DoomEvent e)
        {
            if (active)
            {
                if (current.DoEvent(e))
                {
                    return(true);
                }

                if (e.Key == DoomKeys.Escape && e.Type == EventType.KeyDown)
                {
                    Close();
                }

                return(true);
            }
            else
            {
                if (e.Key == DoomKeys.Escape && e.Type == EventType.KeyDown)
                {
                    current = main;
                    Open();
                    return(true);
                }

                if (e.Type == EventType.KeyDown && app.State == ApplicationState.Opening)
                {
                    current = main;
                    Open();
                    return(true);
                }

                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool DoEvent(DoomEvent e)
        {
            if (active)
            {
                if (current.DoEvent(e))
                {
                    return(true);
                }

                if (e.Key == DoomKey.Escape && e.Type == EventType.KeyDown)
                {
                    Close();
                }

                return(true);
            }
            else
            {
                if (e.Key == DoomKey.Escape && e.Type == EventType.KeyDown)
                {
                    SetCurrent(main);
                    Open();
                    StartSound(Sfx.SWTCHN);
                    return(true);
                }

                if (e.Type == EventType.KeyDown && app.State == ApplicationState.Opening)
                {
                    if (e.Key == DoomKey.Enter ||
                        e.Key == DoomKey.Space ||
                        e.Key == DoomKey.LControl ||
                        e.Key == DoomKey.RControl ||
                        e.Key == DoomKey.Escape)
                    {
                        SetCurrent(main);
                        Open();
                        StartSound(Sfx.SWTCHN);
                        return(true);
                    }
                }

                return(false);
            }
        }