Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ViewLinkManualCameraComponent.c
Go to the documentation of this file.
1 
4 [BaseContainerProps(), SCR_BaseManualCameraComponentTitle()]
6 {
7  //------------------------------------------------------------------------------------------------
8  override void EOnCameraFrame(SCR_ManualCameraParam param)
9  {
10  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_VIEW_LINK))
11  {
12  string prefix = "enfusion://WorldEditor/";
13  string link = System.ImportFromClipboard();
14  if (link.StartsWith(prefix))
15  {
16  array<string> values = {};
17  link.Split(";", values, false);
18  if (values.Count() >= 2)
19  {
20  string fullLink = GetGame().GetWorldFile();
21  int begin = fullLink.IndexOf(":") + 1;
22  string worldPath = fullLink.Substring(begin, fullLink.Length() - begin);
23  if (values[0] == prefix + worldPath)
24  {
25  array<string> valuesPos = {}, valuesDir = {};
26  values[1].Split(",", valuesPos, false);
27  values[2].Split(",", valuesDir, false);
28 
29  vector pos = Vector(valuesPos[0].ToFloat(), valuesPos[1].ToFloat(), valuesPos[2].ToFloat());
30  vector dir = Vector(valuesDir[1].ToFloat(), valuesDir[0].ToFloat(), valuesDir[2].ToFloat());
31 
32  vector transform[4];
33  Math3D.AnglesToMatrix(dir, transform);
34  transform[3] = pos;
35  GetCameraEntity().SetWorldTransform(transform);
36 
37  PrintFormat("View link applied: %1", link);
38  }
39  }
40  }
41  DiagMenu.SetValue(SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_VIEW_LINK, 0);
42  }
43  }
44 
45  //------------------------------------------------------------------------------------------------
46  override bool EOnCameraInit()
47  {
48  DiagMenu.RegisterBool(SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_VIEW_LINK, "lshift+lalt+l", "Paste view link", "Manual Camera");
49  return true;
50  }
51 
52  //------------------------------------------------------------------------------------------------
53  override void EOnCameraExit()
54  {
55  DiagMenu.Unregister(SCR_DebugMenuID.DEBUGUI_MANUAL_CAMERA_VIEW_LINK);
56  }
57 }
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition: SCR_BaseManualCameraComponent.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GetCameraEntity
protected SCR_ManualCamera GetCameraEntity()
Definition: SCR_BaseManualCameraComponent.c:59
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition: SCR_ManualCameraParam.c:5
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.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