Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FactionCommanderCancelMenuHandler.c
Go to the documentation of this file.
3{
4 //------------------------------------------------------------------------------------------------
5 override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText = "")
6 {
7 if (!IsTaskValid(hoveredEntity))
8 return false;
9
10 // commander can confirm all tasks if it is allowed by config
11 if (SCR_FactionCommanderPlayerComponent.IsLocalPlayerCommander())
12 return true;
13
14 return false;
15 }
16
17 //------------------------------------------------------------------------------------------------
18 override void OnCommandIssued(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
19 {
20 SCR_Task task = SCR_Task.Cast(hoveredEntity);
21 if (!task)
22 return;
23
24 if (!IsTaskValid(hoveredEntity))
25 return;
26
27 SCR_FactionCommanderPlayerComponent comp = GetLocalCommanderComponent();
28 if (!comp)
29 return;
30
31 comp.CancelTask(task.GetTaskID());
32 }
33}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
vector position
void SCR_Task(IEntitySource src, IEntity parent)
Definition SCR_Task.c:1938
SCR_FactionCommanderPlayerComponent GetLocalCommanderComponent()