try fixing progress box bugs
This commit is contained in:
parent
f6943cfa0f
commit
6a69022568
|
@ -16,6 +16,7 @@ namespace BizHawk.DiscSystem
|
||||||
public class ProgressReport
|
public class ProgressReport
|
||||||
{
|
{
|
||||||
public string Message;
|
public string Message;
|
||||||
|
public bool InfoPresent;
|
||||||
public double ProgressEstimate;
|
public double ProgressEstimate;
|
||||||
public double ProgressCurrent;
|
public double ProgressCurrent;
|
||||||
public int TaskCount;
|
public int TaskCount;
|
||||||
|
|
|
@ -535,6 +535,9 @@ namespace BizHawk.DiscSystem
|
||||||
progress.TaskCount = 2;
|
progress.TaskCount = 2;
|
||||||
|
|
||||||
progress.Message = "Generating Cue";
|
progress.Message = "Generating Cue";
|
||||||
|
progress.ProgressEstimate = 1;
|
||||||
|
progress.ProgressCurrent = 0;
|
||||||
|
progress.InfoPresent = true;
|
||||||
string cuePath = Path.Combine(directory, baseName + ".cue");
|
string cuePath = Path.Combine(directory, baseName + ".cue");
|
||||||
File.WriteAllText(cuePath, cue);
|
File.WriteAllText(cuePath, cue);
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,6 @@ using System.IO;
|
||||||
//it can handle binpercue
|
//it can handle binpercue
|
||||||
//it seems not to be able to handle binpertrack, or maybe i am doing something wrong (still havent ruled it out)
|
//it seems not to be able to handle binpertrack, or maybe i am doing something wrong (still havent ruled it out)
|
||||||
|
|
||||||
//isobuster -
|
|
||||||
//does not like onebinpertrack images with index 00
|
|
||||||
|
|
||||||
|
|
||||||
namespace BizHawk
|
namespace BizHawk
|
||||||
{
|
{
|
||||||
class DiscoHawk
|
class DiscoHawk
|
||||||
|
|
|
@ -29,8 +29,14 @@ namespace BizHawk
|
||||||
{
|
{
|
||||||
double curr = pr.ProgressCurrent;
|
double curr = pr.ProgressCurrent;
|
||||||
double max = pr.ProgressEstimate;
|
double max = pr.ProgressEstimate;
|
||||||
double value = curr / max * 100;
|
if (pr.InfoPresent)
|
||||||
progressBar1.Value = (int)value;
|
{
|
||||||
|
double value = curr/max*100;
|
||||||
|
int nValue = (int) value;
|
||||||
|
if (nValue < 0 || nValue > 100)
|
||||||
|
nValue = 0;
|
||||||
|
progressBar1.Value = nValue;
|
||||||
|
}
|
||||||
lblMessage.Text = pr.Message;
|
lblMessage.Text = pr.Message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue