Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SpawnAtPlayersAttribute.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))
12  return null;
13 
14  BaseGameMode gameMode = GetGame().GetGameMode();
15  if (!gameMode)
16  return null;
17 
18  SCR_PlayerSpawnPointManagerComponent playerSpawnPointManager = SCR_PlayerSpawnPointManagerComponent.Cast(gameMode.FindComponent(SCR_PlayerSpawnPointManagerComponent));
19  if (!playerSpawnPointManager)
20  return null;
21 
22  return SCR_BaseEditorAttributeVar.CreateBool(playerSpawnPointManager.IsPlayerSpawnPointsEnabled());
23  }
24 
25  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
26  {
27  if (!var)
28  return;
29 
30  //If opened in global attributes
31  if (!IsGameMode(item))
32  return;
33 
34  BaseGameMode gameMode = GetGame().GetGameMode();
35  if (!gameMode)
36  return;
37 
38  SCR_PlayerSpawnPointManagerComponent playerSpawnPointManager = SCR_PlayerSpawnPointManagerComponent.Cast(gameMode.FindComponent(SCR_PlayerSpawnPointManagerComponent));
39  if (!playerSpawnPointManager)
40  return;
41 
42  //Notification
43  playerSpawnPointManager.EnablePlayerSpawnPoints(var.GetBool(), playerID);
44  }
45 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_SpawnAtPlayersEditorAttribute
Definition: SCR_SpawnAtPlayersAttribute.c:6
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
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