Ejemplo n.º 1
0
        private void setToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QualityInputForm dialog = new QualityInputForm();

            if (map.IsValidTile(PopupTile) && dialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    int quality = Int32.Parse(dialog.InputBox.Text);
                    if (quality < 20 || quality > 100)
                    {
                        throw new Exception("Quality must be between 20 and 100");
                    }
                    map[PopupTile].ExactQuality = quality;
                    RepaintTile(PopupTile);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Failed to parse number: " + ex.Message);
                }
            }
        }
Ejemplo n.º 2
0
 private void setToolStripMenuItem_Click(object sender, EventArgs e)
 {
     QualityInputForm dialog = new QualityInputForm();
     if (map.IsValidTile(PopupTile) && dialog.ShowDialog() == DialogResult.OK)
     {
         try
         {
             int quality = Int32.Parse(dialog.InputBox.Text);
             if (quality < 20 || quality > 100)
                 throw new Exception("Quality must be between 20 and 100");
             map[PopupTile].ExactQuality = quality;
             RepaintTile(PopupTile);
         }
         catch (Exception ex)
         {
             MessageBox.Show("Failed to parse number: " + ex.Message);
         }
     }
 }