diff --git a/BSIPA-ModList/UI/FloatingNotification.cs b/BSIPA-ModList/UI/FloatingNotification.cs index 90141791..d97d09d1 100644 --- a/BSIPA-ModList/UI/FloatingNotification.cs +++ b/BSIPA-ModList/UI/FloatingNotification.cs @@ -50,6 +50,7 @@ namespace BSIPA_ModList.UI StopAllCoroutines(); _showingMessage = true; _headerText.text = message; + _headerText.alignment = TextAlignmentOptions.Left; _loadingBar.enabled = false; _loadingBackg.enabled = false; _canvas.enabled = true; @@ -61,6 +62,7 @@ namespace BSIPA_ModList.UI StopAllCoroutines(); _showingMessage = true; _headerText.text = message; + _headerText.alignment = TextAlignmentOptions.Left; _loadingBar.enabled = false; _loadingBackg.enabled = false; _canvas.enabled = true; @@ -86,6 +88,7 @@ namespace BSIPA_ModList.UI { _showingMessage = false; _headerText.text = HeaderText; + _headerText.alignment = TextAlignmentOptions.Left; _loadingBar.enabled = false; _loadingBackg.enabled = false; _canvas.enabled = true; @@ -95,9 +98,11 @@ namespace BSIPA_ModList.UI private void CheckForUpdatesDone(int count) { if (count == 0) updatesZero = true; + else updatesZero = false; _showingMessage = false; _headerText.text = $"{count} updates found"; + _headerText.alignment = TextAlignmentOptions.Left; _loadingBar.enabled = false; _loadingBackg.enabled = false; _canvas.enabled = true; @@ -127,6 +132,7 @@ namespace BSIPA_ModList.UI StopAllCoroutines(); _showingMessage = false; _headerText.text = "Downloading updates..."; + _headerText.alignment = TextAlignmentOptions.Left; _loadingBar.enabled = false; _loadingBackg.enabled = false; _canvas.enabled = true; @@ -135,13 +141,18 @@ namespace BSIPA_ModList.UI { StopAllCoroutines(); _showingMessage = false; - _headerText.text = "Updates complete"; + _headerText.text = "Update complete. Restart to finish installation."; + _headerText.alignment = TextAlignmentOptions.Center; _loadingBar.enabled = false; _loadingBackg.enabled = false; - StartCoroutine(DisableCanvasRoutine(5f)); } } + internal void Close() + { + StartCoroutine(DisableCanvasRoutine(0f)); + } + private IEnumerator DisableCanvasRoutine(float time) { yield return new WaitForSecondsRealtime(time); @@ -149,7 +160,7 @@ namespace BSIPA_ModList.UI _showingMessage = false; } - private static FloatingNotification instance; + internal static FloatingNotification instance; protected void Awake() { diff --git a/BSIPA-ModList/UI/ViewControllers/DownloadProgressViewController.cs b/BSIPA-ModList/UI/ViewControllers/DownloadProgressViewController.cs index 358784b2..cb60390a 100644 --- a/BSIPA-ModList/UI/ViewControllers/DownloadProgressViewController.cs +++ b/BSIPA-ModList/UI/ViewControllers/DownloadProgressViewController.cs @@ -122,6 +122,9 @@ namespace BSIPA_ModList.UI.ViewControllers { DownloadController.Instance.OnDownloaderListChanged -= Refresh; DownloadController.Instance.OnDownloadStateChanged -= DownloaderStateChanged; + + if (DownloadController.Instance.IsDone) + FloatingNotification.instance.Close(); } private void Refresh()