Exemplo n.º 1
0
        public override void UpdateControl()
        {
            //GlobalServices.TextHandler.DumpBuffer();
            base.UpdateControl();
            //menu.Update();

            // TODO: Implement text input as a control that can be attached to an entity?
            //   Start() and Stop() TextHandler from within the entity?

            /*
             * foreach (char c in GlobalServices.TextHandler.TextBuffer)
             * {
             *  if (Char.IsLetterOrDigit(c) || Char.IsPunctuation(c) || Char.IsSymbol(c) || c == ' ')
             *  {
             *      // TODO: Strip off characters out of the font range? (Convert to question mark or similar.)
             *      message.Append(c);
             *  }
             *  else if (c == '\b')
             *  {
             *      if (message.Length > 0)
             *          message.Remove(message.Length - 1, 1);
             *  }
             *
             *  else
             *  {
             *      // To figure out which keys are being registered and what their codes are.
             *      message.Append("(" + String.Format("0x{0:X}", Convert.ToByte(c)) + ")");
             *  }
             *
             * }
             * stop1.SetText(message.ToString());
             */

            if (GlobalServices.InputManager.JustPressed(GameCommand.MenuCancel))
            {
                if (menu.CheckOrSelectLast())
                {
                    GlobalServices.Game.Exit();
                }
            }
        }