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_FactionCommanderEstablishBaseRequestMenuHandler.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_FactionCommanderEstablishBaseRequestMenuHandler
:
SCR_FactionCommanderBaseRequestMenuHandler
3
{
4
protected
int
m_iRequesterGroup
;
5
protected
SCR_AIGroup
m_Group
;
6
protected
ref
SCR_EstablishBaseMapCommandCursor
m_MapCommandCursor
;
7
8
protected
const
string
ESTABLISH_BASE_LIMIT_REACHED
=
"#AR-Notification_GROUP_TASK_ESTABLISH_BASE_TOO_MANY_BASES"
;
9
10
//------------------------------------------------------------------------------------------------
11
override
bool
CanQuickEntryBeShown
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity)
12
{
13
if
(!super.CanQuickEntryBeShown(commanderFaction, playerId,
position
, hoveredEntity))
14
return
false
;
15
16
SCR_EstablishBaseRequestedTaskEntity
task
= SCR_EstablishBaseRequestedTaskEntity.Cast(hoveredEntity);
17
if
(!
task
)
18
return
false
;
19
20
return
true
;
21
}
22
23
//------------------------------------------------------------------------------------------------
24
override
bool
CanEntryBeSelected
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity, out
string
disabledText =
""
)
25
{
26
SCR_GameModeCampaign
gameModeCampaign =
SCR_GameModeCampaign
.Cast(
GetGame
().
GetGameMode
());
27
if
(gameModeCampaign && !gameModeCampaign.GetBaseManager().CanFactionBuildNewBase(commanderFaction))
28
{
29
disabledText =
ESTABLISH_BASE_LIMIT_REACHED
;
30
return
false
;
31
}
32
33
return
true
;
34
}
35
36
//------------------------------------------------------------------------------------------------
37
override
bool
CanGroupEntryBeSelected
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity,
SCR_AIGroup
group, out
string
disabledText =
""
)
38
{
39
return
false
;
40
}
41
42
//------------------------------------------------------------------------------------------------
43
override
void
OnCommandIssued
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity,
SCR_AIGroup
group)
44
{
45
SCR_FactionCommanderPlayerComponent factionCommanderPlayerComponent =
GetLocalCommanderComponent
();
46
if
(!factionCommanderPlayerComponent)
47
return
;
48
49
SCR_GroupsManagerComponent
groupComp =
SCR_GroupsManagerComponent
.GetInstance();
50
if
(!groupComp)
51
return
;
52
53
SCR_AIGroup
requesterGroup = groupComp.GetPlayerGroup(playerId);
54
if
(!requesterGroup)
55
return
;
56
57
SCR_EstablishBaseRequestedTaskEntity
task
= SCR_EstablishBaseRequestedTaskEntity.Cast(hoveredEntity);
58
if
(!
task
)
59
{
60
m_MapCommandCursor
=
new
SCR_EstablishBaseMapCommandCursor
();
61
m_MapCommandCursor
.ShowCursor(
position
);
62
m_MapCommandCursor
.SetData(commanderFaction, playerId, hoveredEntity);
63
m_MapCommandCursor
.GetOnCommandExecuted().Insert(
OnCommandExecuted
);
64
m_Group
= group;
65
m_iRequesterGroup
= requesterGroup.
GetGroupID
();
66
}
67
}
68
69
//------------------------------------------------------------------------------------------------
70
protected
void
OnCommandExecuted
(
vector
position
)
71
{
72
if
(!
m_MapCommandCursor
)
73
return
;
74
75
SCR_FactionCommanderPlayerComponent factionCommanderPlayerComponent =
GetLocalCommanderComponent
();
76
if
(!factionCommanderPlayerComponent)
77
return
;
78
79
factionCommanderPlayerComponent.CreateRequestedTask(
GetTaskPrefab
(),
position
,
m_iRequesterGroup
,
m_Group
,
m_MapCommandCursor
.GetPlayerId(),
this
);
80
}
81
82
//------------------------------------------------------------------------------------------------
83
override
bool
CanEntryBeShown
(notnull
Faction
commanderFaction,
int
playerId,
vector
position
,
IEntity
hoveredEntity)
84
{
85
SCR_GameModeCampaign
gameModeCampaign =
SCR_GameModeCampaign
.Cast(
GetGame
().
GetGameMode
());
86
if
(gameModeCampaign && !gameModeCampaign.GetEstablishingBasesEnabled())
87
return
false
;
88
89
return
super.CanEntryBeShown(commanderFaction, playerId,
position
, hoveredEntity);
90
}
91
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition
SCR_BaseGameModeComponent.c:15
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition
SCR_GameModeCampaign.c:1812
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupsManagerComponent.c:1747
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_AIGroup::GetGroupID
int GetGroupID()
Definition
SCR_AIGroup.c:935
SCR_EstablishBaseMapCommandCursor
Definition
SCR_EstablishBaseMapCommandCursor.c:2
SCR_FactionCommanderBaseMenuHandler::GetLocalCommanderComponent
SCR_FactionCommanderPlayerComponent GetLocalCommanderComponent()
Definition
SCR_FactionCommanderBaseMenuHandler.c:19
SCR_FactionCommanderBaseRequestMenuHandler
Definition
SCR_FactionCommanderBaseRequestMenuHandler.c:3
SCR_FactionCommanderBaseTaskMenuHandler::GetTaskPrefab
ResourceName GetTaskPrefab()
Definition
SCR_FactionCommanderBaseTaskMenuHandler.c:5
SCR_FactionCommanderEstablishBaseRequestMenuHandler
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:3
SCR_FactionCommanderEstablishBaseRequestMenuHandler::OnCommandIssued
override void OnCommandIssued(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:43
SCR_FactionCommanderEstablishBaseRequestMenuHandler::OnCommandExecuted
void OnCommandExecuted(vector position)
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:70
SCR_FactionCommanderEstablishBaseRequestMenuHandler::CanQuickEntryBeShown
override bool CanQuickEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:11
SCR_FactionCommanderEstablishBaseRequestMenuHandler::CanEntryBeSelected
override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText="")
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:24
SCR_FactionCommanderEstablishBaseRequestMenuHandler::m_Group
SCR_AIGroup m_Group
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:5
SCR_FactionCommanderEstablishBaseRequestMenuHandler::ESTABLISH_BASE_LIMIT_REACHED
const string ESTABLISH_BASE_LIMIT_REACHED
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:8
SCR_FactionCommanderEstablishBaseRequestMenuHandler::CanGroupEntryBeSelected
override bool CanGroupEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group, out string disabledText="")
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:37
SCR_FactionCommanderEstablishBaseRequestMenuHandler::CanEntryBeShown
override bool CanEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:83
SCR_FactionCommanderEstablishBaseRequestMenuHandler::m_MapCommandCursor
ref SCR_EstablishBaseMapCommandCursor m_MapCommandCursor
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:6
SCR_FactionCommanderEstablishBaseRequestMenuHandler::m_iRequesterGroup
int m_iRequesterGroup
Definition
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c:4
vector
Definition
vector.c:13
scripts
Game
FactionCommander
MenuHandlers
SCR_FactionCommanderEstablishBaseRequestMenuHandler.c
Generated by
1.17.0