private void btnGenerate_Click(object sender, EventArgs e) { if (lvwSourceFiles.Items.Count == 0) { MessageBox.Show("No source files are specified", Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } // Create mixer MapMixer mixer; if (radOrdered.Checked) { mixer = new OrderedMapMixer(sourceMaps.Values); } else if (radShuffled.Checked) { mixer = new ShuffledMapMixer(sourceMaps.Values); } else { MessageBox.Show("Unknown map mixing mode", Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } // Get mixing parameters var mixParams = new MapMixParams() { // Intelligence RemoveTrappedPlayerStarts = chkRemTrapPlay.Checked, TranslateCommonCOG = chkTranslateCOG.Checked, KeepEventTagLinks = chkKeepEventTag.Checked, KeepWorldConnections = chkKeepWorldCons.Checked, ExpandPortals = chkExpandPortals.Checked, // Probabilities SolidProb = (double)numSolid.Value / 100.0, SemiSolidProb = (double)numSemiSolid.Value / 100.0, NonSolidProb = (double)numNonSolid.Value / 100.0, SubtractProb = (double)numSubtract.Value / 100.0, MoverProb = (double)numMover.Value / 100.0, LightProb = (double)numLight.Value / 100.0, OtherProb = (double)numOther.Value / 100.0, // Excluded actors ExcludeInvisible = chkExInvis.Checked, ExcludePortal = chkExPortal.Checked, ExcludeZoneInfo = chkExZoneInfo.Checked, ExcludeMore = chkExMore.Checked, ExcludeMoreNames = txtExcludeActors.Lines.Where(s => s.Length != 0), // Source map-specific parameters MapOffsets = new Dictionary <string, Vector3D>() }; // Show layout form (responsible for starting and saving the mix) var layoutForm = new frmMapLayout(mixer, mixParams); layoutForm.Show(); }
public frmMapLayout(MapMixer mixer, MapMixParams mixParams) { // We are mixing into a new map InitializeComponent(); sourceMaps = mixer.Maps.ToArray(); this.mixer = mixer; this.mixParams = mixParams; // Perform mix Mix(); // Update controls Text = "Mixed Map - Layout Top View"; cmbSourceMap.Items.AddRange(sourceMaps.Select(m => Path.GetFileName(m.FilePath)).ToArray()); cmbSourceMap.SelectedIndex = 0; UpdateSourceMapControls(); FinalInit(); }