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