forked from FabianTerhorst/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFocusData.cs
More file actions
94 lines (85 loc) · 2.38 KB
/
FocusData.cs
File metadata and controls
94 lines (85 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System.Numerics;
using System.Runtime.InteropServices;
using AltV.Net.CApi.ClientEvents;
using AltV.Net.Client.Elements.Interfaces;
using AltV.Net.Elements.Entities;
using AltV.Net.Shared.Utils;
namespace AltV.Net.Client
{
public class FocusData
{
private readonly ICore core;
public FocusData(ICore core)
{
this.core = core;
}
public bool IsFocusOverriden
{
get
{
unsafe
{
return core.Library.Client.Core_IsFocusOverriden(core.NativePointer) == 1;
}
}
}
public Vector3 FocusOverridePosition
{
get
{
unsafe
{
var vec = Vector3.Zero;
core.Library.Client.Core_GetFocusOverridePos(core.NativePointer, &vec);
return vec;
}
}
}
public Vector3 FocusOverrideOffset
{
get
{
unsafe
{
var vec = Vector3.Zero;
core.Library.Client.Core_GetFocusOverrideOffset(core.NativePointer, &vec);
return vec;
}
}
}
public void OverrideFocusPosition(Vector3 pos, Vector3 offset)
{
unsafe
{
core.Library.Client.Core_OverrideFocusPosition(core.NativePointer, pos, offset);
}
}
public IEntity FocusOverrideEntity
{
get
{
unsafe
{
var type = (byte) BaseObjectType.Undefined;
if (!core.BaseEntityPool.Get(core.Library.Client.Core_GetFocusOverrideEntity(core.NativePointer, &type), (BaseObjectType) type, out var entity))
return null;
return entity;
}
}
set
{
unsafe
{
core.Library.Client.Core_OverrideFocusEntity(core.NativePointer, value.EntityNativePointer);
}
}
}
public void ClearFocusOverride()
{
unsafe
{
core.Library.Client.Core_ClearFocusOverride(core.NativePointer);
}
}
}
}