From 387bcb91ce072c772c60c3d19a8ec55c4cd33172 Mon Sep 17 00:00:00 2001 From: dockfries Date: Mon, 1 Jul 2024 17:26:24 +0800 Subject: [PATCH] feat(core): applyAnimation forceSyncEnum --- packages/core/src/controllers/player/entity.ts | 5 +++-- packages/core/src/enums/player.ts | 7 +++++++ packages/core/src/wrapper/native/player.ts | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/core/src/controllers/player/entity.ts b/packages/core/src/controllers/player/entity.ts index 92ec3418..2c306905 100644 --- a/packages/core/src/controllers/player/entity.ts +++ b/packages/core/src/controllers/player/entity.ts @@ -7,6 +7,7 @@ import type { WeaponEnum, WeaponStatesEnum, BoneIdsEnum, + ForceSyncEnum, } from "../../enums"; import { @@ -551,7 +552,7 @@ export class Player { lockX = true, lockY = true, freeze = false, - forceSync = false, + forceSync: boolean | ForceSyncEnum = false, ): void { const duration = getAnimateDurationByLibName(animLib, animName); if (duration === undefined) @@ -566,7 +567,7 @@ export class Player { lockY, freeze, loop ? 0 : duration, - forceSync, + +forceSync, ); } clearAnimations(forceSync = false): void { diff --git a/packages/core/src/enums/player.ts b/packages/core/src/enums/player.ts index 9a347d2c..469c34ef 100644 --- a/packages/core/src/enums/player.ts +++ b/packages/core/src/enums/player.ts @@ -90,3 +90,10 @@ export enum BoneIdsEnum { Neck, Jaw, } + +export enum ForceSyncEnum { + UNKNOWN = -1, + NONE = 0, + ALL = 1, + OTHER = 2, +} diff --git a/packages/core/src/wrapper/native/player.ts b/packages/core/src/wrapper/native/player.ts index 973a63c3..c0b27cd1 100644 --- a/packages/core/src/wrapper/native/player.ts +++ b/packages/core/src/wrapper/native/player.ts @@ -666,7 +666,7 @@ export const ApplyAnimation = ( lockY: boolean, freeze: boolean, time: number, - forceSync: boolean, + forceSync: number, ): number => { return samp.callNative( "ApplyAnimation",