Exemple #1
0
        /// <summary>
        /// Generic Subscreen handler.
        /// </summary>
        public static void Handler()
        {
            if (Subscreens.FirstDraw)
            {
                Subscreens.FirstDraw = false;
                Subscreens.Redraw    = true;
            }
            if (Subscreens.Redraw)
            {
                Subscreens.Redraw = false;
                NoxicoGame.DrawMessages();
                NoxicoGame.DrawStatus();
                UIManager.Draw();
            }

            if (NoxicoGame.IsKeyDown(KeyBinding.Back) || NoxicoGame.IsKeyDown(KeyBinding.Accept) || Vista.Triggers == XInputButtons.A || Vista.Triggers == XInputButtons.B)
            {
                //If we pressed Back/Esc or [B], pick the out-of-band -1 sentinel option.
                if (NoxicoGame.IsKeyDown(KeyBinding.Back) || Vista.Triggers == XInputButtons.B)
                {
                    option = -1;
                }

                Enter(null, null);

                ActionList.Answer = option == -1 ? -1 : options.ElementAt(option).Key;
                onChoice();                 //Let the caller handle things.
                NoxicoGame.ClearKeys();
            }
            else
            {
                UIManager.CheckKeys();
            }
        }