-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
63 lines (55 loc) · 1.66 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.IO;
using System.Windows.Forms;
namespace osu_8K_to_7K_Converter
{
public partial class Form1 : Form
{
private string[] filePaths;
public Form1()
{
InitializeComponent();
openfd.FileName = "";
openfd.Filter = ".osu files|*.osu";
openfd.Multiselect = true;
textBox.Text = string.Empty;
}
private void convertKeysounds_CheckedChanged(object sender, EventArgs e)
{
if (this.convertKeysounds.Checked)
{
Converter.convertSounds = true;
}
}
private void browseButton_Click(object sender, EventArgs e)
{
openfd.ShowDialog();
textBox.Text = openfd.FileName;
filePaths = openfd.FileNames;
}
private void convertButton_Click(object sender, EventArgs e)
{
if (textBox.Text == string.Empty)
{
MessageBox.Show("You need to select a file!");
return;
}
foreach (string file in filePaths)
{
if (Path.GetExtension(file) != ".osu")
{
MessageBox.Show($"Can't convert: {file}");
}
else
{
Converter.Convert(file);
}
}
MessageBox.Show("Done!");
}
private void githubLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://github.com/sxturndev/mania-8K-to-7K-Converter/");
}
}
}