3 protected ImageWidget m_wScrenEffectColor;
4 protected ImageWidget m_wScrenEffectVignette;
5 protected BlurWidget m_wBlurEffect;
6 protected WidgetAnimationBase m_WidgetAnimation;
8 protected const float DURATION_IN_ALPHA = 0.5;
9 protected const float DURATION_IN_BLUR = 0.75;
10 protected const float DURATION_OUT_ALPHA = 0.5;
11 protected const float DURATION_OUT_BLUR = 0.5;
13 protected const float VALUE_ALPHA = 0.5;
14 protected const float VALUE_BLUR = 0.8;
15 protected const float VALUE_DISABLED = 0.0;
18 override protected void HandlerAttached(Widget w)
20 m_wScrenEffectColor = ImageWidget.Cast(w.FindAnyWidget(
"ScreenEffectColor"));
21 m_wScrenEffectVignette = ImageWidget.Cast(w.FindAnyWidget(
"ScreenEffectVignette"));
22 m_wBlurEffect = BlurWidget.Cast(w.FindAnyWidget(
"ScreenEffectBlur"));
24 SCR_CampaignBuildingEditorComponent CampaignBuildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
25 if (!CampaignBuildingEditorComponent)
28 CampaignBuildingEditorComponent.GetOnObstructionEventTriggered().Insert(AreaTriggerChange);
34 void AreaTriggerChange(
bool activated)
37 StartObstructionAnimation();
39 FinishObstructionAnimation();
44 void StartObstructionAnimation()
46 m_WidgetAnimation = AnimateWidget.AlphaMask(m_wScrenEffectVignette, VALUE_ALPHA, DURATION_IN_ALPHA);
47 m_WidgetAnimation.SetCurve(EAnimationCurve.EASE_OUT_CUBIC);
54 void FinishObstructionAnimation()
56 m_WidgetAnimation = AnimateWidget.AlphaMask(m_wScrenEffectVignette, VALUE_DISABLED, DURATION_OUT_ALPHA);
57 m_WidgetAnimation.SetCurve(EAnimationCurve.EASE_IN_OUT_CUBIC);