Ejemplo n.º 1
0
        private void btnAccept_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtName.Text) || (cbSort.SelectedItem == null && cbType.SelectedIndex != 1) || cbType.SelectedItem == null)
            {
                MessageBox.Show("You must fill all fields to create a new charSet");
                return;
            }

            if (cbType.SelectedIndex == 0 &&
                !(nudWidth.Value == 1 && nudHeight.Value == 1) &&
                !(nudWidth.Value == 1 && nudHeight.Value == 2) &&
                !(nudWidth.Value == 2 && nudHeight.Value == 2))
            {
                MessageBox.Show("Invalid sprite size, only 1x1, 1x2 and 2x2 sizes are acceptable");
                return;
            }

            CharSetName  = txtName.Text;
            CharWidth    = (int)nudWidth.Value;
            CharHeight   = (int)nudHeight.Value;
            CharSetType  = (CharSetType)cbType.SelectedIndex;
            CharSetSort  = (CharSetSort)cbSort.SelectedIndex;
            DialogResult = DialogResult.OK;
            Close();
        }
Ejemplo n.º 2
0
        public CharSetEditor(string CharSetName, int CharWidth, int CharHeight, CharSetSort CharSetSort, CharSetType CharSetType)
        {
            ConfigureForm();

            this.CharWidth   = CharWidth;
            this.CharHeight  = CharHeight;
            this.CharSetSort = CharSetSort;
            this.CharSetName = CharSetName;
            this.CharSetType = CharSetType;
            this.CharSetId   = Guid.NewGuid();

            SetText();
            GenerateEditors();
        }
Ejemplo n.º 3
0
 private void SetText()
 {
     this.Text = $"{CharSetType.ToString()} {CharSetName}, {CharWidth}x{CharHeight} chars, sorted {CharSetSort.ToString()}";
 }