Esempio n. 1
0
        private void OnAddButtonClick(object sender, EventArgs args)
        {
            var input  = new StringInput();
            var dialog = new ValueDialog <StringInput>("Player name: ", input);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                friendManager.Add(input.Text);
            }
        }
Esempio n. 2
0
        public override void Edit(GoGame game, byte x, byte y)
        {
            var input  = new StringInput();
            var dialog = new ValueDialog <StringInput>("Label: ", input);

            if (dialog.ShowDialog() == DialogResult.OK && input.Text != string.Empty)
            {
                ClearMarkup(game, x, y);
                var node = game.CurrentNode;
                node.EnsureMarkup();
                node.Markup.Labels.Add(new TextLabel(x, y, input.Text));
            }
        }
Esempio n. 3
0
 private void OnHandicapClick(object sender, EventArgs args)
 {
     if (!Ended)
     {
         var input = new IntInput()
         {
             MinValue = 0,
             MaxValue = 9
         };
         var dialog = new ValueDialog <IntInput>("Handicap count: ", input);
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             gamePlayer.SetHandicap(input.Value);
         }
     }
 }
Esempio n. 4
0
 private void OnKomiClick(object sender, EventArgs args)
 {
     if (!Ended)
     {
         var input = new FloatInput()
         {
             Value = 0.5f,
             Step  = 0.5f
         };
         var dialog = new ValueDialog <FloatInput>("Komi value: ", input);
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             gamePlayer.SetKomi(Convert.ToSingle(input.Value));
         }
     }
 }