Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionOnDamageStateChanged.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity to check damage changes on.")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(UIWidgets.Auto, desc: "What to do on damage state change")]
8 ref array<ref SCR_ScenarioFrameworkActionBase> m_aAction;
9
10 [Attribute(defvalue: "EDamageState.UNDAMAGED.ToString()", desc: "Activation Damage State", uiwidget: UIWidgets.ComboBox, enumType: EDamageState)]
11 EDamageState m_eActivationDamageState;
12
13 //------------------------------------------------------------------------------------------------
14 override void OnActivate(IEntity object)
15 {
16 if (!CanActivate())
17 return;
18
19 if (!ValidateInputEntity(object, m_Getter, m_Entity))
20 return;
21
22 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.GetDamageManager(m_Entity);
23 if (!objectDmgManager)
24 return;
25
26 objectDmgManager.GetOnDamageStateChanged().Insert(OnDamageStateChanged);
27 }
28
29 //------------------------------------------------------------------------------------------------
31 void OnDamageStateChanged(EDamageState state)
32 {
33 if (state != m_eActivationDamageState)
34 return;
35
36 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.GetDamageManager(m_Entity);
37 if (objectDmgManager)
38 objectDmgManager.GetOnDamageStateChanged().Remove(OnDamageStateChanged);
39
40 foreach (SCR_ScenarioFrameworkActionBase action : m_aAction)
41 {
42 action.OnActivate(m_Entity);
43 }
44 }
45
46 //------------------------------------------------------------------------------------------------
47 override array<ref SCR_ScenarioFrameworkActionBase> GetSubActions()
48 {
49 return m_aAction;
50 }
51}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_FieldOfViewSettings Attribute
EDamageState