Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_NearbyContextWidgetComponentBase.c
Go to the documentation of this file.
2{
3 [Attribute("1 1 1 1", UIWidgets.ColorPicker)]
5
6 [Attribute("0.1 0.1 0.1 1", UIWidgets.ColorPicker)]
8
9 [Attribute()]
10 protected string m_sBackgroundWidgetName;
11
12 [Attribute()]
13 protected string m_sGlowWidgetName;
14
15 protected Widget m_wRoot;
16
19
22
23 // Invokes when a new Context is assigned to this Widget
24 // Can be used to detect if this Widget is not assigned to the needed context anymore
26
27 //------------------------------------------------------------------------------------------------
28 override void HandlerAttached(Widget w)
29 {
30 m_wRoot = w;
32 m_wGlow = ImageWidget.Cast(m_wRoot.FindAnyWidget(m_sGlowWidgetName));
33 }
34
35 //------------------------------------------------------------------------------------------------
41 {
42 m_AssignedContext = context;
43
44 array<BaseUserAction> allActions = {};
45 context.GetActionsList(allActions);
46
47 if (!allActions.IsEmpty())
48 m_FirstAction = allActions[0];
49
51 m_OnContextAssigned.Invoke();
52
53 if (info)
55
56#ifdef NEARBY_INTERACTIONS_CONTEXT_DEBUG
57 RichTextWidget debugTextWidget = RichTextWidget.Cast(m_wRoot.FindAnyWidget("DebugText"));
58 if (debugTextWidget)
59 {
60 debugTextWidget.SetText(" Context: " + context.GetContextName());
61 debugTextWidget.SetVisible(true);
62 }
63#endif
64 }
65
66 //------------------------------------------------------------------------------------------------
70 {
71 if (m_wBackground)
72 m_wBackground.SetColor(newColor);
73 }
74
75 //------------------------------------------------------------------------------------------------
78 void ChangeVisibility(bool isInLineOfSight)
79 {
80 if (isInLineOfSight)
82 else
84 }
85
86 //------------------------------------------------------------------------------------------------
92
93 //------------------------------------------------------------------------------------------------
101}
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
Definition Color.c:13
void OnWidgetAssigned(Widget widget)
UserActionContext GetAssignedContext()
Get the context that currently uses this Widget.
void OnAssigned(SCR_ActionContextUIInfo info, UserActionContext context)
SCR_FieldOfViewSettings Attribute