Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_DayDurationEditorAttribute.c
Go to the documentation of this file.
1 
6 {
7  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
8  {
9  //If opened in global attributes
10  if (!IsGameMode(item))
11  return null;
12 
13  GenericEntity ent = GenericEntity.Cast(item);
14  ChimeraWorld world = ent.GetWorld();
15  TimeAndWeatherManagerEntity timeManager = world.GetTimeAndWeatherManager();
16  if (!timeManager) return null;
17 
18  return SCR_BaseEditorAttributeVar.CreateFloat(86400 / timeManager.GetDayDuration());
19  }
20  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
21  {
22  if (!var) return;
23 
24  GenericEntity ent = GenericEntity.Cast(item);
25  ChimeraWorld world = ent.GetWorld();
26  TimeAndWeatherManagerEntity timeManager = world.GetTimeAndWeatherManager();
27  if (!timeManager) return;
28 
29  timeManager.SetDayDuration(86400 / var.GetFloat());
30 
31  //Notification
32  if (item)
33  {
34  int notificationInt = var.GetFloat() * 10;
35  SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_DAY_DURATION_CHANGED, playerID, notificationInt * 100);
36  }
37  }
38 };
ChimeraWorld
Definition: ChimeraWorld.c:12
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
ENotification
ENotification
Definition: ENotification.c:4
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseValueListEditorAttribute
Definition: SCR_BaseValueListEditorAttribute.c:5
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