1
0
mirror of https://github.com/SirusDoma/VoxCharger.git synced 2024-11-24 15:10:14 +01:00
VoxCharger/Sources/Forms/MixSelectorForm.cs
CXO2 b8f49e3e2d Update 0.9.12c
- Fix naming and other code style issues
- Fix `float` and `double` parsing issue when current System Culture comma separator is not `.` - This fixes issue when parsing BPM and other floating numbers.
- Fix song selection when the program doesn't support the latest datecode in the future - It will disable Game Version and Infinite Version selection.
- Replaced ancient `FolderBrowserDialog` with `CommonFileDialog`
- Update default GameVersion and BackgroundId to latest version
- Implement Radar information in `LevelEditorForm`
- Implement built-in 2DX Encoder
- Start Offset / TimeStamp and Fader effect for audio preview is now supported
- Audio preview files is no longer divided into multiple files by default when audio files are unique. It still possible to specify unique preview via `LevelEditorForm`
- Implement advanced configuration when importing .ksh chart
- Add draft codes for Effect Mapping configurations and S3V support
- Other Bugfixes and QoL improvements
2023-01-06 20:59:21 +07:00

85 lines
2.7 KiB
C#

using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace VoxCharger
{
public partial class MixSelectorForm : Form
{
public int ExpandedHeight = 165;
public int CollapsedHeight = 140;
public MixSelectorForm(bool createMode = false)
{
InitializeComponent();
if (createMode)
{
Text = "Create Mix";
MixSelectorDropDown.SelectedIndex = 0;
NameTextBox.Location = MixSelectorDropDown.Location;
MixSelectorDropDown.Visible = MixSelectorDropDown.Enabled = false;
ModSelectorLabel.Text = "Enter mix name:";
Size = new Size(Size.Width, CollapsedHeight);
}
}
private void OnModSelectorFormLoad(object sender, EventArgs e)
{
foreach (string mix in AssetManager.GetMixes())
MixSelectorDropDown.Items.Add(mix);
}
private void OnModSelectorDropDownSelectedIndexChanged(object sender, EventArgs e)
{
if (MixSelectorDropDown.SelectedIndex == 0)
Size = new Size(Size.Width, ExpandedHeight);
else
Size = new Size(Size.Width, CollapsedHeight);
NameTextBox.Visible = MixSelectorDropDown.SelectedIndex == 0;
ContinueButton.Enabled = true;
}
private void OnContinueButtonClick(object sender, EventArgs e)
{
if (MixSelectorDropDown.SelectedIndex == 0)
{
if (string.IsNullOrEmpty(NameTextBox.Text))
{
MessageBox.Show(
"Mix name cannot be empty",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Warning
);
return;
}
else if (AssetManager.GetMixes().Contains(NameTextBox.Text) || NameTextBox.Text.ToLower() == "original")
{
MessageBox.Show(
"Mix name is already exists",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Warning
);
return;
}
AssetManager.CreateMix(NameTextBox.Text);
}
else if (MixSelectorDropDown.SelectedIndex == 1)
AssetManager.LoadMix(string.Empty);
else
AssetManager.LoadMix(MixSelectorDropDown.SelectedItem.ToString());
DialogResult = DialogResult.OK;
Close();
}
}
}