7 protected const float FADE_OUT_WAIT_TIME = 2.5;
13 protected bool m_bIsDownloading;
16 override void HandlerAttached(Widget w)
18 super.HandlerAttached(w);
28 if (!m_bIsDownloading)
29 m_Animator.FadeOutInstantly();
32 m_Widgets.m_DownloadButtonComponent.m_OnClicked.Insert(OnButtonClick);
42 override void HandlerDeattached(Widget w)
44 super.HandlerDeattached(w);
46 GetGame().GetCallqueue().Remove(OnFrame);
56 protected void OnFrame(
float tDelta)
66 m_Animator.Update(tDelta);
70 protected void UpdateAllWidgets()
76 string downloadStateText;
77 int nCompleted, nTotal;
78 mgr.GetDownloadQueueState(nCompleted, nTotal);
80 m_bIsDownloading = nTotal > 0;
83 m_Widgets.m_DownloadDoneImage.SetVisible(nTotal == 0);
84 m_Widgets.m_QueueSizeText.SetVisible(m_bIsDownloading);
88 array<ref SCR_WorkshopItemActionDownload> downloadQueue = mgr.GetDownloadQueue();
92 m_Widgets.m_ProgressCircle.SetMaskProgress(progress);
95 string queueSizeText =
string.Format(
"%1", nTotal - nCompleted);
96 m_Widgets.m_QueueSizeText.SetText(queueSizeText);
100 m_Widgets.m_QueueSizeText.SetText(
string.Empty);
101 m_Widgets.m_ProgressCircle.SetMaskProgress(1.0);
104 m_Animator.ForceVisible(m_bIsDownloading);
107 m_Widgets.m_DownloadButtonComponent.SetEnabled(m_bIsDownloading);
111 protected void OnButtonClick()
122 if (!m_bIsDownloading)
123 m_Animator.FadeOutInstantly();
125 menu.m_OnUpdate.Remove(OnFrame);
126 menu.m_OnUpdate.Insert(OnFrame);
135 menu.m_OnUpdate.Remove(OnFrame);