Exemple #1
0
        public static void SetupNameWidget(OrderManager orderManager, Session.Client c, TextFieldWidget name)
        {
            name.Text       = c.Name;
            name.OnEnterKey = () =>
            {
                name.Text = name.Text.Trim();
                if (name.Text.Length == 0)
                {
                    name.Text = c.Name;
                }

                name.LoseFocus();
                if (name.Text == c.Name)
                {
                    return(true);
                }

                orderManager.IssueOrder(Order.Command("name " + name.Text));
                Game.Settings.Player.Name = name.Text;
                Game.Settings.Save();
                return(true);
            };
            name.OnLoseFocus = () => name.OnEnterKey();
        }
Exemple #2
0
 public void CloseChat()
 {
     ChatOverlay.Visible = true;
     ChatChrome.Visible  = false;
     ChatText.LoseFocus();
 }