Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_TimeAdvancementEditorAttribute.c
Go to the documentation of this file.
1 // Script File
5 // Script File
8 {
9  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
10  {
11  //If opened in global attributes
12  if (!IsGameMode(item)) return null;
13 
14  GenericEntity ent = GenericEntity.Cast(item);
15  ChimeraWorld world = ent.GetWorld();
16  TimeAndWeatherManagerEntity weatherManager = world.GetTimeAndWeatherManager();
17  if (!weatherManager) return null;
18 
19  return SCR_BaseEditorAttributeVar.CreateBool(weatherManager.GetIsDayAutoAdvanced());
20  }
21 
22  //Disable respawn time if respawning is disabled
23  override void UpdateInterlinkedVariables(SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, bool isInit = false)
24  {
25  if (isInit)
26  manager.SetAttributeAsSubAttribute(SCR_DayDurationEditorAttribute);
27 
28  manager.SetAttributeEnabled(SCR_DayDurationEditorAttribute, var && var.GetBool());
29  }
30 
31  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
32  {
33  GenericEntity ent = GenericEntity.Cast(item);
34  ChimeraWorld world = ent.GetWorld();
35  TimeAndWeatherManagerEntity weatherManager = world.GetTimeAndWeatherManager();
36  if (!weatherManager)
37  return;
38 
39  bool value = var.GetBool();
40  weatherManager.SetIsDayAutoAdvanced(value);
41 
42  if (item)
43  {
44  if (value)
45  SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_DAY_ADVANCE_ENABLED, playerID);
46  else
47  SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_DAY_ADVANCE_DISABLED, playerID);
48  }
49  }
50 };
ChimeraWorld
Definition: ChimeraWorld.c:12
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_TimeAdvancementEditorAttribute
Definition: SCR_TimeAdvancementEditorAttribute.c:7
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
ENotification
ENotification
Definition: ENotification.c:4
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_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