Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionHideHint.c
Go to the documentation of this file.
3{
4 [Attribute()]
5 FactionKey m_sFactionKey;
6
7 [Attribute(desc: "Getter to get either a specific player or array of player entities")]
8 ref SCR_ScenarioFrameworkGet m_Getter;
9
10 //------------------------------------------------------------------------------------------------
11 override void OnActivate(IEntity object)
12 {
13 if (!CanActivate())
14 return;
15
17 if (!scenarioFrameworkSystem)
18 return;
19
20 PlayerManager playerManager = GetGame().GetPlayerManager();
21 if (!playerManager)
22 return;
23
24 int playerID = -1;
25 array<IEntity> aEntities;
26
27 if (m_Getter)
28 {
29 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
30 if (!entityWrapper)
31 {
32 SCR_ScenarioFrameworkParam<array<IEntity>> arrayOfEntitiesWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_Getter.Get());
33 if (!arrayOfEntitiesWrapper)
34 return;
35
36 aEntities = arrayOfEntitiesWrapper.GetValue();
37 if (!aEntities)
38 return;
39 }
40 else
41 {
42 IEntity entityFrom = entityWrapper.GetValue();
43 if (entityFrom)
44 playerID = playerManager.GetPlayerIdFromControlledEntity(entityFrom);
45 }
46 }
47 else
48 {
49 if (EntityUtils.IsPlayer(object))
50 playerID = playerManager.GetPlayerIdFromControlledEntity(object);
51 }
52
53 if (!aEntities)
54 {
55 if (playerID > -1)
56 HideHint(playerID);
57 }
58 else
59 {
60 foreach (IEntity entity : aEntities)
61 {
62 if (!EntityUtils.IsPlayer(entity))
63 continue;
64
65 playerID = playerManager.GetPlayerIdFromControlledEntity(entity);
66 if (playerID > -1)
67 HideHint(playerID);
68 }
69 }
70 }
71
72 //------------------------------------------------------------------------------------------------
73 void HideHint(int playerID)
74 {
76 if (!scenarioFrameworkSystem)
77 return;
78
79 // Resolve Alias
80 SCR_FactionAliasComponent factionAliasComponent = SCR_FactionAliasComponent.Cast(GetGame().GetFactionManager().FindComponent(SCR_FactionAliasComponent));
81 if (factionAliasComponent)
82 m_sFactionKey = factionAliasComponent.ResolveFactionAlias(m_sFactionKey);
83
84 scenarioFrameworkSystem.HideHint(m_sFactionKey, playerID);
85 }
86}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
void HideHint()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static SCR_ScenarioFrameworkSystem GetInstance()
void HideHint(FactionKey factionKey="", int playerID=-1)
SCR_FieldOfViewSettings Attribute