Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_ViewLinkManualCameraComponent.c
Go to the documentation of this file.
1
2
4
[
BaseContainerProps
(), SCR_BaseManualCameraComponentTitle()]
5
class
SCR_ViewLinkManualCameraComponent
:
SCR_BaseManualCameraComponent
6
{
7
//------------------------------------------------------------------------------------------------
8
override
void
EOnCameraFrame(
SCR_ManualCameraParam
param)
9
{
10
if
(
DiagMenu
.GetBool(
SCR_DebugMenuID
.DEBUGUI_MANUAL_CAMERA_VIEW_LINK))
11
{
12
const
string
prefix =
"enfusion://WorldEditor/"
;
// TODO: check for good const usage
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_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition
DebugMenuID.c:4
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
DiagMenu
Diagnostic and developer menu system.
Definition
DiagMenu.c:18
Math3D
Definition
Math3D.c:13
SCR_BaseManualCameraComponent
Parent class from which all SCR_ManualCamera components inherit.
Definition
SCR_BaseManualCameraComponent.c:6
SCR_BaseManualCameraComponent::GetCameraEntity
SCR_ManualCamera GetCameraEntity()
Definition
SCR_BaseManualCameraComponent.c:64
SCR_BaseManualCameraComponent::EOnCameraInit
bool EOnCameraInit()
SCR_BaseManualCameraComponent::EOnCameraExit
void EOnCameraExit()
Terminate the component.
SCR_ManualCameraParam
Parameter for carrying information between individual camera components.
Definition
SCR_ManualCameraParam.c:6
SCR_ViewLinkManualCameraComponent
Teleporting camera to position defined by Workbench link.
Definition
SCR_ViewLinkManualCameraComponent.c:6
System
Definition
System.c:13
vector
Definition
vector.c:13
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
Vector
proto native vector Vector(float x, float y, float z)
scripts
Game
Camera
Components
SCR_ViewLinkManualCameraComponent.c
Generated by
1.17.0