8 protected int m_iStartingHours;
16 [
Attribute(
"0",
desc:
"Random time range is superior to random time. When both are set to true, random range will be used.",
category:
"Time")]
34 [
Attribute(
"1",
UIWidgets.Slider,
"Time acceleration during the night (1 = 100%, 2 = 200% etc)",
"0.1 12 0.1",
category:
"Time")]
90 protected static SCR_TimeAndWeatherHandlerComponent s_Instance;
94 static SCR_TimeAndWeatherHandlerComponent GetInstance()
110 manager.SetWindSpeedOverride(
true, windSpeed);
111 manager.SetWindDirectionOverride(
true, windDirection);
115 void SetupFog(
float fogAmount,
float fogHeightDensity)
125 manager.SetFogAmountOverride(
true, fogAmount);
126 manager.SetFogHeightDensityOverride(
true, fogHeightDensity);
140 if (!manager.SetDate(year, month, day))
141 Print(
"SCR_TimeAndWeatherHandlerComponent: Invalid date parameter",
LogLevel.ERROR);
150 void SetupDaytimeAndWeather(
int hours,
int minutes,
int seconds = 0,
string loadedWeatherState =
"",
bool loadDone =
false)
165 float sunrise, morning, evening, sunset;
168 if (manager.GetSunriseHour(sunrise))
170 manager.GetSunsetHour(sunset);
181 morning = sunrise + 0.25;
182 float noon = (sunrise + sunset) * 0.5;
183 float afternoon = (noon + sunset) * 0.5;
184 evening = sunset - 0.5;
185 float night = noon + 12;
190 array<float> startingTimes = {morning, noon, afternoon, evening, night};
196 if (startingTimes.IsIndexValid(
index))
197 startingTime = startingTimes[
index];
199 startingTime = startingTimes.GetRandomElement();
201 manager.TimeToHoursMinutesSeconds(startingTime, hours, minutes, seconds);
227 array<ref WeatherState> weatherStates = {};
228 manager.GetWeatherStatesList(weatherStates);
230 if (!weatherStates.IsEmpty())
242 if (!loadedWeatherState.IsEmpty())
245 manager.SetHoursMinutesSeconds(hours, minutes, seconds);
268 if (manager.IsNightHour(manager.GetTimeOfTheDay()))
289 super.OnWorldPostProcess(world);
294 if (s_Instance !=
this)
296 Print(
"Multiple instances of SCR_TimeAndWeatherHandlerComponent detected.",
LogLevel.WARNING);
316 if (s_Instance || !
GetGame().InPlayMode())
320#ifdef TDM_CLI_SELECTION
333 m_iStartingHours = header.m_iStartingHours;
ArmaReforgerScripted GetGame()
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
float m_fFogHeightDensity
const float DEFAULT_DAYTIME_START
const float DEFAULT_DAYTIME_END
bool m_bRandomStartingWeather
bool m_bRandomStartingDaytimeRange
bool m_bRandomWeatherChanges
void SetupDate(int day, int month, int year)
void HandleDaytimeAcceleration(bool setup=false)
void SetupWind(float windSpeed, float windDirection)
bool m_bAllowHeaderSettings
bool m_bRandomStartingDaytime
float m_fDayTimeAcceleration
bool m_bSavedSettingApplied
const int DAYTIME_CHECK_PERIOD
void SetupFog(float fogAmount, float fogHeightDensity)
bool m_bDaytimeAcceleration
bool m_bUsePredefineStartingTimeAndWeather
override void OnWorldPostProcess(World world)
float m_fNightTimeAcceleration
ref array< ref SCR_TimeAndWeatherState > m_aStartingWeatherAndTime
void SetupDaytimeAndWeather(int hours, int minutes, int seconds=0, string loadedWeatherState="", bool loadDone=false)
string GetWeatherPresetName()
void ForceWeatherTo(bool setLooping, string weatherID=string.Empty, float transitionDuration=0, float stateDuration=0.001, int playerThatChangedWeather=0)
IEntity GetOwner()
Owner entity of the fuel tank.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute