Browse Source

Adjusted floating notification

pull/11/head
Anairkoen Schno 5 years ago
parent
commit
ba8670d5b4
2 changed files with 10 additions and 4 deletions
  1. +3
    -3
      BSIPA-ModList/DownloadController.cs
  2. +7
    -1
      BSIPA-ModList/UI/FloatingNotification.cs

+ 3
- 3
BSIPA-ModList/DownloadController.cs View File

@ -148,6 +148,9 @@ namespace BSIPA_ModList
if (SelfConfig.SelfConfigRef.Value.Updates.AutoUpdate) if (SelfConfig.SelfConfigRef.Value.Updates.AutoUpdate)
StartDownloads(); StartDownloads();
if (downloads.Count == 0)
OnAllDownloadsCompleted();
} }
public void StartDownloads() public void StartDownloads()
@ -158,9 +161,6 @@ namespace BSIPA_ModList
State = States.Downloading; State = States.Downloading;
Updater.Instance.StartDownload(downloads.Select(d => d.Mod), _DownloadStart, _DownloadProgress, Updater.Instance.StartDownload(downloads.Select(d => d.Mod), _DownloadStart, _DownloadProgress,
_DownloadFailed, _DownloadFinished, _InstallFailed, _InstallFinished); _DownloadFailed, _DownloadFinished, _InstallFailed, _InstallFinished);
if (downloads.Count == 0)
OnAllDownloadsCompleted();
} }
private void _DownloadStart(DependencyObject obj) private void _DownloadStart(DependencyObject obj)


+ 7
- 1
BSIPA-ModList/UI/FloatingNotification.cs View File

@ -90,13 +90,18 @@ namespace BSIPA_ModList.UI
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
} }
private bool updatesZero = false;
private void CheckForUpdatesDone(int count) private void CheckForUpdatesDone(int count)
{ {
if (count == 0) updatesZero = true;
_showingMessage = false; _showingMessage = false;
_headerText.text = $"{count} updates found"; _headerText.text = $"{count} updates found";
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
StartCoroutine(DisableCanvasRoutine(5f)); StartCoroutine(DisableCanvasRoutine(5f));
} }
@ -126,8 +131,9 @@ namespace BSIPA_ModList.UI
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
} }
if (DownloadController.Instance.IsDone)
if (DownloadController.Instance.IsDone && !updatesZero)
{ {
StopAllCoroutines();
_showingMessage = false; _showingMessage = false;
_headerText.text = "Updates complete"; _headerText.text = "Updates complete";
_loadingBar.enabled = false; _loadingBar.enabled = false;


Loading…
Cancel
Save