Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ManualCameraNightModeHintCondition.c
Go to the documentation of this file.
1 [BaseContainerProps(), SCR_BaseContainerHintCondition()]
3 {
4  //------------------------------------------------------------------------------------------------
5  protected SCR_NightModeGameModeComponent GetNightModeComponent()
6  {
7  BaseGameMode gameMode = GetGame().GetGameMode();
8  if (!gameMode)
9  return null;
10 
11  return SCR_NightModeGameModeComponent.Cast(gameMode.FindComponent(SCR_NightModeGameModeComponent));
12  }
13 
14  //------------------------------------------------------------------------------------------------
15  protected void OnEditorNightModeEnabled(bool enabled)
16  {
17  //~ Do not show hint on disabling night mode
18  if (!enabled)
19  return;
20 
21  SCR_NightModeGameModeComponent nightModeComponent = GetNightModeComponent();
22  if (!nightModeComponent)
23  return;
24 
25  //~ Only activate if global nightmode is not enabled
26  if (!nightModeComponent.IsGlobalNightModeEnabled())
27  Activate();
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  override protected void OnInitCondition(Managed owner)
32  {
33  SCR_NightModeGameModeComponent nightModeComponent = GetNightModeComponent();
34  if (!nightModeComponent)
35  return;
36 
37  nightModeComponent.GetOnLocalEditorNightModeEnabledChanged().Insert(OnEditorNightModeEnabled);
38  }
39 
40  //------------------------------------------------------------------------------------------------
41  override protected void OnExitCondition(Managed owner)
42  {
43  SCR_NightModeGameModeComponent nightModeComponent = GetNightModeComponent();
44  if (!nightModeComponent)
45  return;
46 
47  nightModeComponent.GetOnLocalEditorNightModeEnabledChanged().Insert(OnEditorNightModeEnabled);
48  }
49 }
SCR_BaseHintCondition
Definition: SCR_BaseHintCondition.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Activate
protected void Activate()
Definition: SCR_BaseHintCondition.c:9
SCR_ManualCameraNightModeHintCondition
Definition: SCR_ManualCameraNightModeHintCondition.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