diff --git a/code/client/clrcore/External/Tasks.cs b/code/client/clrcore/External/Tasks.cs index 3a730f7480..08d5d0cfa8 100644 --- a/code/client/clrcore/External/Tasks.cs +++ b/code/client/clrcore/External/Tasks.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; #if MONO_V2 using CitizenFX.Core; @@ -77,6 +78,16 @@ public enum LeaveVehicleFlags LeaveDoorOpen = 256, BailOut = 4096 } + + public enum LookPriority + { + VeryLow = 0, + Low = 1, + Medium = 2, + High = 3, + VeryHigh = 4 + } + [Flags] public enum LookFlags { @@ -301,25 +312,50 @@ public void LeaveVehicle(Vehicle vehicle, LeaveVehicleFlags flags) API.TaskLeaveVehicle(_ped.Handle, vehicle.Handle, (int)flags); } + /// + /// Looks at the specified . + /// + /// + /// Must be greater than 0 for the ped to actually move their head. + /// + /// + public void LookAt(Entity target, int duration = 1, LookFlags flag = LookFlags.None, LookPriority lookPriority = LookPriority.Medium) + { + API.TaskLookAtEntity(_ped.Handle, target.Handle, duration, (int)flag, (int)lookPriority); + } + /// - /// Looks at the specified . + /// Looks at the specified /// /// /// Must be greater than 0 for the ped to actually move their head. - /// - public void LookAt(Entity target, int duration = 1, LookFlags flag = LookFlags.FastTurnRate) - { - API.TaskLookAtEntity(_ped.Handle, target.Handle, duration, 0, (int)flag); - } + [EditorBrowsable(EditorBrowsableState.Never)] + public void LookAt(Entity target, int duration = 1) + { + API.TaskLookAtEntity(_ped.Handle, target.Handle, duration, (int)LookFlags.None, (int)LookPriority.Medium); + } + + /// + /// Looks at the specified position. + /// + /// + /// Must be greater than 0 for the ped to actually move their head. + /// + /// + public void LookAt(Vector3 position, int duration = 1, LookFlags flag = LookFlags.None, LookPriority lookPriority = LookPriority.Medium) + { + API.TaskLookAtCoord(_ped.Handle, position.X, position.Y, position.Z, duration, (int)flag, (int)lookPriority); + } + /// - /// Looks at the specified position. + /// Looks at the specified /// /// /// Must be greater than 0 for the ped to actually move their head. - /// - public void LookAt(Vector3 position, int duration = 1, LookFlags flag = LookFlags.FastTurnRate) + [EditorBrowsable(EditorBrowsableState.Never)] + public void LookAt(Vector3 position, int duration = 1) { - API.TaskLookAtCoord(_ped.Handle, position.X, position.Y, position.Z, duration, 0, (int)flag); + API.TaskLookAtCoord(_ped.Handle, position.X, position.Y, position.Z, duration, (int)LookFlags.None, (int)LookPriority.Medium); } public void ParachuteTo(Vector3 position)