Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RotationEditorAttribute.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 vector angles = Math3D.MatrixToAngles(mat);
23
25 }
26
27 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
28 {
29 if (!var)
30 return;
31
33 if (!editableEntity)
34 return;
35
36 vector mat[4];
37 editableEntity.GetTransform(mat);
38 vector angles = Math3D.MatrixToAngles(mat);
39 angles[0] = var.GetFloat() - 180;
40 Math3D.AnglesToMatrix(angles, mat);
41 editableEntity.SetTransform(mat, true);
42
43 //Print("UPDATE CHILDREN!");
44 }
45
46 override int GetEntries(notnull array<ref SCR_BaseEditorAttributeEntry> outEntries)
47 {
48 outEntries.Insert(new SCR_BaseEditorAttributeDefaultFloatValue(180));
49 return super.GetEntries(outEntries);
50 }
51};
ref array< string > angles
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_BaseEditorAttributeDefaultFloatValue(float floatValue)
static SCR_BaseEditorAttributeVar CreateFloat(float value)
bool SetTransform(vector transform[4], bool changedByUser=false)
EEditableEntityType GetEntityType(IEntity owner=null)
int GetChildrenCount(bool onlyDirect=false)
bool GetTransform(out vector outTransform[4])