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_BaseCommandAction.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleResourceName
(
"m_CommandPrefab"
,
true
)]
2
class
SCR_BaseCommandAction
:
SCR_BaseToggleToolbarAction
3
{
4
[
Attribute
(
""
,
UIWidgets
.ResourcePickerThumbnail,
"Objective or waypoint prefab"
,
"et"
)]
5
protected
ResourceName
m_CommandPrefab
;
6
7
//------------------------------------------------------------------------------------------------
8
ResourceName
GetCommandPrefab
()
9
{
10
return
m_CommandPrefab
;
11
}
12
13
//------------------------------------------------------------------------------------------------
14
protected
void
FilterEntities
(notnull set<SCR_EditableEntityComponent> inEntities, out notnull set<SCR_EditableEntityComponent> outEntities)
15
{
16
outEntities.Copy(inEntities);
17
}
18
19
//------------------------------------------------------------------------------------------------
20
protected
set<SCR_EditableEntityComponent>
GetSelectedEntities
(notnull set<SCR_EditableEntityComponent> inEntities)
21
{
22
set<SCR_EditableEntityComponent> selectedEnities =
new
set<SCR_EditableEntityComponent>();
23
FilterEntities
(inEntities, selectedEnities);
24
return
selectedEnities;
25
}
26
27
//------------------------------------------------------------------------------------------------
28
//--- Called from command toolbar, initiates placing mode
29
bool
StartPlacing
(notnull set<SCR_EditableEntityComponent> selectedEntities)
30
{
31
SCR_PlacingEditorComponent
placingManager =
SCR_PlacingEditorComponent
.Cast(
SCR_PlacingEditorComponent
.GetInstance(
SCR_PlacingEditorComponent
,
true
));
32
if
(!placingManager)
33
return
false
;
34
35
return
placingManager.
SetSelectedPrefab
(
m_CommandPrefab
, recipients:
GetSelectedEntities
(selectedEntities), sourceAction:
this
);
36
}
37
38
//------------------------------------------------------------------------------------------------
39
//--- Called from radial menu, places the command instantly
40
override
void
Perform
(
SCR_EditableEntityComponent
hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities,
vector
cursorWorldPosition,
int
flags
,
int
param = -1)
41
{
42
if
(cursorWorldPosition ==
vector
.Zero)
43
return
;
44
45
SCR_PlacingEditorComponent
placingManager =
SCR_PlacingEditorComponent
.Cast(
SCR_PlacingEditorComponent
.GetInstance(
SCR_PlacingEditorComponent
,
true
,
true
));
46
if
(!placingManager)
47
return
;
48
49
bool
isQueue =
flags
&
EEditorCommandActionFlags
.IS_QUEUE;
50
51
vector
transform[4];
52
Math3D
.MatrixIdentity3(transform);
53
transform[3] = cursorWorldPosition;
54
SCR_EditorPreviewParams
params
=
SCR_EditorPreviewParams
.
CreateParams
(transform);
55
56
//++ If the flags is to attach, use the hovered entity as the holder for the spawned entity
57
SCR_EditableEntityComponent
holder = null;
58
if
(
flags
&
EEditorCommandActionFlags
.ATTACH)
59
holder = hoveredEntity;
60
61
placingManager.
CreateEntity
(
m_CommandPrefab
,
params
, !isQueue,
false
,
GetSelectedEntities
(selectedEntities), holder,
this
);
62
}
63
64
//------------------------------------------------------------------------------------------------
65
protected
void
OnCurrentActionChanged
()
66
{
67
SCR_CommandActionsEditorComponent
commandActionsManager =
SCR_CommandActionsEditorComponent
.Cast(
SCR_CommandActionsEditorComponent
.GetInstance(
SCR_CommandActionsEditorComponent
));
68
if
(commandActionsManager)
69
Toggle
(0, commandActionsManager.
IsActionCurrent
(
this
))
70
}
71
72
//------------------------------------------------------------------------------------------------
73
override
void
Track
()
74
{
75
SCR_CommandActionsEditorComponent
commandActionsManager =
SCR_CommandActionsEditorComponent
.Cast(
SCR_CommandActionsEditorComponent
.GetInstance(
SCR_CommandActionsEditorComponent
));
76
if
(commandActionsManager)
77
{
78
commandActionsManager.
GetOnCurrentActionChanged
().Insert(
OnCurrentActionChanged
);
79
OnCurrentActionChanged
();
80
}
81
}
82
83
//------------------------------------------------------------------------------------------------
84
override
void
Untrack
()
85
{
86
SCR_CommandActionsEditorComponent
commandActionsManager =
SCR_CommandActionsEditorComponent
.Cast(
SCR_CommandActionsEditorComponent
.GetInstance(
SCR_CommandActionsEditorComponent
));
87
if
(commandActionsManager)
88
commandActionsManager.
GetOnCurrentActionChanged
().Remove(
OnCurrentActionChanged
);
89
}
90
91
//------------------------------------------------------------------------------------------------
92
override
bool
IsServer
()
93
{
94
//--- Must be called on client, placing handles server communication itself
95
return
false
;
96
}
97
}
flags
SCR_EAIThreatSectorFlags flags
Definition
AIControlComponentSerializer.c:16
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_BaseContainerCustomTitleResourceName
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
Definition
SCR_CampaignMilitaryBaseComponent.c:2910
Toggle
void Toggle()
Toggle hint. Hide it if it's shown, and open it again if it's hidden.
Definition
SCR_HintManagerComponent.c:219
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
Math3D
Definition
Math3D.c:13
ResourceName
Definition
ResourceName.c:13
SCR_BaseCommandAction
Definition
SCR_BaseCommandAction.c:3
SCR_BaseCommandAction::Perform
override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
Definition
SCR_BaseCommandAction.c:40
SCR_BaseCommandAction::m_CommandPrefab
ResourceName m_CommandPrefab
Definition
SCR_BaseCommandAction.c:5
SCR_BaseCommandAction::StartPlacing
bool StartPlacing(notnull set< SCR_EditableEntityComponent > selectedEntities)
Definition
SCR_BaseCommandAction.c:29
SCR_BaseCommandAction::Untrack
override void Untrack()
Definition
SCR_BaseCommandAction.c:84
SCR_BaseCommandAction::Track
override void Track()
Definition
SCR_BaseCommandAction.c:73
SCR_BaseCommandAction::GetCommandPrefab
ResourceName GetCommandPrefab()
Definition
SCR_BaseCommandAction.c:8
SCR_BaseCommandAction::OnCurrentActionChanged
void OnCurrentActionChanged()
Definition
SCR_BaseCommandAction.c:65
SCR_BaseCommandAction::IsServer
override bool IsServer()
Definition
SCR_BaseCommandAction.c:92
SCR_BaseCommandAction::GetSelectedEntities
set< SCR_EditableEntityComponent > GetSelectedEntities(notnull set< SCR_EditableEntityComponent > inEntities)
Definition
SCR_BaseCommandAction.c:20
SCR_BaseCommandAction::FilterEntities
void FilterEntities(notnull set< SCR_EditableEntityComponent > inEntities, out notnull set< SCR_EditableEntityComponent > outEntities)
Definition
SCR_BaseCommandAction.c:14
SCR_BaseToggleToolbarAction
Definition
SCR_BaseToggleToolbarAction.c:4
SCR_CommandActionsEditorComponent
Definition
SCR_CommandActionsEditorComponent.c:11
SCR_CommandActionsEditorComponent::IsActionCurrent
bool IsActionCurrent(SCR_BaseEditorAction action)
Definition
SCR_CommandActionsEditorComponent.c:32
SCR_CommandActionsEditorComponent::GetOnCurrentActionChanged
ScriptInvoker GetOnCurrentActionChanged()
Definition
SCR_CommandActionsEditorComponent.c:23
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_EditorPreviewParams
Network packet of variables for entity placing and transformation.
Definition
SCR_EditorPreviewParams.c:5
SCR_EditorPreviewParams::CreateParams
static SCR_EditorPreviewParams CreateParams(vector transform[4], RplId parentID=Replication.INVALID_ID, EEditorTransformVertical verticalMode=EEditorTransformVertical.SEA, bool isUnderwater=false, SCR_EditableEntityComponent target=null, EEditableEntityInteraction targetInteraction=EEditableEntityInteraction.NONE)
Definition
SCR_EditorPreviewParams.c:220
SCR_PlacingEditorComponent
Definition
SCR_PlacingEditorComponent.c:119
SCR_PlacingEditorComponent::SetSelectedPrefab
bool SetSelectedPrefab(ResourceName prefab="", bool onConfirm=false, bool showBudgetMaxNotification=true, set< SCR_EditableEntityComponent > recipients=null, SCR_BaseEditorAction sourceAction=null)
Definition
SCR_PlacingEditorComponent.c:1184
SCR_PlacingEditorComponent::CreateEntity
bool CreateEntity(bool unselectPrefab=true, bool canBePlayer=false, SCR_EditableEntityComponent holder=null, SCR_BaseEditorAction sourceAction=null)
Definition
SCR_PlacingEditorComponent.c:221
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EEditorCommandActionFlags
EEditorCommandActionFlags
Simplified action conditions.
Definition
EEditorCommandActionFlags.c:6
scripts
Game
Editor
Containers
Actions
CommandActions
SCR_BaseCommandAction.c
Generated by
1.17.0