Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FactionCommanderCommandConflictBaseMenuHandler.c
Go to the documentation of this file.
3{
4 [Attribute(desc:"If checked, player commander can only place this command on enemy base")]
5 protected bool m_bMustPlaceOnEnemyBase;
6
7 [Attribute("0 0 0", desc:"Task offset")]
9
10 //------------------------------------------------------------------------------------------------
11 override bool CanCreateObjectiveEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
12 {
13 if (!super.CanCreateObjectiveEntryBeShown(commanderFaction, playerId, position, hoveredEntity))
14 return false;
15
16 SCR_Task task = GetTask(hoveredEntity, commanderFaction, GetTaskPrefabClassTypename());
17 if (task)
18 return false;
19
20 return true;
21 }
22
23 //------------------------------------------------------------------------------------------------
24 override bool CanQuickEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
25 {
26 if (!super.CanQuickEntryBeShown(commanderFaction, playerId, position, hoveredEntity))
27 return false;
28
29 return IsTaskValid(hoveredEntity);
30 }
31
32 //------------------------------------------------------------------------------------------------
33 override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText = "")
34 {
36 if (!hoveredBase)
37 {
38 disabledText = BASE_NOT_SELECTED_TEXT;
39 return false;
40 }
41
42 SCR_CampaignFaction campaignFaction = SCR_CampaignFaction.Cast(commanderFaction);
43 if (!campaignFaction)
44 return false;
45
46 SCR_Task task = GetTask(hoveredEntity, commanderFaction, GetTaskPrefabClassTypename());
48 return false;
49
51 return hoveredBase.IsValidTarget(campaignFaction);
52
53 return hoveredBase.GetFaction() == commanderFaction;
54 }
55
56 //------------------------------------------------------------------------------------------------
57 override bool CanGroupEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
58 {
59 SCR_Task task = GetTask(hoveredEntity, commanderFaction, GetTaskPrefabClassTypename());
61 return false;
62
63 if (!super.CanGroupEntryBeShown(commanderFaction, playerId, position, hoveredEntity, group))
64 return false;
65
66 return true;
67 }
68
69 //------------------------------------------------------------------------------------------------
70 override bool CanGroupEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group, out string disabledText = "")
71 {
72 if (!super.CanGroupEntryBeSelected(commanderFaction, playerId, position, hoveredEntity, group))
73 return false;
74
75 return CanCampaignGroupEntryBeSelected(commanderFaction, hoveredEntity, group, GetTaskPrefabClassTypename());
76 }
77
78 //------------------------------------------------------------------------------------------------
79 override void OnCommandIssued(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
80 {
81 SCR_CampaignFactionCommanderPlayerComponent factionCommanderPlayerComponent = GetLocalCampaignCommanderComponent();
82 if (!factionCommanderPlayerComponent)
83 return;
84
85 SCR_Task task = GetTask(hoveredEntity, commanderFaction, GetTaskPrefabClassTypename());
86 if (!task)
87 {
88 factionCommanderPlayerComponent.CreateCampaignMilitaryBaseTask(GetTaskPrefab(), group, playerId, m_vPositionOffset);
89 return;
90 }
91
92 if (group)
93 factionCommanderPlayerComponent.AssignGroupToTask(group.GetGroupID(), task.GetTaskID());
94 }
95}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
vector position
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_ScenarioFrameworkTask GetTask()
void SCR_Task(IEntitySource src, IEntity parent)
Definition SCR_Task.c:1938
int GetGroupID()
bool IsValidTarget(notnull SCR_CampaignFaction faction)
override bool CanCreateObjectiveEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
override bool CanGroupEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
override bool CanQuickEntryBeShown(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity)
override bool CanEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, out string disabledText="")
override void OnCommandIssued(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group)
override bool CanGroupEntryBeSelected(notnull Faction commanderFaction, int playerId, vector position, IEntity hoveredEntity, SCR_AIGroup group, out string disabledText="")
bool CanCampaignGroupEntryBeSelected(notnull Faction faction, IEntity hoveredEntity, notnull SCR_AIGroup group, typename taskClass)
SCR_CampaignFactionCommanderPlayerComponent GetLocalCampaignCommanderComponent()
SCR_FieldOfViewSettings Attribute