1
0
mirror of https://github.com/SirusDoma/VoxCharger.git synced 2024-11-23 22:51:01 +01:00
VoxCharger/Sources/Forms/LoadingForm.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

70 lines
1.6 KiB
C#

using System;
using System.Windows.Forms;
namespace VoxCharger
{
public partial class LoadingForm : Form
{
private Action<LoadingForm> _action;
private bool _completed = false;
public LoadingForm()
{
InitializeComponent();
}
private void OnLoadingForm(object sender, EventArgs e)
{
}
private void OnLoadingFormShown(object sender, EventArgs e)
{
this._action(this);
}
public void SetAction(Action<LoadingForm> action)
{
this._action = action;
}
public void SetStatus(string text)
{
if (StatusLabel.InvokeRequired)
{
StatusLabel.Invoke(new Action(() => SetStatus(text)));
return;
}
StatusLabel.Text = text;
StatusLabel.Update();
}
public void SetProgress(float percentage)
{
if (ProgressBar.InvokeRequired)
{
ProgressBar.Invoke(new Action<float>(SetProgress), percentage);
return;
}
percentage = percentage > 100f ? 100f : percentage < 0f ? 0f : percentage;
ProgressBar.Value = (int)percentage;
ProgressBar.Update();
}
public void Complete()
{
_completed = true;
if (InvokeRequired)
Invoke(new Action(Close));
else
Close();
}
private void OnLoadingFormFormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = !_completed;
}
}
}