Updater now pops up when updates are failed, completed or need confirmation

This commit is contained in:
2019-01-05 16:32:16 +01:00
parent 50867c16a8
commit 8b24d4660e
3 changed files with 9 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ namespace RothenburgAR
{
public Camera UICamera;
public Camera UIObjectCamera;
private LogFileHandler logFileHandler;
// Use this for initialization
void Start()

View File

@@ -15,6 +15,8 @@ namespace RothenburgAR.UI
private void Start()
{
UIManager.Instance.StartingUp = false;
UpdateDialog.SetActive(true);
UpdateConfirmationDialog.SetActive(false);
UpdateCompletedDialog.SetActive(false);

View File

@@ -28,14 +28,12 @@ namespace RothenburgAR.Updater
public int CurrentProgress { get; private set; }
public int MaxProgress { get; private set; }
private float afterDownloadWaitTime = 10f;
private readonly int retriesUntilFailure = 4;
private readonly string trackerMainFile = "tracker.dat";
public ApiVersioncheckAnswer VersionAnswer { get; set; }
Dictionary<string, List<ApiExhibit>> ExhibitMetas = new Dictionary<string, List<ApiExhibit>>();
private LogFileHandler logFileHandler;
void Start()
{
@@ -82,7 +80,6 @@ namespace RothenburgAR.Updater
if (VersionAnswer.Data.TrueForAll(d => d.Meta.Status == VersionStatus.ok && d.Tracker.Status == VersionStatus.ok))
{
afterDownloadWaitTime = 0f;
StartCoroutine(CheckFiles());
return;
}
@@ -96,6 +93,9 @@ namespace RothenburgAR.Updater
else
{
UpdateState = UpdateState.ConfirmationPending;
if (!UIManager.Instance.StartingUp)
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
}
};
}
@@ -444,13 +444,15 @@ namespace RothenburgAR.Updater
http.Request.responseCode));
UpdateState = UpdateState.Failed;
if (!UIManager.Instance.StartingUp)
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
}
public void UpdatesCompleted()
{
UpdateState = UpdateState.Completed;
//TODO force switch to UpdaterView when update needs to be applied
if (!UIManager.Instance.StartingUp)
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
}