Skip to content

Commit b442f15

Browse files
committed
add new blip apis
1 parent b7433d2 commit b442f15

File tree

9 files changed

+333
-9
lines changed

9 files changed

+333
-9
lines changed

api/AltV.Net.Async/Elements/Entities/AsyncBlip.cs

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,101 @@ public void Fade(uint opacity, uint duration)
687687
}
688688
}
689689

690-
public bool Visible { get; set; }
690+
public bool Visible
691+
{
692+
get
693+
{
694+
lock (Blip)
695+
{
696+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return default;
697+
return Blip.Visible;
698+
}
699+
}
700+
set {
701+
lock (Blip)
702+
{
703+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return;
704+
Blip.Visible = value;
705+
}
706+
}
707+
}
708+
709+
public bool IsHiddenOnLegend
710+
{
711+
get
712+
{
713+
lock (Blip)
714+
{
715+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return default;
716+
return Blip.IsHiddenOnLegend;
717+
}
718+
}
719+
set {
720+
lock (Blip)
721+
{
722+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return;
723+
Blip.IsHiddenOnLegend = value;
724+
}
725+
}
726+
}
727+
728+
public bool IsMinimalOnEdge
729+
{
730+
get
731+
{
732+
lock (Blip)
733+
{
734+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return default;
735+
return Blip.IsMinimalOnEdge;
736+
}
737+
}
738+
set {
739+
lock (Blip)
740+
{
741+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return;
742+
Blip.IsMinimalOnEdge = value;
743+
}
744+
}
745+
}
746+
747+
public bool IsUseHeightIndicatorOnEdge
748+
{
749+
get
750+
{
751+
lock (Blip)
752+
{
753+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return default;
754+
return Blip.IsUseHeightIndicatorOnEdge;
755+
}
756+
}
757+
set {
758+
lock (Blip)
759+
{
760+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return;
761+
Blip.IsUseHeightIndicatorOnEdge = value;
762+
}
763+
}
764+
}
765+
766+
public bool IsShortHeightThreshold
767+
{
768+
get
769+
{
770+
lock (Blip)
771+
{
772+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return default;
773+
return Blip.IsShortHeightThreshold;
774+
}
775+
}
776+
set {
777+
lock (Blip)
778+
{
779+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return;
780+
Blip.IsShortHeightThreshold = value;
781+
}
782+
}
783+
}
784+
691785

692786
[Obsolete("Use new async API instead")]
693787
public IBlip ToAsync(IAsyncContext asyncContext)

api/AltV.Net.CApi/Libraries/ClientLibrary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ public unsafe interface IClientLibrary
867867

868868
public unsafe class ClientLibrary : IClientLibrary
869869
{
870-
public readonly uint Methods = 1626;
870+
public readonly uint Methods = 1634;
871871
public delegate* unmanaged[Cdecl]<nint, nint, void> Audio_AddOutput { get; }
872872
public delegate* unmanaged[Cdecl]<nint, nint> Audio_GetBaseObject { get; }
873873
public delegate* unmanaged[Cdecl]<nint, double> Audio_GetCurrentTime { get; }
@@ -3436,7 +3436,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
34363436
public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
34373437
{
34383438
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
3439-
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 9326924779181455521UL) Outdated = true;
3439+
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 16305499154589035788UL) Outdated = true;
34403440
Audio_AddOutput = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Audio_AddOutputDelegate>(funcTable, 9914412815391408844UL, Audio_AddOutputFallback);
34413441
Audio_GetBaseObject = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<Audio_GetBaseObjectDelegate>(funcTable, 6330360502401226894UL, Audio_GetBaseObjectFallback);
34423442
Audio_GetCurrentTime = (delegate* unmanaged[Cdecl]<nint, double>) GetUnmanagedPtr<Audio_GetCurrentTimeDelegate>(funcTable, 2944324482134975819UL, Audio_GetCurrentTimeFallback);

api/AltV.Net.CApi/Libraries/ServerLibrary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public unsafe interface IServerLibrary
434434

435435
public unsafe class ServerLibrary : IServerLibrary
436436
{
437-
public readonly uint Methods = 1626;
437+
public readonly uint Methods = 1634;
438438
public delegate* unmanaged[Cdecl]<nint, nint, void> BaseObject_DeleteSyncedMetaData { get; }
439439
public delegate* unmanaged[Cdecl]<nint, nint, nint, void> BaseObject_SetSyncedMetaData { get; }
440440
public delegate* unmanaged[Cdecl]<nint, nint, void> Blip_AddTargetPlayer { get; }
@@ -1704,7 +1704,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
17041704
public ServerLibrary(Dictionary<ulong, IntPtr> funcTable)
17051705
{
17061706
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
1707-
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 9326924779181455521UL) Outdated = true;
1707+
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 16305499154589035788UL) Outdated = true;
17081708
BaseObject_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<BaseObject_DeleteSyncedMetaDataDelegate>(funcTable, 8228424877092269355UL, BaseObject_DeleteSyncedMetaDataFallback);
17091709
BaseObject_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) GetUnmanagedPtr<BaseObject_SetSyncedMetaDataDelegate>(funcTable, 8002999088966424231UL, BaseObject_SetSyncedMetaDataFallback);
17101710
Blip_AddTargetPlayer = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Blip_AddTargetPlayerDelegate>(funcTable, 12411235729553386187UL, Blip_AddTargetPlayerFallback);

0 commit comments

Comments
 (0)