Browse Source

Added message telling users to restart to update

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
ef78cad1e9
2 changed files with 17 additions and 3 deletions
  1. +14
    -3
      BSIPA-ModList/UI/FloatingNotification.cs
  2. +3
    -0
      BSIPA-ModList/UI/ViewControllers/DownloadProgressViewController.cs

+ 14
- 3
BSIPA-ModList/UI/FloatingNotification.cs View File

@ -50,6 +50,7 @@ namespace BSIPA_ModList.UI
StopAllCoroutines(); StopAllCoroutines();
_showingMessage = true; _showingMessage = true;
_headerText.text = message; _headerText.text = message;
_headerText.alignment = TextAlignmentOptions.Left;
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
@ -61,6 +62,7 @@ namespace BSIPA_ModList.UI
StopAllCoroutines(); StopAllCoroutines();
_showingMessage = true; _showingMessage = true;
_headerText.text = message; _headerText.text = message;
_headerText.alignment = TextAlignmentOptions.Left;
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
@ -86,6 +88,7 @@ namespace BSIPA_ModList.UI
{ {
_showingMessage = false; _showingMessage = false;
_headerText.text = HeaderText; _headerText.text = HeaderText;
_headerText.alignment = TextAlignmentOptions.Left;
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
@ -95,9 +98,11 @@ namespace BSIPA_ModList.UI
private void CheckForUpdatesDone(int count) private void CheckForUpdatesDone(int count)
{ {
if (count == 0) updatesZero = true; if (count == 0) updatesZero = true;
else updatesZero = false;
_showingMessage = false; _showingMessage = false;
_headerText.text = $"{count} updates found"; _headerText.text = $"{count} updates found";
_headerText.alignment = TextAlignmentOptions.Left;
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
@ -127,6 +132,7 @@ namespace BSIPA_ModList.UI
StopAllCoroutines(); StopAllCoroutines();
_showingMessage = false; _showingMessage = false;
_headerText.text = "Downloading updates..."; _headerText.text = "Downloading updates...";
_headerText.alignment = TextAlignmentOptions.Left;
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
_canvas.enabled = true; _canvas.enabled = true;
@ -135,13 +141,18 @@ namespace BSIPA_ModList.UI
{ {
StopAllCoroutines(); StopAllCoroutines();
_showingMessage = false; _showingMessage = false;
_headerText.text = "Updates complete";
_headerText.text = "Update complete. Restart to finish installation.";
_headerText.alignment = TextAlignmentOptions.Center;
_loadingBar.enabled = false; _loadingBar.enabled = false;
_loadingBackg.enabled = false; _loadingBackg.enabled = false;
StartCoroutine(DisableCanvasRoutine(5f));
} }
} }
internal void Close()
{
StartCoroutine(DisableCanvasRoutine(0f));
}
private IEnumerator DisableCanvasRoutine(float time) private IEnumerator DisableCanvasRoutine(float time)
{ {
yield return new WaitForSecondsRealtime(time); yield return new WaitForSecondsRealtime(time);
@ -149,7 +160,7 @@ namespace BSIPA_ModList.UI
_showingMessage = false; _showingMessage = false;
} }
private static FloatingNotification instance;
internal static FloatingNotification instance;
protected void Awake() protected void Awake()
{ {


+ 3
- 0
BSIPA-ModList/UI/ViewControllers/DownloadProgressViewController.cs View File

@ -122,6 +122,9 @@ namespace BSIPA_ModList.UI.ViewControllers
{ {
DownloadController.Instance.OnDownloaderListChanged -= Refresh; DownloadController.Instance.OnDownloaderListChanged -= Refresh;
DownloadController.Instance.OnDownloadStateChanged -= DownloaderStateChanged; DownloadController.Instance.OnDownloadStateChanged -= DownloaderStateChanged;
if (DownloadController.Instance.IsDone)
FloatingNotification.instance.Close();
} }
private void Refresh() private void Refresh()


Loading…
Cancel
Save