Ejemplo n.º 1
0
        private void savePlusConfigButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog selectConfigDialogue = new OpenFileDialog();

            selectConfigDialogue.Filter      = "osu!oABC|*.xml";
            selectConfigDialogue.Multiselect = false;

            if (selectConfigDialogue.ShowDialog() ?? true)
            {
                var storage        = ConfigStorage.readFromFile(selectConfigDialogue.FileName);
                var existingConfig = storage.configs.FindIndex((x) => x.name == difficultyNameTextbox.Text);
                if (existingConfig != -1)
                {
                    MessageBoxResult dialogResult = MessageBox.Show("There is already a config with the name " + difficultyNameTextbox.Text + "\nDo you want to override it?", "Override warning!", MessageBoxButton.YesNo);
                    if (dialogResult == MessageBoxResult.Yes)
                    {
                        storage.configs[existingConfig] = new PatternConfiguration(difficultyNameTextbox.Text, beatmapStats, Patterns.ToList());
                    }
                    else if (dialogResult == MessageBoxResult.No)
                    {
                        return;
                    }
                }
                else
                {
                    storage.configs.Add(new PatternConfiguration(difficultyNameTextbox.Text, beatmapStats, Patterns.ToList()));
                }
                ConfigStorage.saveToFile(selectConfigDialogue.FileName, storage);
                MessageBox.Show("Configuration saved!");
            }
        }
Ejemplo n.º 2
0
        private void saveConfigButton_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialogue = new SaveFileDialog();

            saveFileDialogue.Filter = "osu!oABC config|*.xml";

            if (saveFileDialogue.ShowDialog() ?? true)
            {
                var storage = new ConfigStorage();
                storage.configs.Add(new PatternConfiguration(difficultyNameTextbox.Text, beatmapStats, Patterns.ToList()));
                ConfigStorage.saveToFile(saveFileDialogue.FileName, storage);
                MessageBox.Show("Configuration saved!");
            }
        }