Example #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (configsListView.SelectedIndex == -1)
            {
                MessageBox.Show("No config selected");
                return;
            }

            DialogResult = true;

            selected = Patterns[configsListView.SelectedIndex];

            Close();
        }
Example #2
0
        private void generateBeatmapButton_Click(object sender, RoutedEventArgs e)
        {
            if (!mapSelected())
            {
                MessageBox.Show("You must select .osu file first!");
                return;
            }

            if (difficultyNameTextbox.Text.Length == 0)
            {
                MessageBox.Show("Please enter the difficulty name!");
                return;
            }

            try
            {
                PatternConfiguration config = new PatternConfiguration(difficultyNameTextbox.Text, beatmapStats, Patterns.ToList());
                initializeBeatmap();
                generator.mapContext = (MapContextAwareness)baseContext.Clone();
                Beatmap generatedMap = generator.generateBeatmap(config);

                if (!generatedMap.checkObjectsBounds())
                {
                    MessageBox.Show("WARNING! Some objects were found to be outside of the playfield. Beware.");
                }

                generatedMap.Version = difficultyNameTextbox.Text;
                generatedMap.regenerateFilename();
                generatedMap.Save(generatedMap.Filename);
                MessageBox.Show("Map saved");
            }
            catch (Exception ex)
            {
                MessageBox.Show("My appologies. Something went wrong while constructing the map. The description might help but most likely you chose large spacing for some pattern which the program wasn't able to handle. Please clear the patterns and try again.\n" + ex.ToString());
            }
        }
 public Beatmap generateBeatmap(PatternConfiguration config)
 {
     addPatterns(config.patterns);
     applyBeatmapStats(config.beatmapStats);
     return(generatedMap);
 }