Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FactionCommanderBaseCancelRequestMenuHandler.c
Go to the documentation of this file.
3{
4 [Attribute(desc:"If true, player voted as commander can cancel request")]
6
7 //------------------------------------------------------------------------------------------------
8 override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText = "")
9 {
10 SCR_BaseRequestedTaskEntity task = SCR_BaseRequestedTaskEntity.Cast(hoveredEntity);
11 if (!task)
12 return false;
13
14 // commander can cancel all requests if it is allowed by config
15 if (SCR_FactionCommanderPlayerComponent.IsLocalPlayerCommander() && m_bCanBeCanceledByCommander)
16 return true;
17
18 SCR_PlayerControllerGroupComponent playerControllerGroupComponent = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
19 if (!playerControllerGroupComponent)
20 return false;
21
22 // group leader can't cancel own request if a group is already assigned
23 if (task.GetTaskAssigneeCount() > 0 ||
24 !task.RequestedByLocalPlayerGroup() ||
25 !playerControllerGroupComponent.IsPlayerLeaderOwnGroup())
26 return false;
27
28 return true;
29 }
30
31 //------------------------------------------------------------------------------------------------
32 override void OnCommandIssued(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
33 {
34 SCR_FactionCommanderPlayerComponent factionCommanderPlayerComponent = GetLocalCommanderComponent();
35
36 if (!factionCommanderPlayerComponent)
37 return;
38
39 SCR_BaseRequestedTaskEntity task = SCR_BaseRequestedTaskEntity.Cast(hoveredEntity);
40 if (!task)
41 return;
42
43 factionCommanderPlayerComponent.CancelTask(task.GetTaskID());
44 }
45}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
vector position
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
override void OnCommandIssued(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText="")
SCR_FactionCommanderPlayerComponent GetLocalCommanderComponent()
SCR_FieldOfViewSettings Attribute