9 override void HandlerAttached(Widget w)
15 GetGame().GetCallqueue().CallLater(Update, 50,
true);
21 override void HandlerDeattached(Widget w)
24 GetGame().GetCallqueue().Remove(Update);
43 protected void UpdateAllWidgets()
46 string downloadStateText;
47 int nCompleted, nTotal;
48 mgr.GetDownloadQueueState(nCompleted, nTotal);
50 if (nTotal > 0 && !mgr.GetDownloadsPaused())
51 downloadStateText =
string.Format(
"%1 %2 / %3", WidgetManager.Translate(
"#AR-DownloadManager_State_Downloading"), nCompleted, nTotal);
52 else if (nTotal > 0 && mgr.GetDownloadsPaused())
53 downloadStateText =
string.Format(
"%1 %2 / %3", WidgetManager.Translate(
"#AR-DownloadManager_State_AllDownloadsPaused"), nCompleted, nTotal);
54 else if (mgr.GetDownloadsPaused())
55 downloadStateText =
"#AR-DownloadManager_State_AllDownloadsPaused";
57 downloadStateText =
"#AR-DownloadManager_State_NoActiveDownloads";
59 m_Widgets.m_StateText.SetText(downloadStateText);
65 array<ref SCR_WorkshopItemActionDownload> downloadQueue = mgr.GetDownloadQueue();
69 m_Widgets.m_ProgressBar.SetCurrent(progress);
72 string progressText =
string.Format(
"%1 %%", Math.Floor(progress * 100.0));
73 m_Widgets.m_ProgressText.SetText(progressText);
81 m_Widgets.m_ProgressOverlay.SetVisible(nTotal > 0);