예제 #1
0
        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();
        }
예제 #2
0
        private void btnView_Click(object sender, EventArgs e)
        {
            var paths = lvwSourceFiles.SelectedItems?.Cast <ListViewItem>().Select(i => i.Text);

            foreach (string path in paths)
            {
                var layoutForm = new frmMapLayout(sourceMaps[path]);
                layoutForm.Show();
            }
        }