6 protected string m_sProgressWidgetName;
9 protected string m_sInitLoadingWidgetName;
12 protected string m_sLoadingWidgetName;
15 protected string m_sBlurName;
18 protected string m_sAutoInitName;
20 [
Attribute(
"0.4",
desc:
"When the actual charging starts. This should be after ping is evaluated. Thinging this value also means changing the process min of m_RadialProcessBar and the Ping input!")]
21 protected float m_fChargeThreshold;
24 protected MenuManager m_MenuManager;
25 protected Widget m_Widget;
26 protected Widget m_Blur;
27 protected Widget m_AutoInit;
28 protected Widget m_ProgressWidget;
34 protected bool m_bCharging;
37 protected void ChargeStart()
43 m_Blur.SetVisible(
true);
45 if (m_Widget.IsVisible())
48 m_Widget.SetVisible(
true);
49 m_RadialProcessBar.FadeImage(
true);
50 m_ProgressWidget.SetVisible(
true);
51 m_LoadingWidget.GetFadeWidget().SetVisible(
false);
55 protected void ChargeFail()
58 m_Blur.SetVisible(
false);
60 if (m_RadialProcessBar.GetProgress() == m_RadialProcessBar.GetMaxProgress() || m_RadialProcessBar.GetProgress() <= m_RadialProcessBar.GetMinProgress())
63 m_RadialProcessBar.InstantProgressMaxMin(
false);
64 m_Widget.SetVisible(
false);
68 protected void WaitStart()
72 mode.GetInfo().SetIconTo(m_RadialProcessBar.GetFadeImage());
74 if (!m_Widget.IsVisible())
77 m_Blur.SetVisible(
true);
78 m_Widget.SetVisible(
true);
79 m_RadialProcessBar.InstantProgressMaxMin(
false);
80 m_RadialProcessBar.FadeImage(
true);
82 m_LoadingWidget.FadeIn();
86 m_InitLoadingWidget.FadeIn();
90 protected void WaitEnd()
92 m_RadialProcessBar.SetProgress(m_RadialProcessBar.GetMinProgress());
94 if (m_AutoInit.IsVisible())
96 AnimateWidget.Opacity(m_AutoInit, 0,
UIConstants.FADE_RATE_SUPER_SLOW);
98 if (m_InitLoadingWidget)
99 m_InitLoadingWidget.FadeOut(
true);
102 m_Blur.SetVisible(
false);
103 m_LoadingWidget.FadeOut(
false);
109 if (!m_bCharging && !isFadeIn)
111 m_RadialProcessBar.InstantProgressMaxMin(
false);
112 m_Widget.SetVisible(
false);
117 protected void OnEditorToggleValue(
float value, EActionTrigger reason)
140 else if (value < m_fChargeThreshold)
148 m_RadialProcessBar.SetProgress(value);
152 protected void OnEditorToggleDone()
162 protected void OnRequest()
168 protected void OnRequestEnd()
175 protected void OnAsyncLoad(
float progress)
184 override void HandlerAttached(Widget w)
193 InputManager inputManager =
GetGame().GetInputManager();
197 m_ProgressWidget = w.FindWidget(m_sProgressWidgetName);
198 if (!m_ProgressWidget)
200 Print(
string.Format(
"ProgressBarWidget '%1' not found!", m_sProgressWidgetName), LogLevel.WARNING);
205 if (!m_RadialProcessBar)
208 m_RadialProcessBar.GetOnFadeDone().Insert(OnRadialProgressFadeDone);
210 m_Blur = w.FindWidget(m_sBlurName);
211 m_AutoInit = w.FindWidget(m_sAutoInitName);
212 m_AutoInit.SetVisible(
false);
214 Widget loadingWidget = w.FindAnyWidget(m_sLoadingWidgetName);
216 m_LoadingWidget.GetFadeWidget().SetVisible(
false);
218 Widget initLoadingWidget = w.FindAnyWidget(m_sInitLoadingWidgetName);
222 m_Widget.SetVisible(
false);
229 inputManager.AddActionListener(
"EditorToggle", EActionTrigger.VALUE, OnEditorToggleValue);
230 inputManager.AddActionListener(
"EditorToggle", EActionTrigger.UP, OnEditorToggleDone);
236 override void HandlerDeattached(Widget w)
246 InputManager inputManager =
GetGame().GetInputManager();
249 inputManager.RemoveActionListener(
"EditorToggle", EActionTrigger.VALUE, OnEditorToggleValue);
250 inputManager.RemoveActionListener(
"EditorToggle", EActionTrigger.UP, OnEditorToggleDone);
254 if (m_RadialProcessBar)
255 m_RadialProcessBar.GetOnFadeDone().Remove(OnRadialProgressFadeDone);