Skip to content

Commit

Permalink
2.4 - Added Manage Replays, Fixed crash
Browse files Browse the repository at this point in the history
- Had to replace DarkUI again. This time it's a repo on my account TcNobo.
- Fixed loop when only 1 user present, breaking program... This was simple and I missed it somehow. #5
- Added Manage Replays to clear replays from users with certain user names. Can save some serious space.
  • Loading branch information
TCNOco committed Sep 27, 2021
1 parent 293affd commit 0d45be6
Show file tree
Hide file tree
Showing 8 changed files with 3,229 additions and 627 deletions.
1,193 changes: 603 additions & 590 deletions osu-cleaner/Form1.Designer.cs

Large diffs are not rendered by default.

66 changes: 38 additions & 28 deletions osu-cleaner/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace osu_cleaner
{
public partial class MainApp : DarkForm
{
private const string _versionNumber = "2.3";
private const string _versionNumber = "2.4";
private readonly ContextMenuStrip _collectionRoundMenuStrip = new ContextMenuStrip();
private long _filesSize;
private long _forRemovalSize;
Expand Down Expand Up @@ -733,36 +733,37 @@ private void FindAccount()
{
SelectUser su = null;

while (true)

var configFiles = new DirectoryInfo(directoryPath.Text).GetFiles("osu!*.cfg");
if (configFiles.Length == 2)
{
var configFiles = new DirectoryInfo(directoryPath.Text).GetFiles("osu!*.cfg");
if (configFiles.Length == 2)
{
_userCfgFile = configFiles[1].Name;
lblCurrentAccount.Text = "Current account: " + _userCfgFile.Substring(5, _userCfgFile.Length - 9);
}
else if (configFiles.Length > 1)
{
_userCfgFile = configFiles[1].Name;
lblCurrentAccount.Text = "Current account: " + _userCfgFile.Substring(5, _userCfgFile.Length - 9);
}
else if (configFiles.Length > 1)
{
while (true)
{
// Notify user as well if auto picked what it will do.
if (su == null) su = new SelectUser(directoryPath.Text)
{
StartPosition = FormStartPosition.CenterScreen
};
var result = su.ShowDialog();

if (result != DialogResult.OK)
{
MessageBox.Show(this, "You need to pick a username!", "No username selected", MessageBoxButtons.OK,
MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
continue;
}
_userCfgFile = su.ReturnedFilename;
lblCurrentAccount.Text = "Current account: " + su.ReturnedUsername;
break;
}
{
StartPosition = FormStartPosition.CenterScreen
};
var result = su.ShowDialog();

FindSongsFolder();
}
if (result != DialogResult.OK)
{
MessageBox.Show(this, "You need to pick a username!", "No username selected", MessageBoxButtons.OK,
MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
continue;
}
_userCfgFile = su.ReturnedFilename;
lblCurrentAccount.Text = "Current account: " + su.ReturnedUsername;
break;
}
}

FindSongsFolder();
}

/// <summary>
Expand Down Expand Up @@ -797,7 +798,16 @@ private void LblCurrentAccount_Click(object sender, EventArgs e)
FindAccount();
}

private void BtnReplaceMissing_Click(object sender, EventArgs e)
private void btnManageReplays_Click(object sender, EventArgs e)
{
var mr = new ManageReplays(directoryPath.Text)
{
StartPosition = FormStartPosition.CenterScreen
};
mr.ShowDialog();
}

private void BtnReplaceMissing_Click(object sender, EventArgs e)
{
FindProgressBar.Show();
_pixelWorker.RunWorkerAsync();
Expand Down
133 changes: 133 additions & 0 deletions osu-cleaner/ManageReplays.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d45be6

Please sign in to comment.