void EditShowUnitFlagsButton_Click(object sender, EventArgs e) { CreatureEdit.UnitFlags unit_flags = new CreatureEdit.UnitFlags(Convert.ToInt32(EditBox_unit_flags.Text)); if (unit_flags.ShowDialog() == DialogResult.OK) { EditBox_unit_flags.Text = unit_flags.ToString(); } }
void LocationUnitFlagsButton_Click(object sender, EventArgs e) { if (LocationDataGrid.SelectedCells.Count == 0) { MessageBox.Show("Error: Row is not selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { int current_flags = 0; if (LocationDataGrid.Rows[LocationDataGrid.CurrentCell.RowIndex].Cells[18].Value != null) { current_flags = Convert.ToInt32(LocationDataGrid.Rows[LocationDataGrid.CurrentCell.RowIndex].Cells[18].Value.ToString()); } CreatureEdit.UnitFlags unit_flags = new CreatureEdit.UnitFlags(current_flags); if (unit_flags.ShowDialog() == DialogResult.OK) { LocationDataGrid.Rows[LocationDataGrid.CurrentCell.RowIndex].Cells[18].Value = unit_flags.ToString(); } } }