Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
ppelightintensityparamsnative.c
Go to the documentation of this file.
1 //---------------------------------------------------------
2 //Native exceptions - legacy methods for direct access to specific postprocesses. Each one is evaluated and handled separately, this just connects them to the system.
3 
6 {
7  //g_Game.SetEVValue
8  static const int PARAM_LIGHT_MULT = 0;
9  static const int PARAM_NOISE_MULT = 1;
10 
11  static const int L_0_NVG = 100;
12  static const int L_0_TOXIC_TINT = 200;
13  static const int L_1_NVG = 100;
14  static const int L_1_TOXIC_TINT = 200;
15 
16  override int GetPostProcessEffectID()
17  {
18  return PPEExceptions.NVLIGHTPARAMS;
19  }
20 
21  override void RegisterMaterialParameters()
22  {
23  RegisterParameterScalarFloat(PARAM_LIGHT_MULT,"lightIntensityMul",1.0,0.0,50.0); //some reasonable values
24  RegisterParameterScalarFloat(PARAM_NOISE_MULT,"noiseIntensity",0.0,0.0,50.0); //some reasonable values
25  }
26 
27  override void ApplyValueChanges()
28  {
29  if (m_UpdatedParameters.Count() > 0)
30  {
31  SetFinalParameterValue(-1); //unique handling
32  }
33 
34  m_UpdatedParameters.Clear();
35  }
36 
38  override void SetFinalParameterValue(int parameter_idx)
39  {
40  array<float> array_values = new array<float>;
41 
42  for (int i = 0; i < PARAM_NOISE_MULT + 1; i++)
43  {
44  Param values = GetParameterCommandData(i).GetCurrentValues();
45  float value_var_float = Param1<float>.Cast(values).param1;
46  array_values.Insert(value_var_float);
47  }
48 
49  g_Game.NightVissionLightParams(array_values.Get(PARAM_LIGHT_MULT),array_values.Get(PARAM_NOISE_MULT));
50 
51  //DbgPrnt("PPEDebug | SetFinalParameterValue | PPELightIntensityParamsNative | float val: " + value_var_float);
52  }
53 }
PPEClassBase
Created once, on manager init. Script-side representation of C++ material class, separate handling.
Definition: ppematclassesbase.c:2
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
PPELightIntensityParamsNative
g_Game.NightVissionLightParams, does not directly use materials. Controls light multiplication and fi...
Definition: ppelightintensityparamsnative.c:5
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
PPEExceptions
PPEExceptions
Definition: ppeconstants.c:41
array< float >