Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionShowLayout.c
Go to the documentation of this file.
3{
4 [Attribute("", UIWidgets.ResourceNamePicker, "", "layout")]
6
7 [Attribute(desc: "Fade in time", params: "0 inf 0.01")]
8 float m_fFadeIn;
9
10 [Attribute(desc: "Fade out time", params: "0 inf 0.01")]
12
13 [Attribute(desc: "For how long the layout should stay visible.", params: "0 inf 0.001")]
15
16 [Attribute(desc: "Target value for opacity.", params: "0 1")]
18
19 [Attribute(desc: "Unique layout ID")]
20 int m_iID;
21
22 [Attribute(desc: "Getter to get either a specific player or array of player entities")]
24
25 //------------------------------------------------------------------------------------------------
26 override void OnActivate(IEntity object)
27 {
28 if (!CanActivate())
29 return;
30
32 if (!scenarioFrameworkSystem)
33 return;
34
35 PlayerManager playerManager = GetGame().GetPlayerManager();
36 if (!playerManager)
37 return;
38
39 int playerId = -1;
40 if (EntityUtils.IsPlayer(object))
41 playerId = playerManager.GetPlayerIdFromControlledEntity(object);
42
43 array<IEntity> aEntities;
44
45 if (m_Getter)
46 {
47 // Getter takes the priority. We set it back to -1 in case that object was player.
48 playerId = -1;
49
50 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
51 if (!entityWrapper)
52 {
53 SCR_ScenarioFrameworkParam<array<IEntity>> arrayOfEntitiesWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_Getter.Get());
54 if (!arrayOfEntitiesWrapper)
55 return;
56
57 aEntities = arrayOfEntitiesWrapper.GetValue();
58 if (!aEntities)
59 return;
60 }
61 else
62 {
63 IEntity entityFrom = entityWrapper.GetValue();
64 if (entityFrom)
65 playerId = playerManager.GetPlayerIdFromControlledEntity(entityFrom);
66 }
67 }
68
69 if (!aEntities)
70 {
71 scenarioFrameworkSystem.ShowLayout(playerId, object.GetID(), m_iID, m_fFadeIn, m_fFadeOut, m_fVisibilityTime, m_fOpacityValue);
72 }
73 else
74 {
75 foreach (IEntity entity : aEntities)
76 {
77 if (!EntityUtils.IsPlayer(entity))
78 continue;
79
80 playerId = playerManager.GetPlayerIdFromControlledEntity(entity);
81 scenarioFrameworkSystem.ShowLayout(playerId, object.GetID(), m_iID, m_fFadeIn, m_fFadeOut, m_fVisibilityTime, m_fOpacityValue);
82 }
83 }
84 }
85
86 //------------------------------------------------------------------------------------------------
91}
ArmaReforgerScripted GetGame()
Definition game.c:1398
override string GetID(string fileName, string varName, array< BaseContainer > objects, array< int > indexes)
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void ShowLayout(int playerId=-1, EntityID actionOwnerEntId=EntityID.INVALID, int layoutId=-1, float fadeIn=-1, float fadeOut=-1, float visibilityTime=-1, float opacity=-1)
static SCR_ScenarioFrameworkSystem GetInstance()
SCR_FieldOfViewSettings Attribute