Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_2DOpticsDisplay.c
Go to the documentation of this file.
1 void On2DOpticsADSChange(SCR_2DOpticsComponent comp, bool inADS);
3 
4 void On2DOpticsIlluminationChange(Color color, Color glowColor);
6 
7 class SCR_2DOpticsDisplay : SCR_InfoDisplayExtended
8 {
9  protected bool m_bActivated;
10  protected SCR_2DOpticsComponent m_Optic;
11 
12  protected ResourceName m_sReticleTexture;
13  protected ResourceName m_sReticleGlowTexture;
14  protected ResourceName m_sFilterTexture;
15 
16  // Optics data
17  protected float m_fOpticBaseFov;
18  protected float m_fOpticCurrentFov;
19  protected float m_fReticleSize;
20  protected float m_fReticleAngularSize;
21  protected float m_fReticlePortion;
22  protected float m_fReticleBaseZoom;
23  protected float m_fReticleOffsetX;
24  protected float m_fReticleOffsetY;
25  protected float m_fVignetteScale;
26  protected float m_fVignetteSize;
27  protected float m_fVignetteMoveSpeed;
28  protected float m_fObjectiveFov;
29  protected float m_fObjectiveScale;
30  protected float m_fObjectiveSize;
31  protected float m_fMisalignmentScale;
32  protected float m_fMisalignmentDampingSpeed;
33  protected float m_fRotationScale;
34  protected float m_fRotationDampingSpeed;
35  protected float m_fMovementScale;
36  protected float m_fMovementDampingSpeed;
37  protected float m_fRollScale;
38  protected float m_fRollDampingSpeed;
39  protected float m_fRollOffset;
40 
41  protected vector m_vMisalignmentOffset;
42  protected vector m_vObjectiveOffset; // Objective and reticle offset
43  protected vector m_vVignetteOffset; // Vignette SetReticleOffset
44  protected vector m_vRotation;
45  protected vector m_vRotationSpeed;
46  protected vector m_vRotationOffset;
47  protected vector m_vMovement;
48  protected vector m_vMovementSpeed;
49  protected vector m_vMovementOffset;
50 
51  protected bool m_bInitialBlurOver;
52 
53  // Default widget names
54  const string WIDGET_LAYOUT_REAR = "HRearEyePiece";
55  const string WIDGET_LAYOUT_FRONT = "HFrontObjective";
56  const string WIDGET_IMAGE_COVER = "ImgCover";
57 
58  const string WIDGET_SIZE_REAR = "SizeRear";
59  const string WIDGET_SIZE_OBJECTIVE = "SizeFrontObjective";
60 
61  const string WIDGET_IMAGE_PADDING_LEFT = "ImgPaddingLeft";
62  const string WIDGET_IMAGE_PADDING_RIGHT = "ImgPaddingRight";
63  const string WIDGET_IMAGE_PADDING_TOP = "ImgPaddingTop";
64  const string WIDGET_IMAGE_PADDING_BOTTOM = "ImgPaddingBottom";
65 
66  const string WIDGET_OVERLAY_RETICLES = "OverlayReticles";
67  const string WIDGET_IMAGE_RETICLE = "ImgReticle";
68  const string WIDGET_IMAGE_RETICLE_GLOW = "ImgReticleGlow";
69  const string WIDGET_IMAGE_VIGNETTE = "ImgVignette";
70  const string WIDGET_IMAGE_SCRATCHES = "ImgScratches";
71  const string WIDGET_BLUR = "Blur";
72  const string WIDGET_IMAGE_FILTER = "ImgFilter";
73 
74  const string WIDGET_SIZE_LEFT = "SizePaddingLeft";
75  const string WIDGET_SIZE_TOP = "SizePaddingTop";
76 
77  const float OPACITY_INITIAL = 0.75;
78 
79  protected Widget m_wLayoutRear;
80  protected Widget m_wLayoutFront;
81  protected ImageWidget m_wImgCover;
82  protected ImageWidget m_wImgScratches;
83 
84  protected Widget m_wOverlayReticles;
85  protected ImageWidget m_wImgReticle;
86  protected ImageWidget m_wImgReticleGlow;
87  protected BlurWidget m_wBlur;
88  protected ImageWidget m_wImgFilter;
89 
90  protected SizeLayoutWidget m_wRearFillLeft;
91  protected SizeLayoutWidget m_wRearFillTop;
92  protected SizeLayoutWidget m_wFrontFillLeft;
93  protected SizeLayoutWidget m_wFrontFillTop;
94 
95  protected SizeLayoutWidget m_wSizeLayoutRear;
96  protected SizeLayoutWidget m_wSizeLayoutObjective;
97 
98  //------------------------------------------------------------------------------------------------
99  protected void OnLayoutChanged(SCR_HUDLayout newLayout, SCR_HUDLayout oldLayout, SCR_HUDManagerComponent hudManager)
100  {
101  if (!m_bActivated)
102  DeactivateWidget();
103  }
104 
105  //------------------------------------------------------------------------------------------------
106  protected override void DisplayStartDraw(IEntity owner)
107  {
108  if (!m_wRoot)
109  return;
110 
111  m_wRoot.SetVisible(false);
112 
113  FindWidgets();
114 
115  SCR_2DOpticsComponent.s_On2DOpticADSChanged.Insert(OnADSChange);
116 
118  if (layoutHandler)
119  layoutHandler.GetOnLayoutChange().Insert(OnLayoutChanged);
120 
121 #ifdef ENABLE_DIAG
122  if (!s_bOpticDiagRegistered)
123  {
124  DiagMenu.RegisterBool(SCR_DebugMenuID.DEBUGUI_WEAPONS_OPTICS_USE_2D, "", "Toggle 2D optics", "Weapons");
125  DiagMenu.RegisterBool(SCR_DebugMenuID.DEBUGUI_WEAPONS_OPTICS, "", "Show optics diag", "Weapons");
126  s_bOpticDiagRegistered = true;
127  }
128 #endif
129  }
130 
131  //------------------------------------------------------------------------------------------------
132  protected override void DisplayStopDraw(IEntity owner)
133  {
134  SCR_2DOpticsComponent.s_On2DOpticADSChanged.Remove(OnADSChange);
135 
136  if (!m_Optic)
137  return;
138 
139  m_Optic.OnSetupOpticImage().Remove(SetupOpticImage);
140  m_Optic.OnIlluminationChange().Remove(ChangeReticleTint);
141  }
142 
143  //------------------------------------------------------------------------------------------------
144  protected override void DisplayUpdate(IEntity owner, float timeSlice)
145  {
146 #ifdef ENABLE_DIAG
147  if (s_bToggle2DOptics != DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_WEAPONS_OPTICS_USE_2D))
148  {
149  s_bToggle2DOptics = !s_bToggle2DOptics;
150  SetScope2DEnabled(!SCR_Global.IsScope2DEnabled());
151  }
152 
153  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_WEAPONS_OPTICS))
154  DebugOptics();
155 #endif
156 
157  if (!m_Optic)
158  return;
159 
160  if (!m_bInADS && !SCR_BinocularsComponent.IsZoomedView() && !m_Optic.GetIsZoomed())
161  return;
162 
163  // Widget check
164  if (!m_wLayoutRear || !m_wLayoutFront)
165  return;
166 
167  UpdateCurrentFov();
168 
169  MoveScopeWidgets(timeSlice);
170  LowerBlurIntensity(timeSlice, m_Optic.GetAnimationSpeedBlur());
171 
172  m_fReticleOffsetX = m_Optic.GetReticleOffsetX();
173  m_fReticleOffsetY = m_Optic.GetCurrentReticleOffsetY();
174  SetReticleOffset(m_fReticleOffsetX, m_fReticleOffsetY);
175  }
176 
177  //------------------------------------------------------------------------------------------------
179  protected void FindWidgets()
180  {
181  // Parts
182  m_wLayoutRear = m_wRoot.FindAnyWidget(WIDGET_LAYOUT_REAR);
183  m_wLayoutFront = m_wRoot.FindAnyWidget(WIDGET_LAYOUT_FRONT);
184  m_wImgCover = ImageWidget.Cast(m_wRoot.FindAnyWidget(WIDGET_IMAGE_COVER));
185  m_wImgScratches = ImageWidget.Cast(m_wRoot.FindAnyWidget(WIDGET_IMAGE_SCRATCHES));
186 
187  if (!m_wLayoutRear || !m_wLayoutFront)
188  {
189  Print("Scope vignette movement is not possible due to missing widget references!", LogLevel.WARNING);
190  return;
191  }
192 
193  // Rear part - eye piece
194  m_wSizeLayoutRear = SizeLayoutWidget.Cast(m_wLayoutRear.FindAnyWidget(WIDGET_SIZE_REAR));
195  m_wRearFillLeft = SizeLayoutWidget.Cast(m_wLayoutRear.FindAnyWidget(WIDGET_SIZE_LEFT));
196  m_wRearFillTop = SizeLayoutWidget.Cast(m_wLayoutRear.FindAnyWidget(WIDGET_SIZE_TOP));
197 
198  // Front part - objective
199  m_wSizeLayoutObjective = SizeLayoutWidget.Cast(m_wLayoutFront.FindAnyWidget(WIDGET_SIZE_OBJECTIVE));
200  m_wFrontFillLeft = SizeLayoutWidget.Cast(m_wLayoutFront.FindAnyWidget(WIDGET_SIZE_LEFT));
201  m_wFrontFillTop = SizeLayoutWidget.Cast(m_wLayoutFront.FindAnyWidget(WIDGET_SIZE_TOP));
202 
203  m_wOverlayReticles = m_wLayoutFront.FindAnyWidget(WIDGET_OVERLAY_RETICLES);
204  m_wImgReticle = ImageWidget.Cast(m_wLayoutFront.FindAnyWidget(WIDGET_IMAGE_RETICLE));
205  m_wImgReticleGlow = ImageWidget.Cast(m_wLayoutFront.FindAnyWidget(WIDGET_IMAGE_RETICLE_GLOW));
206  m_wBlur = BlurWidget.Cast(m_wRoot.FindAnyWidget(WIDGET_BLUR));
207  m_wImgFilter = ImageWidget.Cast(m_wLayoutFront.FindAnyWidget(WIDGET_IMAGE_FILTER));
208  }
209 
210  //------------------------------------------------------------------------------------------------
212  void SetupOpticImage()
213  {
214  // Setup reticle
215  if (!m_sReticleTexture.IsEmpty())
216  m_wImgReticle.LoadImageTexture(0, m_sReticleTexture);
217 
218  m_wImgReticleGlow.SetVisible(!m_sReticleTexture.IsEmpty());
219 
220  if (!m_sReticleGlowTexture.IsEmpty())
221  m_wImgReticleGlow.LoadImageTexture(0, m_sReticleGlowTexture);
222 
223  m_wImgReticleGlow.SetVisible(!m_sReticleGlowTexture.IsEmpty());
224 
225  // Setup lens filter
226  if (!m_sFilterTexture.IsEmpty())
227  m_wImgFilter.LoadImageTexture(0, m_sFilterTexture);
228 
229  m_wImgFilter.SetVisible(!m_sFilterTexture.IsEmpty());
230 
231  UpdateCurrentFov(true);
232  }
233 
234  //------------------------------------------------------------------------------------------------
235  void UpdateCurrentFov(bool forceUpdate = false)
236  {
237  float fov;
238  if (m_Optic)
239  {
240  // for binoculars getFOV is wrong
241  SCR_FixedFOVInfo fixedFOVInfo = SCR_FixedFOVInfo.Cast(m_Optic.GetFOVInfo());
242  if (fixedFOVInfo)
243  fov = m_Optic.GetFovZoomed();
244  else
245  fov = m_Optic.GetFOV();
246  }
247  else
248  {
249  CameraBase camera = GetGame().GetCameraManager().CurrentCamera();
250  if (camera)
251  fov = camera.GetVerticalFOV();
252  }
253 
254  if (!float.AlmostEqual(m_fOpticCurrentFov, fov))
255  m_fOpticCurrentFov = fov;
256  else if (!forceUpdate)
257  return;
258 
259  UpdateReticleSize();
260  }
261 
262  //------------------------------------------------------------------------------------------------
264  void UpdateReticleSize()
265  {
266  // Compute reticle base FOV once
267  if (m_fReticleBaseZoom > 0)
268  m_fReticleBaseZoom = -m_Optic.CalculateZoomFOV(m_fReticleBaseZoom);
269 
270  float fovReticle;
271  if (m_fReticleBaseZoom == 0)
272  fovReticle = m_fOpticCurrentFov;
273  else
274  fovReticle = -m_fReticleBaseZoom;
275 
276  // Account for part that represents the measurable reticle
277  float reticleAngularSize;
278  if (m_fReticlePortion > 0)
279  reticleAngularSize = m_fReticleAngularSize / m_fReticlePortion;
280 
281  if (fovReticle > 0)
282  m_fReticleSize = reticleAngularSize / fovReticle;
283  else if (m_fOpticBaseFov > 0)
284  m_fReticleSize = reticleAngularSize / m_fOpticBaseFov;
285 
286  UpdateScale(1, 1, 1);
287  }
288 
289  //------------------------------------------------------------------------------------------------
290  protected void OnADSChange(notnull SCR_2DOpticsComponent comp, bool inADS)
291  {
292  if (m_Optic != comp)
293  {
294  // Clear previous optic invokers as well
295  if (m_Optic)
296  {
297  m_Optic.OnSetupOpticImage().Remove(SetupOpticImage);
298  m_Optic.OnIlluminationChange().Remove(ChangeReticleTint);
299  }
300 
301  m_Optic = comp;
302 
303  GetOpticData();
304  }
305 
306  if (inADS)
307  {
308  m_Optic.OnSetupOpticImage().Insert(SetupOpticImage);
309  m_Optic.OnIlluminationChange().Insert(ChangeReticleTint);
310  }
311  else
312  {
313  m_Optic.OnSetupOpticImage().Remove(SetupOpticImage);
314  m_Optic.OnIlluminationChange().Remove(ChangeReticleTint);
315  Deactivate();
316  return;
317  }
318 
319  m_wRoot.SetZOrder(-1);
320  m_wRoot.SetVisible(false);
321 
322  m_bInitialBlurOver = false;
323 
324  m_vMisalignmentOffset = vector.Zero;
325 
326  m_Optic.GetRotation(m_vRotation, 1);
327  m_vRotationSpeed = vector.Zero;
328  m_vRotationOffset = vector.Zero;
329 
330  m_Optic.GetMovement(m_vMovement, 1);
331 
332  m_vMovementSpeed = vector.Zero;
333  m_vMovementOffset = vector.Zero;
334 
335  SetupOpticImage();
336 
337  Activate();
338  }
339 
340  //------------------------------------------------------------------------------------------------
341  protected void Activate()
342  {
343  // Prevent calnceling animation
344  AnimateWidget.StopAnimation(m_wRoot, WidgetAnimationOpacity);
345  GetGame().GetCallqueue().Remove(DeactivateWidget);
346 
347  // Activate and setup hud
348  m_wRoot.SetVisible(true);
349  m_wImgCover.SetVisible(false);
350  m_wRoot.SetOpacity(0);
351 
352  // Blur
353  m_wBlur.SetIntensity(OPACITY_INITIAL);
354  m_wBlur.SetOpacity(1);
355 
356  m_bActivated = true;
357 
358  //Play fadeIn animation after given delay
359  GetGame().GetCallqueue().CallLater(PlayEntryAnimation, m_Optic.GetAnimationActivationDelay(), false, m_Optic.GetAnimationEnterTime());
360  }
361 
362  //------------------------------------------------------------------------------------------------
364  protected void Deactivate()
365  {
366  m_bActivated = false;
367 
368  // Prevent entering animation
369  AnimateWidget.StopAnimation(m_wRoot, WidgetAnimationOpacity);
370  GetGame().GetCallqueue().Remove(PlayEntryAnimation);
371 
372  //Deactivate the HUD after set delay
373  if (m_Optic)
374  GetGame().GetCallqueue().CallLater(DeactivateWidget, m_Optic.GetAnimationDeactivationDelay(), false);
375  }
376 
377  //------------------------------------------------------------------------------------------------
380  protected void PlayEntryAnimation(float animationSpeed)
381  {
382  if (animationSpeed > 0)
383  AnimateWidget.Opacity(m_wRoot, 1, animationSpeed);
384  else
385  m_wRoot.SetOpacity(1);
386  }
387 
388  //------------------------------------------------------------------------------------------------
390  protected void DeactivateWidget()
391  {
392  if (m_wImgCover)
393  m_wImgCover.SetOpacity(0);
394 
395  if (m_wRoot)
396  m_wRoot.SetVisible(false);
397  }
398 
399  //------------------------------------------------------------------------------------------------
401  void GetOpticData()
402  {
403  m_Optic.GetReticleTextures(m_sReticleTexture, m_sReticleGlowTexture, m_sFilterTexture);
404  m_Optic.GetReticleData(m_fReticleAngularSize, m_fReticlePortion, m_fReticleBaseZoom);
405  m_fOpticBaseFov = m_Optic.GetFovZoomed();
406  m_fObjectiveFov = m_Optic.GetObjectiveFov();
407  m_fObjectiveScale = m_Optic.GetObjectiveScale();
408  m_fVignetteScale = m_Optic.GetVignetteScale();
409  m_fVignetteMoveSpeed = m_Optic.GetVignetteMoveSpeed();
410  m_fMisalignmentScale = m_Optic.GetMisalignmentScale();
411  m_fMisalignmentDampingSpeed = m_Optic.GetMisalignmentDampingSpeed();
412  m_fRotationScale = m_Optic.GetRotationScale();
413  m_fRotationDampingSpeed = m_Optic.GetRotationDampingSpeed();
414  m_fMovementScale = m_Optic.GetMovementScale();
415  m_fMovementDampingSpeed = m_Optic.GetMovementDampingSpeed();
416  m_fRollScale = m_Optic.GetRollScale();
417  m_fRollDampingSpeed = m_Optic.GetRollDampingSpeed();
418 
419 #ifdef ENABLE_DIAG
420  s_bDebugOpticsReset = true;
421 #endif
422  }
423 
424  //------------------------------------------------------------------------------------------------
426  void UpdateScale(float reticleScale, float vignetteScale, float objectiveScale)
427  {
428  float uiScale = 1;
429  WorkspaceWidget workspace = GetGame().GetWorkspace();
430  if (workspace)
431  uiScale = workspace.DPIUnscale(workspace.GetHeight());
432 
433  // Reticle size setup
434  if (m_wOverlayReticles)
435  {
436  float reticleSize = m_fReticleSize * uiScale * reticleScale;
437  FrameSlot.SetSize(m_wOverlayReticles, reticleSize, reticleSize);
438  }
439 
440  // Vignette size setup
441  if (m_wSizeLayoutRear)
442  {
443  m_fVignetteSize = m_fObjectiveFov * m_fVignetteScale * uiScale * vignetteScale / m_fOpticBaseFov;
444 
445  m_wSizeLayoutRear.SetWidthOverride(m_fVignetteSize);
446  m_wSizeLayoutRear.SetHeightOverride(m_fVignetteSize);
447  }
448 
449  // Ocular size setup
450  if (m_wSizeLayoutObjective)
451  {
452  m_fObjectiveSize = m_fObjectiveFov * m_fObjectiveScale * uiScale * objectiveScale / m_fOpticBaseFov;
453 
454  m_wSizeLayoutObjective.SetWidthOverride(m_fObjectiveSize);
455  m_wSizeLayoutObjective.SetHeightOverride(m_fObjectiveSize);
456  }
457  }
458 
459  //------------------------------------------------------------------------------------------------
463  void SetReticleOffset(float x, float y)
464  {
465  if (!m_wOverlayReticles)
466  return;
467 
468  WorkspaceWidget workspace = GetGame().GetWorkspace();
469  if (!workspace)
470  return;
471 
472  float fov = m_fOpticBaseFov;
473  CameraManager cameraManager = GetGame().GetCameraManager();
474  if (cameraManager)
475  {
476  CameraBase camera = cameraManager.CurrentCamera();
477  if (camera)
478  fov = camera.GetVerticalFOV();
479  }
480 
481  float uiHeight = workspace.DPIUnscale(workspace.GetHeight());
482  float offsetX = x * uiHeight / fov;
483  float offsetY = y * uiHeight / fov;
484 
485  FrameSlot.SetPos(m_wOverlayReticles, offsetX, offsetY);
486 
487  vector size = FrameSlot.GetSize(m_wOverlayReticles);
488  if (m_wImgReticle)
489  {
490  float pivotX = 0.5 - (offsetX / size[0]);
491  float pivotY = 0.5 - (offsetY / size[1]);
492  m_wImgReticle.SetPivot(pivotX, pivotY);
493  }
494 
495  if (m_wImgReticleGlow)
496  {
497  float pivotX = 0.5 - (offsetX / size[0]);
498  float pivotY = 0.5 - (offsetY / size[1]);
499  m_wImgReticleGlow.SetPivot(pivotX, pivotY);
500  }
501  }
502 
503  //------------------------------------------------------------------------------------------------
507  protected void LowerBlurIntensity(float timeSlice, float speed)
508  {
509  if (!m_wBlur)
510  return;
511 
512  float intensity = m_wBlur.GetIntensity();
513  intensity = Math.Lerp(intensity, 0, timeSlice * speed);
514 
515  // Clear initial bluer
516  if (intensity < 0.1 && !m_bInitialBlurOver)
517  {
518  m_bInitialBlurOver = true;
519  intensity = 0;
520  }
521 
522  m_wBlur.SetIntensity(intensity);
523  }
524 
525  //------------------------------------------------------------------------------------------------
529  protected void ChangeReticleTint(Color color, Color colorGlow)
530  {
531  if (m_wImgReticleGlow)
532  m_wImgReticleGlow.SetColor(colorGlow);
533 
534  if (m_wImgReticle)
535  m_wImgReticle.SetColor(color);
536  }
537 
538  //------------------------------------------------------------------------------------------------
540  protected void MoveScopeWidgets(float timeSlice)
541  {
542  // Only valid if there is main camera
543  CameraManager cameraManager = GetGame().GetCameraManager();
544  if (!cameraManager)
545  return;
546 
547  CameraBase camera = cameraManager.CurrentCamera();
548  if (!camera)
549  return;
550 
551  // Only positive FOV allowed
552  float fov = camera.GetVerticalFOV();
553  if (fov <= 0)
554  return;
555 
556  // Update vignette and reticle direction and roll
557  vector misalignment = m_Optic.GetMisalignmentAngles(camera);
558 
559  // Stabilize roll
560  float roll = misalignment[2] * m_fRollScale;
561  if (m_fRollDampingSpeed > 0)
562  {
563  float rollSmooth = Math.Min(1, timeSlice * m_fRollDampingSpeed);
564  m_fRollOffset = Math.Lerp(m_fRollOffset, roll, rollSmooth);
565  roll -= m_fRollOffset;
566  }
567 
568  // Stabilize binocular reticle over time
569  if (m_fMisalignmentDampingSpeed > 0)
570  {
571  float offsetDamping = Math.Min(timeSlice * m_fMisalignmentDampingSpeed, 1);
572  m_vMisalignmentOffset = vector.Lerp(m_vMisalignmentOffset, misalignment, offsetDamping);
573  misalignment = misalignment - m_vMisalignmentOffset;
574  }
575 
576  // Stabilize rotation speed over time
577  vector rotation = m_Optic.GetRotation(m_vRotation, timeSlice);
578  if (m_fRotationDampingSpeed > 0)
579  {
580  float rotationDamping = Math.Min(timeSlice * m_fRotationDampingSpeed, 1);
581  m_vRotationOffset = vector.Lerp(m_vRotationOffset, rotation, rotationDamping);
582  rotation = rotation - m_vRotationOffset;
583  }
584 
585  // Movement is also stabilizable
586  vector movement = m_Optic.GetMovement(m_vMovement, timeSlice);
587  if (m_fMovementDampingSpeed > 0)
588  {
589  float movementDamping = Math.Min(timeSlice * m_fMovementDampingSpeed, 1);
590  m_vMovementOffset = vector.Lerp(m_vMovementOffset, movement, movementDamping);
591  movement = movement - m_vMovementOffset;
592  }
593 
594  // Make sure lerp doesn't go out of bounds
595  float vignetteMove = Math.Min(timeSlice * m_fVignetteMoveSpeed, 1);
596 
597  m_vVignetteOffset = vector.Lerp(m_vVignetteOffset, m_fMisalignmentScale * misalignment, vignetteMove);
598 
599  // Objective must be set instantly
600  m_vObjectiveOffset = m_fMisalignmentScale * misalignment;
601 
602  if (m_fRotationScale > 0)
603  m_vVignetteOffset = m_vVignetteOffset - rotation * m_fRotationScale;
604 
605  if (m_fMovementScale > 0)
606  m_vVignetteOffset = m_vVignetteOffset + movement * m_fMovementScale;
607 
608  WorkspaceWidget workspace = GetGame().GetWorkspace();
609 
610  float screenW, screenH;
611  workspace.GetScreenSize(screenW, screenH);
612  screenW = workspace.DPIUnscale(screenW);
613  screenH = workspace.DPIUnscale(screenH);
614 
615  float pixelsPerDegree = screenH / fov;
616 
617  // Vignette movement
618  float defaultRearLeft = VignetteDefaultPosition(screenW, m_fVignetteSize);
619  float defaultRearTop = VignetteDefaultPosition(screenH, m_fVignetteSize);
620 
621  float rearPaddingLeft = defaultRearLeft + pixelsPerDegree * m_vVignetteOffset[0];
622  float rearPaddingTop = defaultRearTop - pixelsPerDegree * m_vVignetteOffset[1];
623 
624  m_wRearFillLeft.SetWidthOverride(rearPaddingLeft);
625  m_wRearFillTop.SetHeightOverride(rearPaddingTop);
626 
627  // Objective and reticle movement
628  float defaultFrontLeft = VignetteDefaultPosition(screenW, m_fObjectiveSize);
629  float defaultFrontTop = VignetteDefaultPosition(screenH, m_fObjectiveSize);
630 
631  float frontPaddingLeft = defaultFrontLeft + pixelsPerDegree * m_vObjectiveOffset[0];
632  float frontPaddingTop = defaultFrontTop - pixelsPerDegree * m_vObjectiveOffset[1];
633 
634  m_wFrontFillLeft.SetWidthOverride(frontPaddingLeft);
635  m_wFrontFillTop.SetHeightOverride(frontPaddingTop);
636 
637  // Reticle rotation
638  if (m_wImgReticle)
639  m_wImgReticle.SetRotation(roll);
640 
641  if (m_wImgReticleGlow)
642  m_wImgReticleGlow.SetRotation(roll);
643 
644  if (m_wImgFilter)
645  m_wImgFilter.SetRotation(roll);
646 
647  if (m_wImgCover)
648  m_wImgCover.SetRotation(roll);
649 
650  if (m_wImgScratches)
651  m_wImgScratches.SetRotation(roll + m_Optic.GetScratchesRoll());
652 
653  // Motion offset blur
654  if (m_bInitialBlurOver)
655  MotionBlur(m_vVignetteOffset[0], m_vVignetteOffset[1]);
656  }
657 
658  //------------------------------------------------------------------------------------------------
659  protected void MotionBlur(float posX, float posY)
660  {
661  if (!m_wBlur)
662  return;
663 
664  // Check movement
665  if (!m_Optic.GetIsMoving() || !m_Optic.GetIsRotating())
666  return;
667 
668  // Pick axis
669  float intensity = Math.AbsFloat(posX);
670  if (intensity > Math.AbsFloat(posY))
671  intensity = Math.AbsFloat(posY);
672 
673  // Scale and limit
674  intensity = intensity * m_Optic.GetMotionBlurScale();
675  if (intensity > m_Optic.GetMotionBlurMax())
676  intensity = m_Optic.GetMotionBlurMax();
677 
678  m_wBlur.SetIntensity(intensity);
679  }
680 
681  //------------------------------------------------------------------------------------------------
682  protected float VignetteDefaultPosition(float screenSize, float vignetteSize)
683  {
684  float defaultPos = (screenSize - vignetteSize) * 0.5;
685  if (defaultPos < 0)
686  defaultPos = 0;
687  return defaultPos;
688  }
689 
690 #ifdef ENABLE_DIAG
691  protected static bool s_bOpticDiagRegistered;
692  protected static bool s_bToggle2DOptics;
693  protected static bool s_bDebugOptics;
694  protected static bool s_bDebugOpticsReset;
695  protected static bool s_bDebug2DOptics;
696  protected static bool s_bDebug2DOpticsReset;
697  protected static bool s_bDebugDrawReset;
698  protected static bool s_bDebugDrawCross = true;
699  protected static bool s_bDebugDrawNotches = true;
700  protected static bool s_bDebugDrawFieldOfView = true;
701  protected static bool s_bDebugDrawRandomColors;
702 
703  protected static SCR_EOpticsAngleUnits s_eCrossUnit = SCR_EOpticsAngleUnits.RETICLE;
704  protected static float s_fCrossUnit = 0.05625;
705  protected static float s_fCrossRadius = 100;
706 
707  protected static SCR_EOpticsAngleUnits s_eNotchesUnit = SCR_EOpticsAngleUnits.RETICLE;
708  protected static float s_fNotchesUnit = 0.05625;
709  protected static float s_fNotchesSize = 100;
710  protected static float s_fNotchesSmallLength = 5;
711  protected static float s_fNotchesSmallSpacing = 5;
712  protected static float s_fNotchesLargeLength = 10;
713  protected static float s_fNotchesLargeSpacing = 10;
714 
715  protected static SCR_EOpticsAngleUnits s_eFieldOfViewUnit = SCR_EOpticsAngleUnits.OBJECTIVE;
716  protected static float s_fFieldOfViewUnit = 0.05625;
717  protected static float s_fFieldOfViewAngle = 100;
718 
719  protected static ref array<int> s_aRandomColors = {COLOR_BLUE, COLOR_RED, COLOR_GREEN, COLOR_YELLOW};
720  protected static int s_iLineColor;
721 
722  //------------------------------------------------------------------------------------------------
723  protected void InputFloatClamped(inout float value, string label, float min, float max, int pxWidth = 100)
724  {
725  DbgUI.InputFloat(label, value, pxWidth);
726  value = Math.Clamp(value, min, max);
727  }
728 
729  //------------------------------------------------------------------------------------------------
730  void DebugOptics()
731  {
732  if (s_bDebugOpticsReset)
733  {
734  s_bDebugOpticsReset = false;
735 
736  if (!SCR_Global.IsScope2DEnabled())
737  {
738  SetScope2DEnabled(true);
739  s_bToggle2DOptics = !DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_WEAPONS_OPTICS_USE_2D);
740  }
741 
742  return;
743  }
744 
745  if (s_bDebugDrawReset)
746  {
747  s_bDebugDrawReset = false;
748  s_bDebugDrawCross = true;
749  s_bDebugDrawNotches = true;
750  s_bDebugDrawFieldOfView = true;
751  s_bDebugDrawRandomColors = false;
752 
753  s_eCrossUnit = SCR_EOpticsAngleUnits.RETICLE;
754  s_fCrossUnit = 0.05625;
755  s_fCrossRadius = 100;
756 
757  s_eNotchesUnit = SCR_EOpticsAngleUnits.RETICLE;
758  s_fNotchesUnit = 0.05625;
759  s_fNotchesSize = 100;
760  s_fNotchesSmallLength = 5;
761  s_fNotchesSmallSpacing = 5;
762  s_fNotchesLargeLength = 10;
763  s_fNotchesLargeSpacing = 10;
764 
765  s_eFieldOfViewUnit = SCR_EOpticsAngleUnits.OBJECTIVE;
766  s_fFieldOfViewUnit = 0.05625;
767  s_fFieldOfViewAngle = 100;
768 
769  return;
770  }
771 
772  vector sightMat[4];
773 
774  if (m_Optic)
775  {
776  m_Optic.GetSightsTransform(sightMat, true);
777  sightMat[3] = m_Optic.GetSightsFrontPosition(true);
778  vector ownerMat[4];
779  m_Optic.GetOwner().GetWorldTransform(ownerMat);
780  Math3D.MatrixMultiply4(ownerMat, sightMat, sightMat);
781  }
782 
783  // In case of binoculars, side and up vector is expected to match camera
784  CameraBase camera = GetGame().GetCameraManager().CurrentCamera();
785  if (camera && m_fRollDampingSpeed != 0)
786  {
787  vector cameraMat[4];
788  camera.GetTransform(cameraMat);
789  sightMat[0] = cameraMat[0];
790  sightMat[1] = cameraMat[1];
791  }
792 
793  DbgUI.Begin("Optics", 100, 300);
794 
795  array<string> units = {};
796  SCR_Enum.GetEnumNames(SCR_EOpticsAngleUnits, units);
797 
799  {
800  DbgUI.Text("________________________________________");
801  DbgUI.Check("OPTICS ", s_bDebugOptics);
802  }
803 
804  // Basic reticle and objective FOV settings
805  if (s_bDebugOptics)
806  {
807  {
808  InputFloatClamped(m_fObjectiveFov, "m_fObjectiveFov deg", 0, 100);
809  InputFloatClamped(m_fObjectiveScale, "m_fObjectiveScale %", 0, 100);
810  InputFloatClamped(m_fReticleBaseZoom, "m_fReticleBaseZoom x", -60, 200);
811  InputFloatClamped(m_fReticleAngularSize, "m_fReticleAngularSize deg", 0, 100);
812  InputFloatClamped(m_fReticlePortion, "m_fReticlePortion %", 0, 100);
813  InputFloatClamped(m_fReticleOffsetX, "m_fReticleOffsetX deg", -90, 90);
814  InputFloatClamped(m_fReticleOffsetY, "m_fReticleOffsetY deg", -90, 90);
815  }
816 
817  if (m_Optic && DbgUI.Button("LOAD OPTICS ATTRIBUTES"))
818  GetOpticData();
819 
820  if (m_Optic && DbgUI.Button("SAVE OPTICS ATTRIBUTES"))
821  {
822  m_Optic.SetObjectiveFov(m_fObjectiveFov);
823  m_Optic.SetObjectiveScale(m_fObjectiveScale);
824  m_Optic.SetReticleBaseZoom(m_fReticleBaseZoom);
825  m_Optic.SetReticleAngularSize(m_fReticleAngularSize);
826  m_Optic.SetReticlePortion(m_fReticlePortion);
827  m_Optic.SetReticleOffsetX(m_fReticleOffsetX);
828  m_Optic.SetReticleOffsetY(m_fReticleOffsetY);
829  }
830  }
831 
833  {
834  DbgUI.Text("________________________________________");
835  DbgUI.Check("2D OPTICS ", s_bDebug2DOptics);
836  }
837 
838  // 2D optics features attributes
839  if (s_bDebug2DOptics)
840  {
841  {
842  InputFloatClamped(m_fVignetteScale, "m_fVignetteScale ", 0, 100);
843  InputFloatClamped(m_fVignetteMoveSpeed, "m_fVignetteMoveSpeed ", -100, 100);
844  InputFloatClamped(m_fMisalignmentScale, "m_fMisalignmentScale ", -100, 100);
845  InputFloatClamped(m_fMisalignmentDampingSpeed, "m_fMisalignmentDampingSpeed ", -100, 100);
846  InputFloatClamped(m_fRotationScale, "m_fRotationScale ", -100, 100);
847  InputFloatClamped(m_fRotationDampingSpeed, "m_fRotationDampingSpeed ", -100, 100);
848  InputFloatClamped(m_fMovementScale, "m_fMovementScale ", -100, 100);
849  InputFloatClamped(m_fMovementDampingSpeed, "m_fMovementDampingSpeed ", -100, 100);
850  InputFloatClamped(m_fRollScale, "m_fRollScale ", -100, 100);
851  InputFloatClamped(m_fRollDampingSpeed, "m_fRollDampingSpeed ", -100, 100);
852  }
853  }
854 
855  // Debug settings
856  {
857  DbgUI.Text("________________________________________");
858 
859  if (DbgUI.Button("RESET DEBUG ATTRIBUTES"))
860  s_bDebugDrawReset = true;
861 
862  DbgUI.Check("RANDOM LINE COLORS ", s_bDebugDrawRandomColors);
863 
864  if (s_bDebugDrawRandomColors)
865  s_iLineColor = s_aRandomColors.GetRandomElement();
866  else
867  s_iLineColor = COLOR_RED;
868 
869  DbgUI.Text(" ");
870  }
871 
873  {
874  DbgUI.Text("________________________________________");
875  DbgUI.Check("CROSS ", s_bDebugDrawCross);
876  }
877 
878  // Draw basic crosshair matching reticle size
879  if (s_bDebugDrawCross)
880  {
881  {
882  DbgUI.Combo("Cross units ", s_eCrossUnit, units);
883  if (s_eCrossUnit == SCR_EOpticsAngleUnits.CUSTOM)
884  InputFloatClamped(s_fCrossUnit, "Custom cross unit deg", 0, 180);
885 
886  InputFloatClamped(s_fCrossRadius, "Cross radius ", 0, 1000);
887  }
888 
889  float unit = DebugAngleUnitsToDegrees(s_eCrossUnit, s_fCrossUnit);
890 
891  DebugDrawCross(sightMat, s_fCrossRadius * unit);
892  }
893 
895  {
896  DbgUI.Text("________________________________________");
897  DbgUI.Check("NOTCHES ", s_bDebugDrawNotches);
898  }
899 
900  // Draw notches for the angle measurement across reticle
901  if (s_bDebugDrawNotches)
902  {
903  {
904  DbgUI.Combo("Notches units ", s_eNotchesUnit, units);
905  if (s_eNotchesUnit == SCR_EOpticsAngleUnits.CUSTOM)
906  InputFloatClamped(s_fNotchesUnit, "Custom notches unit deg", 0, 180);
907 
908  InputFloatClamped(s_fNotchesSize, "Size ", 0, 100);
909  InputFloatClamped(s_fNotchesSmallLength, "Small length ", 0, 100);
910  InputFloatClamped(s_fNotchesSmallSpacing, "Small spacing ", 0, 100);
911  InputFloatClamped(s_fNotchesLargeLength, "Large length ", 0, 100);
912  InputFloatClamped(s_fNotchesLargeSpacing, "Large spacing ", 0, 100);
913  }
914 
915  float unit = DebugAngleUnitsToDegrees(s_eNotchesUnit, s_fNotchesUnit);
916  DebugDrawNotches(sightMat, s_fNotchesSmallLength * unit, s_fNotchesSmallSpacing * unit, s_fNotchesSize * unit * 0.5);
917  DebugDrawNotches(sightMat, s_fNotchesLargeLength * unit, s_fNotchesLargeSpacing * unit, s_fNotchesSize * unit * 0.5);
918  }
919 
921  {
922  DbgUI.Text("________________________________________");
923  DbgUI.Check("FIELD OF VIEW ", s_bDebugDrawFieldOfView);
924  }
925 
926  // Draw basic circle and frame
927  if (s_bDebugDrawFieldOfView)
928  {
929  {
930  DbgUI.Combo("Field of view units ", s_eFieldOfViewUnit, units);
931  if (s_eFieldOfViewUnit == SCR_EOpticsAngleUnits.CUSTOM)
932  InputFloatClamped(s_fFieldOfViewUnit, "Custom field of view unit deg", 0, 180);
933 
934  InputFloatClamped(s_fFieldOfViewAngle, "Field of view angle ", 0, 1000);
935  }
936 
937  float unit = DebugAngleUnitsToDegrees(s_eFieldOfViewUnit, s_fFieldOfViewUnit);
938 
939  DebugDrawFieldOfView(sightMat, s_fFieldOfViewAngle * unit);
940  }
941 
942  DbgUI.End();
943 
944  if (m_Optic && s_bDebugOptics)
945  UpdateCurrentFov(true);
946 
947  if (m_Optic && s_bDebug2DOptics)
948  UpdateScale(1, 1, 1);
949  }
950 
951  //------------------------------------------------------------------------------------------------
952  protected float DebugAngleUnitsToDegrees(SCR_EOpticsAngleUnits unit, float custom = 0)
953  {
954  if (unit == SCR_EOpticsAngleUnits.DEGREES)
955  return 1;
956 
957  if (unit == SCR_EOpticsAngleUnits.RETICLE)
958  {
959  float reticleAngularSize = m_fReticleAngularSize * 0.01;
960 
961  if (m_fReticleBaseZoom < 0)
962  reticleAngularSize *= m_fOpticCurrentFov / -m_fReticleBaseZoom;
963  else if (m_fReticleBaseZoom > 0)
964  reticleAngularSize *= m_fOpticCurrentFov / m_Optic.CalculateZoomFOV(m_fReticleBaseZoom);
965 
966  return reticleAngularSize;
967  }
968 
969  if (unit == SCR_EOpticsAngleUnits.OBJECTIVE)
970  {
971  float objectiveSize = m_fObjectiveFov * m_fObjectiveScale * 0.01;
972 
973  if (m_fOpticBaseFov > 0)
974  objectiveSize *= m_fOpticCurrentFov / m_fOpticBaseFov;
975 
976  return objectiveSize;
977  }
978 
979  if (unit == SCR_EOpticsAngleUnits.MILS_WP)
980  return 360 / 6000;
981 
982  if (unit == SCR_EOpticsAngleUnits.MILS_NATO)
983  return 360 / 6400;
984 
985  if (unit == SCR_EOpticsAngleUnits.MILS_STRECK)
986  return 360 / 6300;
987 
988  if (unit == SCR_EOpticsAngleUnits.MILLIRADIANS)
989  return Math.RAD2DEG * 0.001;
990 
991  return custom;
992  }
993 
994  //------------------------------------------------------------------------------------------------
995  static void DebugDrawFieldOfView(vector sightMat[4], float angle)
996  {
997  if (float.AlmostEqual(angle, 0))
998  return;
999 
1000  // References
1001  float targetSize = Math.Tan(Math.DEG2RAD * angle * 0.5);
1002  float range = 1000;
1003  CameraBase currentCamera = GetGame().GetCameraManager().CurrentCamera();
1004  if (currentCamera)
1005  range = currentCamera.GetFarPlane() * 0.5;
1006 
1007  vector fovMat[4];
1008  fovMat[0] = sightMat[0];
1009  fovMat[1] = sightMat[2];
1010  fovMat[2] = sightMat[1];
1011  fovMat[3] = sightMat[3] + sightMat[2] * range;
1012 
1013  SCR_Shape.DrawCircle(fovMat, targetSize * range, s_iLineColor, COLOR_YELLOW_A, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER | ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE | ShapeFlags.NOZWRITE);
1014  }
1015 
1016  //------------------------------------------------------------------------------------------------
1017  protected void DebugDrawNotches(vector sightMat[4], float length, float spacing, float size)
1018  {
1019  if (float.AlmostEqual(length, 0))
1020  return;
1021 
1022  if (float.AlmostEqual(spacing, 0))
1023  return;
1024 
1025  vector opticSide = sightMat[0];
1026  vector opticUp = sightMat[1];
1027  vector opticDir = sightMat[2];
1028  vector opticPos = sightMat[3];
1029 
1030  // References
1031  int count = Math.Floor(size / spacing);
1032  float notchSpacing = Math.DEG2RAD * spacing;
1033  float notchHalf = Math.Tan(Math.DEG2RAD * length * 0.5);
1034  float range = 1000;
1035  CameraBase currentCamera = GetGame().GetCameraManager().CurrentCamera();
1036  if (currentCamera)
1037  range = currentCamera.GetFarPlane() * 0.5;
1038 
1039  vector zeroMat[4] = sightMat;
1040  zeroMat[3] = opticPos + opticDir * range;
1041 
1042  vector notchMat[4] = zeroMat;
1043  vector notchSide = opticSide * notchHalf * range;
1044  vector notchUp = opticUp * notchHalf * range;
1045  vector notch[2];
1046 
1047  // Horizontal markings - left
1048  notchMat = zeroMat;
1049  for (int i; i < count; i++)
1050  {
1051  SCR_Math3D.RotateAround(notchMat, opticPos, opticUp, -notchSpacing, notchMat);
1052  notch[0] = notchMat[3] + notchUp;
1053  notch[1] = notchMat[3] - notchUp;
1054  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, notch, 2);
1055  }
1056 
1057  // Horizontal markings - right
1058  notchMat = zeroMat;
1059  for (int i; i < count; i++)
1060  {
1061  SCR_Math3D.RotateAround(notchMat, opticPos, opticUp, notchSpacing, notchMat);
1062  notch[0] = notchMat[3] + notchUp;
1063  notch[1] = notchMat[3] - notchUp;
1064  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, notch, 2);
1065  }
1066 
1067  // Vertical markings - up
1068  notchMat = zeroMat;
1069  for (int i; i < count; i++)
1070  {
1071  SCR_Math3D.RotateAround(notchMat, opticPos, opticSide, -notchSpacing, notchMat);
1072  notch[0] = notchMat[3] + notchSide;
1073  notch[1] = notchMat[3] - notchSide;
1074  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, notch, 2);
1075  }
1076 
1077  // Vertical markings - down
1078  notchMat = zeroMat;
1079  for (int i; i < count; i++)
1080  {
1081  SCR_Math3D.RotateAround(notchMat, opticPos, opticSide, notchSpacing, notchMat);
1082  notch[0] = notchMat[3] + notchSide;
1083  notch[1] = notchMat[3] - notchSide;
1084  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, notch, 2);
1085  }
1086  }
1087 
1088  //------------------------------------------------------------------------------------------------
1089  protected void DebugDrawCross(vector sightMat[4], float radius)
1090  {
1091  if (float.AlmostEqual(radius, 0))
1092  return;
1093 
1094  vector opticSide = sightMat[0];
1095  vector opticUp = sightMat[1];
1096  vector opticDir = sightMat[2];
1097  vector opticPos = sightMat[3];
1098 
1099  // References
1100  float crossRadius = Math.Tan(Math.DEG2RAD * radius * 0.5);
1101  float range = 1000;
1102  CameraBase currentCamera = GetGame().GetCameraManager().CurrentCamera();
1103  if (currentCamera)
1104  range = currentCamera.GetFarPlane() * 0.5;
1105 
1106  vector crossPos = opticPos + opticDir * range;
1107  vector cross[2];
1108 
1109  // Line of sight
1110  cross[0] = opticPos;
1111  cross[1] = crossPos;
1112  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, cross, 2);
1113 
1114  // Horizontal
1115  vector crossSide = opticSide * crossRadius * range;
1116  cross[0] = crossPos + crossSide;
1117  cross[1] = crossPos - crossSide;
1118  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, cross, 2);
1119 
1120  // Vertical
1121  vector crossUp = opticUp * crossRadius * range;
1122  cross[0] = crossPos + crossUp;
1123  cross[1] = crossPos - crossUp;
1124  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, cross, 2);
1125 
1126  // Diagonal #1
1127  cross[0] = crossPos - crossUp - crossSide;
1128  cross[1] = crossPos + crossUp + crossSide;
1129  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, cross, 2);
1130 
1131  // Diagonal #2
1132  cross[0] = crossPos + crossUp - crossSide;
1133  cross[1] = crossPos - crossUp + crossSide;
1134  Shape.CreateLines(s_iLineColor, ShapeFlags.ONCE | ShapeFlags.NOZBUFFER, cross, 2);
1135  }
1136 
1137  //------------------------------------------------------------------------------------------------
1138  static void SetScope2DEnabled(bool enabled)
1139  {
1140  BaseContainer gameplaySettings = GetGame().GetGameUserSettings().GetModule("SCR_GameplaySettings");
1141  if (gameplaySettings)
1142  gameplaySettings.Set("m_b2DScopes", enabled);
1143  }
1144 #endif
1145 }
SCR_EOpticsAngleUnits
SCR_EOpticsAngleUnits
Definition: SCR_EOpticsAngleUnits.c:5
SCR_HUDManagerComponent
Definition: SCR_HUDManagerComponent.c:23
SCR_FixedFOVInfo
Definition: SCR_FixedFOVInfo.c:1
On2DOpticsADSChange
func On2DOpticsADSChange
Definition: SCR_2DOpticsDisplay.c:2
SCR_Enum
Definition: SCR_Enum.c:1
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
m_HUDManager
protected SCR_HUDManagerComponent m_HUDManager
Definition: game.c:41
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_bInADS
protected bool m_bInADS
Definition: SCR_InfoDisplayExtended.c:34
SCR_HUDLayout
Definition: SCR_HUDLayout.c:2
m_Optic
protected SCR_2DOpticsComponent m_Optic
Definition: SCR_BinocularsComponent.c:15
func
func
Definition: SCR_AIThreatSystem.c:5
SCR_Math3D
Contains various scripted 3D math functions.
Definition: SCR_Math3D.c:2
SCR_2DOpticsComponent
Definition: SCR_2DOpticsComponent.c:12
rotation
RespawnSystemComponentClass GameComponentClass vector vector rotation
Definition: RespawnSystemComponent.c:23
SCR_Shape
Definition: SCR_Shape.c:1
On2DOpticsIlluminationChange
func On2DOpticsIlluminationChange
Definition: SCR_2DOpticsDisplay.c:5
SCR_Global
Definition: Functions.c:6
SCR_HUDManagerLayoutHandler
Definition: SCR_HUDManagerLayoutHandler.c:7
SCR_2DOpticsDisplay
Definition: SCR_2DOpticsDisplay.c:7
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.c:3