Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_NearbyContextWidgetComponentBase.c
Go to the documentation of this file.
1
class
SCR_NearbyContextWidgetComponentBase
:
ScriptedWidgetComponent
2
{
3
[
Attribute
(
"1 1 1 1"
,
UIWidgets
.ColorPicker)]
4
protected
ref
Color
m_VisibleWidgetColor
;
5
6
[
Attribute
(
"0.1 0.1 0.1 1"
,
UIWidgets
.ColorPicker)]
7
protected
ref
Color
m_NotVisibleWidgetColor
;
8
9
[
Attribute
()]
10
protected
string
m_sBackgroundWidgetName
;
11
12
[
Attribute
()]
13
protected
string
m_sGlowWidgetName
;
14
15
protected
Widget
m_wRoot
;
16
17
protected
ImageWidget
m_wBackground
;
18
protected
ImageWidget
m_wGlow
;
19
20
protected
UserActionContext
m_AssignedContext
;
21
protected
BaseUserAction
m_FirstAction
;
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
25
protected
ref
ScriptInvokerVoid
m_OnContextAssigned
;
26
27
//------------------------------------------------------------------------------------------------
28
override
void
HandlerAttached
(
Widget
w)
29
{
30
m_wRoot
= w;
31
m_wBackground
=
ImageWidget
.Cast(
m_wRoot
.FindAnyWidget(
m_sBackgroundWidgetName
));
32
m_wGlow
=
ImageWidget
.Cast(
m_wRoot
.FindAnyWidget(
m_sGlowWidgetName
));
33
}
34
35
//------------------------------------------------------------------------------------------------
40
void
OnAssigned
(
SCR_ActionContextUIInfo
info,
UserActionContext
context)
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
50
if
(
m_OnContextAssigned
)
51
m_OnContextAssigned
.Invoke();
52
53
if
(info)
54
info.
OnWidgetAssigned
(
m_wRoot
);
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
//------------------------------------------------------------------------------------------------
69
void
ChangeBackgroundColor
(
Color
newColor)
70
{
71
if
(
m_wBackground
)
72
m_wBackground
.SetColor(newColor);
73
}
74
75
//------------------------------------------------------------------------------------------------
78
void
ChangeVisibility
(
bool
isInLineOfSight)
79
{
80
if
(isInLineOfSight)
81
m_wRoot
.SetColor(
m_VisibleWidgetColor
);
82
else
83
m_wRoot
.SetColor(
m_NotVisibleWidgetColor
);
84
}
85
86
//------------------------------------------------------------------------------------------------
88
UserActionContext
GetAssignedContext
()
89
{
90
return
m_AssignedContext
;
91
}
92
93
//------------------------------------------------------------------------------------------------
94
ScriptInvokerVoid
GetOnContextAssigned
()
95
{
96
if
(!
m_OnContextAssigned
)
97
m_OnContextAssigned
=
new
ScriptInvokerVoid
();
98
99
return
m_OnContextAssigned
;
100
}
101
}
ScriptInvokerVoid
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
Definition
SCR_ScriptInvokerHelper.c:9
BaseUserAction
Definition
BaseUserAction.c:13
Color
Definition
Color.c:13
ImageWidget
Definition
ImageWidget.c:13
RichTextWidget
Definition
RichTextWidget.c:13
SCR_ActionContextUIInfo
Definition
SCR_ActionContextUIInfo.c:2
SCR_ActionContextUIInfo::OnWidgetAssigned
void OnWidgetAssigned(Widget widget)
Definition
SCR_ActionContextUIInfo.c:23
SCR_NearbyContextWidgetComponentBase
Definition
SCR_NearbyContextWidgetComponentBase.c:2
SCR_NearbyContextWidgetComponentBase::GetOnContextAssigned
ScriptInvokerVoid GetOnContextAssigned()
Definition
SCR_NearbyContextWidgetComponentBase.c:94
SCR_NearbyContextWidgetComponentBase::m_OnContextAssigned
ref ScriptInvokerVoid m_OnContextAssigned
Definition
SCR_NearbyContextWidgetComponentBase.c:25
SCR_NearbyContextWidgetComponentBase::m_wBackground
ImageWidget m_wBackground
Definition
SCR_NearbyContextWidgetComponentBase.c:17
SCR_NearbyContextWidgetComponentBase::ChangeBackgroundColor
void ChangeBackgroundColor(Color newColor)
Definition
SCR_NearbyContextWidgetComponentBase.c:69
SCR_NearbyContextWidgetComponentBase::m_VisibleWidgetColor
ref Color m_VisibleWidgetColor
Definition
SCR_NearbyContextWidgetComponentBase.c:4
SCR_NearbyContextWidgetComponentBase::m_wRoot
Widget m_wRoot
Definition
SCR_NearbyContextWidgetComponentBase.c:15
SCR_NearbyContextWidgetComponentBase::m_wGlow
ImageWidget m_wGlow
Definition
SCR_NearbyContextWidgetComponentBase.c:18
SCR_NearbyContextWidgetComponentBase::m_FirstAction
BaseUserAction m_FirstAction
Definition
SCR_NearbyContextWidgetComponentBase.c:21
SCR_NearbyContextWidgetComponentBase::m_AssignedContext
UserActionContext m_AssignedContext
Definition
SCR_NearbyContextWidgetComponentBase.c:20
SCR_NearbyContextWidgetComponentBase::m_sBackgroundWidgetName
string m_sBackgroundWidgetName
Definition
SCR_NearbyContextWidgetComponentBase.c:10
SCR_NearbyContextWidgetComponentBase::m_sGlowWidgetName
string m_sGlowWidgetName
Definition
SCR_NearbyContextWidgetComponentBase.c:13
SCR_NearbyContextWidgetComponentBase::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_NearbyContextWidgetComponentBase.c:28
SCR_NearbyContextWidgetComponentBase::m_NotVisibleWidgetColor
ref Color m_NotVisibleWidgetColor
Definition
SCR_NearbyContextWidgetComponentBase.c:7
SCR_NearbyContextWidgetComponentBase::ChangeVisibility
void ChangeVisibility(bool isInLineOfSight)
Definition
SCR_NearbyContextWidgetComponentBase.c:78
SCR_NearbyContextWidgetComponentBase::GetAssignedContext
UserActionContext GetAssignedContext()
Get the context that currently uses this Widget.
Definition
SCR_NearbyContextWidgetComponentBase.c:88
SCR_NearbyContextWidgetComponentBase::OnAssigned
void OnAssigned(SCR_ActionContextUIInfo info, UserActionContext context)
Definition
SCR_NearbyContextWidgetComponentBase.c:40
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
UIWidgets
Definition
attributes.c:40
UserActionContext
Definition
UserActionContext.c:16
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
HUD
SCR_NearbyContextWidgetComponentBase.c
Generated by
1.17.0