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_FactionCommanderConflictBaseMenuHandler.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_FactionCommanderConflictBaseMenuHandler
:
SCR_FactionCommanderBaseTaskMenuHandler
3
{
4
[
Attribute
(
"1"
,
desc
:
"If checked, player commander can create objective"
)]
5
protected
bool
m_bIsObjectiveCreationEnabled
;
6
7
protected
const
string
BASE_NOT_SELECTED_TEXT
=
"#AR-FactionCommander_NoBaseSelected"
;
8
9
//------------------------------------------------------------------------------------------------
10
bool
CanCreateObjectiveEntryBeShown
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity)
11
{
12
return
m_bIsObjectiveCreationEnabled
;
13
}
14
15
//------------------------------------------------------------------------------------------------
16
bool
CanCreateObjectiveEntryBeSelected
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity, out
string
disabledText =
""
)
17
{
18
SCR_GroupTaskManagerComponent
groupTaskManager =
SCR_GroupTaskManagerComponent
.GetInstance();
19
if
(!groupTaskManager)
20
return
false
;
21
22
return
groupTaskManager.CanCreateNewTaskWithTypename(
GetTaskPrefabClassTypename
(), commanderFaction);
23
}
24
25
//------------------------------------------------------------------------------------------------
26
override
bool
CanEntryBeShown
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity)
27
{
28
return
true
;
29
}
30
31
//------------------------------------------------------------------------------------------------
32
override
bool
CanEntryBeSelected
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity, out
string
disabledText =
""
)
33
{
34
if
(!
GetHoveredBase
())
35
return
false
;
36
37
return
true
;
38
}
39
40
//------------------------------------------------------------------------------------------------
41
override
bool
CanGroupEntryBeSelected
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity,
SCR_AIGroup
group, out
string
disabledText =
""
)
42
{
43
return
true
;
44
}
45
46
//------------------------------------------------------------------------------------------------
47
protected
SCR_CampaignFactionCommanderPlayerComponent
GetLocalCampaignCommanderComponent
()
48
{
49
return
SCR_CampaignFactionCommanderPlayerComponent.Cast(
GetLocalCommanderComponent
());
50
}
51
52
//------------------------------------------------------------------------------------------------
53
protected
SCR_CampaignMilitaryBaseComponent
GetHoveredBase
()
54
{
55
SCR_CampaignFactionCommanderPlayerComponent factionCommanderPlayerComponent =
GetLocalCampaignCommanderComponent
();
56
57
if
(!factionCommanderPlayerComponent)
58
return
null;
59
60
return
factionCommanderPlayerComponent.GetHoveredBase();
61
}
62
63
//------------------------------------------------------------------------------------------------
64
protected
SCR_Task
GetTaskOnBase
(
SCR_CampaignMilitaryBaseComponent
targetBase,
Faction
targetFaction,
typename
taskClass)
65
{
66
if
(!targetBase)
67
return
null;
68
69
array<SCR_Task> tasks = {};
70
SCR_TaskSystem
.GetInstance().GetTasksByState(tasks,
SCR_ETaskState
.CREATED |
SCR_ETaskState
.ASSIGNED, targetFaction.GetFactionKey());
71
SCR_CampaignMilitaryBaseTaskData
data
;
72
SCR_CampaignMilitaryBaseComponent
base
;
73
74
foreach
(
SCR_Task
task
: tasks)
75
{
76
SCR_CampaignMilitaryBaseTaskEntity campaignMilitaryBaseTask = SCR_CampaignMilitaryBaseTaskEntity.Cast(
task
);
77
if
(!campaignMilitaryBaseTask)
78
continue
;
79
80
data
=
SCR_CampaignMilitaryBaseTaskData
.Cast(
task
.GetTaskData());
81
if
(!
data
)
82
continue
;
83
84
if
(
data
.m_aOwnerFactionKeys.IsEmpty())
85
continue
;
86
87
base
= campaignMilitaryBaseTask.GetMilitaryBase();
88
if
(!
base
)
89
continue
;
90
91
if
(
task
.Type() == taskClass &&
base
== targetBase &&
data
.m_aOwnerFactionKeys.Contains(targetFaction.GetFactionKey()))
92
return
task
;
93
}
94
95
return
null;
96
}
97
98
//------------------------------------------------------------------------------------------------
99
protected
SCR_Task
GetTask
(
IEntity
hoveredEntity, notnull
Faction
faction,
typename
taskClass)
100
{
101
SCR_Task
task
=
SCR_Task
.Cast(hoveredEntity);
102
if
(!
task
||
task
&&
task
.Type() != taskClass)
103
task
=
GetTaskOnHoveredBase
(faction, taskClass);
104
105
return
task
;
106
}
107
108
//------------------------------------------------------------------------------------------------
109
protected
SCR_Task
GetTaskOnHoveredBase
(notnull
Faction
faction,
typename
taskClass)
110
{
111
return
GetTaskOnBase
(
GetHoveredBase
(), faction, taskClass);
112
}
113
114
//------------------------------------------------------------------------------------------------
115
protected
bool
CanCampaignGroupEntryBeSelected
(notnull
Faction
faction,
IEntity
hoveredEntity, notnull
SCR_AIGroup
group,
typename
taskClass)
116
{
117
SCR_Task
task
=
GetTask
(hoveredEntity, faction, taskClass);
118
if
(!
task
)
119
{
120
SCR_GroupTaskManagerComponent
groupTaskManager =
SCR_GroupTaskManagerComponent
.GetInstance();
121
if
(groupTaskManager && groupTaskManager.CanCreateNewTaskWithTypename(taskClass, faction))
122
return
true
;
123
124
return
false
;
125
}
126
127
SCR_TaskExecutorGroup
groupExecutor =
SCR_TaskExecutorGroup
.Cast(
SCR_TaskExecutorGroup
.FromGroup(group.GetGroupID()));
128
bool
canBeAssigned =
SCR_TaskSystem
.GetInstance().CanTaskBeAssignedTo(
task
, groupExecutor);
129
return
canBeAssigned && !
task
.IsTaskAssignedTo(groupExecutor);
130
}
131
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
SCR_GroupTaskManagerComponent
void SCR_GroupTaskManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupTaskManagerComponent.c:794
base
around base
Definition
SCR_HoldCampaignMilitaryBaseTaskEntity.c:9
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
GetTask
SCR_ScenarioFrameworkTask GetTask()
Definition
SCR_ScenarioFrameworkLayerTask.c:131
SCR_Task
void SCR_Task(IEntitySource src, IEntity parent)
Definition
SCR_Task.c:1938
SCR_ETaskState
SCR_ETaskState
Definition
SCR_Task.c:3
task
from task
Definition
SCR_TaskNotificationConfigs.c:12
Faction
Definition
Faction.c:13
IEntity
Definition
IEntity.c:13
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_CampaignMilitaryBaseComponent
Definition
SCR_CampaignMilitaryBaseComponent.c:38
SCR_CampaignMilitaryBaseTaskData
Definition
SCR_CampaignMilitaryBaseTaskData.c:2
SCR_FactionCommanderBaseMenuHandler::GetLocalCommanderComponent
SCR_FactionCommanderPlayerComponent GetLocalCommanderComponent()
Definition
SCR_FactionCommanderBaseMenuHandler.c:19
SCR_FactionCommanderBaseTaskMenuHandler
Definition
SCR_FactionCommanderBaseTaskMenuHandler.c:3
SCR_FactionCommanderBaseTaskMenuHandler::GetTaskPrefabClassTypename
GetTaskPrefabClassTypename()
Definition
SCR_FactionCommanderBaseTaskMenuHandler.c:36
SCR_FactionCommanderConflictBaseMenuHandler
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:3
SCR_FactionCommanderConflictBaseMenuHandler::GetTaskOnBase
SCR_Task GetTaskOnBase(SCR_CampaignMilitaryBaseComponent targetBase, Faction targetFaction, typename taskClass)
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:64
SCR_FactionCommanderConflictBaseMenuHandler::CanEntryBeShown
override bool CanEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:26
SCR_FactionCommanderConflictBaseMenuHandler::CanGroupEntryBeSelected
override bool CanGroupEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group, out string disabledText="")
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:41
SCR_FactionCommanderConflictBaseMenuHandler::CanEntryBeSelected
override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText="")
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:32
SCR_FactionCommanderConflictBaseMenuHandler::CanCreateObjectiveEntryBeShown
bool CanCreateObjectiveEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:10
SCR_FactionCommanderConflictBaseMenuHandler::CanCampaignGroupEntryBeSelected
bool CanCampaignGroupEntryBeSelected(notnull Faction faction, IEntity hoveredEntity, notnull SCR_AIGroup group, typename taskClass)
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:115
SCR_FactionCommanderConflictBaseMenuHandler::GetTask
SCR_Task GetTask(IEntity hoveredEntity, notnull Faction faction, typename taskClass)
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:99
SCR_FactionCommanderConflictBaseMenuHandler::GetTaskOnHoveredBase
SCR_Task GetTaskOnHoveredBase(notnull Faction faction, typename taskClass)
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:109
SCR_FactionCommanderConflictBaseMenuHandler::GetLocalCampaignCommanderComponent
SCR_CampaignFactionCommanderPlayerComponent GetLocalCampaignCommanderComponent()
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:47
SCR_FactionCommanderConflictBaseMenuHandler::m_bIsObjectiveCreationEnabled
bool m_bIsObjectiveCreationEnabled
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:5
SCR_FactionCommanderConflictBaseMenuHandler::BASE_NOT_SELECTED_TEXT
const string BASE_NOT_SELECTED_TEXT
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:7
SCR_FactionCommanderConflictBaseMenuHandler::GetHoveredBase
SCR_CampaignMilitaryBaseComponent GetHoveredBase()
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:53
SCR_FactionCommanderConflictBaseMenuHandler::CanCreateObjectiveEntryBeSelected
bool CanCreateObjectiveEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText="")
Definition
SCR_FactionCommanderConflictBaseMenuHandler.c:16
SCR_TaskExecutorGroup
Definition
SCR_TaskExecutorGroup.c:2
SCR_TaskSystem
Definition
SCR_TaskSystem.c:6
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
FactionCommander
MenuHandlers
SCR_FactionCommanderConflictBaseMenuHandler.c
Generated by
1.17.0