public MapInfo(MapCombine form, int mapnum) { if (mapnum < 0) { return; } if (mapnum == 0) { Index = (int)form.numericUpDownIndex0.Value; Width = (int)Math.Max(form.numericUpDownWidth1.Value + form.numericUpDownWidth3.Value, form.numericUpDownWidth2.Value + form.numericUpDownWidth4.Value); Height = (int)Math.Max(form.numericUpDownHeight1.Value + form.numericUpDownHeight3.Value, form.numericUpDownHeight2.Value + form.numericUpDownHeight4.Value); CopyMap = form.checkBoxMap1.Checked | form.checkBoxMap2.Checked | form.checkBoxMap3.Checked | form.checkBoxMap4.Checked; CopyStatics = form.checkBoxStatics1.Checked | form.checkBoxStatics2.Checked | form.checkBoxStatics3.Checked | form.checkBoxStatics4.Checked; } else { CheckBox checkBoxMap = (mapnum == 1) ? form.checkBoxMap1 : (mapnum == 2) ? form.checkBoxMap2 : (mapnum == 3) ? form.checkBoxMap3 : (mapnum == 4) ? form.checkBoxMap4 : null; CheckBox checkBoxStatics = (mapnum == 1) ? form.checkBoxStatics1 : (mapnum == 2) ? form.checkBoxStatics2 : (mapnum == 3) ? form.checkBoxStatics3 : (mapnum == 4) ? form.checkBoxStatics4 : null; NumericUpDown numericUpDownWidth = (mapnum == 1) ? form.numericUpDownWidth1 : (mapnum == 2) ? form.numericUpDownWidth2 : (mapnum == 3) ? form.numericUpDownWidth3 : (mapnum == 4) ? form.numericUpDownWidth4 : null; NumericUpDown numericUpDownHeight = (mapnum == 1) ? form.numericUpDownHeight1 : (mapnum == 2) ? form.numericUpDownHeight2 : (mapnum == 3) ? form.numericUpDownHeight3 : (mapnum == 4) ? form.numericUpDownHeight4 : null; NumericUpDown numericUpDownAlt = (mapnum == 1) ? form.numericUpDownAlt1 : (mapnum == 2) ? form.numericUpDownAlt2 : (mapnum == 3) ? form.numericUpDownAlt3 : (mapnum == 4) ? form.numericUpDownAlt4 : null; if (checkBoxMap == null || checkBoxStatics == null || numericUpDownWidth == null || numericUpDownHeight == null || numericUpDownAlt == null) { throw new NullReferenceException(); } CopyMap = checkBoxMap.Checked; CopyStatics = checkBoxStatics.Checked; Width = (int)numericUpDownWidth.Value; Height = (int)numericUpDownHeight.Value; Alt = (int)numericUpDownAlt.Value; } TextBox textBox = (mapnum == 0) ? form.textBoxPath0 : (mapnum == 1) ? form.textBoxPath1 : (mapnum == 2) ? form.textBoxPath2 : (mapnum == 3) ? form.textBoxPath3 : (mapnum == 4) ? form.textBoxPath4 : null; if (textBox == null) { throw new NullReferenceException(); } if (!String.IsNullOrEmpty(textBox.Text)) { FilesPaths = textBox.Text; } else { CopyMap = CopyStatics = false; Width = Height = Alt = 0; return; } }
public MapInfo(MapCombine form, int mapnum) { if (mapnum < 0) return; if (mapnum == 0) { Index = (int)form.numericUpDownIndex0.Value; Width = (int) Math.Max(form.numericUpDownWidth1.Value + form.numericUpDownWidth3.Value, form.numericUpDownWidth2.Value + form.numericUpDownWidth4.Value); Height = (int) Math.Max(form.numericUpDownHeight1.Value + form.numericUpDownHeight3.Value, form.numericUpDownHeight2.Value + form.numericUpDownHeight4.Value); CopyMap = form.checkBoxMap1.Checked | form.checkBoxMap2.Checked | form.checkBoxMap3.Checked | form.checkBoxMap4.Checked; CopyStatics = form.checkBoxStatics1.Checked | form.checkBoxStatics2.Checked | form.checkBoxStatics3.Checked | form.checkBoxStatics4.Checked; } else { CheckBox checkBoxMap = (mapnum == 1) ? form.checkBoxMap1 : (mapnum == 2) ? form.checkBoxMap2 : (mapnum == 3) ? form.checkBoxMap3 : (mapnum == 4) ? form.checkBoxMap4 : null; CheckBox checkBoxStatics = (mapnum == 1) ? form.checkBoxStatics1 : (mapnum == 2) ? form.checkBoxStatics2 : (mapnum == 3) ? form.checkBoxStatics3 : (mapnum == 4) ? form.checkBoxStatics4 : null; NumericUpDown numericUpDownWidth = (mapnum == 1) ? form.numericUpDownWidth1 : (mapnum == 2) ? form.numericUpDownWidth2 : (mapnum == 3) ? form.numericUpDownWidth3 : (mapnum == 4) ? form.numericUpDownWidth4 : null; NumericUpDown numericUpDownHeight = (mapnum == 1) ? form.numericUpDownHeight1 : (mapnum == 2) ? form.numericUpDownHeight2 : (mapnum == 3) ? form.numericUpDownHeight3 : (mapnum == 4) ? form.numericUpDownHeight4 : null; NumericUpDown numericUpDownAlt = (mapnum == 1) ? form.numericUpDownAlt1 : (mapnum == 2) ? form.numericUpDownAlt2 : (mapnum == 3) ? form.numericUpDownAlt3 : (mapnum == 4) ? form.numericUpDownAlt4 : null; if (checkBoxMap == null || checkBoxStatics == null || numericUpDownWidth == null || numericUpDownHeight == null || numericUpDownAlt == null) throw new NullReferenceException(); CopyMap = checkBoxMap.Checked; CopyStatics = checkBoxStatics.Checked; Width = (int) numericUpDownWidth.Value; Height = (int) numericUpDownHeight.Value; Alt = (int) numericUpDownAlt.Value; } TextBox textBox = (mapnum == 0) ? form.textBoxPath0 : (mapnum == 1) ? form.textBoxPath1 : (mapnum == 2) ? form.textBoxPath2 : (mapnum == 3) ? form.textBoxPath3 : (mapnum == 4) ? form.textBoxPath4 : null; if (textBox == null) throw new NullReferenceException(); if (!String.IsNullOrEmpty(textBox.Text)) FilesPaths = textBox.Text; else { CopyMap = CopyStatics = false; Width = Height = Alt = 0; return; } }
private void OnClickCombine(object sender, EventArgs e) { if ((showformMapCombine == null) || (showformMapCombine.IsDisposed)) { showformMapCombine = new MapCombine(currmap); showformMapCombine.TopMost = true; showformMapCombine.Show(); } }