forked from altmp/coreclr-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FocusData.cs
95 lines (86 loc) · 2.4 KB
/
FocusData.cs
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
95
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;
var entity = (IEntity)
core.PoolManager.Get(core.Library.Client.Core_GetFocusOverrideEntity(core.NativePointer, &type),
(BaseObjectType)type);
return entity;
}
}
set
{
unsafe
{
core.Library.Client.Core_OverrideFocusEntity(core.NativePointer, value.EntityNativePointer);
}
}
}
public void ClearFocusOverride()
{
unsafe
{
core.Library.Client.Core_ClearFocusOverride(core.NativePointer);
}
}
}
}