Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DayDurationAttributeDynamicDescription.c
Go to the documentation of this file.
1
4[BaseContainerProps(), BaseContainerCustomStringTitleField("Day description (CUSTOM)")]
6{
7 //------------------------------------------------------------------------------------------------
8 override void InitDynamicDescription(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
9 {
10 super.InitDynamicDescription(attribute);
11
12 if (!attribute.IsInherited(SCR_DayDurationEditorAttribute))
13 Print("'SCR_DayDurationAttributeDynamicDescription' is not attached to the 'SCR_DayDurationEditorAttribute'!", LogLevel.ERROR);
14 }
15
16 //------------------------------------------------------------------------------------------------
17 override bool IsValid(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
18 {
19 if (!super.IsValid(attribute, attributeUi) || !attribute.IsInherited(SCR_DayDurationEditorAttribute))
20 return false;
21
22 return true;
23 }
24
25 //------------------------------------------------------------------------------------------------
26 override void GetDescriptionData(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi, out SCR_EditorAttributeUIInfo uiInfo, out string param1 = string.Empty, out string param2 = string.Empty, out string param3 = string.Empty)
27 {
28 SCR_BaseEditorAttributeVar var = attribute.GetVariableOrCopy();
29 if (!var)
30 return;
31
32 //Calculate how many real life seconds 1 in game hour is
33 float realLifeSecondsFloat = Math.Round(3600 / var.GetFloat());
34
35 int days, hours, minutes, seconds;
36 SCR_DateTimeHelper.GetDayHourMinuteSecondFromSeconds((int)realLifeSecondsFloat, days, hours, minutes, seconds);
37
38 param1 = hours.ToString();
39 param2 = minutes.ToString();
40 param3 = seconds.ToString();
42 }
43};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_HitZoneGroupNameHolder BaseContainerCustomStringTitleField("USE INHERITED VERSION ONLY!")
Definition Math.c:13
void InitDynamicDescription(notnull SCR_BaseEditorAttribute attribute, notnull SCR_BaseEditorAttributeUIComponent attributeUi)
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
UIInfo used by editor attribute system.
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
T3 param3
Definition tuple.c:93
T2 param2
Definition tuple.c:92
Tuple param1