@nativewrappers/common-game 0.0.126 → 0.0.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CommonGameConstants.d.ts +1 -1
- package/CommonGameConstants.js +7 -7
- package/CommonModel.js +2 -2
- package/CommonTasks.d.ts +1 -1
- package/CommonTasks.js +2 -2
- package/common/Command.d.ts +77 -0
- package/common/Command.js +152 -0
- package/common/Convar.d.ts +13 -0
- package/common/Convar.js +58 -0
- package/common/GlobalData.d.ts +12 -0
- package/common/GlobalData.js +20 -0
- package/common/Kvp.d.ts +69 -0
- package/common/Kvp.js +137 -0
- package/common/Resource.d.ts +14 -0
- package/common/Resource.js +54 -0
- package/common/decors/ConVar.d.ts +14 -0
- package/common/decors/ConVar.js +70 -0
- package/common/decors/Events.d.ts +66 -0
- package/common/decors/Events.js +163 -0
- package/common/decors/Exports.d.ts +1 -0
- package/common/decors/Exports.js +53 -0
- package/common/decors/Permissions.d.ts +3 -0
- package/common/decors/Permissions.js +49 -0
- package/common/decors/Resources.d.ts +8 -0
- package/common/decors/Resources.js +94 -0
- package/common/decors/Ticks.d.ts +9 -0
- package/common/decors/Ticks.js +32 -0
- package/common/net/NetworkedMap.d.ts +28 -0
- package/common/net/NetworkedMap.js +225 -0
- package/common/types.d.ts +5 -0
- package/common/types.js +0 -0
- package/common/utils/ClassTypes.d.ts +11 -0
- package/common/utils/ClassTypes.js +15 -0
- package/common/utils/Color.d.ts +14 -0
- package/common/utils/Color.js +33 -0
- package/common/utils/Delay.d.ts +1 -0
- package/common/utils/Delay.js +6 -0
- package/common/utils/Maths.d.ts +4 -0
- package/common/utils/Maths.js +18 -0
- package/common/utils/Point.d.ts +9 -0
- package/common/utils/Point.js +36 -0
- package/common/utils/PointF.d.ts +7 -0
- package/common/utils/PointF.js +18 -0
- package/common/utils/Quaternion.d.ts +10 -0
- package/common/utils/Quaternion.js +33 -0
- package/common/utils/Vector.d.ts +429 -0
- package/common/utils/Vector.js +589 -0
- package/common/utils/cleanPlayerName.d.ts +6 -0
- package/common/utils/cleanPlayerName.js +17 -0
- package/common/utils/enumValues.d.ts +12 -0
- package/common/utils/enumValues.js +20 -0
- package/common/utils/getStringFromUInt8Array.d.ts +8 -0
- package/common/utils/getStringFromUInt8Array.js +6 -0
- package/common/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/common/utils/getUInt32FromUint8Array.js +6 -0
- package/common/utils/randomInt.d.ts +1 -0
- package/common/utils/randomInt.js +9 -0
- package/entities/CommonBaseEntity.d.ts +3 -3
- package/entities/CommonBaseEntity.js +2 -2
- package/entities/CommonBaseEntityBone.d.ts +1 -1
- package/entities/CommonBaseEntityBone.js +1 -1
- package/entities/CommonPed.d.ts +1 -1
- package/entities/CommonPed.js +1 -1
- package/entities/CommonPlayer.js +5 -5
- package/entities/CommonProp.d.ts +1 -1
- package/entities/CommonProp.js +1 -1
- package/entities/CommonVehicle.d.ts +1 -1
- package/entities/CommonVehicle.js +1 -1
- package/index.d.ts +26 -0
- package/index.js +26 -0
- package/interfaces/Dimension.d.ts +1 -1
- package/package.json +1 -1
- package/utils/Animations.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ClassTypes } from "
|
|
2
|
-
import type { Quaternion } from "
|
|
3
|
-
import { Vector3 } from "
|
|
1
|
+
import type { ClassTypes } from "../common/utils/ClassTypes";
|
|
2
|
+
import type { Quaternion } from "../common/utils/Quaternion";
|
|
3
|
+
import { Vector3 } from "../common/utils/Vector";
|
|
4
4
|
import type { CommonBaseEntityBoneCollection } from "./CommonBaseEntityBoneCollection";
|
|
5
5
|
import type { StateBagChangeHandler } from "../cfx/StateBagChangeHandler";
|
|
6
6
|
import { CommonModel } from "../CommonModel";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { Vector3 } from "
|
|
3
|
+
import { Vector3 } from "../common/utils/Vector";
|
|
4
4
|
import cfx from "../cfx/cfx";
|
|
5
5
|
import { CommonModel } from "../CommonModel";
|
|
6
|
-
import { GlobalData } from "
|
|
6
|
+
import { GlobalData } from "../common/GlobalData";
|
|
7
7
|
import { IHandle } from "./IHandle";
|
|
8
8
|
class CommonBaseEntity extends IHandle {
|
|
9
9
|
static {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { Vector3 } from "
|
|
3
|
+
import { Vector3 } from "../common/utils/Vector";
|
|
4
4
|
class CommonBaseEntityBone {
|
|
5
5
|
static {
|
|
6
6
|
__name(this, "CommonBaseEntityBone");
|
package/entities/CommonPed.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonBaseEntity } from "./CommonBaseEntity";
|
|
2
2
|
import { CommonPlayer } from "./CommonPlayer";
|
|
3
|
-
import { ClassTypes } from "
|
|
3
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
4
4
|
import { CommonPedBoneCollection } from "./CommonPedBoneCollection";
|
|
5
5
|
import { CommonTasks } from "../CommonTasks";
|
|
6
6
|
export declare class CommonPed extends CommonBaseEntity {
|
package/entities/CommonPed.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { CommonBaseEntity } from "./CommonBaseEntity";
|
|
4
4
|
import { CommonPlayer } from "./CommonPlayer";
|
|
5
|
-
import { ClassTypes } from "
|
|
5
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
6
6
|
import { CommonPedBoneCollection } from "./CommonPedBoneCollection";
|
|
7
7
|
import { CommonTasks } from "../CommonTasks";
|
|
8
8
|
class CommonPed extends CommonBaseEntity {
|
package/entities/CommonPlayer.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
import { CommonPed } from "./CommonPed";
|
|
4
|
-
import { ClassTypes } from "
|
|
4
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
5
5
|
import { GetEntityClassFromHandle } from "./GetEntityClassIdFromHandle";
|
|
6
6
|
import cfx from "../cfx/cfx";
|
|
7
|
-
import {
|
|
7
|
+
import { CommonGameConstants } from "../CommonGameConstants";
|
|
8
8
|
class CommonPlayer {
|
|
9
9
|
static {
|
|
10
10
|
__name(this, "CommonPlayer");
|
|
@@ -17,7 +17,7 @@ class CommonPlayer {
|
|
|
17
17
|
type = ClassTypes.Player;
|
|
18
18
|
static *AllPlayers(excludeLocalPlayer = true) {
|
|
19
19
|
for (const ply of GetActivePlayers()) {
|
|
20
|
-
if (excludeLocalPlayer && ply ===
|
|
20
|
+
if (excludeLocalPlayer && ply === CommonGameConstants.PlayerId) {
|
|
21
21
|
continue;
|
|
22
22
|
}
|
|
23
23
|
yield new CommonPlayer(ply);
|
|
@@ -50,7 +50,7 @@ class CommonPlayer {
|
|
|
50
50
|
* @param [fromPlayer=GameConstants.Player] the player to get the distance from
|
|
51
51
|
* @returns the closest player from {@param fromPlayer} and the distance the player was
|
|
52
52
|
*/
|
|
53
|
-
static getClosestPlayerPedWithDistance(minimumDistance = Number.MAX_VALUE, fromPlayer =
|
|
53
|
+
static getClosestPlayerPedWithDistance(minimumDistance = Number.MAX_VALUE, fromPlayer = CommonGameConstants.Player) {
|
|
54
54
|
const ped = fromPlayer.Ped;
|
|
55
55
|
const pos = ped.Position;
|
|
56
56
|
const data = [null, Number.MAX_VALUE];
|
|
@@ -69,7 +69,7 @@ class CommonPlayer {
|
|
|
69
69
|
* @param [fromPlayer=GameConstants.Player] the player to get the distance from
|
|
70
70
|
* @returns the closest player from {@param fromPlayer} and the distance the player was
|
|
71
71
|
*/
|
|
72
|
-
static getClosestPlayerPed(minimumDistance = Number.MAX_VALUE, fromPlayer =
|
|
72
|
+
static getClosestPlayerPed(minimumDistance = Number.MAX_VALUE, fromPlayer = CommonGameConstants.Player) {
|
|
73
73
|
const data = this.getClosestPlayerPedWithDistance(minimumDistance, fromPlayer);
|
|
74
74
|
return data[0];
|
|
75
75
|
}
|
package/entities/CommonProp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassTypes } from "
|
|
1
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
2
2
|
import { CommonBaseEntity } from "./CommonBaseEntity";
|
|
3
3
|
import { CommonEntityBoneCollection } from "./CommonEntityBoneCollection";
|
|
4
4
|
import type { CommonEntity } from "./CommonEntityType";
|
package/entities/CommonProp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { ClassTypes } from "
|
|
3
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
4
4
|
import { CommonBaseEntity } from "./CommonBaseEntity";
|
|
5
5
|
import { CommonEntityBoneCollection } from "./CommonEntityBoneCollection";
|
|
6
6
|
import { GetEntityClassFromHandle } from "./GetEntityClassIdFromHandle";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassTypes } from "
|
|
1
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
2
2
|
import { CommonBaseEntity } from "./CommonBaseEntity";
|
|
3
3
|
import { CommonEntityBoneCollection } from "./CommonEntityBoneCollection";
|
|
4
4
|
export declare class CommonVehicle extends CommonBaseEntity {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { ClassTypes } from "
|
|
3
|
+
import { ClassTypes } from "../common/utils/ClassTypes";
|
|
4
4
|
import { CommonBaseEntity } from "./CommonBaseEntity";
|
|
5
5
|
import { CommonEntityBoneCollection } from "./CommonEntityBoneCollection";
|
|
6
6
|
class CommonVehicle extends CommonBaseEntity {
|
package/index.d.ts
CHANGED
|
@@ -20,5 +20,31 @@ export * from "./entities/GetEntityClassIdFromHandle";
|
|
|
20
20
|
export * from "./entities/IHandle";
|
|
21
21
|
export * from "./definitions/index.d";
|
|
22
22
|
export * from "./definitions/redm.d";
|
|
23
|
+
export * from "./common/Command";
|
|
24
|
+
export * from "./common/Convar";
|
|
25
|
+
export * from "./common/GlobalData";
|
|
26
|
+
export * from "./common/Kvp";
|
|
27
|
+
export * from "./common/Resource";
|
|
28
|
+
export * from "./common/types";
|
|
29
|
+
export * from "./common/utils/ClassTypes";
|
|
30
|
+
export * from "./common/utils/Color";
|
|
31
|
+
export * from "./common/utils/Delay";
|
|
32
|
+
export * from "./common/utils/Maths";
|
|
33
|
+
export * from "./common/utils/Point";
|
|
34
|
+
export * from "./common/utils/PointF";
|
|
35
|
+
export * from "./common/utils/Quaternion";
|
|
36
|
+
export * from "./common/utils/Vector";
|
|
37
|
+
export * from "./common/utils/cleanPlayerName";
|
|
38
|
+
export * from "./common/utils/enumValues";
|
|
39
|
+
export * from "./common/utils/getStringFromUInt8Array";
|
|
40
|
+
export * from "./common/utils/getUInt32FromUint8Array";
|
|
41
|
+
export * from "./common/utils/randomInt";
|
|
42
|
+
export * from "./common/net/NetworkedMap";
|
|
43
|
+
export * from "./common/decors/ConVar";
|
|
44
|
+
export * from "./common/decors/Events";
|
|
45
|
+
export * from "./common/decors/Exports";
|
|
46
|
+
export * from "./common/decors/Permissions";
|
|
47
|
+
export * from "./common/decors/Resources";
|
|
48
|
+
export * from "./common/decors/Ticks";
|
|
23
49
|
export * from "./cfx/StateBagChangeHandler";
|
|
24
50
|
export * from "./cfx/cfx";
|
package/index.js
CHANGED
|
@@ -20,5 +20,31 @@ export * from "./entities/GetEntityClassIdFromHandle";
|
|
|
20
20
|
export * from "./entities/IHandle";
|
|
21
21
|
export * from "./definitions/index.d";
|
|
22
22
|
export * from "./definitions/redm.d";
|
|
23
|
+
export * from "./common/Command";
|
|
24
|
+
export * from "./common/Convar";
|
|
25
|
+
export * from "./common/GlobalData";
|
|
26
|
+
export * from "./common/Kvp";
|
|
27
|
+
export * from "./common/Resource";
|
|
28
|
+
export * from "./common/types";
|
|
29
|
+
export * from "./common/utils/ClassTypes";
|
|
30
|
+
export * from "./common/utils/Color";
|
|
31
|
+
export * from "./common/utils/Delay";
|
|
32
|
+
export * from "./common/utils/Maths";
|
|
33
|
+
export * from "./common/utils/Point";
|
|
34
|
+
export * from "./common/utils/PointF";
|
|
35
|
+
export * from "./common/utils/Quaternion";
|
|
36
|
+
export * from "./common/utils/Vector";
|
|
37
|
+
export * from "./common/utils/cleanPlayerName";
|
|
38
|
+
export * from "./common/utils/enumValues";
|
|
39
|
+
export * from "./common/utils/getStringFromUInt8Array";
|
|
40
|
+
export * from "./common/utils/getUInt32FromUint8Array";
|
|
41
|
+
export * from "./common/utils/randomInt";
|
|
42
|
+
export * from "./common/net/NetworkedMap";
|
|
43
|
+
export * from "./common/decors/ConVar";
|
|
44
|
+
export * from "./common/decors/Events";
|
|
45
|
+
export * from "./common/decors/Exports";
|
|
46
|
+
export * from "./common/decors/Permissions";
|
|
47
|
+
export * from "./common/decors/Resources";
|
|
48
|
+
export * from "./common/decors/Ticks";
|
|
23
49
|
export * from "./cfx/StateBagChangeHandler";
|
|
24
50
|
export * from "./cfx/cfx";
|
package/package.json
CHANGED
package/utils/Animations.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { Delay } from "
|
|
3
|
+
import { Delay } from "../common/utils/Delay";
|
|
4
4
|
const LoadAnimDict = /* @__PURE__ */ __name(async (animDict, waitTime = 1e3) => {
|
|
5
5
|
const start = GetGameTimer();
|
|
6
6
|
if (!HasAnimDictLoaded(animDict)) {
|