Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkRadioBaseUserAction.c
Go to the documentation of this file.
2{
3 [Attribute(desc: "Fill the conditions and it's values to be avaluated with this user action. If the condition isn't met, the user action will not be shown.")]
4 protected ref array<ref SCR_ScenarioFrameworkUserActionConditionData> m_aCustomConditionsList;
5
6 [Attribute("0", UIWidgets.ComboBox, desc: "How to evaluate set conditions.", enums: ParamEnumArray.FromEnum(SCR_EEvaluationType))]
7 protected SCR_EEvaluationType m_eEvaluationType;
8
9 [Attribute("", UIWidgets.Auto)]
10 ref SCR_AudioSourceConfiguration m_AudioSourceConfiguration;
11
14
15 //------------------------------------------------------------------------------------------------
16 protected override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
17 {
19 super.Init(pOwnerEntity, pManagerComponent);
20 }
21
22 //------------------------------------------------------------------------------------------------
23 override void OnActionStart(IEntity pUserEntity)
24 {
25 SCR_SoundManagerModule soundManager = SCR_SoundManagerModule.GetInstance(pUserEntity.GetWorld());
26 if (!soundManager)
27 return;
28
30 return;
31
32 SCR_AudioSource audioSource = soundManager.CreateAudioSource(GetOwner(), m_AudioSourceConfiguration);
33 if (!audioSource)
34 return;
35
36 soundManager.PlayAudioSource(audioSource);
37
38 m_AudioHandle = audioSource.m_AudioHandle;
39
40 super.OnActionStart(pUserEntity);
41 }
42
43 //------------------------------------------------------------------------------------------------
44 override void OnActionCanceled(IEntity pOwnerEntity, IEntity pUserEntity)
45 {
46 SCR_SoundManagerModule soundManager = SCR_SoundManagerModule.GetInstance(pUserEntity.GetWorld());
47 if (!soundManager)
48 return;
49
51 return;
52
53 soundManager.TerminateAudioSource(pOwnerEntity);
54
55 super.OnActionCanceled(pOwnerEntity, pUserEntity);
56 }
57
58 //------------------------------------------------------------------------------------------------
60 override protected bool CustomRadioCondition()
61 {
63 return false;
64
65 string value;
67 {
68 if (!m_ScenarioFrameworkSystem.GetVariable(condition.GetVariableName(), value))
69 {
70 if (m_eEvaluationType == SCR_EEvaluationType.AND)
71 return false;
72 else
73 continue;
74 }
75
76 if (value == condition.GetVariableValue())
77 {
78 if (m_eEvaluationType == SCR_EEvaluationType.AND)
79 continue;
80 else
81 return true;
82 }
83 else
84 {
85 if (m_eEvaluationType == SCR_EEvaluationType.AND)
86 return false;
87 else
88 continue;
89 }
90
91 }
92
93 return true;
94 }
95}
96
97
98enum SCR_EEvaluationType
99{
100 AND = 0,
101 OR = 1
102}
void SCR_AudioSource(SCR_AudioSourceConfiguration audioSourceConfiguration, vector mat[4])
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external BaseWorld GetWorld()
bool CustomRadioCondition()
Evaluate all set conditions for this user action.
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
override void OnActionCanceled(IEntity pOwnerEntity, IEntity pUserEntity)
ref array< ref SCR_ScenarioFrameworkUserActionConditionData > m_aCustomConditionsList
static SCR_ScenarioFrameworkSystem GetInstance()
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute