@nativewrappers/redm 0.0.44 → 0.0.46
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/Controls.d.ts +7 -0
- package/Controls.js +14 -0
- package/entities/BaseEntity.d.ts +1 -0
- package/entities/BaseEntity.js +21 -0
- package/entities/Ped.d.ts +1 -0
- package/entities/Ped.js +6 -0
- package/enums/Keys.d.ts +804 -7
- package/enums/Keys.js +806 -9
- package/enums/index.d.ts +1 -0
- package/enums/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +2 -2
package/Controls.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KeyHash } from "./enums/Keys";
|
|
2
|
+
export declare class Controls {
|
|
3
|
+
static IsInputJustPressed(hash: KeyHash): boolean;
|
|
4
|
+
static IsInputPressed(hash: KeyHash): boolean;
|
|
5
|
+
static IsDisabledInputPressed(hash: KeyHash): boolean;
|
|
6
|
+
static DisableControl(hash: KeyHash): void;
|
|
7
|
+
}
|
package/Controls.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class Controls {
|
|
2
|
+
static IsInputJustPressed(hash) {
|
|
3
|
+
return IsControlJustPressed(0, hash);
|
|
4
|
+
}
|
|
5
|
+
static IsInputPressed(hash) {
|
|
6
|
+
return IsControlPressed(0, hash);
|
|
7
|
+
}
|
|
8
|
+
static IsDisabledInputPressed(hash) {
|
|
9
|
+
return IsDisabledControlPressed(0, hash);
|
|
10
|
+
}
|
|
11
|
+
static DisableControl(hash) {
|
|
12
|
+
DisableControlAction(0, hash, false);
|
|
13
|
+
}
|
|
14
|
+
}
|
package/entities/BaseEntity.d.ts
CHANGED
package/entities/BaseEntity.js
CHANGED
|
@@ -3,6 +3,27 @@ export class BaseEntity {
|
|
|
3
3
|
constructor(entHandle) {
|
|
4
4
|
this.handle = entHandle;
|
|
5
5
|
}
|
|
6
|
+
// Replaces the current handle for the entity used on, this hsould be used sparringly, mainly
|
|
7
|
+
// in situations where you're going to reuse an entity over and over and don't want to make a
|
|
8
|
+
// new entity every time.
|
|
9
|
+
//
|
|
10
|
+
// **WARNING**: This does no checks, if you provide it an invalid entity it will use it
|
|
11
|
+
//
|
|
12
|
+
// ```ts
|
|
13
|
+
// const REUSABLE_ENTITY = new Entity(entityHandle);
|
|
14
|
+
//
|
|
15
|
+
// onNet("entityHandler", (entNetId: number) => {
|
|
16
|
+
// // if no net entity we should ignore
|
|
17
|
+
// if (!NetworkDoesEntityExistWithNetworkId(entNetId)) return;
|
|
18
|
+
//
|
|
19
|
+
// // Reuse our entity so we don't have to initialize a new one
|
|
20
|
+
// REUSABLE_ENTITY.replaceHandle(NetworkGetEntityFromNetworkId(entNetId));
|
|
21
|
+
// // Do something with REUSABLE_ENTITY entity
|
|
22
|
+
// })
|
|
23
|
+
// ```
|
|
24
|
+
replaceHandle(newHandle) {
|
|
25
|
+
this.handle = newHandle;
|
|
26
|
+
}
|
|
6
27
|
get Handle() {
|
|
7
28
|
return this.handle;
|
|
8
29
|
}
|
package/entities/Ped.d.ts
CHANGED
package/entities/Ped.js
CHANGED
|
@@ -331,4 +331,10 @@ export class Ped extends BaseEntity {
|
|
|
331
331
|
applyDamagePack(damagePack, damage, mult) {
|
|
332
332
|
ApplyPedDamagePack(this.Handle, damagePack, damage, mult);
|
|
333
333
|
}
|
|
334
|
+
get CurrentVehicle() {
|
|
335
|
+
const veh = GetVehiclePedIsIn(this.Handle, false);
|
|
336
|
+
if (veh === 0)
|
|
337
|
+
return null;
|
|
338
|
+
return new Vehicle(veh);
|
|
339
|
+
}
|
|
334
340
|
}
|