Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkDayTimeCondition.c
Go to the documentation of this file.
3{
4 [Attribute(defvalue: "1", desc: "If true, this can be activated only during the day. If false, only during the night.", category: "Time")]
5 bool m_bOnlyDuringDay;
6
7 //------------------------------------------------------------------------------------------------
8 override bool Init(IEntity entity)
9 {
10 // Here you can debug specific Condition instance.
11 // This can be also adjusted during runtime via Debug Menu > ScenarioFramework > Condition Inspector
12 if (m_bDebug)
13 Print("[SCR_ScenarioFrameworkDayTimeCondition.Init] debug line (" + __FILE__ + " L" + __LINE__ + ")", LogLevel.WARNING);
14
15 ChimeraWorld world = ChimeraWorld.CastFrom(entity.GetWorld());
16 if (!world)
17 return true;
18
19 TimeAndWeatherManagerEntity manager = world.GetTimeAndWeatherManager();
20 if (!manager)
21 return true;
22
23 TimeContainer timeContainer = manager.GetTime();
24 int currentHour = timeContainer.m_iHours;
25
26 if (m_bOnlyDuringDay)
27 return manager.IsDayHour(currentHour);
28 else
29 return manager.IsNightHour(currentHour);
30 }
31}
override void Init()
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void TimeContainer(int hours=0, int minutes=0, int seconds=0)
proto external BaseWorld GetWorld()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute