Fix startup progress bar not working if first item has no cover.
This commit is contained in:
@@ -15,6 +15,7 @@ namespace Cryville.Crtr {
|
||||
SettingsPanel m_settingsPanel;
|
||||
#pragma warning restore IDE0044
|
||||
|
||||
int frameIndex = 2;
|
||||
bool initialized = false;
|
||||
int totalTasks = 0;
|
||||
#pragma warning disable IDE0051
|
||||
@@ -27,7 +28,11 @@ namespace Cryville.Crtr {
|
||||
if (!initialized) {
|
||||
int taskCount = Game.NetworkTaskWorker.TaskCount;
|
||||
if (totalTasks < taskCount) totalTasks = taskCount;
|
||||
m_progressBar.value = 1 - (float)taskCount / totalTasks;
|
||||
if (frameIndex > 0) {
|
||||
frameIndex--;
|
||||
return;
|
||||
}
|
||||
m_progressBar.value = totalTasks == 0 ? 1 : (1 - (float)taskCount / totalTasks);
|
||||
if (taskCount == 0) {
|
||||
initialized = true;
|
||||
m_targetAnimator.SetTrigger("T_Main");
|
||||
|
Reference in New Issue
Block a user