Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkTimeSpecificCondition.c
Go to the documentation of this file.
3{
4 [Attribute(defvalue: "0", desc: "Minimal day time hour", params: "0 24 1", category: "Time")]
5 int m_iHours;
6
7 [Attribute(defvalue: "0", desc: "Maximal day time hour", params: "0 59 1", category: "Time")]
8 int m_iMinutes;
9
10 [Attribute(defvalue: "0", desc: "Maximal day time hour", params: "0 59 1", category: "Time")]
11 int m_iSeconds;
12
13 [Attribute("0", UIWidgets.ComboBox, "Operator", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkComparisonOperator))]
15
16 //------------------------------------------------------------------------------------------------
17 override bool Init(IEntity entity)
18 {
19 // Here you can debug specific Condition instance.
20 // This can be also adjusted during runtime via Debug Menu > ScenarioFramework > Condition Inspector
21 if (m_bDebug)
22 Print("[SCR_ScenarioFrameworkTimeSpecificCondition.Init] debug line (" + __FILE__ + " L" + __LINE__ + ")", LogLevel.WARNING);
23
24 ChimeraWorld world = ChimeraWorld.CastFrom(entity.GetWorld());
25 if (!world)
26 return false;
27
28 TimeAndWeatherManagerEntity manager = world.GetTimeAndWeatherManager();
29 if (!manager)
30 return false;
31
32 int targetSeconds = m_iHours * 3600 + m_iMinutes * 60 + m_iSeconds;
33
34 TimeContainer worldTime = manager.GetTime();
35 int worldTimeSeconds = worldTime.m_iHours * 3600 + worldTime.m_iMinutes * 60 + worldTime.m_iSeconds;
36
37 return ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.LESS_THAN) && (worldTimeSeconds < targetSeconds)) ||
38 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.LESS_OR_EQUAL) && (worldTimeSeconds <= targetSeconds)) ||
39 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.EQUAL) && (worldTimeSeconds == targetSeconds)) ||
40 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.GREATER_OR_EQUAL) && (worldTimeSeconds >= targetSeconds)) ||
41 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.GREATER_THEN) && (worldTimeSeconds > targetSeconds));
42 }
43}
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