-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Ability to export map sets back to .osz archives
- Loading branch information
Showing
12 changed files
with
374 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace GuiComponents.Interfaces | ||
{ | ||
public interface IProgressForm : IForm | ||
{ | ||
event EventHandler AbortClicked; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using GuiComponents.Forms; | ||
using GuiComponents.Interfaces; | ||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace GuiComponents | ||
{ | ||
public partial class ProgressForm : BaseForm, IProgressForm | ||
{ | ||
public event EventHandler AbortClicked; | ||
public ProgressForm() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private const int CP_NOCLOSE_BUTTON = 0x200; | ||
protected override CreateParams CreateParams | ||
{ | ||
get | ||
{ | ||
CreateParams myCp = base.CreateParams; | ||
myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON; | ||
return myCp; | ||
} | ||
} | ||
internal static IProgressForm ShowDialog(Progress<string> userProgressMessage, Progress<int> completionPercentage) | ||
{ | ||
var form = new ProgressForm(); | ||
userProgressMessage.ProgressChanged += (_, message) => form.label_text.Text = message; | ||
completionPercentage.ProgressChanged += form.CompletionPercentage_ProgressChanged; | ||
form.button_cancel.Click += (_, __) => form.AbortClicked?.Invoke(form, EventArgs.Empty); | ||
|
||
form.Text = $"Collection Manager - Beatmap Export"; | ||
return form; | ||
} | ||
|
||
private void CompletionPercentage_ProgressChanged(object sender, int percentage) | ||
{ | ||
progressBar1.Value = percentage; | ||
if (percentage == progressBar1.Maximum) | ||
button_cancel.Text = "Close"; | ||
} | ||
} | ||
} |
Oops, something went wrong.