Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FlashlightToolbarAction.c
Go to the documentation of this file.
3 {
5 
6  protected void OnFlashlightStateChanged(bool state)
7  {
8  Toggle(state, state)
9  }
10  protected void InitFlashlight(SCR_ManualCamera camera)
11  {
13  cameraComponent.GetOnCameraCreate().Remove(InitFlashlight);
14 
15  m_FlashLight = SCR_LightManualCameraComponent.Cast(camera.FindCameraComponent(SCR_LightManualCameraComponent));
16  if (!m_FlashLight)
17  return;
18 
19  m_FlashLight.GetOnLightChanged().Insert(OnFlashlightStateChanged);
20  OnFlashlightStateChanged(m_FlashLight.IsLightOn());
21  }
22 
23  override bool IsServer()
24  {
25  return false;
26  }
27 
28  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
29  {
30  return true;
31  }
32  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
33  {
34  return true;
35  }
36 
37  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
38  {
39  if (m_FlashLight)
40  m_FlashLight.ToggleLight();
41  }
42 
43  override void Track()
44  {
46  SCR_ManualCamera camera = cameraComponent.GetCamera();
47  if (cameraComponent && !camera)
48  cameraComponent.GetOnCameraCreate().Insert(InitFlashlight);
49  else
50  InitFlashlight(camera);
51  }
52 
53 
54  override void Untrack()
55  {
56  if (!m_FlashLight) return;
57  m_FlashLight.GetOnLightChanged().Remove(OnFlashlightStateChanged);
58  }
59 };
60 
SCR_LightManualCameraComponent
Create a light on camera position.
Definition: SCR_LightManualCameraComponent.c:5
SCR_ManualCamera
Definition: SCR_ManualCamera.c:16
SCR_CameraEditorComponent
Definition: SCR_CameraEditorComponent.c:13
Toggle
void Toggle()
Toggle hint. Hide it if it's shown, and open it again if it's hidden.
Definition: SCR_HintManagerComponent.c:216
SCR_BaseToggleToolbarAction
Definition: SCR_BaseToggleToolbarAction.c:3
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
SCR_FlashlightToolbarAction
Definition: SCR_FlashlightToolbarAction.c:2
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468