Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseAIFactionCommander.c
Go to the documentation of this file.
3{
4 [Attribute()]
6
7 protected SCR_FactionCommanderHandlerComponent m_FactionCommanderHandlerComponent;
9 protected bool m_bIsAICommanderActivated
10
11 //------------------------------------------------------------------------------------------------
12 protected void OnAICommanderActivated()
13 {
14 m_bIsAICommanderActivated = true;
15 }
16
17 //------------------------------------------------------------------------------------------------
18 protected void OnAICommanderDeactivated()
19 {
20 m_bIsAICommanderActivated = false;
21 }
22
23 //------------------------------------------------------------------------------------------------
24 protected void OnFactionCommanderChanged(notnull SCR_Faction faction, int commanderPlayerId)
25 {
26 if (faction != m_Faction)
27 return;
28
30 }
31
32 //------------------------------------------------------------------------------------------------
35 void Init(notnull SCR_FactionCommanderHandlerComponent factionCommanderHandlerComponent)
36 {
37 m_FactionCommanderHandlerComponent = factionCommanderHandlerComponent;
38
39 FactionManager factionManager = GetGame().GetFactionManager();
40 if (!factionManager)
41 return;
42
43 m_Faction = SCR_Faction.Cast(factionManager.GetFactionByKey(m_sFactionKey));
44 if (!m_Faction)
45 return;
46
48
49 m_FactionCommanderHandlerComponent.GetOnFactionCommanderChanged().Insert(OnFactionCommanderChanged);
50 }
51
52 //------------------------------------------------------------------------------------------------
54 void Deinit()
55 {
57 return;
58
59 m_FactionCommanderHandlerComponent.GetOnFactionCommanderChanged().Remove(OnFactionCommanderChanged);
60 }
61
62 //------------------------------------------------------------------------------------------------
63 protected void UpdateAICommanderState()
64 {
65 if (!m_Faction)
66 return;
67
68 bool isAICommander = m_Faction.IsAICommander();
69 if (isAICommander == m_bIsAICommanderActivated)
70 return;
71
72 if (isAICommander)
74 else
76 }
77}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void Init(notnull SCR_FactionCommanderHandlerComponent factionCommanderHandlerComponent)
void OnFactionCommanderChanged(notnull SCR_Faction faction, int commanderPlayerId)
SCR_FactionCommanderHandlerComponent m_FactionCommanderHandlerComponent
void Deinit()
Deinit AI faction commander.
SCR_FieldOfViewSettings Attribute