From ba8670d5b429374d854fc5b61a8cef24b941ae86 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sun, 21 Apr 2019 23:21:37 -0500 Subject: [PATCH] Adjusted floating notification --- BSIPA-ModList/DownloadController.cs | 6 +++--- BSIPA-ModList/UI/FloatingNotification.cs | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/BSIPA-ModList/DownloadController.cs b/BSIPA-ModList/DownloadController.cs index 12ad9880..b9021817 100644 --- a/BSIPA-ModList/DownloadController.cs +++ b/BSIPA-ModList/DownloadController.cs @@ -148,6 +148,9 @@ namespace BSIPA_ModList if (SelfConfig.SelfConfigRef.Value.Updates.AutoUpdate) StartDownloads(); + + if (downloads.Count == 0) + OnAllDownloadsCompleted(); } public void StartDownloads() @@ -158,9 +161,6 @@ namespace BSIPA_ModList State = States.Downloading; Updater.Instance.StartDownload(downloads.Select(d => d.Mod), _DownloadStart, _DownloadProgress, _DownloadFailed, _DownloadFinished, _InstallFailed, _InstallFinished); - - if (downloads.Count == 0) - OnAllDownloadsCompleted(); } private void _DownloadStart(DependencyObject obj) diff --git a/BSIPA-ModList/UI/FloatingNotification.cs b/BSIPA-ModList/UI/FloatingNotification.cs index 006673bb..90141791 100644 --- a/BSIPA-ModList/UI/FloatingNotification.cs +++ b/BSIPA-ModList/UI/FloatingNotification.cs @@ -90,13 +90,18 @@ namespace BSIPA_ModList.UI _loadingBackg.enabled = false; _canvas.enabled = true; } + + private bool updatesZero = false; private void CheckForUpdatesDone(int count) { + if (count == 0) updatesZero = true; + _showingMessage = false; _headerText.text = $"{count} updates found"; _loadingBar.enabled = false; _loadingBackg.enabled = false; _canvas.enabled = true; + StartCoroutine(DisableCanvasRoutine(5f)); } @@ -126,8 +131,9 @@ namespace BSIPA_ModList.UI _loadingBackg.enabled = false; _canvas.enabled = true; } - if (DownloadController.Instance.IsDone) + if (DownloadController.Instance.IsDone && !updatesZero) { + StopAllCoroutines(); _showingMessage = false; _headerText.text = "Updates complete"; _loadingBar.enabled = false;