Skip to content

Commit 3d4d9e0

Browse files
committed
fix bug with taskbar progress: switching to marquee style when resetting
1 parent 71076d7 commit 3d4d9e0

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

FlashpointSecurePlayer/ProgressManager.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -467,28 +467,29 @@ public static Form ProgressForm {
467467
private static ProgressBarStyle ProgressFormStyle {
468468
/*
469469
get {
470-
return ProgressManager.progressFormState == TaskbarProgressBarState.Indeterminate ? ProgressBarStyle.Marquee : ProgressBarStyle.Blocks;
470+
return ProgressManager.progressFormState == TBPF.TBPF_INDETERMINATE ? ProgressBarStyle.Marquee : ProgressBarStyle.Blocks;
471471
}
472472
*/
473473

474474
set {
475-
if (ProgressManager.progressFormValue >= PROGRESS_FORM_VALUE_COMPLETE) {
476-
return;
477-
}
478-
479475
if (value != ProgressBarStyle.Marquee) {
480476
ProgressFormValue = ProgressManager.value;
481477
ProgressFormState = ProgressManager.state;
482478
return;
483479
}
484480

485481
// normal state does not take priority over indeterminate state
486-
if (ProgressManager.progressFormState != TBPF.TBPF_NORMAL) {
482+
if (ProgressManager.progressFormState != TBPF.TBPF_NORMAL
483+
&& ProgressManager.progressFormState != TBPF.TBPF_NOPROGRESS) {
487484
return;
488485
}
489486

490487
ProgressManager.progressFormState = TBPF.TBPF_INDETERMINATE;
491488

489+
if (ProgressManager.progressFormValue >= PROGRESS_FORM_VALUE_COMPLETE) {
490+
return;
491+
}
492+
492493
if (ProgressForm == null) {
493494
return;
494495
}
@@ -531,6 +532,7 @@ private static int ProgressFormValue {
531532
} else {
532533
// if we haven't completed, ignore the value in the indeterminate state
533534
if (ProgressManager.progressFormState == TBPF.TBPF_INDETERMINATE) {
535+
ProgressFormStyle = ProgressManager.style;
534536
return;
535537
}
536538
}
@@ -576,10 +578,6 @@ private static IntPtr ProgressFormState {
576578
*/
577579

578580
set {
579-
if (ProgressManager.progressFormValue >= PROGRESS_FORM_VALUE_COMPLETE) {
580-
return;
581-
}
582-
583581
if (value == PBST_ERROR) {
584582
if (ProgressManager.progressFormState == TBPF.TBPF_ERROR) {
585583
return;
@@ -604,6 +602,10 @@ private static IntPtr ProgressFormState {
604602

605603
ProgressManager.progressFormState = TBPF.TBPF_NORMAL;
606604
}
605+
606+
if (ProgressManager.progressFormValue >= PROGRESS_FORM_VALUE_COMPLETE) {
607+
return;
608+
}
607609

608610
if (ProgressForm == null) {
609611
return;

0 commit comments

Comments
 (0)