Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PositionEditorAttribute.c
Go to the documentation of this file.
3 {
4  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
5  {
6  //Disable
7  return null;
8 
10  if (!editableEntity)
11  return null;
12 
13  if (!IsValidEntityType(editableEntity.GetEntityType()))
14  return null;
15 
16  //~Todo: Make sure chilren positions are set correctly
17  if (editableEntity.GetChildrenCount() > 0)
18  return null;
19 
20  vector mat[4];
21  editableEntity.GetTransform(mat);
22 
23  return SCR_BaseEditorAttributeVar.CreateVector(mat[3]);
24  }
25 
26  override void UpdateInterlinkedVariables(SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, bool isInit = false)
27  {
28  if (!var)
29  return;
30 
31  //Set sub labels
33 
34  if (isInit && manager.GetAttributeVariable(SCR_SnapYPositionEditorAttribute, snapVar))
35  manager.SetAttributeAsSubAttribute(SCR_SnapYPositionEditorAttribute);
36  }
37 
38  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
39  {
40  if (!var)
41  return;
42 
43  SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item);
44  if (!editableEntity)
45  return;
46 
47  vector mat[4];
48 
49  editableEntity.GetTransform(mat);
50  vector value = var.GetVector();
51 
52  mat[3] = value;
53  editableEntity.SetTransform(mat, true);
54 
55  //Print("UPDATE CHILDREN!");
56  }
57 };
SCR_PositionEditorAttribute
Definition: SCR_PositionEditorAttribute.c:2
SCR_SnapYPositionEditorAttribute
Definition: SCR_SnapYPositionEditorAttribute.c:5
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_ValidTypeBaseEditorAttribute
Definition: SCR_ValidTypeBaseEditorAttribute.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