@nativewrappers/fivem 0.0.30 → 0.0.31
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/client/Game.js +1 -1
- package/client/TaskSequence.js +1 -0
- package/client/models/BaseEntity.d.ts +10 -10
- package/client/models/BaseEntity.js +16 -16
- package/client/models/EntityBoneCollection.d.ts +0 -2
- package/client/models/EntityBoneCollection.js +0 -1
- package/client/models/Ped.d.ts +6 -6
- package/client/models/Ped.js +47 -50
- package/client/models/Player.d.ts +1 -1
- package/client/models/Prop.d.ts +1 -1
- package/client/models/Prop.js +3 -3
- package/client/models/Vehicle.d.ts +4 -4
- package/client/models/VehicleModCollection.d.ts +1 -1
- package/client/models/VehicleModCollection.js +1 -2
- package/client/models/VehicleWindowCollection.d.ts +2 -2
- package/client/models/VehicleWindowCollection.js +6 -5
- package/client/ui/menu/Menu.d.ts +2 -2
- package/client/ui/menu/items/UIMenuItem.d.ts +1 -1
- package/client/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +2 -2
- package/client/ui/menu/items/panels/AbstractUIMenuPanel.js +1 -1
- package/client/ui/menu/items/panels/UIMenuGridPanel.d.ts +4 -4
- package/package.json +1 -1
package/client/Game.js
CHANGED
|
@@ -76,7 +76,7 @@ export class Game {
|
|
|
76
76
|
*/
|
|
77
77
|
static get Player() {
|
|
78
78
|
const handle = PlayerId();
|
|
79
|
-
if (
|
|
79
|
+
if (this.cachedPlayer === undefined || handle !== this.cachedPlayer.Handle) {
|
|
80
80
|
this.cachedPlayer = new Player(handle);
|
|
81
81
|
}
|
|
82
82
|
return this.cachedPlayer;
|
package/client/TaskSequence.js
CHANGED
|
@@ -132,19 +132,11 @@ export declare class BaseEntity {
|
|
|
132
132
|
isNearEntity(entity: BaseEntity, bounds: Vector3): boolean;
|
|
133
133
|
isTouching(entity: BaseEntity): boolean;
|
|
134
134
|
isTouchingModel(model: Model): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated use [[getAbsolutePositionOffset]]
|
|
137
|
-
*/
|
|
138
|
-
getOffsetPosition(offset: Vector3): Vector3;
|
|
139
135
|
/**
|
|
140
136
|
* @param offset: the amount to offset from the entity
|
|
141
137
|
* @returns the offset position from the entity in world coords
|
|
142
138
|
*/
|
|
143
|
-
getAbsolutePositionOffset(
|
|
144
|
-
/**
|
|
145
|
-
* @deprecated use [[getRelativePositionOffset]] instead
|
|
146
|
-
*/
|
|
147
|
-
getPositionOffset(worldCoords: Vector3): Vector3;
|
|
139
|
+
getAbsolutePositionOffset(worldCoords: Vector3): Vector3;
|
|
148
140
|
/**
|
|
149
141
|
* @example
|
|
150
142
|
* ```typescript
|
|
@@ -161,7 +153,15 @@ export declare class BaseEntity {
|
|
|
161
153
|
* @param worldCoords: the offset given the world coords
|
|
162
154
|
* @returns the offset position from the entity in relative coords
|
|
163
155
|
*/
|
|
164
|
-
getRelativePositionOffset(
|
|
156
|
+
getRelativePositionOffset(offset: Vector3): Vector3;
|
|
157
|
+
/**
|
|
158
|
+
* @deprecated use [[getAbsolutePositionOffset]] instead
|
|
159
|
+
*/
|
|
160
|
+
getPositionOffset(worldCoords: Vector3): Vector3;
|
|
161
|
+
/**
|
|
162
|
+
* @deprecated use [[getRelativePositionOffset]]
|
|
163
|
+
*/
|
|
164
|
+
getOffsetPosition(offset: Vector3): Vector3;
|
|
165
165
|
attachTo(entity: BaseEntity, position: Vector3, rotation: Vector3, collisions?: boolean, unk9?: boolean, useSoftPinning?: boolean, rotationOrder?: number): void;
|
|
166
166
|
attachToBone(entityBone: EntityBone, position: Vector3, rotation: Vector3, collisions?: boolean, unk9?: boolean, useSoftPinning?: boolean, rotationOrder?: number): void;
|
|
167
167
|
detach(): void;
|
|
@@ -362,24 +362,12 @@ export class BaseEntity {
|
|
|
362
362
|
isTouchingModel(model) {
|
|
363
363
|
return IsEntityTouchingModel(this.handle, model.Hash);
|
|
364
364
|
}
|
|
365
|
-
/**
|
|
366
|
-
* @deprecated use [[getAbsolutePositionOffset]]
|
|
367
|
-
*/
|
|
368
|
-
getOffsetPosition(offset) {
|
|
369
|
-
return Vector3.fromArray(GetOffsetFromEntityInWorldCoords(this.handle, offset.x, offset.y, offset.z));
|
|
370
|
-
}
|
|
371
365
|
/**
|
|
372
366
|
* @param offset: the amount to offset from the entity
|
|
373
367
|
* @returns the offset position from the entity in world coords
|
|
374
368
|
*/
|
|
375
|
-
getAbsolutePositionOffset(
|
|
376
|
-
return Vector3.fromArray(
|
|
377
|
-
}
|
|
378
|
-
/**
|
|
379
|
-
* @deprecated use [[getRelativePositionOffset]] instead
|
|
380
|
-
*/
|
|
381
|
-
getPositionOffset(worldCoords) {
|
|
382
|
-
return this.getRelativePositionOffset(worldCoords);
|
|
369
|
+
getAbsolutePositionOffset(worldCoords) {
|
|
370
|
+
return Vector3.fromArray(GetOffsetFromEntityGivenWorldCoords(this.handle, worldCoords.x, worldCoords.y, worldCoords.z));
|
|
383
371
|
}
|
|
384
372
|
// TODO: Better example
|
|
385
373
|
/**
|
|
@@ -398,8 +386,20 @@ export class BaseEntity {
|
|
|
398
386
|
* @param worldCoords: the offset given the world coords
|
|
399
387
|
* @returns the offset position from the entity in relative coords
|
|
400
388
|
*/
|
|
401
|
-
getRelativePositionOffset(
|
|
402
|
-
return Vector3.fromArray(
|
|
389
|
+
getRelativePositionOffset(offset) {
|
|
390
|
+
return Vector3.fromArray(GetOffsetFromEntityInWorldCoords(this.handle, offset.x, offset.y, offset.z));
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* @deprecated use [[getAbsolutePositionOffset]] instead
|
|
394
|
+
*/
|
|
395
|
+
getPositionOffset(worldCoords) {
|
|
396
|
+
return this.getAbsolutePositionOffset(worldCoords);
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* @deprecated use [[getRelativePositionOffset]]
|
|
400
|
+
*/
|
|
401
|
+
getOffsetPosition(offset) {
|
|
402
|
+
return this.getRelativePositionOffset(offset);
|
|
403
403
|
}
|
|
404
404
|
attachTo(entity, position, rotation, collisions = false, unk9 = true, useSoftPinning = true, rotationOrder = 1) {
|
|
405
405
|
if (this.handle == entity.Handle) {
|
|
@@ -2,8 +2,6 @@ import { EntityBone } from './';
|
|
|
2
2
|
import type { BaseEntity } from './BaseEntity';
|
|
3
3
|
export declare class EntityBoneCollection {
|
|
4
4
|
protected readonly owner: BaseEntity;
|
|
5
|
-
private readonly _collection;
|
|
6
|
-
private _currentIndex;
|
|
7
5
|
constructor(owner: BaseEntity);
|
|
8
6
|
hasBone(name: string): boolean;
|
|
9
7
|
getBone(boneIndex?: number, boneName?: string): EntityBone;
|
package/client/models/Ped.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ import { BaseEntity } from './BaseEntity';
|
|
|
9
9
|
export declare class Ped extends BaseEntity {
|
|
10
10
|
static exists(ped: Ped): boolean;
|
|
11
11
|
static fromHandle(handle: number): Ped | null;
|
|
12
|
-
static fromNetworkId(networkId: number
|
|
12
|
+
static fromNetworkId(networkId: number): Ped | null;
|
|
13
13
|
protected type: ClassTypes;
|
|
14
|
-
private pedBones
|
|
15
|
-
private weapons
|
|
16
|
-
private readonly speechModifierNames;
|
|
14
|
+
private pedBones?;
|
|
15
|
+
private weapons?;
|
|
16
|
+
private static readonly speechModifierNames;
|
|
17
17
|
private tasks;
|
|
18
18
|
constructor(handle: number);
|
|
19
19
|
get Player(): Player;
|
|
@@ -107,7 +107,7 @@ export declare class Ped extends BaseEntity {
|
|
|
107
107
|
set DrivingStyle(style: DrivingStyle);
|
|
108
108
|
set IsDrunk(isDrunk: boolean);
|
|
109
109
|
set MotionBlur(value: boolean);
|
|
110
|
-
get Task(): Tasks
|
|
110
|
+
get Task(): Tasks;
|
|
111
111
|
get DeathCause(): number;
|
|
112
112
|
get TaskSequenceProgress(): number;
|
|
113
113
|
set BlockPermanentEvents(block: boolean);
|
|
@@ -157,7 +157,7 @@ export declare class Ped extends BaseEntity {
|
|
|
157
157
|
setConfigFlag(flagId: number, value: boolean): void;
|
|
158
158
|
resetConfigFlag(flagId: number): void;
|
|
159
159
|
clone(): Ped;
|
|
160
|
-
exists(
|
|
160
|
+
exists(): boolean;
|
|
161
161
|
isFacingPed(ped: Ped, angle?: number): boolean;
|
|
162
162
|
setComponentVariation(componentId: number, drawableId: number, textureId: number, paletteId?: number): void;
|
|
163
163
|
setRandomComponentVariation(): void;
|
package/client/models/Ped.js
CHANGED
|
@@ -12,54 +12,15 @@ export class Ped extends BaseEntity {
|
|
|
12
12
|
static fromHandle(handle) {
|
|
13
13
|
return new Ped(handle);
|
|
14
14
|
}
|
|
15
|
-
static fromNetworkId(networkId
|
|
16
|
-
if (
|
|
17
|
-
|
|
15
|
+
static fromNetworkId(networkId) {
|
|
16
|
+
if (!NetworkDoesEntityExistWithNetworkId(networkId)) {
|
|
17
|
+
return null;
|
|
18
18
|
}
|
|
19
19
|
return new Ped(NetworkGetEntityFromNetworkId(networkId));
|
|
20
20
|
}
|
|
21
21
|
constructor(handle) {
|
|
22
22
|
super(handle);
|
|
23
23
|
this.type = ClassTypes.Ped;
|
|
24
|
-
this.speechModifierNames = [
|
|
25
|
-
'SPEECH_PARAMS_STANDARD',
|
|
26
|
-
'SPEECH_PARAMS_ALLOW_REPEAT',
|
|
27
|
-
'SPEECH_PARAMS_BEAT',
|
|
28
|
-
'SPEECH_PARAMS_FORCE',
|
|
29
|
-
'SPEECH_PARAMS_FORCE_FRONTEND',
|
|
30
|
-
'SPEECH_PARAMS_FORCE_NO_REPEAT_FRONTEND',
|
|
31
|
-
'SPEECH_PARAMS_FORCE_NORMAL',
|
|
32
|
-
'SPEECH_PARAMS_FORCE_NORMAL_CLEAR',
|
|
33
|
-
'SPEECH_PARAMS_FORCE_NORMAL_CRITICAL',
|
|
34
|
-
'SPEECH_PARAMS_FORCE_SHOUTED',
|
|
35
|
-
'SPEECH_PARAMS_FORCE_SHOUTED_CLEAR',
|
|
36
|
-
'SPEECH_PARAMS_FORCE_SHOUTED_CRITICAL',
|
|
37
|
-
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY',
|
|
38
|
-
'SPEECH_PARAMS_MEGAPHONE',
|
|
39
|
-
'SPEECH_PARAMS_HELI',
|
|
40
|
-
'SPEECH_PARAMS_FORCE_MEGAPHONE',
|
|
41
|
-
'SPEECH_PARAMS_FORCE_HELI',
|
|
42
|
-
'SPEECH_PARAMS_INTERRUPT',
|
|
43
|
-
'SPEECH_PARAMS_INTERRUPT_SHOUTED',
|
|
44
|
-
'SPEECH_PARAMS_INTERRUPT_SHOUTED_CLEAR',
|
|
45
|
-
'SPEECH_PARAMS_INTERRUPT_SHOUTED_CRITICAL',
|
|
46
|
-
'SPEECH_PARAMS_INTERRUPT_NO_FORCE',
|
|
47
|
-
'SPEECH_PARAMS_INTERRUPT_FRONTEND',
|
|
48
|
-
'SPEECH_PARAMS_INTERRUPT_NO_FORCE_FRONTEND',
|
|
49
|
-
'SPEECH_PARAMS_ADD_BLIP',
|
|
50
|
-
'SPEECH_PARAMS_ADD_BLIP_ALLOW_REPEAT',
|
|
51
|
-
'SPEECH_PARAMS_ADD_BLIP_FORCE',
|
|
52
|
-
'SPEECH_PARAMS_ADD_BLIP_SHOUTED',
|
|
53
|
-
'SPEECH_PARAMS_ADD_BLIP_SHOUTED_FORCE',
|
|
54
|
-
'SPEECH_PARAMS_ADD_BLIP_INTERRUPT',
|
|
55
|
-
'SPEECH_PARAMS_ADD_BLIP_INTERRUPT_FORCE',
|
|
56
|
-
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED',
|
|
57
|
-
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED_CLEAR',
|
|
58
|
-
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED_CRITICAL',
|
|
59
|
-
'SPEECH_PARAMS_SHOUTED',
|
|
60
|
-
'SPEECH_PARAMS_SHOUTED_CLEAR',
|
|
61
|
-
'SPEECH_PARAMS_SHOUTED_CRITICAL',
|
|
62
|
-
];
|
|
63
24
|
}
|
|
64
25
|
get Player() {
|
|
65
26
|
return new Player(NetworkGetPlayerIndexFromPed(this.handle));
|
|
@@ -441,12 +402,12 @@ export class Ped extends BaseEntity {
|
|
|
441
402
|
RemovePedFromGroup(this.handle);
|
|
442
403
|
}
|
|
443
404
|
playAmbientSpeed(speechName, voiceName = '', modifier = SpeechModifier.Standard) {
|
|
444
|
-
if (Number(modifier) >= 0 && Number(modifier) <
|
|
405
|
+
if (Number(modifier) >= 0 && Number(modifier) < Ped.speechModifierNames.length) {
|
|
445
406
|
if (voiceName === '') {
|
|
446
|
-
PlayAmbientSpeech1(this.handle, speechName,
|
|
407
|
+
PlayAmbientSpeech1(this.handle, speechName, Ped.speechModifierNames[Number(modifier)]);
|
|
447
408
|
}
|
|
448
409
|
else {
|
|
449
|
-
PlayAmbientSpeechWithVoice(this.handle, speechName, voiceName,
|
|
410
|
+
PlayAmbientSpeechWithVoice(this.handle, speechName, voiceName, Ped.speechModifierNames[Number(modifier)], false);
|
|
450
411
|
}
|
|
451
412
|
}
|
|
452
413
|
else {
|
|
@@ -533,11 +494,8 @@ export class Ped extends BaseEntity {
|
|
|
533
494
|
clone() {
|
|
534
495
|
return new Ped(ClonePed(this.handle, false, false, false));
|
|
535
496
|
}
|
|
536
|
-
exists(
|
|
537
|
-
|
|
538
|
-
return super.exists() && GetEntityType(this.handle) === 1;
|
|
539
|
-
}
|
|
540
|
-
return ped?.exists() ?? false;
|
|
497
|
+
exists() {
|
|
498
|
+
return super.exists() && GetEntityType(this.handle) === 1;
|
|
541
499
|
}
|
|
542
500
|
isFacingPed(ped, angle = 25.0) {
|
|
543
501
|
return IsPedFacingPed(this.handle, ped.Handle, angle);
|
|
@@ -683,3 +641,42 @@ export class Ped extends BaseEntity {
|
|
|
683
641
|
return HasPedHeadBlendFinished(this.handle);
|
|
684
642
|
}
|
|
685
643
|
}
|
|
644
|
+
Ped.speechModifierNames = [
|
|
645
|
+
'SPEECH_PARAMS_STANDARD',
|
|
646
|
+
'SPEECH_PARAMS_ALLOW_REPEAT',
|
|
647
|
+
'SPEECH_PARAMS_BEAT',
|
|
648
|
+
'SPEECH_PARAMS_FORCE',
|
|
649
|
+
'SPEECH_PARAMS_FORCE_FRONTEND',
|
|
650
|
+
'SPEECH_PARAMS_FORCE_NO_REPEAT_FRONTEND',
|
|
651
|
+
'SPEECH_PARAMS_FORCE_NORMAL',
|
|
652
|
+
'SPEECH_PARAMS_FORCE_NORMAL_CLEAR',
|
|
653
|
+
'SPEECH_PARAMS_FORCE_NORMAL_CRITICAL',
|
|
654
|
+
'SPEECH_PARAMS_FORCE_SHOUTED',
|
|
655
|
+
'SPEECH_PARAMS_FORCE_SHOUTED_CLEAR',
|
|
656
|
+
'SPEECH_PARAMS_FORCE_SHOUTED_CRITICAL',
|
|
657
|
+
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY',
|
|
658
|
+
'SPEECH_PARAMS_MEGAPHONE',
|
|
659
|
+
'SPEECH_PARAMS_HELI',
|
|
660
|
+
'SPEECH_PARAMS_FORCE_MEGAPHONE',
|
|
661
|
+
'SPEECH_PARAMS_FORCE_HELI',
|
|
662
|
+
'SPEECH_PARAMS_INTERRUPT',
|
|
663
|
+
'SPEECH_PARAMS_INTERRUPT_SHOUTED',
|
|
664
|
+
'SPEECH_PARAMS_INTERRUPT_SHOUTED_CLEAR',
|
|
665
|
+
'SPEECH_PARAMS_INTERRUPT_SHOUTED_CRITICAL',
|
|
666
|
+
'SPEECH_PARAMS_INTERRUPT_NO_FORCE',
|
|
667
|
+
'SPEECH_PARAMS_INTERRUPT_FRONTEND',
|
|
668
|
+
'SPEECH_PARAMS_INTERRUPT_NO_FORCE_FRONTEND',
|
|
669
|
+
'SPEECH_PARAMS_ADD_BLIP',
|
|
670
|
+
'SPEECH_PARAMS_ADD_BLIP_ALLOW_REPEAT',
|
|
671
|
+
'SPEECH_PARAMS_ADD_BLIP_FORCE',
|
|
672
|
+
'SPEECH_PARAMS_ADD_BLIP_SHOUTED',
|
|
673
|
+
'SPEECH_PARAMS_ADD_BLIP_SHOUTED_FORCE',
|
|
674
|
+
'SPEECH_PARAMS_ADD_BLIP_INTERRUPT',
|
|
675
|
+
'SPEECH_PARAMS_ADD_BLIP_INTERRUPT_FORCE',
|
|
676
|
+
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED',
|
|
677
|
+
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED_CLEAR',
|
|
678
|
+
'SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED_CRITICAL',
|
|
679
|
+
'SPEECH_PARAMS_SHOUTED',
|
|
680
|
+
'SPEECH_PARAMS_SHOUTED_CLEAR',
|
|
681
|
+
'SPEECH_PARAMS_SHOUTED_CRITICAL',
|
|
682
|
+
];
|
package/client/models/Prop.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { BaseEntity } from './BaseEntity';
|
|
|
3
3
|
export declare class Prop extends BaseEntity {
|
|
4
4
|
static exists(prop: Prop): boolean;
|
|
5
5
|
static fromHandle(handle: number): Prop | null;
|
|
6
|
-
static fromNetworkId(networkId: number
|
|
6
|
+
static fromNetworkId(networkId: number): Prop | null;
|
|
7
7
|
protected type: ClassTypes;
|
|
8
8
|
constructor(handle: number);
|
|
9
9
|
exists(): boolean;
|
package/client/models/Prop.js
CHANGED
|
@@ -7,9 +7,9 @@ export class Prop extends BaseEntity {
|
|
|
7
7
|
static fromHandle(handle) {
|
|
8
8
|
return new Prop(handle);
|
|
9
9
|
}
|
|
10
|
-
static fromNetworkId(networkId
|
|
11
|
-
if (
|
|
12
|
-
|
|
10
|
+
static fromNetworkId(networkId) {
|
|
11
|
+
if (!NetworkDoesEntityExistWithNetworkId(networkId)) {
|
|
12
|
+
return null;
|
|
13
13
|
}
|
|
14
14
|
return new Prop(NetworkGetEntityFromNetworkId(networkId));
|
|
15
15
|
}
|
|
@@ -11,10 +11,10 @@ export declare class Vehicle extends BaseEntity {
|
|
|
11
11
|
static exists(vehicle: Vehicle): boolean;
|
|
12
12
|
static fromHandle(handle: number): Vehicle | null;
|
|
13
13
|
static fromNetworkId(networkId: number): Vehicle | null;
|
|
14
|
-
private _doors
|
|
15
|
-
private _mods
|
|
16
|
-
private _wheels
|
|
17
|
-
private _windows
|
|
14
|
+
private _doors?;
|
|
15
|
+
private _mods?;
|
|
16
|
+
private _wheels?;
|
|
17
|
+
private _windows?;
|
|
18
18
|
protected type: ClassTypes;
|
|
19
19
|
constructor(handle: number);
|
|
20
20
|
exists(): boolean;
|
|
@@ -16,7 +16,7 @@ export declare class VehicleModCollection {
|
|
|
16
16
|
set WheelType(type: VehicleWheelType);
|
|
17
17
|
installModKit(): void;
|
|
18
18
|
get Livery(): number | undefined;
|
|
19
|
-
set Livery(value: number
|
|
19
|
+
set Livery(value: number);
|
|
20
20
|
get LiveryCount(): number;
|
|
21
21
|
get WindowTint(): VehicleWindowTint;
|
|
22
22
|
set WindowTint(tint: VehicleWindowTint);
|
|
@@ -44,6 +44,7 @@ export class VehicleModCollection {
|
|
|
44
44
|
installModKit() {
|
|
45
45
|
SetVehicleModKit(this._owner.Handle, 0);
|
|
46
46
|
}
|
|
47
|
+
// TODO: This should return always return a number
|
|
47
48
|
get Livery() {
|
|
48
49
|
const modCount = this.getMod(VehicleModType.Livery)?.ModCount;
|
|
49
50
|
if (modCount !== undefined && modCount > 0) {
|
|
@@ -52,8 +53,6 @@ export class VehicleModCollection {
|
|
|
52
53
|
return GetVehicleLivery(this._owner.Handle);
|
|
53
54
|
}
|
|
54
55
|
set Livery(value) {
|
|
55
|
-
if (value === undefined)
|
|
56
|
-
return;
|
|
57
56
|
const mod = this.getMod(VehicleModType.Livery);
|
|
58
57
|
if (mod !== undefined && mod.ModCount > 0) {
|
|
59
58
|
mod.Index = value;
|
|
@@ -5,8 +5,8 @@ export declare class VehicleWindowCollection {
|
|
|
5
5
|
private _owner;
|
|
6
6
|
private readonly _vehicleWindows;
|
|
7
7
|
constructor(owner: Vehicle);
|
|
8
|
-
getWindow(index: VehicleWindowIndex): VehicleWindow
|
|
9
|
-
getAllWindows(): (VehicleWindow | null
|
|
8
|
+
getWindow(index: VehicleWindowIndex): VehicleWindow;
|
|
9
|
+
getAllWindows(): (VehicleWindow | null)[];
|
|
10
10
|
get AreAllWindowsIntact(): boolean;
|
|
11
11
|
rollDownAllWindows(): void;
|
|
12
12
|
rollUpAllWindows(): void;
|
|
@@ -6,10 +6,13 @@ export class VehicleWindowCollection {
|
|
|
6
6
|
this._owner = owner;
|
|
7
7
|
}
|
|
8
8
|
getWindow(index) {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
let window = this._vehicleWindows.get(index);
|
|
10
|
+
if (!window) {
|
|
11
|
+
const vehicleWindow = new VehicleWindow(this._owner, index);
|
|
12
|
+
this._vehicleWindows.set(index, vehicleWindow);
|
|
13
|
+
return vehicleWindow;
|
|
11
14
|
}
|
|
12
|
-
return
|
|
15
|
+
return window;
|
|
13
16
|
}
|
|
14
17
|
getAllWindows() {
|
|
15
18
|
return Object.keys(VehicleWindowIndex)
|
|
@@ -37,8 +40,6 @@ export class VehicleWindowCollection {
|
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
42
|
hasWindow(window) {
|
|
40
|
-
if (this._owner.Bones === undefined)
|
|
41
|
-
return false;
|
|
42
43
|
switch (window) {
|
|
43
44
|
case VehicleWindowIndex.FrontLeftWindow:
|
|
44
45
|
return this._owner.Bones.hasBone('window_lf');
|
package/client/ui/menu/Menu.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export declare class Menu {
|
|
|
9
9
|
static screenResolution: Size;
|
|
10
10
|
readonly id: string;
|
|
11
11
|
visible: boolean;
|
|
12
|
-
parentMenu
|
|
13
|
-
parentItem
|
|
12
|
+
parentMenu?: Menu;
|
|
13
|
+
parentItem?: UIMenuItem;
|
|
14
14
|
items: UIMenuItem[];
|
|
15
15
|
children: Map<string, Menu>;
|
|
16
16
|
readonly menuOpen: LiteEvent;
|
|
@@ -3,9 +3,9 @@ import { Rectangle, Sprite } from '../../../';
|
|
|
3
3
|
import { Menu } from '../../';
|
|
4
4
|
export declare abstract class AbstractUIMenuPanel {
|
|
5
5
|
readonly id: string;
|
|
6
|
-
protected parentItem
|
|
6
|
+
protected parentItem?: UIMenuItem;
|
|
7
7
|
protected enabled: boolean;
|
|
8
|
-
protected readonly background
|
|
8
|
+
protected readonly background?: Sprite | Rectangle;
|
|
9
9
|
get ParentMenu(): Menu | undefined;
|
|
10
10
|
get ParentItem(): UIMenuItem | undefined;
|
|
11
11
|
set ParentItem(value: UIMenuItem | undefined);
|
|
@@ -7,10 +7,10 @@ export declare class UIMenuGridPanel extends AbstractUIMenuPanel {
|
|
|
7
7
|
private _pressed;
|
|
8
8
|
private _lockXAxis;
|
|
9
9
|
private _lockYAxis;
|
|
10
|
-
private _topText
|
|
11
|
-
private _leftText
|
|
12
|
-
private _rightText
|
|
13
|
-
private _bottomText
|
|
10
|
+
private _topText?;
|
|
11
|
+
private _leftText?;
|
|
12
|
+
private _rightText?;
|
|
13
|
+
private _bottomText?;
|
|
14
14
|
private _lastCirclePosition;
|
|
15
15
|
private readonly _grid;
|
|
16
16
|
private readonly _circle;
|