Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_RespawnTimeEditorAttribute.c
Go to the documentation of this file.
1 
4 // Script File
7 {
8  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
9  {
10  //If opened in global attributes
11  if (!IsGameMode(item)) return null;
12 
14  if (!gameMode) return null;
15  SCR_RespawnTimerComponent respawnTimeComponent = SCR_RespawnTimerComponent.Cast(gameMode.FindComponent(SCR_RespawnTimerComponent));
16  if (!respawnTimeComponent) return null;
17 
18  float value = respawnTimeComponent.GetRespawnTime();;
19  return SCR_BaseEditorAttributeVar.CreateFloat(value);
20  }
21 
22  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
23  {
24  if (!var) return;
25 
27  if (!gameMode) return;
28  SCR_RespawnTimerComponent respawnTimeComponent = SCR_RespawnTimerComponent.Cast(gameMode.FindComponent(SCR_RespawnTimerComponent));
29  if (!respawnTimeComponent) return;
30  float value = var.GetFloat();
31 
32 
33  if (value != respawnTimeComponent.GetRespawnTime())
34  {
35  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_ATTRIBUTES_RESPAWN_TIME_CHANGED, playerID, value * 1000);
36  }
37 
38  respawnTimeComponent.SetRespawnTime(value);
39  }
40 };
SCR_RespawnTimeEditorAttribute
Definition: SCR_RespawnTimeEditorAttribute.c:6
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
ENotification
ENotification
Definition: ENotification.c:4
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_RespawnTimerComponent
void SCR_RespawnTimerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_RespawnTimerComponent.c:333
SCR_BaseValueListEditorAttribute
Definition: SCR_BaseValueListEditorAttribute.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