Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SnackBarController.c
Go to the documentation of this file.
2{
4
5 [Attribute(UIColors.GetColorAttribute(UIColors.NEUTRAL_ACTIVE_STANDBY), UIWidgets.ColorPicker)]
6 protected ref Color m_IconColor;
7
8 [Attribute(UIColors.GetColorAttribute(UIColors.NEUTRAL_ACTIVE_STANDBY), UIWidgets.ColorPicker)]
9 protected ref Color m_TextColor;
10
11 [Attribute(UIColors.GetColorAttribute(UIColors.DARK_GREY), UIWidgets.ColorPicker)]
12 protected ref Color m_BackgroundColor;
13
14 [Attribute("0.2", UIWidgets.Slider, params: "0 10 0.1")]
16
17 [Attribute("0.6", UIWidgets.Slider, params: "0 10 0.1")]
18 protected float m_fSnackBarFadeInSpeed;
19
20 [Attribute("0.3", UIWidgets.Slider, params: "0 10 0.1")]
21 protected float m_fSnackBarFadeOutSpeed;
22
23 //------------------------------------------------------------------------------------------------
24 override void HandlerAttached(Widget w)
25 {
26 super.HandlerAttached(w);
27
28 m_Widgets.Init(w);
29
30 // Defaults
32
33 m_wRoot.SetVisible(false);
34 m_wRoot.SetOpacity(0);
35 }
36
37 //------------------------------------------------------------------------------------------------
38 protected float GetFadeInSpeed()
39 {
40 return 1 / m_fSnackBarFadeInSpeed;
41 }
42
43 //------------------------------------------------------------------------------------------------
44 protected float GetColorFadeInSpeed()
45 {
46 return 1 / m_fSnackBarFadeInSpeed;
47 }
48
49 //------------------------------------------------------------------------------------------------
50 protected float GetFadeOutSpeed()
51 {
52 return 1 / m_fSnackBarFadeOutSpeed;
53 }
54
55 //------------------------------------------------------------------------------------------------
56 void SetVisibility(bool show)
57 {
59 m_wRoot.SetVisible(show);
60 }
61
62 //------------------------------------------------------------------------------------------------
64 {
67
68 m_Widgets.m_wSnackBarBackgroundImgLeft.SetColor(UIColors.DARK_SAGE);
69 m_Widgets.m_wSnackBarBackgroundImgMid.SetColor(UIColors.DARK_SAGE);
70 m_Widgets.m_wSnackBarBackgroundImgRight.SetColor(UIColors.DARK_SAGE);
71
72 AnimateWidget.Color(m_Widgets.m_wSnackBarBackgroundImgLeft, m_BackgroundColor, GetColorFadeInSpeed());
73 AnimateWidget.Color(m_Widgets.m_wSnackBarBackgroundImgMid, m_BackgroundColor, GetColorFadeInSpeed());
74 AnimateWidget.Color(m_Widgets.m_wSnackBarBackgroundImgRight, m_BackgroundColor, GetColorFadeInSpeed());
75 }
76
77 //------------------------------------------------------------------------------------------------
83
84 //------------------------------------------------------------------------------------------------
85 void SetText(string text)
86 {
87 m_Widgets.m_wSnackBarText.SetText(text);
88 }
89
90 //------------------------------------------------------------------------------------------------
91 void SetIcon(string imageSet, string icon)
92 {
93 m_Widgets.m_wSnackBarIcon.LoadImageFromSet(0, imageSet, icon);
94 }
95
96 //------------------------------------------------------------------------------------------------
97 void SetColors(notnull Color IconColor, notnull Color TextColor, Color BackgrounsColor)
98 {
99 m_IconColor = IconColor;
100 m_TextColor = TextColor;
101 m_BackgroundColor = BackgrounsColor;
102
103 m_Widgets.m_wSnackBarIcon.SetColor(IconColor);
104 m_Widgets.m_wSnackBarText.SetColor(TextColor);
105
106 m_Widgets.m_wSnackBarBackgroundImgLeft.SetColor(BackgrounsColor);
107 m_Widgets.m_wSnackBarBackgroundImgMid.SetColor(BackgrounsColor);
108 m_Widgets.m_wSnackBarBackgroundImgRight.SetColor(BackgrounsColor);
109 }
110}
static WidgetAnimationOpacity Opacity(Widget widget, float targetValue, float speed, bool toggleVisibility=false)
static void StopAllAnimations(Widget w)
static WidgetAnimationColor Color(Widget widget, Color color, float speed)
Definition Color.c:13
void SetIcon(string imageSet, string icon)
void SetColors(notnull Color IconColor, notnull Color TextColor, Color BackgrounsColor)
override void HandlerAttached(Widget w)
ref SCR_ActionMenuSnackBarWidgets m_Widgets
SCR_FieldOfViewSettings Attribute