Updater now pops up when updates are failed, completed or need confirmation
This commit is contained in:
@@ -12,6 +12,7 @@ namespace RothenburgAR
|
|||||||
{
|
{
|
||||||
public Camera UICamera;
|
public Camera UICamera;
|
||||||
public Camera UIObjectCamera;
|
public Camera UIObjectCamera;
|
||||||
|
private LogFileHandler logFileHandler;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start()
|
void Start()
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ namespace RothenburgAR.UI
|
|||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
UIManager.Instance.StartingUp = false;
|
||||||
|
|
||||||
UpdateDialog.SetActive(true);
|
UpdateDialog.SetActive(true);
|
||||||
UpdateConfirmationDialog.SetActive(false);
|
UpdateConfirmationDialog.SetActive(false);
|
||||||
UpdateCompletedDialog.SetActive(false);
|
UpdateCompletedDialog.SetActive(false);
|
||||||
|
|||||||
@@ -28,14 +28,12 @@ namespace RothenburgAR.Updater
|
|||||||
public int CurrentProgress { get; private set; }
|
public int CurrentProgress { get; private set; }
|
||||||
public int MaxProgress { get; private set; }
|
public int MaxProgress { get; private set; }
|
||||||
|
|
||||||
private float afterDownloadWaitTime = 10f;
|
|
||||||
private readonly int retriesUntilFailure = 4;
|
private readonly int retriesUntilFailure = 4;
|
||||||
private readonly string trackerMainFile = "tracker.dat";
|
private readonly string trackerMainFile = "tracker.dat";
|
||||||
|
|
||||||
public ApiVersioncheckAnswer VersionAnswer { get; set; }
|
public ApiVersioncheckAnswer VersionAnswer { get; set; }
|
||||||
|
|
||||||
Dictionary<string, List<ApiExhibit>> ExhibitMetas = new Dictionary<string, List<ApiExhibit>>();
|
Dictionary<string, List<ApiExhibit>> ExhibitMetas = new Dictionary<string, List<ApiExhibit>>();
|
||||||
private LogFileHandler logFileHandler;
|
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
@@ -82,7 +80,6 @@ namespace RothenburgAR.Updater
|
|||||||
|
|
||||||
if (VersionAnswer.Data.TrueForAll(d => d.Meta.Status == VersionStatus.ok && d.Tracker.Status == VersionStatus.ok))
|
if (VersionAnswer.Data.TrueForAll(d => d.Meta.Status == VersionStatus.ok && d.Tracker.Status == VersionStatus.ok))
|
||||||
{
|
{
|
||||||
afterDownloadWaitTime = 0f;
|
|
||||||
StartCoroutine(CheckFiles());
|
StartCoroutine(CheckFiles());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -96,6 +93,9 @@ namespace RothenburgAR.Updater
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateState = UpdateState.ConfirmationPending;
|
UpdateState = UpdateState.ConfirmationPending;
|
||||||
|
|
||||||
|
if (!UIManager.Instance.StartingUp)
|
||||||
|
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -444,13 +444,15 @@ namespace RothenburgAR.Updater
|
|||||||
http.Request.responseCode));
|
http.Request.responseCode));
|
||||||
|
|
||||||
UpdateState = UpdateState.Failed;
|
UpdateState = UpdateState.Failed;
|
||||||
|
|
||||||
|
if (!UIManager.Instance.StartingUp)
|
||||||
|
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatesCompleted()
|
public void UpdatesCompleted()
|
||||||
{
|
{
|
||||||
UpdateState = UpdateState.Completed;
|
UpdateState = UpdateState.Completed;
|
||||||
|
|
||||||
//TODO force switch to UpdaterView when update needs to be applied
|
|
||||||
if (!UIManager.Instance.StartingUp)
|
if (!UIManager.Instance.StartingUp)
|
||||||
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
|
UIManager.Instance.SwitchToView(ViewName.UpdaterView);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user