7 [
Attribute(
"#AR-Editor_Attribute_Date_Description_NoSunSetOrRise",
desc:
"Text shown in description when there is no sunset nor sunrise")]
8 protected string m_sNoSunriseSunSet;
10 protected TimeAndWeatherManagerEntity m_TimeAndWeatherManager;
11 protected SCR_AttributesManagerEditorComponent m_AttributeManager;
16 super.InitDynamicDescription(attribute);
18 if (!m_TimeAndWeatherManager)
21 m_TimeAndWeatherManager = world.GetTimeAndWeatherManager();
24 if (!m_AttributeManager)
25 m_AttributeManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
28 Print(
"'SCR_DateAttributeDynamicDescription' is not attached to the 'SCR_DateEditorAttribute'!", LogLevel.ERROR);
37 return m_TimeAndWeatherManager !=
null;
56 daytime = dayTimeVar.GetFloat() / 3600;
58 array<int> yearArray = {};
59 dateAttribute.GetYearArray(yearArray);
61 vector date = var.GetVector();
64 int month = date[1] +1;
65 int year = yearArray[date[2]];
67 float timeZoneOffset = m_TimeAndWeatherManager.GetTimeZoneOffset();
68 float dstOffset = m_TimeAndWeatherManager.GetDSTOffset();
69 float latitude = m_TimeAndWeatherManager.GetCurrentLatitude();
71 SCR_MoonPhaseUIInfo moonPhaseInfo = m_TimeAndWeatherManager.GetMoonPhaseInfoForDate(year, month, day, daytime, timeZoneOffset, dstOffset, latitude);
73 float sunRiseTime, sunSetTime;
74 bool hasSunRise = m_TimeAndWeatherManager.GetSunriseHourForDate(year, month, day, m_TimeAndWeatherManager.GetCurrentLatitude(), m_TimeAndWeatherManager.GetCurrentLongitude(), m_TimeAndWeatherManager.GetTimeZoneOffset(), m_TimeAndWeatherManager.GetDSTOffset(), sunRiseTime);
75 bool hasSunSet = m_TimeAndWeatherManager.GetSunsetHourForDate(year, month, day, m_TimeAndWeatherManager.GetCurrentLatitude(), m_TimeAndWeatherManager.GetCurrentLongitude(), m_TimeAndWeatherManager.GetTimeZoneOffset(), m_TimeAndWeatherManager.GetDSTOffset(), sunSetTime);
77 string sunRiseName, sunSetName;
80 sunRiseName = m_sNoSunriseSunSet;
84 sunSetName = m_sNoSunriseSunSet;
88 uiInfo = m_DescriptionDisplayInfo;
91 param3 = moonPhaseInfo.GetName();