Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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();
41  uiInfo = m_DescriptionDisplayInfo;
42  }
43 };
SCR_BaseAttributeDynamicDescription
Definition: SCR_BaseAttributeDynamicDescription.c:5
SCR_DayDurationAttributeDynamicDescription
Definition: SCR_DayDurationAttributeDynamicDescription.c:5
BaseContainerCustomStringTitleField
class SCR_HitZoneGroupNameHolder BaseContainerCustomStringTitleField("USE INHERENT VERSION ONLY!")
Definition: SCR_HitZoneGroupNameHolder.c:27
SCR_EditorAttributeUIInfo
UIInfo used by editor attribute system.
Definition: SCR_EditorAttributeUIInfo.c:3
SCR_DateTimeHelper
Definition: SCR_DateTimeHelper.c:1
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
SCR_BaseEditorAttributeUIComponent
Definition: SCR_BaseEditorAttributeUIComponent.c:3
SCR_DayDurationEditorAttribute
Definition: SCR_DayDurationEditorAttribute.c:5
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468