Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.