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_EntityLabelPointComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/Components"
, description:
"Component labeling entities and tracking their positions updates (if they are in editable composition)"
)]
2
class
SCR_EntityLabelPointComponentClass
:
ScriptComponentClass
3
{
4
[
Attribute
(uiwidget:
UIWidgets
.SearchComboBox,
category
:
"Entity Spawner"
,
desc
:
"Entity labels."
, enums: ParamEnumArray.FromEnum(
EEditableEntityLabel
))]
5
protected
ref array<EEditableEntityLabel>
m_aEntityLabels
;
6
7
//------------------------------------------------------------------------------------------------
11
bool
GetEntityLabels
(out notnull array<EEditableEntityLabel> labels)
12
{
13
if
(
m_aEntityLabels
)
14
{
15
labels.Clear();
16
labels.Copy(
m_aEntityLabels
);
17
}
18
19
return
m_aEntityLabels
!= null;
20
}
21
}
22
23
class
SCR_EntityLabelPointComponent :
ScriptComponent
24
{
25
//invokes with labelComponent and owner origin
26
protected
ref
ScriptInvoker
m_OnOwnerUpdated
;
27
28
//------------------------------------------------------------------------------------------------
30
bool
HasLabel
(
EEditableEntityLabel
label)
31
{
32
SCR_EntityLabelPointComponentClass
prefabData =
SCR_EntityLabelPointComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
33
if
(!prefabData)
34
return
false
;
35
36
array<EEditableEntityLabel> labels = {};
37
prefabData.
GetEntityLabels
(labels);
38
39
return
labels.Contains(label);
40
}
41
42
//------------------------------------------------------------------------------------------------
44
ScriptInvoker
GetOnOwnerUpdated
()
45
{
46
if
(!
m_OnOwnerUpdated
)
47
m_OnOwnerUpdated
=
new
ScriptInvoker
();
48
49
return
m_OnOwnerUpdated
;
50
}
51
52
//------------------------------------------------------------------------------------------------
53
protected
void
OnEntityUpdated
(notnull
SCR_EditableEntityComponent
editableComponent)
54
{
55
IEntity
owner = editableComponent.GetOwner();
56
if
(!owner)
57
return
;
58
59
SCR_EntityLabelPointComponent labelComponent = SCR_EntityLabelPointComponent.Cast(owner.
FindComponent
(SCR_EntityLabelPointComponent));
60
if
(labelComponent &&
m_OnOwnerUpdated
)
61
m_OnOwnerUpdated
.Invoke(labelComponent, owner.
GetOrigin
());
62
}
63
64
//------------------------------------------------------------------------------------------------
65
protected
override
void
EOnInit
(
IEntity
owner)
66
{
67
super.EOnInit(owner);
68
69
SCR_EditableEntityCore
core =
SCR_EditableEntityCore
.Cast(
SCR_EditableEntityCore
.GetInstance(
SCR_EditableEntityCore
));
70
if
(core)
71
core.Event_OnEntityTransformChanged.Insert(
OnEntityUpdated
);
72
else
73
Print
(
"SCR_EditableEntityCore not found! SCR_EntityLaberComponent won't be updated!"
,
LogLevel
.WARNING);
74
}
75
76
//------------------------------------------------------------------------------------------------
77
// destructor
78
void
~SCR_EntityLabelPointComponent
()
79
{
80
SCR_EditableEntityCore
core =
SCR_EditableEntityCore
.Cast(
SCR_EditableEntityCore
.GetInstance(
SCR_EditableEntityCore
));
81
if
(core)
82
core.Event_OnEntityTransformChanged.Remove(
OnEntityUpdated
);
83
}
84
}
EEditableEntityLabel
EEditableEntityLabel
Definition
EEditableEntityLabel.c:2
GetComponentData
SCR_CharacterSoundComponentClass GetComponentData()
Definition
SCR_CharacterSoundComponent.c:132
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
HasLabel
bool HasLabel(EEditableEntityLabel label)
Definition
SCR_EntityLabelPointComponent.c:30
~SCR_EntityLabelPointComponent
void ~SCR_EntityLabelPointComponent()
Definition
SCR_EntityLabelPointComponent.c:78
OnEntityUpdated
void OnEntityUpdated(notnull SCR_EditableEntityComponent editableComponent)
Definition
SCR_EntityLabelPointComponent.c:53
m_OnOwnerUpdated
SCR_EntityLabelPointComponentClass m_OnOwnerUpdated
GetOnOwnerUpdated
ScriptInvoker GetOnOwnerUpdated()
Definition
SCR_EntityLabelPointComponent.c:44
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetOrigin
proto external vector GetOrigin()
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_EditableEntityCore
Definition
SCR_EditableEntityCore.c:20
SCR_EntityLabelPointComponentClass
Definition
SCR_EntityLabelPointComponent.c:3
SCR_EntityLabelPointComponentClass::GetEntityLabels
bool GetEntityLabels(out notnull array< EEditableEntityLabel > labels)
Definition
SCR_EntityLabelPointComponent.c:11
SCR_EntityLabelPointComponentClass::m_aEntityLabels
ref array< EEditableEntityLabel > m_aEntityLabels
Definition
SCR_EntityLabelPointComponent.c:5
ScriptComponentClass
Definition
ScriptComponentClass.c:8
ScriptComponent
Definition
ScriptComponent.c:24
ScriptComponent::GetOwner
proto external GenericEntity GetOwner()
Get owner entity.
UIWidgets
Definition
attributes.c:40
EOnInit
override void EOnInit(IEntity owner)
Definition
SCR_AIConfigComponent.c:87
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
Components
Spawner
SCR_EntityLabelPointComponent.c
Generated by
1.17.0