@nativewrappers/fivem 0.0.72 → 0.0.73

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/index.js CHANGED
@@ -17,9 +17,9 @@ var Maths = class {
17
17
  };
18
18
 
19
19
  // src/fivem/utils/String.ts
20
- var String2 = class {
20
+ var _String = class {
21
21
  static {
22
- __name(this, "String");
22
+ __name(this, "_String");
23
23
  }
24
24
  static stringToArray(input) {
25
25
  let stringsNeeded = 1;
@@ -28,10 +28,7 @@ var String2 = class {
28
28
  }
29
29
  const outputString = new Array(stringsNeeded);
30
30
  for (let i = 0; i < stringsNeeded; i++) {
31
- outputString[i] = input.substring(
32
- i * 99,
33
- i * 99 + Maths.clamp(input.substring(i * 99).length, 0, 99)
34
- );
31
+ outputString[i] = input.substring(i * 99, i * 99 + Maths.clamp(input.substring(i * 99).length, 0, 99));
35
32
  }
36
33
  return outputString;
37
34
  }
@@ -133,10 +130,7 @@ var Point = class _Point {
133
130
  } else {
134
131
  if (arg.indexOf(",") !== -1) {
135
132
  const arr = arg.split(",");
136
- point = new _Point(
137
- Number.parseFloat(arr[0]),
138
- Number.parseFloat(arr[1])
139
- );
133
+ point = new _Point(Number.parseFloat(arr[0]), Number.parseFloat(arr[1]));
140
134
  }
141
135
  }
142
136
  }
@@ -204,8 +198,7 @@ var Vector = class _Vector {
204
198
  if (type !== EXT_VECTOR2 && type !== EXT_VECTOR3 && type !== EXT_VECTOR4)
205
199
  throw new Error("Buffer type is not a valid Vector.");
206
200
  const arr = new Array(buffer.length / 4);
207
- for (let i = 0; i < arr.length; i++)
208
- arr[i] = Number(buffer.readFloatLE(i * 4).toPrecision(7));
201
+ for (let i = 0; i < arr.length; i++) arr[i] = Number(buffer.readFloatLE(i * 4).toPrecision(7));
209
202
  return this.fromArray(arr);
210
203
  }
211
204
  /**
@@ -258,12 +251,7 @@ var Vector = class _Vector {
258
251
  * @returns A new vector with the z-component incremented.
259
252
  */
260
253
  static addZ(obj, z) {
261
- return this.create(
262
- obj.x,
263
- obj.y,
264
- obj.z + z,
265
- obj.w
266
- );
254
+ return this.create(obj.x, obj.y, obj.z + z, obj.w);
267
255
  }
268
256
  /**
269
257
  * Adds a scalar value to the w-component of a vector.
@@ -313,10 +301,8 @@ var Vector = class _Vector {
313
301
  const isNumber = typeof b === "number";
314
302
  x = operator(Math.abs(x), isNumber ? b : Math.abs(b.x ?? 0));
315
303
  y = operator(Math.abs(y), isNumber ? b : Math.abs(b.y ?? 0));
316
- if (z !== void 0)
317
- z = operator(Math.abs(z), isNumber ? b : Math.abs(b.z ?? 0));
318
- if (w !== void 0)
319
- w = operator(Math.abs(w), isNumber ? b : Math.abs(b.w ?? 0));
304
+ if (z !== void 0) z = operator(Math.abs(z), isNumber ? b : Math.abs(b.z ?? 0));
305
+ if (w !== void 0) w = operator(Math.abs(w), isNumber ? b : Math.abs(b.w ?? 0));
320
306
  return this.create(x, y, z, w);
321
307
  }
322
308
  /**
@@ -367,8 +353,7 @@ var Vector = class _Vector {
367
353
  const x = a[key];
368
354
  const y = b[key];
369
355
  if (!!x && !!y) result += x * y;
370
- else if (x || y)
371
- throw new Error("Vectors must have the same dimensions.");
356
+ else if (x || y) throw new Error("Vectors must have the same dimensions.");
372
357
  }
373
358
  return result;
374
359
  }
@@ -382,15 +367,8 @@ var Vector = class _Vector {
382
367
  const { x: ax, y: ay, z: az, w: aw } = a;
383
368
  const { x: bx, y: by, z: bz } = b;
384
369
  if (ax === void 0 || ay === void 0 || az === void 0 || bx === void 0 || by === void 0 || bz === void 0)
385
- throw new Error(
386
- "Vector.crossProduct requires two three-dimensional vectors."
387
- );
388
- return this.create(
389
- ay * bz - az * by,
390
- az * bx - ax * bz,
391
- ax * by - ay * bx,
392
- aw
393
- );
370
+ throw new Error("Vector.crossProduct requires two three-dimensional vectors.");
371
+ return this.create(ay * bz - az * by, az * bx - ax * bz, ax * by - ay * bx, aw);
394
372
  }
395
373
  /**
396
374
  * Normalizes a vector, producing a new vector with the same direction but with a magnitude of 1.
@@ -414,8 +392,7 @@ var Vector = class _Vector {
414
392
  * @param primitive The object to use as a vector.
415
393
  */
416
394
  static fromObject(primitive) {
417
- if (Array.isArray(primitive))
418
- return this.fromArray(primitive);
395
+ if (Array.isArray(primitive)) return this.fromArray(primitive);
419
396
  if ("buffer" in primitive) return this.fromBuffer(primitive);
420
397
  const { x, y, z, w } = primitive;
421
398
  return this.create(x, y, z, w);
@@ -600,8 +577,7 @@ var Vector = class _Vector {
600
577
  return Math.sqrt(sum);
601
578
  }
602
579
  swizzle(components) {
603
- if (!/^[xyzw]+$/.test(components))
604
- throw new Error(`Invalid key in swizzle components (${components}).`);
580
+ if (!/^[xyzw]+$/.test(components)) throw new Error(`Invalid key in swizzle components (${components}).`);
605
581
  const arr = components.split("").map((char) => this[char] ?? 0);
606
582
  return _Vector.create(...arr);
607
583
  }
@@ -890,8 +866,7 @@ var LoadAnimDictArray = /* @__PURE__ */ __name(async (animDict, waitTime = 1e3)
890
866
  animsLoaded.add(dict);
891
867
  }
892
868
  }
893
- if (GetGameTimer() - start >= waitTime)
894
- return [false, animDict.filter((dict) => !animsLoaded.has(dict))];
869
+ if (GetGameTimer() - start >= waitTime) return [false, animDict.filter((dict) => !animsLoaded.has(dict))];
895
870
  await Wait(0);
896
871
  }
897
872
  return [true, null];
@@ -906,23 +881,13 @@ var RemoveAnimDictArray = /* @__PURE__ */ __name((animDict) => {
906
881
  var Wait = /* @__PURE__ */ __name((milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds)), "Wait");
907
882
 
908
883
  // src/fivem/Audio.ts
909
- var Audio = class {
884
+ var Audio = class _Audio {
910
885
  static {
911
886
  __name(this, "Audio");
912
887
  }
913
888
  static playSoundAt(position, sound, set, generateSoundId = true) {
914
889
  const SOUND_ID = generateSoundId ? GetSoundId() : -1;
915
- PlaySoundFromCoord(
916
- SOUND_ID,
917
- sound,
918
- position.x,
919
- position.y,
920
- position.z,
921
- set ?? "",
922
- false,
923
- 0,
924
- false
925
- );
890
+ PlaySoundFromCoord(SOUND_ID, sound, position.x, position.y, position.z, set ?? "", false, 0, false);
926
891
  return SOUND_ID;
927
892
  }
928
893
  static playSoundFromEntity(entity, sound, set, generateSoundId = true) {
@@ -948,24 +913,24 @@ var Audio = class {
948
913
  if (typeof flag === "string") {
949
914
  SetAudioFlag(flag, toggle);
950
915
  } else {
951
- SetAudioFlag(this.audioFlags[Number(flag)], toggle);
916
+ SetAudioFlag(_Audio.audioFlags[Number(flag)], toggle);
952
917
  }
953
918
  }
954
919
  static playSound(soundFile, soundSet) {
955
- this.releaseSound(this.playSoundFrontEnd(soundFile, soundSet));
920
+ _Audio.releaseSound(_Audio.playSoundFrontEnd(soundFile, soundSet));
956
921
  }
957
922
  static playMusic(musicFile) {
958
- if (!this.cachedMusicFile) {
923
+ if (!_Audio.cachedMusicFile) {
959
924
  CancelMusicEvent(musicFile);
960
925
  }
961
- this.cachedMusicFile = musicFile;
926
+ _Audio.cachedMusicFile = musicFile;
962
927
  TriggerMusicEvent(musicFile);
963
928
  }
964
929
  static stopMusic(musicFile) {
965
930
  if (!musicFile) {
966
- if (!this.cachedMusicFile) {
967
- CancelMusicEvent(this.cachedMusicFile);
968
- this.cachedMusicFile = "";
931
+ if (!_Audio.cachedMusicFile) {
932
+ CancelMusicEvent(_Audio.cachedMusicFile);
933
+ _Audio.cachedMusicFile = "";
969
934
  }
970
935
  } else {
971
936
  CancelMusicEvent(musicFile ?? "");
@@ -5429,11 +5394,7 @@ var BaseEntity = class _BaseEntity {
5429
5394
  }
5430
5395
  AddStateBagChangeHandler(keyFilter, handler) {
5431
5396
  const stateBagName = this.IsNetworked ? `entity:${this.NetworkId}` : `localEntity:${this.handle}`;
5432
- const cookie = AddStateBagChangeHandler(
5433
- keyFilter,
5434
- stateBagName,
5435
- handler
5436
- );
5397
+ const cookie = AddStateBagChangeHandler(keyFilter, stateBagName, handler);
5437
5398
  this.stateBagCookies.push(cookie);
5438
5399
  return cookie;
5439
5400
  }
@@ -5448,7 +5409,7 @@ var BaseEntity = class _BaseEntity {
5448
5409
  }
5449
5410
  removeStateListener(tgtCookie) {
5450
5411
  this.stateBagCookies = this.stateBagCookies.filter((cookie) => {
5451
- const isCookie = cookie == tgtCookie;
5412
+ const isCookie = cookie === tgtCookie;
5452
5413
  if (isCookie) RemoveStateBagChangeHandler(cookie);
5453
5414
  return isCookie;
5454
5415
  });
@@ -5472,8 +5433,7 @@ var BaseEntity = class _BaseEntity {
5472
5433
  return Vector3.fromArrays(GetEntityMatrix(this.handle));
5473
5434
  }
5474
5435
  set Matrix(vectors) {
5475
- if (vectors.length !== 4)
5476
- throw Error(`Expected 4 Vectors, got ${vectors.length}`);
5436
+ if (vectors.length !== 4) throw Error(`Expected 4 Vectors, got ${vectors.length}`);
5477
5437
  const [forward, right, up, pos] = vectors;
5478
5438
  SetEntityMatrix(
5479
5439
  this.handle,
@@ -5551,27 +5511,10 @@ var BaseEntity = class _BaseEntity {
5551
5511
  return Vector3.fromArray(GetEntityCoords(this.handle, false));
5552
5512
  }
5553
5513
  set Position(position) {
5554
- SetEntityCoords(
5555
- this.handle,
5556
- position.x,
5557
- position.y,
5558
- position.z,
5559
- false,
5560
- false,
5561
- false,
5562
- true
5563
- );
5514
+ SetEntityCoords(this.handle, position.x, position.y, position.z, false, false, false, true);
5564
5515
  }
5565
5516
  set PositionNoOffset(position) {
5566
- SetEntityCoordsNoOffset(
5567
- this.handle,
5568
- position.x,
5569
- position.y,
5570
- position.z,
5571
- true,
5572
- true,
5573
- true
5574
- );
5517
+ SetEntityCoordsNoOffset(this.handle, position.x, position.y, position.z, true, true, true);
5575
5518
  }
5576
5519
  get Rotation() {
5577
5520
  return Vector3.fromArray(GetEntityRotation(this.handle, 2));
@@ -5581,21 +5524,10 @@ var BaseEntity = class _BaseEntity {
5581
5524
  }
5582
5525
  get Quaternion() {
5583
5526
  const quaternion = GetEntityQuaternion(this.handle);
5584
- return new Quaternion(
5585
- quaternion[0],
5586
- quaternion[1],
5587
- quaternion[2],
5588
- quaternion[3]
5589
- );
5527
+ return new Quaternion(quaternion[0], quaternion[1], quaternion[2], quaternion[3]);
5590
5528
  }
5591
5529
  set Quaternion(quaternion) {
5592
- SetEntityQuaternion(
5593
- this.handle,
5594
- quaternion.x,
5595
- quaternion.y,
5596
- quaternion.z,
5597
- quaternion.w
5598
- );
5530
+ SetEntityQuaternion(this.handle, quaternion.x, quaternion.y, quaternion.z, quaternion.w);
5599
5531
  }
5600
5532
  get Heading() {
5601
5533
  return GetEntityHeading(this.handle);
@@ -5786,16 +5718,7 @@ var BaseEntity = class _BaseEntity {
5786
5718
  return v.dotProduct(v) < range * range;
5787
5719
  }
5788
5720
  isNearEntity(entity, bounds) {
5789
- return IsEntityAtEntity(
5790
- this.handle,
5791
- entity.Handle,
5792
- bounds.x,
5793
- bounds.y,
5794
- bounds.z,
5795
- false,
5796
- true,
5797
- 0
5798
- );
5721
+ return IsEntityAtEntity(this.handle, entity.Handle, bounds.x, bounds.y, bounds.z, false, true, 0);
5799
5722
  }
5800
5723
  isTouching(entity) {
5801
5724
  return IsEntityTouchingEntity(this.handle, entity.Handle);
@@ -5809,12 +5732,7 @@ var BaseEntity = class _BaseEntity {
5809
5732
  */
5810
5733
  getOffsetInRelativeCoords(worldCoords) {
5811
5734
  return Vector3.fromArray(
5812
- GetOffsetFromEntityGivenWorldCoords(
5813
- this.handle,
5814
- worldCoords.x,
5815
- worldCoords.y,
5816
- worldCoords.z
5817
- )
5735
+ GetOffsetFromEntityGivenWorldCoords(this.handle, worldCoords.x, worldCoords.y, worldCoords.z)
5818
5736
  );
5819
5737
  }
5820
5738
  // TODO: Better example
@@ -5835,14 +5753,7 @@ var BaseEntity = class _BaseEntity {
5835
5753
  * @returns the offset position from the entity in relative coords
5836
5754
  */
5837
5755
  getOffsetInWorldCoords(offset) {
5838
- return Vector3.fromArray(
5839
- GetOffsetFromEntityInWorldCoords(
5840
- this.handle,
5841
- offset.x,
5842
- offset.y,
5843
- offset.z
5844
- )
5845
- );
5756
+ return Vector3.fromArray(GetOffsetFromEntityInWorldCoords(this.handle, offset.x, offset.y, offset.z));
5846
5757
  }
5847
5758
  /**
5848
5759
  * @deprecated use [[getOffsetInRelativeCoords]] instead
@@ -5857,10 +5768,8 @@ var BaseEntity = class _BaseEntity {
5857
5768
  return this.getOffsetInWorldCoords(offset);
5858
5769
  }
5859
5770
  attachTo(entity, position, rotation, collisions = false, unk9 = true, useSoftPinning = true, rotationOrder = 1) {
5860
- if (this.handle == entity.Handle) {
5861
- throw new Error(
5862
- "You cannot attach an entity to the same entity this will result in a crash!"
5863
- );
5771
+ if (this.handle === entity.Handle) {
5772
+ throw new Error("You cannot attach an entity to the same entity this will result in a crash!");
5864
5773
  }
5865
5774
  AttachEntityToEntity(
5866
5775
  this.handle,
@@ -5894,10 +5803,8 @@ var BaseEntity = class _BaseEntity {
5894
5803
  * ```
5895
5804
  */
5896
5805
  attachToBone(entityBone, position, rotation, collisions = false, unk9 = true, useSoftPinning = true, rotationOrder = 1) {
5897
- if (this.handle == entityBone.Owner.Handle) {
5898
- throw new Error(
5899
- "You cannot attach an entity to the same entity this will result in a crash!"
5900
- );
5806
+ if (this.handle === entityBone.Owner.Handle) {
5807
+ throw new Error("You cannot attach an entity to the same entity this will result in a crash!");
5901
5808
  }
5902
5809
  AttachEntityToEntity(
5903
5810
  this.handle,
@@ -6007,14 +5914,10 @@ var EntityBone = class {
6007
5914
  return this.owner;
6008
5915
  }
6009
5916
  get Position() {
6010
- return Vector3.fromArray(
6011
- GetWorldPositionOfEntityBone(this.owner.Handle, this.index)
6012
- );
5917
+ return Vector3.fromArray(GetWorldPositionOfEntityBone(this.owner.Handle, this.index));
6013
5918
  }
6014
5919
  get Rotation() {
6015
- return Vector3.fromArray(
6016
- GetEntityBoneRotation(this.owner.Handle, this.index)
6017
- );
5920
+ return Vector3.fromArray(GetEntityBoneRotation(this.owner.Handle, this.index));
6018
5921
  }
6019
5922
  get IsValid() {
6020
5923
  return this.owner.exists() && this.index !== -1;
@@ -6069,18 +5972,8 @@ var Tasks = class {
6069
5972
  TaskSetBlockingOfNonTemporaryEvents(this.ped.Handle, block);
6070
5973
  }
6071
5974
  aimAt(target, duration) {
6072
- if (target instanceof BaseEntity)
6073
- TaskAimGunAtEntity(this.ped.Handle, target.Handle, duration, false);
6074
- else
6075
- TaskAimGunAtCoord(
6076
- this.ped.Handle,
6077
- target.x,
6078
- target.y,
6079
- target.z,
6080
- duration,
6081
- false,
6082
- false
6083
- );
5975
+ if (target instanceof BaseEntity) TaskAimGunAtEntity(this.ped.Handle, target.Handle, duration, false);
5976
+ else TaskAimGunAtCoord(this.ped.Handle, target.x, target.y, target.z, duration, false, false);
6084
5977
  }
6085
5978
  arrest(ped) {
6086
5979
  TaskArrestPed(this.ped.Handle, ped.Handle);
@@ -6107,21 +6000,10 @@ var Tasks = class {
6107
6000
  TaskHeliChase(this.ped.Handle, target.Handle, offset.x, offset.y, offset.z);
6108
6001
  }
6109
6002
  chaseWithPlane(target, offset) {
6110
- TaskPlaneChase(
6111
- this.ped.Handle,
6112
- target.Handle,
6113
- offset.x,
6114
- offset.y,
6115
- offset.z
6116
- );
6003
+ TaskPlaneChase(this.ped.Handle, target.Handle, offset.x, offset.y, offset.z);
6117
6004
  }
6118
6005
  cruiseWithVehicle(vehicle, speed, drivingstyle = 0 /* None */) {
6119
- TaskVehicleDriveWander(
6120
- this.ped.Handle,
6121
- vehicle.Handle,
6122
- speed,
6123
- drivingstyle
6124
- );
6006
+ TaskVehicleDriveWander(this.ped.Handle, vehicle.Handle, speed, drivingstyle);
6125
6007
  }
6126
6008
  driveTo(vehicle, target, radius, speed, drivingstyle = 0 /* None */) {
6127
6009
  TaskVehicleDriveToCoordLongrange(
@@ -6150,26 +6032,14 @@ var Tasks = class {
6150
6032
  }
6151
6033
  fightAgainstHatedTargets(radius, duration) {
6152
6034
  if (duration) {
6153
- TaskCombatHatedTargetsAroundPedTimed(
6154
- this.ped.Handle,
6155
- radius,
6156
- duration,
6157
- 0
6158
- );
6035
+ TaskCombatHatedTargetsAroundPedTimed(this.ped.Handle, radius, duration, 0);
6159
6036
  } else {
6160
6037
  TaskCombatHatedTargetsAroundPed(this.ped.Handle, radius, 0);
6161
6038
  }
6162
6039
  }
6163
6040
  fleeFrom(pedOrPosition, duration = -1) {
6164
6041
  if (pedOrPosition instanceof Ped) {
6165
- TaskSmartFleePed(
6166
- this.ped.Handle,
6167
- pedOrPosition.Handle,
6168
- 100,
6169
- duration,
6170
- false,
6171
- false
6172
- );
6042
+ TaskSmartFleePed(this.ped.Handle, pedOrPosition.Handle, 100, duration, false, false);
6173
6043
  } else {
6174
6044
  TaskSmartFleeCoord(
6175
6045
  this.ped.Handle,
@@ -6231,16 +6101,7 @@ var Tasks = class {
6231
6101
  if (offset === null) {
6232
6102
  offset = new Vector3(0, 0, 0);
6233
6103
  }
6234
- TaskGotoEntityOffsetXy(
6235
- this.ped.Handle,
6236
- target.Handle,
6237
- timeout,
6238
- offset.x,
6239
- offset.y,
6240
- offset.z,
6241
- 1,
6242
- true
6243
- );
6104
+ TaskGotoEntityOffsetXy(this.ped.Handle, target.Handle, timeout, offset.x, offset.y, offset.z, 1, true);
6244
6105
  }
6245
6106
  guardCurrentPosition() {
6246
6107
  TaskGuardCurrentPosition(this.ped.Handle, 15, 10, true);
@@ -6278,23 +6139,8 @@ var Tasks = class {
6278
6139
  }
6279
6140
  lookAt(targetOrPosition, duration = -1) {
6280
6141
  if (targetOrPosition instanceof BaseEntity)
6281
- TaskLookAtEntity(
6282
- this.ped.Handle,
6283
- targetOrPosition.Handle,
6284
- duration,
6285
- 0,
6286
- 2
6287
- );
6288
- else
6289
- TaskLookAtCoord(
6290
- this.ped.Handle,
6291
- targetOrPosition.x,
6292
- targetOrPosition.y,
6293
- targetOrPosition.z,
6294
- duration,
6295
- 0,
6296
- 2
6297
- );
6142
+ TaskLookAtEntity(this.ped.Handle, targetOrPosition.Handle, duration, 0, 2);
6143
+ else TaskLookAtCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration, 0, 2);
6298
6144
  }
6299
6145
  parachuteTo(position) {
6300
6146
  TaskParachuteToTarget(this.ped.Handle, position.x, position.y, position.z);
@@ -6343,22 +6189,9 @@ var Tasks = class {
6343
6189
  TaskReloadWeapon(this.ped.Handle, true);
6344
6190
  }
6345
6191
  shootAt(targetOrPosition, duration = -1, pattern = 0 /* Default */) {
6346
- if (targetOrPosition instanceof Ped)
6347
- TaskShootAtEntity(
6348
- this.ped.Handle,
6349
- targetOrPosition.Handle,
6350
- duration,
6351
- pattern
6352
- );
6192
+ if (targetOrPosition instanceof Ped) TaskShootAtEntity(this.ped.Handle, targetOrPosition.Handle, duration, pattern);
6353
6193
  else
6354
- TaskShootAtCoord(
6355
- this.ped.Handle,
6356
- targetOrPosition.x,
6357
- targetOrPosition.y,
6358
- targetOrPosition.z,
6359
- duration,
6360
- pattern
6361
- );
6194
+ TaskShootAtCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration, pattern);
6362
6195
  }
6363
6196
  shuffleToNextVehicleSeat(vehicle) {
6364
6197
  TaskShuffleToNextVehicleSeat(this.ped.Handle, vehicle.Handle);
@@ -6367,14 +6200,7 @@ var Tasks = class {
6367
6200
  TaskSkyDive(this.ped.Handle);
6368
6201
  }
6369
6202
  slideTo(position, heading, duration = 0.7) {
6370
- TaskPedSlideToCoord(
6371
- this.ped.Handle,
6372
- position.x,
6373
- position.y,
6374
- position.z,
6375
- heading,
6376
- duration
6377
- );
6203
+ TaskPedSlideToCoord(this.ped.Handle, position.x, position.y, position.z, heading, duration);
6378
6204
  }
6379
6205
  standStill(duration) {
6380
6206
  TaskStandStill(this.ped.Handle, duration);
@@ -6397,19 +6223,8 @@ var Tasks = class {
6397
6223
  }
6398
6224
  turnTo(targetOrPosition, duration = -1) {
6399
6225
  if (targetOrPosition instanceof BaseEntity)
6400
- TaskTurnPedToFaceEntity(
6401
- this.ped.Handle,
6402
- targetOrPosition.Handle,
6403
- duration
6404
- );
6405
- else
6406
- TaskTurnPedToFaceCoord(
6407
- this.ped.Handle,
6408
- targetOrPosition.x,
6409
- targetOrPosition.y,
6410
- targetOrPosition.z,
6411
- duration
6412
- );
6226
+ TaskTurnPedToFaceEntity(this.ped.Handle, targetOrPosition.Handle, duration);
6227
+ else TaskTurnPedToFaceCoord(this.ped.Handle, targetOrPosition.x, targetOrPosition.y, targetOrPosition.z, duration);
6413
6228
  }
6414
6229
  useParachute() {
6415
6230
  TaskParachute(this.ped.Handle, true);
@@ -6433,16 +6248,7 @@ var Tasks = class {
6433
6248
  TaskPause(this.ped.Handle, duration);
6434
6249
  }
6435
6250
  wanderAround(position, radius) {
6436
- if (position && radius)
6437
- TaskWanderInArea(
6438
- this.ped.Handle,
6439
- position.x,
6440
- position.y,
6441
- position.z,
6442
- radius,
6443
- 0,
6444
- 0
6445
- );
6251
+ if (position && radius) TaskWanderInArea(this.ped.Handle, position.x, position.y, position.z, radius, 0, 0);
6446
6252
  else TaskWanderStandard(this.ped.Handle, 0, 0);
6447
6253
  }
6448
6254
  warpIntoVehicle(vehicle, seat) {
@@ -7176,51 +6982,18 @@ function initializeOnce() {
7176
6982
  const componentCount = GetNumDlcWeaponComponents(i);
7177
6983
  for (let j = 0; j < componentCount; j++) {
7178
6984
  const buffer = new Uint8Array(14 * intLength + 4 * strLength);
7179
- Citizen.invokeNative(
7180
- "0x6CF598A2957C2BF8",
7181
- i,
7182
- j,
7183
- buffer,
7184
- Citizen.returnResultAnyway()
7185
- );
6985
+ Citizen.invokeNative("0x6CF598A2957C2BF8", i, j, buffer, Citizen.returnResultAnyway());
7186
6986
  const dlcWeaponComponentData = {
7187
- attachBone: getUInt32FromUint8Array(
7188
- buffer,
7189
- 0 * intLength,
7190
- 1 * intLength
7191
- ),
7192
- bActiveByDefault: getUInt32FromUint8Array(
7193
- buffer,
7194
- 2 * intLength,
7195
- 3 * intLength
7196
- ),
6987
+ attachBone: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
6988
+ bActiveByDefault: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
7197
6989
  unk: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
7198
- componentHash: getUInt32FromUint8Array(
7199
- buffer,
7200
- 6 * intLength,
7201
- 7 * intLength
7202
- ),
6990
+ componentHash: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
7203
6991
  unk2: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength),
7204
- componentCost: getUInt32FromUint8Array(
7205
- buffer,
7206
- 10 * intLength,
7207
- 11 * intLength
7208
- ),
7209
- name: getStringFromUInt8Array(
7210
- buffer,
7211
- 12 * intLength,
7212
- 12 * intLength + strLength
7213
- ),
7214
- desc: getStringFromUInt8Array(
7215
- buffer,
7216
- 12 * intLength + strLength,
7217
- 12 * intLength + 2 * strLength
7218
- )
6992
+ componentCost: getUInt32FromUint8Array(buffer, 10 * intLength, 11 * intLength),
6993
+ name: getStringFromUInt8Array(buffer, 12 * intLength, 12 * intLength + strLength),
6994
+ desc: getStringFromUInt8Array(buffer, 12 * intLength + strLength, 12 * intLength + 2 * strLength)
7219
6995
  };
7220
- DlcWeaponComponentData.set(
7221
- dlcWeaponComponentData.componentHash,
7222
- dlcWeaponComponentData
7223
- );
6996
+ DlcWeaponComponentData.set(dlcWeaponComponentData.componentHash, dlcWeaponComponentData);
7224
6997
  }
7225
6998
  }
7226
6999
  isInitialized = true;
@@ -7770,10 +7543,7 @@ var WeaponComponentHashesByWeaponHash = /* @__PURE__ */ new Map([
7770
7543
  [
7771
7544
  -1121678507 /* MiniSMG */,
7772
7545
  // Mini SMG
7773
- [
7774
- 2227745491 /* COMPONENT_MINISMG_CLIP_01 */,
7775
- 2474561719 /* COMPONENT_MINISMG_CLIP_02 */
7776
- ]
7546
+ [2227745491 /* COMPONENT_MINISMG_CLIP_01 */, 2474561719 /* COMPONENT_MINISMG_CLIP_02 */]
7777
7547
  ],
7778
7548
  [
7779
7549
  2024373456 /* SMGMk2 */,
@@ -7912,10 +7682,7 @@ var WeaponComponentHashesByWeaponHash = /* @__PURE__ */ new Map([
7912
7682
  [
7913
7683
  94989220 /* CombatShotgun */,
7914
7684
  // Combat Shotgun
7915
- [
7916
- 2076495324 /* COMPONENT_AT_AR_FLSH */,
7917
- 2205435306 /* COMPONENT_AT_AR_SUPP */
7918
- ]
7685
+ [2076495324 /* COMPONENT_AT_AR_FLSH */, 2205435306 /* COMPONENT_AT_AR_SUPP */]
7919
7686
  ],
7920
7687
  // Rifles
7921
7688
  [
@@ -8219,10 +7986,7 @@ var WeaponComponentHashesByWeaponHash = /* @__PURE__ */ new Map([
8219
7986
  [
8220
7987
  1627465347 /* Gusenberg */,
8221
7988
  // Gusenberg Sweeper
8222
- [
8223
- 484812453 /* COMPONENT_GUSENBERG_CLIP_01 */,
8224
- 3939025520 /* COMPONENT_GUSENBERG_CLIP_02 */
8225
- ]
7989
+ [484812453 /* COMPONENT_GUSENBERG_CLIP_01 */, 3939025520 /* COMPONENT_GUSENBERG_CLIP_02 */]
8226
7990
  ],
8227
7991
  // Sniper Rifles
8228
7992
  [
@@ -8351,33 +8115,14 @@ function initializeOnce3() {
8351
8115
  const weaponCount = GetNumDlcWeapons();
8352
8116
  for (let i = 0; i < weaponCount; i++) {
8353
8117
  const weaponBuffer = new Uint8Array(14 * intLength + 4 * strLength);
8354
- Citizen.invokeNative(
8355
- "0x79923CD21BECE14E",
8356
- i,
8357
- weaponBuffer,
8358
- Citizen.returnResultAnyway()
8359
- );
8360
- const weaponHash = getUInt32FromUint8Array(
8361
- weaponBuffer,
8362
- 2 * intLength,
8363
- 3 * intLength
8364
- );
8118
+ Citizen.invokeNative("0x79923CD21BECE14E", i, weaponBuffer, Citizen.returnResultAnyway());
8119
+ const weaponHash = getUInt32FromUint8Array(weaponBuffer, 2 * intLength, 3 * intLength);
8365
8120
  const componentCount = GetNumDlcWeaponComponents(i);
8366
8121
  const componentHashes = [];
8367
8122
  for (let j = 0; j < componentCount; j++) {
8368
8123
  const componentBuffer = new Uint8Array(14 * intLength + 4 * strLength);
8369
- Citizen.invokeNative(
8370
- "0x6CF598A2957C2BF8",
8371
- i,
8372
- j,
8373
- componentBuffer,
8374
- Citizen.returnResultAnyway()
8375
- );
8376
- const componentHash = getUInt32FromUint8Array(
8377
- componentBuffer,
8378
- 6 * intLength,
8379
- 7 * intLength
8380
- );
8124
+ Citizen.invokeNative("0x6CF598A2957C2BF8", i, j, componentBuffer, Citizen.returnResultAnyway());
8125
+ const componentHash = getUInt32FromUint8Array(componentBuffer, 6 * intLength, 7 * intLength);
8381
8126
  componentHashes.push(componentHash);
8382
8127
  }
8383
8128
  WeaponComponentHashesByWeaponHash.set(weaponHash, componentHashes);
@@ -8431,78 +8176,30 @@ var ComponentAttachmentPointByHash = /* @__PURE__ */ new Map([
8431
8176
  [2248057097 /* PistolMk2ClipHollowpoint */, 3723347892 /* Clip */],
8432
8177
  [733837882 /* PistolMk2ClipIncendiary */, 3723347892 /* Clip */],
8433
8178
  [634039983 /* PistolMk2ClipTracer */, 3723347892 /* Clip */],
8434
- [
8435
- 2249208895 /* AssaultRifleMk2ClipNormal */,
8436
- 3723347892 /* Clip */
8437
- ],
8438
- [
8439
- 3509242479 /* AssaultRifleMk2ClipExtended */,
8440
- 3723347892 /* Clip */
8441
- ],
8179
+ [2249208895 /* AssaultRifleMk2ClipNormal */, 3723347892 /* Clip */],
8180
+ [3509242479 /* AssaultRifleMk2ClipExtended */, 3723347892 /* Clip */],
8442
8181
  [1675665560 /* AssaultRifleMk2ClipFMJ */, 3723347892 /* Clip */],
8443
- [
8444
- 2816286296 /* AssaultRifleMk2ClipArmorPiercing */,
8445
- 3723347892 /* Clip */
8446
- ],
8447
- [
8448
- 4218476627 /* AssaultRifleMk2ClipIncendiary */,
8449
- 3723347892 /* Clip */
8450
- ],
8451
- [
8452
- 4012669121 /* AssaultRifleMk2ClipTracer */,
8453
- 3723347892 /* Clip */
8454
- ],
8455
- [
8456
- 1283078430 /* CarbineRifleMk2ClipNormal */,
8457
- 3723347892 /* Clip */
8458
- ],
8459
- [
8460
- 1574296533 /* CarbineRifleMk2ClipExtended */,
8461
- 3723347892 /* Clip */
8462
- ],
8182
+ [2816286296 /* AssaultRifleMk2ClipArmorPiercing */, 3723347892 /* Clip */],
8183
+ [4218476627 /* AssaultRifleMk2ClipIncendiary */, 3723347892 /* Clip */],
8184
+ [4012669121 /* AssaultRifleMk2ClipTracer */, 3723347892 /* Clip */],
8185
+ [1283078430 /* CarbineRifleMk2ClipNormal */, 3723347892 /* Clip */],
8186
+ [1574296533 /* CarbineRifleMk2ClipExtended */, 3723347892 /* Clip */],
8463
8187
  [1141059345 /* CarbineRifleMk2ClipFMJ */, 3723347892 /* Clip */],
8464
- [
8465
- 626875735 /* CarbineRifleMk2ClipArmorPiercing */,
8466
- 3723347892 /* Clip */
8467
- ],
8468
- [
8469
- 1025884839 /* CarbineRifleMk2ClipIncendiary */,
8470
- 3723347892 /* Clip */
8471
- ],
8472
- [
8473
- 391640422 /* CarbineRifleMk2ClipTracer */,
8474
- 3723347892 /* Clip */
8475
- ],
8188
+ [626875735 /* CarbineRifleMk2ClipArmorPiercing */, 3723347892 /* Clip */],
8189
+ [1025884839 /* CarbineRifleMk2ClipIncendiary */, 3723347892 /* Clip */],
8190
+ [391640422 /* CarbineRifleMk2ClipTracer */, 3723347892 /* Clip */],
8476
8191
  [1227564412 /* CombatMGMk2ClipNormal */, 3723347892 /* Clip */],
8477
8192
  [400507625 /* CombatMGMk2ClipExtended */, 3723347892 /* Clip */],
8478
8193
  [1475288264 /* CombatMGMk2ClipFMJ */, 3723347892 /* Clip */],
8479
- [
8480
- 696788003 /* CombatMGMk2ClipArmorPiercing */,
8481
- 3723347892 /* Clip */
8482
- ],
8483
- [
8484
- 3274096058 /* CombatMGMk2ClipIncendiary */,
8485
- 3723347892 /* Clip */
8486
- ],
8194
+ [696788003 /* CombatMGMk2ClipArmorPiercing */, 3723347892 /* Clip */],
8195
+ [3274096058 /* CombatMGMk2ClipIncendiary */, 3723347892 /* Clip */],
8487
8196
  [4133787461 /* CombatMGMk2ClipTracer */, 3723347892 /* Clip */],
8488
8197
  [4196276776 /* HeavySniperMk2ClipNormal */, 3723347892 /* Clip */],
8489
- [
8490
- 752418717 /* HeavySniperMk2ClipExtended */,
8491
- 3723347892 /* Clip */
8492
- ],
8198
+ [752418717 /* HeavySniperMk2ClipExtended */, 3723347892 /* Clip */],
8493
8199
  [1005144310 /* HeavySniperMk2ClipFMJ */, 3723347892 /* Clip */],
8494
- [
8495
- 4164277972 /* HeavySniperMk2ClipArmorPiercing */,
8496
- 3723347892 /* Clip */
8497
- ],
8498
- [
8499
- 247526935 /* HeavySniperMk2ClipIncendiary */,
8500
- 3723347892 /* Clip */
8501
- ],
8502
- [
8503
- 2313935527 /* HeavySniperMk2ClipExplosive */,
8504
- 3723347892 /* Clip */
8505
- ],
8200
+ [4164277972 /* HeavySniperMk2ClipArmorPiercing */, 3723347892 /* Clip */],
8201
+ [247526935 /* HeavySniperMk2ClipIncendiary */, 3723347892 /* Clip */],
8202
+ [2313935527 /* HeavySniperMk2ClipExplosive */, 3723347892 /* Clip */],
8506
8203
  [1277460590 /* SMGMk2ClipNormal */, 3723347892 /* Clip */],
8507
8204
  [3112393518 /* SMGMk2ClipExtended */, 3723347892 /* Clip */],
8508
8205
  [190476639 /* SMGMk2ClipFMJ */, 3723347892 /* Clip */],
@@ -8577,231 +8274,75 @@ var ComponentAttachmentPointByHash = /* @__PURE__ */ new Map([
8577
8274
  [880736428 /* AtMuzzle6 */, 945598191 /* Supp2 */],
8578
8275
  [1303784126 /* AtMuzzle7 */, 945598191 /* Supp2 */],
8579
8276
  [3610841222 /* PistolVarmodLuxe */, 962500902 /* GunRoot */],
8580
- [
8581
- 3328527730 /* CombatPistolVarmodLowrider */,
8582
- 962500902 /* GunRoot */
8583
- ],
8277
+ [3328527730 /* CombatPistolVarmodLowrider */, 962500902 /* GunRoot */],
8584
8278
  [2608252716 /* APPistolVarmodLuxe */, 962500902 /* GunRoot */],
8585
8279
  [1215999497 /* MicroSMGVarmodLuxe */, 962500902 /* GunRoot */],
8586
8280
  [663170192 /* SMGVarmodLuxe */, 962500902 /* GunRoot */],
8587
- [
8588
- 1319990579 /* AssaultRifleVarmodLuxe */,
8589
- 962500902 /* GunRoot */
8590
- ],
8591
- [
8592
- 3634075224 /* CarbineRifleVarmodLuxe */,
8593
- 962500902 /* GunRoot */
8594
- ],
8595
- [
8596
- 930927479 /* AdvancedRifleVarmodLuxe */,
8597
- 962500902 /* GunRoot */
8598
- ],
8281
+ [1319990579 /* AssaultRifleVarmodLuxe */, 962500902 /* GunRoot */],
8282
+ [3634075224 /* CarbineRifleVarmodLuxe */, 962500902 /* GunRoot */],
8283
+ [930927479 /* AdvancedRifleVarmodLuxe */, 962500902 /* GunRoot */],
8599
8284
  [3604658878 /* MGVarmodLowrider */, 962500902 /* GunRoot */],
8600
- [
8601
- 2466172125 /* CombatMGVarmodLowrider */,
8602
- 962500902 /* GunRoot */
8603
- ],
8604
- [
8605
- 2732039643 /* PumpShotgunVarmodLowrider */,
8606
- 962500902 /* GunRoot */
8607
- ],
8285
+ [2466172125 /* CombatMGVarmodLowrider */, 962500902 /* GunRoot */],
8286
+ [2732039643 /* PumpShotgunVarmodLowrider */, 962500902 /* GunRoot */],
8608
8287
  [1077065191 /* SniperRifleVarmodLuxe */, 962500902 /* GunRoot */],
8609
- [
8610
- 663517359 /* AssaultSMGVarmodLowrider */,
8611
- 962500902 /* GunRoot */
8612
- ],
8288
+ [663517359 /* AssaultSMGVarmodLowrider */, 962500902 /* GunRoot */],
8613
8289
  [2008591151 /* Pistol50VarmodLuxe */, 962500902 /* GunRoot */],
8614
- [
8615
- 2242268665 /* SawnoffShotgunVarmodLuxe */,
8616
- 962500902 /* GunRoot */
8617
- ],
8290
+ [2242268665 /* SawnoffShotgunVarmodLuxe */, 962500902 /* GunRoot */],
8618
8291
  [1550611612 /* PistolMk2CamoDigital */, 962500902 /* GunRoot */],
8619
- [
8620
- 368550800 /* PistolMk2CamoBrushstroke */,
8621
- 962500902 /* GunRoot */
8622
- ],
8292
+ [368550800 /* PistolMk2CamoBrushstroke */, 962500902 /* GunRoot */],
8623
8293
  [2525897947 /* PistolMk2CamoWoodland */, 962500902 /* GunRoot */],
8624
8294
  [24902297 /* PistolMk2CamoSkull */, 962500902 /* GunRoot */],
8625
8295
  [4066925682 /* PistolMk2CamoSessanta */, 962500902 /* GunRoot */],
8626
8296
  [3710005734 /* PistolMk2CamoPerseus */, 962500902 /* GunRoot */],
8627
8297
  [3141791350 /* PistolMk2CamoLeopard */, 962500902 /* GunRoot */],
8628
8298
  [1301287696 /* PistolMk2CamoZebra */, 962500902 /* GunRoot */],
8629
- [
8630
- 1597093459 /* PistolMk2CamoGeometric */,
8631
- 962500902 /* GunRoot */
8632
- ],
8299
+ [1597093459 /* PistolMk2CamoGeometric */, 962500902 /* GunRoot */],
8633
8300
  [1769871776 /* PistolMk2CamoBoom */, 962500902 /* GunRoot */],
8634
- [
8635
- 2467084625 /* PistolMk2CamoPatriotic */,
8636
- 962500902 /* GunRoot */
8637
- ],
8638
- [
8639
- 2434475183 /* AssaultRifleMk2CamoDigital */,
8640
- 962500902 /* GunRoot */
8641
- ],
8642
- [
8643
- 937772107 /* AssaultRifleMk2CamoBrushstroke */,
8644
- 962500902 /* GunRoot */
8645
- ],
8646
- [
8647
- 1401650071 /* AssaultRifleMk2CamoWoodland */,
8648
- 962500902 /* GunRoot */
8649
- ],
8650
- [
8651
- 628662130 /* AssaultRifleMk2CamoSkull */,
8652
- 962500902 /* GunRoot */
8653
- ],
8654
- [
8655
- 3309920045 /* AssaultRifleMk2CamoSessanta */,
8656
- 962500902 /* GunRoot */
8657
- ],
8658
- [
8659
- 3482022833 /* AssaultRifleMk2CamoPerseus */,
8660
- 962500902 /* GunRoot */
8661
- ],
8662
- [
8663
- 2847614993 /* AssaultRifleMk2CamoLeopard */,
8664
- 962500902 /* GunRoot */
8665
- ],
8666
- [
8667
- 4234628436 /* AssaultRifleMk2CamoZebra */,
8668
- 962500902 /* GunRoot */
8669
- ],
8670
- [
8671
- 2088750491 /* AssaultRifleMk2CamoGeometric */,
8672
- 962500902 /* GunRoot */
8673
- ],
8674
- [
8675
- 2781053842 /* AssaultRifleMk2CamoBoom */,
8676
- 962500902 /* GunRoot */
8677
- ],
8678
- [
8679
- 3115408816 /* AssaultRifleMk2CamoPatriotic */,
8680
- 962500902 /* GunRoot */
8681
- ],
8682
- [
8683
- 1272803094 /* CarbineRifleMk2CamoDigital */,
8684
- 962500902 /* GunRoot */
8685
- ],
8686
- [
8687
- 1080719624 /* CarbineRifleMk2CamoBrushstroke */,
8688
- 962500902 /* GunRoot */
8689
- ],
8690
- [
8691
- 792221348 /* CarbineRifleMk2CamoWoodland */,
8692
- 962500902 /* GunRoot */
8693
- ],
8694
- [
8695
- 3842785869 /* CarbineRifleMk2CamoSkull */,
8696
- 962500902 /* GunRoot */
8697
- ],
8698
- [
8699
- 3548192559 /* CarbineRifleMk2CamoSessanta */,
8700
- 962500902 /* GunRoot */
8701
- ],
8702
- [
8703
- 2250671235 /* CarbineRifleMk2CamoPerseus */,
8704
- 962500902 /* GunRoot */
8705
- ],
8706
- [
8707
- 4095795318 /* CarbineRifleMk2CamoLeopard */,
8708
- 962500902 /* GunRoot */
8709
- ],
8710
- [
8711
- 2866892280 /* CarbineRifleMk2CamoZebra */,
8712
- 962500902 /* GunRoot */
8713
- ],
8714
- [
8715
- 2559813981 /* CarbineRifleMk2CamoGeometric */,
8716
- 962500902 /* GunRoot */
8717
- ],
8718
- [
8719
- 1796459838 /* CarbineRifleMk2CamoBoom */,
8720
- 962500902 /* GunRoot */
8721
- ],
8722
- [
8723
- 3663056191 /* CarbineRifleMk2CamoPatriotic */,
8724
- 962500902 /* GunRoot */
8725
- ],
8726
- [
8727
- 1249283253 /* CombatMGMk2CamoDigital */,
8728
- 962500902 /* GunRoot */
8729
- ],
8730
- [
8731
- 3437259709 /* CombatMGMk2CamoBrushstroke */,
8732
- 962500902 /* GunRoot */
8733
- ],
8734
- [
8735
- 3197423398 /* CombatMGMk2CamoWoodland */,
8736
- 962500902 /* GunRoot */
8737
- ],
8301
+ [2467084625 /* PistolMk2CamoPatriotic */, 962500902 /* GunRoot */],
8302
+ [2434475183 /* AssaultRifleMk2CamoDigital */, 962500902 /* GunRoot */],
8303
+ [937772107 /* AssaultRifleMk2CamoBrushstroke */, 962500902 /* GunRoot */],
8304
+ [1401650071 /* AssaultRifleMk2CamoWoodland */, 962500902 /* GunRoot */],
8305
+ [628662130 /* AssaultRifleMk2CamoSkull */, 962500902 /* GunRoot */],
8306
+ [3309920045 /* AssaultRifleMk2CamoSessanta */, 962500902 /* GunRoot */],
8307
+ [3482022833 /* AssaultRifleMk2CamoPerseus */, 962500902 /* GunRoot */],
8308
+ [2847614993 /* AssaultRifleMk2CamoLeopard */, 962500902 /* GunRoot */],
8309
+ [4234628436 /* AssaultRifleMk2CamoZebra */, 962500902 /* GunRoot */],
8310
+ [2088750491 /* AssaultRifleMk2CamoGeometric */, 962500902 /* GunRoot */],
8311
+ [2781053842 /* AssaultRifleMk2CamoBoom */, 962500902 /* GunRoot */],
8312
+ [3115408816 /* AssaultRifleMk2CamoPatriotic */, 962500902 /* GunRoot */],
8313
+ [1272803094 /* CarbineRifleMk2CamoDigital */, 962500902 /* GunRoot */],
8314
+ [1080719624 /* CarbineRifleMk2CamoBrushstroke */, 962500902 /* GunRoot */],
8315
+ [792221348 /* CarbineRifleMk2CamoWoodland */, 962500902 /* GunRoot */],
8316
+ [3842785869 /* CarbineRifleMk2CamoSkull */, 962500902 /* GunRoot */],
8317
+ [3548192559 /* CarbineRifleMk2CamoSessanta */, 962500902 /* GunRoot */],
8318
+ [2250671235 /* CarbineRifleMk2CamoPerseus */, 962500902 /* GunRoot */],
8319
+ [4095795318 /* CarbineRifleMk2CamoLeopard */, 962500902 /* GunRoot */],
8320
+ [2866892280 /* CarbineRifleMk2CamoZebra */, 962500902 /* GunRoot */],
8321
+ [2559813981 /* CarbineRifleMk2CamoGeometric */, 962500902 /* GunRoot */],
8322
+ [1796459838 /* CarbineRifleMk2CamoBoom */, 962500902 /* GunRoot */],
8323
+ [3663056191 /* CarbineRifleMk2CamoPatriotic */, 962500902 /* GunRoot */],
8324
+ [1249283253 /* CombatMGMk2CamoDigital */, 962500902 /* GunRoot */],
8325
+ [3437259709 /* CombatMGMk2CamoBrushstroke */, 962500902 /* GunRoot */],
8326
+ [3197423398 /* CombatMGMk2CamoWoodland */, 962500902 /* GunRoot */],
8738
8327
  [1980349969 /* CombatMGMk2CamoSkull */, 962500902 /* GunRoot */],
8739
- [
8740
- 1219453777 /* CombatMGMk2CamoSessanta */,
8741
- 962500902 /* GunRoot */
8742
- ],
8743
- [
8744
- 2441508106 /* CombatMGMk2CamoPerseus */,
8745
- 962500902 /* GunRoot */
8746
- ],
8747
- [
8748
- 2220186280 /* CombatMGMk2CamoLeopard */,
8749
- 962500902 /* GunRoot */
8750
- ],
8328
+ [1219453777 /* CombatMGMk2CamoSessanta */, 962500902 /* GunRoot */],
8329
+ [2441508106 /* CombatMGMk2CamoPerseus */, 962500902 /* GunRoot */],
8330
+ [2220186280 /* CombatMGMk2CamoLeopard */, 962500902 /* GunRoot */],
8751
8331
  [457967755 /* CombatMGMk2CamoZebra */, 962500902 /* GunRoot */],
8752
- [
8753
- 235171324 /* CombatMGMk2CamoGeometric */,
8754
- 962500902 /* GunRoot */
8755
- ],
8332
+ [235171324 /* CombatMGMk2CamoGeometric */, 962500902 /* GunRoot */],
8756
8333
  [42685294 /* CombatMGMk2CamoBoom */, 962500902 /* GunRoot */],
8757
- [
8758
- 3607349581 /* CombatMGMk2CamoPatriotic */,
8759
- 962500902 /* GunRoot */
8760
- ],
8761
- [
8762
- 4164123906 /* HeavySniperMk2CamoDigital */,
8763
- 962500902 /* GunRoot */
8764
- ],
8765
- [
8766
- 3317620069 /* HeavySniperMk2CamoBrushstroke */,
8767
- 962500902 /* GunRoot */
8768
- ],
8769
- [
8770
- 3916506229 /* HeavySniperMk2CamoWoodland */,
8771
- 962500902 /* GunRoot */
8772
- ],
8773
- [
8774
- 329939175 /* HeavySniperMk2CamoSkull */,
8775
- 962500902 /* GunRoot */
8776
- ],
8777
- [
8778
- 643374672 /* HeavySniperMk2CamoSessanta */,
8779
- 962500902 /* GunRoot */
8780
- ],
8781
- [
8782
- 807875052 /* HeavySniperMk2CamoPerseus */,
8783
- 962500902 /* GunRoot */
8784
- ],
8785
- [
8786
- 2893163128 /* HeavySniperMk2CamoLeopard */,
8787
- 962500902 /* GunRoot */
8788
- ],
8789
- [
8790
- 3198471901 /* HeavySniperMk2CamoZebra */,
8791
- 962500902 /* GunRoot */
8792
- ],
8793
- [
8794
- 3447155842 /* HeavySniperMk2CamoGeometric */,
8795
- 962500902 /* GunRoot */
8796
- ],
8797
- [
8798
- 2881858759 /* HeavySniperMk2CamoBoom */,
8799
- 962500902 /* GunRoot */
8800
- ],
8801
- [
8802
- 1815270123 /* HeavySniperMk2CamoPatriotic */,
8803
- 962500902 /* GunRoot */
8804
- ],
8334
+ [3607349581 /* CombatMGMk2CamoPatriotic */, 962500902 /* GunRoot */],
8335
+ [4164123906 /* HeavySniperMk2CamoDigital */, 962500902 /* GunRoot */],
8336
+ [3317620069 /* HeavySniperMk2CamoBrushstroke */, 962500902 /* GunRoot */],
8337
+ [3916506229 /* HeavySniperMk2CamoWoodland */, 962500902 /* GunRoot */],
8338
+ [329939175 /* HeavySniperMk2CamoSkull */, 962500902 /* GunRoot */],
8339
+ [643374672 /* HeavySniperMk2CamoSessanta */, 962500902 /* GunRoot */],
8340
+ [807875052 /* HeavySniperMk2CamoPerseus */, 962500902 /* GunRoot */],
8341
+ [2893163128 /* HeavySniperMk2CamoLeopard */, 962500902 /* GunRoot */],
8342
+ [3198471901 /* HeavySniperMk2CamoZebra */, 962500902 /* GunRoot */],
8343
+ [3447155842 /* HeavySniperMk2CamoGeometric */, 962500902 /* GunRoot */],
8344
+ [2881858759 /* HeavySniperMk2CamoBoom */, 962500902 /* GunRoot */],
8345
+ [1815270123 /* HeavySniperMk2CamoPatriotic */, 962500902 /* GunRoot */],
8805
8346
  [3298267239 /* SMGMk2CamoDigital */, 962500902 /* GunRoot */],
8806
8347
  [940943685 /* SMGMk2CamoBrushstroke */, 962500902 /* GunRoot */],
8807
8348
  [1263226800 /* SMGMk2CamoWoodland */, 962500902 /* GunRoot */],
@@ -8828,63 +8369,24 @@ var ComponentAttachmentPointByHash = /* @__PURE__ */ new Map([
8828
8369
  [2637152041 /* AtScopeMacro */, 196630833 /* Scope */],
8829
8370
  [2396306288 /* PistolMk2Scope */, 196630833 /* Scope */],
8830
8371
  [1140676955 /* PistolMk2Flash */, 196630833 /* Scope */],
8831
- [
8832
- 2193687427 /* HeavySniperMk2ScopeLarge */,
8833
- 196630833 /* Scope */
8834
- ],
8372
+ [2193687427 /* HeavySniperMk2ScopeLarge */, 196630833 /* Scope */],
8835
8373
  [3159677559 /* AtScopeMax */, 196630833 /* Scope */],
8836
- [
8837
- 3061846192 /* HeavySniperMk2ScopeNightvision */,
8838
- 196630833 /* Scope */
8839
- ],
8840
- [
8841
- 776198721 /* HeavySniperMk2ScopeThermal */,
8842
- 196630833 /* Scope */
8843
- ],
8374
+ [3061846192 /* HeavySniperMk2ScopeNightvision */, 196630833 /* Scope */],
8375
+ [776198721 /* HeavySniperMk2ScopeThermal */, 196630833 /* Scope */],
8844
8376
  [2681951826 /* SMGMk2Sights */, 196630833 /* Scope */],
8845
8377
  [3842157419 /* SMGMk2ScopeMacro */, 196630833 /* Scope */],
8846
8378
  [1038927834 /* SMGMk2ScopeSmall */, 196630833 /* Scope */],
8847
- [
8848
- 3036451504 /* PistolMk2CamoSlideDigital */,
8849
- 1684637069 /* Scope2 */
8850
- ],
8851
- [
8852
- 438243936 /* PistolMk2CamoSlideBrushstroke */,
8853
- 1684637069 /* Scope2 */
8854
- ],
8855
- [
8856
- 3839888240 /* PistolMk2CamoSlideWoodland */,
8857
- 1684637069 /* Scope2 */
8858
- ],
8859
- [
8860
- 740920107 /* PistolMk2CamoSlideSkull */,
8861
- 1684637069 /* Scope2 */
8862
- ],
8863
- [
8864
- 3753350949 /* PistolMk2CamoSlideSessanta */,
8865
- 1684637069 /* Scope2 */
8866
- ],
8867
- [
8868
- 1809261196 /* PistolMk2CamoSlidePerseus */,
8869
- 1684637069 /* Scope2 */
8870
- ],
8871
- [
8872
- 2648428428 /* PistolMk2CamoSlideLeopard */,
8873
- 1684637069 /* Scope2 */
8874
- ],
8875
- [
8876
- 3004802348 /* PistolMk2CamoSlideZebra */,
8877
- 1684637069 /* Scope2 */
8878
- ],
8879
- [
8880
- 3330502162 /* PistolMk2CamoSlideGeometric */,
8881
- 1684637069 /* Scope2 */
8882
- ],
8379
+ [3036451504 /* PistolMk2CamoSlideDigital */, 1684637069 /* Scope2 */],
8380
+ [438243936 /* PistolMk2CamoSlideBrushstroke */, 1684637069 /* Scope2 */],
8381
+ [3839888240 /* PistolMk2CamoSlideWoodland */, 1684637069 /* Scope2 */],
8382
+ [740920107 /* PistolMk2CamoSlideSkull */, 1684637069 /* Scope2 */],
8383
+ [3753350949 /* PistolMk2CamoSlideSessanta */, 1684637069 /* Scope2 */],
8384
+ [1809261196 /* PistolMk2CamoSlidePerseus */, 1684637069 /* Scope2 */],
8385
+ [2648428428 /* PistolMk2CamoSlideLeopard */, 1684637069 /* Scope2 */],
8386
+ [3004802348 /* PistolMk2CamoSlideZebra */, 1684637069 /* Scope2 */],
8387
+ [3330502162 /* PistolMk2CamoSlideGeometric */, 1684637069 /* Scope2 */],
8883
8388
  [1135718771 /* PistolMk2CamoSlideBoom */, 1684637069 /* Scope2 */],
8884
- [
8885
- 1253942266 /* PistolMk2CamoSlidePatriotic */,
8886
- 1684637069 /* Scope2 */
8887
- ],
8389
+ [1253942266 /* PistolMk2CamoSlidePatriotic */, 1684637069 /* Scope2 */],
8888
8390
  [1108334355 /* AtSights */, 1684637069 /* Scope2 */],
8889
8391
  [77277509 /* AtScopeMacroMk2 */, 1684637069 /* Scope2 */],
8890
8392
  [3328927042 /* AtScopeMediumMk2 */, 1684637069 /* Scope2 */],
@@ -8906,35 +8408,14 @@ var ComponentAttachmentPointByHash = /* @__PURE__ */ new Map([
8906
8408
  [2640679034 /* AtArAfGrip2 */, 3748215485 /* Grip2 */],
8907
8409
  [2640679034 /* AtArAfGrip2 */, 3748215485 /* Grip2 */],
8908
8410
  [1967214384 /* AtRailCover01 */, 2451679629 /* Rail */],
8909
- [
8910
- 1134861606 /* AssaultRifleMk2BarrelNormal */,
8911
- 2982890265 /* Barrel */
8912
- ],
8913
- [
8914
- 1447477866 /* AssaultRifleMk2BarrelHeavy */,
8915
- 2982890265 /* Barrel */
8916
- ],
8917
- [
8918
- 2201368575 /* CarbineRifleMk2BarrelNormal */,
8919
- 2982890265 /* Barrel */
8920
- ],
8921
- [
8922
- 2335983627 /* CarbineRifleMk2BarrelHeavy */,
8923
- 2982890265 /* Barrel */
8924
- ],
8925
- [
8926
- 3276730932 /* CombatMGMk2BarrelNormal */,
8927
- 2982890265 /* Barrel */
8928
- ],
8411
+ [1134861606 /* AssaultRifleMk2BarrelNormal */, 2982890265 /* Barrel */],
8412
+ [1447477866 /* AssaultRifleMk2BarrelHeavy */, 2982890265 /* Barrel */],
8413
+ [2201368575 /* CarbineRifleMk2BarrelNormal */, 2982890265 /* Barrel */],
8414
+ [2335983627 /* CarbineRifleMk2BarrelHeavy */, 2982890265 /* Barrel */],
8415
+ [3276730932 /* CombatMGMk2BarrelNormal */, 2982890265 /* Barrel */],
8929
8416
  [3051509595 /* CombatMGMk2BarrelHeavy */, 2982890265 /* Barrel */],
8930
- [
8931
- 2425761975 /* HeavySniperMk2BarrelNormal */,
8932
- 2982890265 /* Barrel */
8933
- ],
8934
- [
8935
- 277524638 /* HeavySniperMk2BarrelHeavy */,
8936
- 2982890265 /* Barrel */
8937
- ],
8417
+ [2425761975 /* HeavySniperMk2BarrelNormal */, 2982890265 /* Barrel */],
8418
+ [277524638 /* HeavySniperMk2BarrelHeavy */, 2982890265 /* Barrel */],
8938
8419
  [3641720545 /* SMGMk2BarrelNormal */, 2982890265 /* Barrel */],
8939
8420
  [2774849419 /* SMGMk2BarrelHeavy */, 2982890265 /* Barrel */]
8940
8421
  ]);
@@ -8964,29 +8445,12 @@ function initializeOnce5() {
8964
8445
  const intLength = 4;
8965
8446
  for (const hash of enumValues(WeaponComponentHash)) {
8966
8447
  const buffer = new Uint8Array(40);
8967
- Citizen.invokeNative(
8968
- "0xB3CAF387AE12E9F8",
8969
- hash,
8970
- buffer,
8971
- Citizen.returnResultAnyway()
8972
- );
8448
+ Citizen.invokeNative("0xB3CAF387AE12E9F8", hash, buffer, Citizen.returnResultAnyway());
8973
8449
  const weaponComponentHudStat = {
8974
- hudDamage: getUInt32FromUint8Array(
8975
- buffer,
8976
- 0 * intLength,
8977
- 1 * intLength
8978
- ),
8450
+ hudDamage: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
8979
8451
  hudSpeed: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
8980
- hudCapacity: getUInt32FromUint8Array(
8981
- buffer,
8982
- 4 * intLength,
8983
- 5 * intLength
8984
- ),
8985
- hudAccuracy: getUInt32FromUint8Array(
8986
- buffer,
8987
- 6 * intLength,
8988
- 7 * intLength
8989
- ),
8452
+ hudCapacity: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
8453
+ hudAccuracy: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
8990
8454
  hudRange: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength)
8991
8455
  };
8992
8456
  WeaponComponentHudStats.set(hash, weaponComponentHudStat);
@@ -9032,11 +8496,7 @@ var WeaponComponent = class _WeaponComponent {
9032
8496
  * @constructor
9033
8497
  */
9034
8498
  get Active() {
9035
- return HasPedGotWeaponComponent(
9036
- this.owner.Handle,
9037
- this.weapon.Hash,
9038
- this.componentHash
9039
- );
8499
+ return HasPedGotWeaponComponent(this.owner.Handle, this.weapon.Hash, this.componentHash);
9040
8500
  }
9041
8501
  /**
9042
8502
  * give weapon component to ped
@@ -9046,17 +8506,9 @@ var WeaponComponent = class _WeaponComponent {
9046
8506
  */
9047
8507
  set Active(value) {
9048
8508
  if (value) {
9049
- GiveWeaponComponentToPed(
9050
- this.owner.Handle,
9051
- this.weapon.Hash,
9052
- this.componentHash
9053
- );
8509
+ GiveWeaponComponentToPed(this.owner.Handle, this.weapon.Hash, this.componentHash);
9054
8510
  } else {
9055
- RemoveWeaponComponentFromPed(
9056
- this.owner.Handle,
9057
- this.weapon.Hash,
9058
- this.componentHash
9059
- );
8511
+ RemoveWeaponComponentFromPed(this.owner.Handle, this.weapon.Hash, this.componentHash);
9060
8512
  }
9061
8513
  }
9062
8514
  /**
@@ -9065,10 +8517,7 @@ var WeaponComponent = class _WeaponComponent {
9065
8517
  * @constructor
9066
8518
  */
9067
8519
  get DisplayName() {
9068
- return _WeaponComponent.getComponentDisplayNameFromHash(
9069
- this.weapon.Hash,
9070
- this.componentHash
9071
- );
8520
+ return _WeaponComponent.getComponentDisplayNameFromHash(this.weapon.Hash, this.componentHash);
9072
8521
  }
9073
8522
  /**
9074
8523
  * get component localized name
@@ -9084,10 +8533,7 @@ var WeaponComponent = class _WeaponComponent {
9084
8533
  * @constructor
9085
8534
  */
9086
8535
  get AttachmentPoint() {
9087
- return _WeaponComponent.getAttachmentPoint(
9088
- this.weapon.Hash,
9089
- this.componentHash
9090
- );
8536
+ return _WeaponComponent.getAttachmentPoint(this.weapon.Hash, this.componentHash);
9091
8537
  }
9092
8538
  /**
9093
8539
  * get component hud stats
@@ -9140,7 +8586,6 @@ var InvalidWeaponComponent = class extends WeaponComponent {
9140
8586
  get Active() {
9141
8587
  return false;
9142
8588
  }
9143
- // eslint-disable-next-line @typescript-eslint/no-empty-function
9144
8589
  set Active(value) {
9145
8590
  }
9146
8591
  get DisplayName() {
@@ -9174,9 +8619,8 @@ var WeaponComponentCollection = class {
9174
8619
  next() {
9175
8620
  if (pointer < components.length) {
9176
8621
  return { done: false, value: components[pointer++] };
9177
- } else {
9178
- return { done: true, value: null };
9179
8622
  }
8623
+ return { done: true, value: null };
9180
8624
  }
9181
8625
  };
9182
8626
  }
@@ -9209,11 +8653,7 @@ var WeaponComponentCollection = class {
9209
8653
  * @param index - index of component
9210
8654
  */
9211
8655
  getClipComponent(index) {
9212
- return this.getAnyComponentByAttachmentPoints(
9213
- index,
9214
- 3723347892 /* Clip */,
9215
- 291640902 /* Clip2 */
9216
- );
8656
+ return this.getAnyComponentByAttachmentPoints(index, 3723347892 /* Clip */, 291640902 /* Clip2 */);
9217
8657
  }
9218
8658
  /**
9219
8659
  * get clip variation count
@@ -9221,10 +8661,7 @@ var WeaponComponentCollection = class {
9221
8661
  * @constructor
9222
8662
  */
9223
8663
  get ClipVariationsCount() {
9224
- return this.getComponentHashesByAttachmentPoints(
9225
- 3723347892 /* Clip */,
9226
- 291640902 /* Clip2 */
9227
- ).length;
8664
+ return this.getComponentHashesByAttachmentPoints(3723347892 /* Clip */, 291640902 /* Clip2 */).length;
9228
8665
  }
9229
8666
  /**
9230
8667
  * get scope component
@@ -9244,10 +8681,7 @@ var WeaponComponentCollection = class {
9244
8681
  * @constructor
9245
8682
  */
9246
8683
  get ScopeVariationsCount() {
9247
- return this.getComponentHashesByAttachmentPoints(
9248
- 196630833 /* Scope */,
9249
- 1684637069 /* Scope2 */
9250
- ).length;
8684
+ return this.getComponentHashesByAttachmentPoints(196630833 /* Scope */, 1684637069 /* Scope2 */).length;
9251
8685
  }
9252
8686
  /**
9253
8687
  * get suppressor component
@@ -9276,10 +8710,7 @@ var WeaponComponentCollection = class {
9276
8710
  *
9277
8711
  */
9278
8712
  getLuxuryFinishComponent() {
9279
- return this.getAnyComponentByAttachmentPoints(
9280
- void 0,
9281
- 962500902 /* GunRoot */
9282
- );
8713
+ return this.getAnyComponentByAttachmentPoints(void 0, 962500902 /* GunRoot */);
9283
8714
  }
9284
8715
  /**
9285
8716
  * get Mk2 camo component
@@ -9287,10 +8718,7 @@ var WeaponComponentCollection = class {
9287
8718
  * @param index - index of component
9288
8719
  */
9289
8720
  getMk2CamoComponent(index) {
9290
- return this.getAnyComponentByAttachmentPoints(
9291
- index,
9292
- 962500902 /* GunRoot */
9293
- );
8721
+ return this.getAnyComponentByAttachmentPoints(index, 962500902 /* GunRoot */);
9294
8722
  }
9295
8723
  /**
9296
8724
  * get Mk2 barrel component
@@ -9298,10 +8726,7 @@ var WeaponComponentCollection = class {
9298
8726
  * @param index - index of component
9299
8727
  */
9300
8728
  getMk2BarrelComponent(index) {
9301
- return this.getAnyComponentByAttachmentPoints(
9302
- index,
9303
- 2982890265 /* Barrel */
9304
- );
8729
+ return this.getAnyComponentByAttachmentPoints(index, 2982890265 /* Barrel */);
9305
8730
  }
9306
8731
  /**
9307
8732
  * Create component object and add to collection
@@ -9334,9 +8759,7 @@ var WeaponComponentCollection = class {
9334
8759
  */
9335
8760
  getComponentHashesByAttachmentPoints(...attachmentPoints) {
9336
8761
  return this.AllWeaponComponentHashes.filter(
9337
- (hash) => attachmentPoints.some(
9338
- (attachmentPoint) => ComponentAttachmentPointByHash.get(hash) === attachmentPoint
9339
- )
8762
+ (hash) => attachmentPoints.some((attachmentPoint) => ComponentAttachmentPointByHash.get(hash) === attachmentPoint)
9340
8763
  );
9341
8764
  }
9342
8765
  /**
@@ -9347,9 +8770,7 @@ var WeaponComponentCollection = class {
9347
8770
  * @private
9348
8771
  */
9349
8772
  getAnyComponentByAttachmentPoints(index, ...attachmentPoints) {
9350
- const hashes = this.getComponentHashesByAttachmentPoints(
9351
- ...attachmentPoints
9352
- );
8773
+ const hashes = this.getComponentHashesByAttachmentPoints(...attachmentPoints);
9353
8774
  if (index === void 0) {
9354
8775
  return this.get(hashes[0]) ?? this.invalidComponent;
9355
8776
  }
@@ -9370,60 +8791,19 @@ function initializeOnce6() {
9370
8791
  const weaponCount = GetNumDlcWeapons();
9371
8792
  for (let i = 0; i < weaponCount; i++) {
9372
8793
  const buffer = new Uint8Array(14 * intLength + 4 * strLength);
9373
- Citizen.invokeNative(
9374
- "0x79923CD21BECE14E",
9375
- i,
9376
- buffer,
9377
- Citizen.returnResultAnyway()
9378
- );
8794
+ Citizen.invokeNative("0x79923CD21BECE14E", i, buffer, Citizen.returnResultAnyway());
9379
8795
  const dlcWeaponData = {
9380
- validCheck: getUInt32FromUint8Array(
9381
- buffer,
9382
- 0 * intLength,
9383
- 1 * intLength
9384
- ),
9385
- weaponHash: getUInt32FromUint8Array(
9386
- buffer,
9387
- 2 * intLength,
9388
- 3 * intLength
9389
- ),
8796
+ validCheck: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
8797
+ weaponHash: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
9390
8798
  unk: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
9391
- weaponCost: getUInt32FromUint8Array(
9392
- buffer,
9393
- 6 * intLength,
9394
- 7 * intLength
9395
- ),
8799
+ weaponCost: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
9396
8800
  ammoCost: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength),
9397
- ammoType: getUInt32FromUint8Array(
9398
- buffer,
9399
- 10 * intLength,
9400
- 11 * intLength
9401
- ),
9402
- defaultClipSize: getUInt32FromUint8Array(
9403
- buffer,
9404
- 12 * intLength,
9405
- 13 * intLength
9406
- ),
9407
- name: getStringFromUInt8Array(
9408
- buffer,
9409
- 14 * intLength,
9410
- 14 * intLength + strLength
9411
- ),
9412
- desc: getStringFromUInt8Array(
9413
- buffer,
9414
- 14 * intLength + strLength,
9415
- 14 * intLength + 2 * strLength
9416
- ),
9417
- simpleDesc: getStringFromUInt8Array(
9418
- buffer,
9419
- 14 * intLength + 2 * strLength,
9420
- 14 * intLength + 3 * strLength
9421
- ),
9422
- upperCaseName: getStringFromUInt8Array(
9423
- buffer,
9424
- 14 * intLength + 3 * strLength,
9425
- 14 * intLength + 4 * strLength
9426
- )
8801
+ ammoType: getUInt32FromUint8Array(buffer, 10 * intLength, 11 * intLength),
8802
+ defaultClipSize: getUInt32FromUint8Array(buffer, 12 * intLength, 13 * intLength),
8803
+ name: getStringFromUInt8Array(buffer, 14 * intLength, 14 * intLength + strLength),
8804
+ desc: getStringFromUInt8Array(buffer, 14 * intLength + strLength, 14 * intLength + 2 * strLength),
8805
+ simpleDesc: getStringFromUInt8Array(buffer, 14 * intLength + 2 * strLength, 14 * intLength + 3 * strLength),
8806
+ upperCaseName: getStringFromUInt8Array(buffer, 14 * intLength + 3 * strLength, 14 * intLength + 4 * strLength)
9427
8807
  };
9428
8808
  DlcWeaponData.set(dlcWeaponData.weaponHash, dlcWeaponData);
9429
8809
  }
@@ -9512,29 +8892,12 @@ function initializeOnce8() {
9512
8892
  const intLength = 4;
9513
8893
  for (const hash of enumValues(WeaponHash)) {
9514
8894
  const buffer = new Uint8Array(40);
9515
- Citizen.invokeNative(
9516
- "0xD92C739EE34C9EBA",
9517
- hash,
9518
- buffer,
9519
- Citizen.returnResultAnyway()
9520
- );
8895
+ Citizen.invokeNative("0xD92C739EE34C9EBA", hash, buffer, Citizen.returnResultAnyway());
9521
8896
  const weaponHudStats = {
9522
- hudDamage: getUInt32FromUint8Array(
9523
- buffer,
9524
- 0 * intLength,
9525
- 1 * intLength
9526
- ),
8897
+ hudDamage: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
9527
8898
  hudSpeed: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
9528
- hudCapacity: getUInt32FromUint8Array(
9529
- buffer,
9530
- 4 * intLength,
9531
- 5 * intLength
9532
- ),
9533
- hudAccuracy: getUInt32FromUint8Array(
9534
- buffer,
9535
- 6 * intLength,
9536
- 7 * intLength
9537
- ),
8899
+ hudCapacity: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
8900
+ hudAccuracy: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
9538
8901
  hudRange: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength)
9539
8902
  };
9540
8903
  WeaponHudStats.set(hash, weaponHudStats);
@@ -9772,9 +9135,7 @@ var Weapon = class _Weapon {
9772
9135
  * @constructor
9773
9136
  */
9774
9137
  get IsMk2() {
9775
- return Array.from(enumValues(Mk2WeaponHash)).some(
9776
- (x) => x === this.hash
9777
- );
9138
+ return Array.from(enumValues(Mk2WeaponHash)).some((x) => x === this.hash);
9778
9139
  }
9779
9140
  /**
9780
9141
  * set weapon livery, only work for Mk2 weapon
@@ -9784,25 +9145,16 @@ var Weapon = class _Weapon {
9784
9145
  */
9785
9146
  setLivery(liveryId, colorId) {
9786
9147
  if (!this.IsMk2) {
9787
- console.log(
9788
- `[ERROR]${this.setLivery.name} failed. Reason: non-Mk2 weapon`
9789
- );
9148
+ console.log(`[ERROR]${this.setLivery.name} failed. Reason: non-Mk2 weapon`);
9790
9149
  return;
9791
9150
  }
9792
9151
  const component = this.Components.getMk2CamoComponent(liveryId);
9793
9152
  if (component.IsInvalid) {
9794
- console.log(
9795
- `[ERROR]${this.setLivery.name} failed. Reason: invalid liveryId/Component`
9796
- );
9153
+ console.log(`[ERROR]${this.setLivery.name} failed. Reason: invalid liveryId/Component`);
9797
9154
  return;
9798
9155
  }
9799
9156
  component.Active = true;
9800
- SetPedWeaponLiveryColor(
9801
- this.owner.Handle,
9802
- this.hash,
9803
- component.ComponentHash,
9804
- colorId
9805
- );
9157
+ SetPedWeaponLiveryColor(this.owner.Handle, this.hash, component.ComponentHash, colorId);
9806
9158
  }
9807
9159
  /**
9808
9160
  * get weapon hud stats
@@ -9854,9 +9206,8 @@ var WeaponCollection = class {
9854
9206
  next() {
9855
9207
  if (pointer < weapons.length) {
9856
9208
  return { done: false, value: weapons[pointer++] };
9857
- } else {
9858
- return { done: true, value: null };
9859
9209
  }
9210
+ return { done: true, value: null };
9860
9211
  }
9861
9212
  };
9862
9213
  }
@@ -9884,9 +9235,8 @@ var WeaponCollection = class {
9884
9235
  const [, hash] = GetCurrentPedWeapon(this.owner.Handle, true);
9885
9236
  if (this.weapons.has(hash)) {
9886
9237
  return this.weapons.get(hash);
9887
- } else {
9888
- return this.createAndAddWeapon(hash);
9889
9238
  }
9239
+ return this.createAndAddWeapon(hash);
9890
9240
  }
9891
9241
  /**
9892
9242
  * get ped current weapon object
@@ -9908,9 +9258,8 @@ var WeaponCollection = class {
9908
9258
  const hash = GetBestPedWeapon(this.owner.Handle, false);
9909
9259
  if (this.weapons.has(hash)) {
9910
9260
  return this.weapons.get(hash);
9911
- } else {
9912
- return this.createAndAddWeapon(hash);
9913
9261
  }
9262
+ return this.createAndAddWeapon(hash);
9914
9263
  }
9915
9264
  /**
9916
9265
  * check ped has weapon
@@ -9944,13 +9293,7 @@ var WeaponCollection = class {
9944
9293
  if (weapon.IsPresent) {
9945
9294
  this.select(weapon);
9946
9295
  } else {
9947
- GiveWeaponToPed(
9948
- this.owner.Handle,
9949
- weapon.Hash,
9950
- ammoCount,
9951
- equipNow,
9952
- isAmmoLoaded
9953
- );
9296
+ GiveWeaponToPed(this.owner.Handle, weapon.Hash, ammoCount, equipNow, isAmmoLoaded);
9954
9297
  }
9955
9298
  return weapon;
9956
9299
  }
@@ -9966,13 +9309,12 @@ var WeaponCollection = class {
9966
9309
  }
9967
9310
  SetCurrentPedWeapon(this.owner.Handle, weapon.Hash, true);
9968
9311
  return true;
9969
- } else {
9970
- if (!this.hasWeapon(weapon)) {
9971
- return false;
9972
- }
9973
- SetCurrentPedWeapon(this.owner.Handle, weapon, true);
9974
- return true;
9975
9312
  }
9313
+ if (!this.hasWeapon(weapon)) {
9314
+ return false;
9315
+ }
9316
+ SetCurrentPedWeapon(this.owner.Handle, weapon, true);
9317
+ return true;
9976
9318
  }
9977
9319
  /**
9978
9320
  * remove weapon from ped
@@ -10147,11 +9489,9 @@ var Ped = class _Ped extends BaseEntity {
10147
9489
  }
10148
9490
  get SeatIndex() {
10149
9491
  if (!this.CurrentVehicle) return -3 /* None */;
10150
- const numberOfSeats = GetVehicleModelNumberOfSeats(
10151
- this.CurrentVehicle.Model.Hash
10152
- );
9492
+ const numberOfSeats = GetVehicleModelNumberOfSeats(this.CurrentVehicle.Model.Hash);
10153
9493
  for (let seat = -1; seat < numberOfSeats; seat++) {
10154
- if (this.CurrentVehicle.getPedOnSeat(seat).Handle == this.handle) {
9494
+ if (this.CurrentVehicle.getPedOnSeat(seat).Handle === this.handle) {
10155
9495
  return seat;
10156
9496
  }
10157
9497
  }
@@ -10455,11 +9795,7 @@ var Ped = class _Ped extends BaseEntity {
10455
9795
  playAmbientSpeed(speechName, voiceName = "", modifier = 0 /* Standard */) {
10456
9796
  if (Number(modifier) >= 0 && Number(modifier) < _Ped.speechModifierNames.length) {
10457
9797
  if (voiceName === "") {
10458
- PlayAmbientSpeech1(
10459
- this.handle,
10460
- speechName,
10461
- _Ped.speechModifierNames[Number(modifier)]
10462
- );
9798
+ PlayAmbientSpeech1(this.handle, speechName, _Ped.speechModifierNames[Number(modifier)]);
10463
9799
  } else {
10464
9800
  PlayAmbientSpeechWithVoice(
10465
9801
  this.handle,
@@ -10526,26 +9862,13 @@ var Ped = class _Ped extends BaseEntity {
10526
9862
  }
10527
9863
  ragdoll(duration = -1, ragdollType = 0 /* Normal */) {
10528
9864
  this.CanRagdoll = true;
10529
- SetPedToRagdoll(
10530
- this.handle,
10531
- duration,
10532
- duration,
10533
- Number(ragdollType),
10534
- false,
10535
- false,
10536
- false
10537
- );
9865
+ SetPedToRagdoll(this.handle, duration, duration, Number(ragdollType), false, false, false);
10538
9866
  }
10539
9867
  cancelRagdoll() {
10540
9868
  SetPedToRagdoll(this.handle, 1, 1, 1, false, false, false);
10541
9869
  }
10542
9870
  giveHelmet(canBeRemovedByPed, helmetType, textureIndex) {
10543
- GivePedHelmet(
10544
- this.handle,
10545
- !canBeRemovedByPed,
10546
- Number(helmetType),
10547
- textureIndex
10548
- );
9871
+ GivePedHelmet(this.handle, !canBeRemovedByPed, Number(helmetType), textureIndex);
10549
9872
  }
10550
9873
  removeHelmet(instantly) {
10551
9874
  RemovePedHelmet(this.handle, instantly);
@@ -10573,13 +9896,7 @@ var Ped = class _Ped extends BaseEntity {
10573
9896
  return IsPedFacingPed(this.handle, ped.Handle, angle);
10574
9897
  }
10575
9898
  setComponentVariation(componentId, drawableId, textureId, paletteId = 0) {
10576
- SetPedComponentVariation(
10577
- this.handle,
10578
- componentId,
10579
- drawableId,
10580
- textureId,
10581
- paletteId
10582
- );
9899
+ SetPedComponentVariation(this.handle, componentId, drawableId, textureId, paletteId);
10583
9900
  }
10584
9901
  setRandomComponentVariation() {
10585
9902
  SetPedRandomComponentVariation(this.handle, 0);
@@ -10597,11 +9914,7 @@ var Ped = class _Ped extends BaseEntity {
10597
9914
  return GetPedTextureVariation(this.handle, componentId);
10598
9915
  }
10599
9916
  getNumberTextureVariations(componentId, drawableId = this.getDrawableVariation(componentId)) {
10600
- return GetNumberOfPedTextureVariations(
10601
- this.handle,
10602
- componentId,
10603
- drawableId
10604
- );
9917
+ return GetNumberOfPedTextureVariations(this.handle, componentId, drawableId);
10605
9918
  }
10606
9919
  setRandomProps() {
10607
9920
  SetPedRandomProps(this.handle);
@@ -10668,24 +9981,14 @@ var Ped = class _Ped extends BaseEntity {
10668
9981
  this.setHeadOverlay(overlayId, value, opacity);
10669
9982
  }
10670
9983
  getHeadOverlay(overlayId) {
10671
- const [
10672
- ret,
10673
- overlayValue,
10674
- colourType,
10675
- firstColour,
10676
- secondColour,
10677
- overlayOpacity
10678
- ] = GetPedHeadOverlayData(this.handle, overlayId);
9984
+ const [ret, overlayValue, colourType, firstColour, secondColour, overlayOpacity] = GetPedHeadOverlayData(
9985
+ this.handle,
9986
+ overlayId
9987
+ );
10679
9988
  if (!ret) {
10680
- return void 0;
9989
+ return null;
10681
9990
  }
10682
- return [
10683
- overlayValue,
10684
- colourType,
10685
- firstColour,
10686
- secondColour,
10687
- overlayOpacity
10688
- ];
9991
+ return [overlayValue, colourType, firstColour, secondColour, overlayOpacity];
10689
9992
  }
10690
9993
  setHeadOverlay(overlayId, index, opacity) {
10691
9994
  SetPedHeadOverlay(this.handle, overlayId, index, opacity);
@@ -10694,11 +9997,7 @@ var Ped = class _Ped extends BaseEntity {
10694
9997
  return GetPedHeadOverlayData(this.handle, overlayId)[5];
10695
9998
  }
10696
9999
  setHeadOverlayOpacity(overlayId, opacity) {
10697
- this.setHeadOverlay(
10698
- overlayId,
10699
- this.getHeadOverlayValue(overlayId),
10700
- opacity
10701
- );
10000
+ this.setHeadOverlay(overlayId, this.getHeadOverlayValue(overlayId), opacity);
10702
10001
  }
10703
10002
  setHeadOverlayColor(overlayId, color) {
10704
10003
  let colorId = 0;
@@ -10726,12 +10025,8 @@ var Ped = class _Ped extends BaseEntity {
10726
10025
  }
10727
10026
  getHeadBlend() {
10728
10027
  const buffer = new ArrayBuffer(80);
10729
- if (!Citizen.invokeNative(
10730
- "0x2746BD9D88C5C5D0",
10731
- this.handle,
10732
- new Float32Array(buffer)
10733
- )) {
10734
- return void 0;
10028
+ if (!Citizen.invokeNative("0x2746BD9D88C5C5D0", this.handle, new Float32Array(buffer))) {
10029
+ return null;
10735
10030
  }
10736
10031
  const {
10737
10032
  0: shapeFirstId,
@@ -10742,11 +10037,7 @@ var Ped = class _Ped extends BaseEntity {
10742
10037
  10: skinThirdId,
10743
10038
  18: isParent
10744
10039
  } = new Uint32Array(buffer);
10745
- const {
10746
- 0: shapeMix,
10747
- 2: skinMix,
10748
- 4: thirdMix
10749
- } = new Float32Array(buffer, 48);
10040
+ const { 0: shapeMix, 2: skinMix, 4: thirdMix } = new Float32Array(buffer, 48);
10750
10041
  return [
10751
10042
  shapeFirstId,
10752
10043
  shapeSecondId,
@@ -10860,11 +10151,7 @@ var Player2 = class _Player {
10860
10151
  return cfx_default.Player(this.ServerId).state;
10861
10152
  }
10862
10153
  AddStateBagChangeHandler(keyFilter, handler) {
10863
- const cookie = AddStateBagChangeHandler(
10864
- keyFilter,
10865
- `player:${this.ServerId}`,
10866
- handler
10867
- );
10154
+ const cookie = AddStateBagChangeHandler(keyFilter, `player:${this.ServerId}`, handler);
10868
10155
  this.stateBagCookies.push(cookie);
10869
10156
  return cookie;
10870
10157
  }
@@ -10879,7 +10166,7 @@ var Player2 = class _Player {
10879
10166
  }
10880
10167
  removeStateListener(tgtCookie) {
10881
10168
  this.stateBagCookies = this.stateBagCookies.filter((cookie) => {
10882
- const isCookie = cookie == tgtCookie;
10169
+ const isCookie = cookie === tgtCookie;
10883
10170
  if (isCookie) RemoveStateBagChangeHandler(cookie);
10884
10171
  return isCookie;
10885
10172
  });
@@ -10938,9 +10225,8 @@ var Player2 = class _Player {
10938
10225
  get IsInvincible() {
10939
10226
  if (IsDuplicityVersion()) {
10940
10227
  return GetPlayerInvincible(this.handle);
10941
- } else {
10942
- return GetPlayerInvincible_2(this.handle);
10943
10228
  }
10229
+ return GetPlayerInvincible_2(this.handle);
10944
10230
  }
10945
10231
  get MaxArmor() {
10946
10232
  return GetPlayerMaxArmour(this.handle);
@@ -11558,15 +10844,7 @@ var Vehicle = class _Vehicle extends BaseEntity {
11558
10844
  }
11559
10845
  }
11560
10846
  deform(position, damageAmount, radius) {
11561
- SetVehicleDamage(
11562
- this.handle,
11563
- position.x,
11564
- position.y,
11565
- position.z,
11566
- damageAmount,
11567
- radius,
11568
- false
11569
- );
10847
+ SetVehicleDamage(this.handle, position.x, position.y, position.z, damageAmount, radius, false);
11570
10848
  }
11571
10849
  get PassengerCapacity() {
11572
10850
  return GetVehicleMaxNumberOfPassengers(this.handle);
@@ -11587,17 +10865,10 @@ var Vehicle = class _Vehicle extends BaseEntity {
11587
10865
  return GetVehicleHandlingInt(this.handle, "CHandlingData", fieldName);
11588
10866
  }
11589
10867
  setHandlingInt(fieldName, value) {
11590
- SetVehicleHandlingInt(
11591
- this.handle,
11592
- "CHandlingData",
11593
- fieldName,
11594
- Math.ceil(value)
11595
- );
10868
+ SetVehicleHandlingInt(this.handle, "CHandlingData", fieldName, Math.ceil(value));
11596
10869
  }
11597
10870
  getHandlingVector(fieldName) {
11598
- return Vector3.fromArray(
11599
- GetVehicleHandlingVector(this.handle, "CHandlingData", fieldName)
11600
- );
10871
+ return Vector3.fromArray(GetVehicleHandlingVector(this.handle, "CHandlingData", fieldName));
11601
10872
  }
11602
10873
  };
11603
10874
 
@@ -11807,10 +11078,7 @@ var VehicleModCollection = class {
11807
11078
  }
11808
11079
  getToggleMod(modType) {
11809
11080
  if (!this._vehicleToggleMods.has(modType)) {
11810
- this._vehicleToggleMods.set(
11811
- modType,
11812
- new VehicleToggleMod(this._owner, modType)
11813
- );
11081
+ this._vehicleToggleMods.set(modType, new VehicleToggleMod(this._owner, modType));
11814
11082
  }
11815
11083
  return this._vehicleToggleMods.get(modType);
11816
11084
  }
@@ -11967,24 +11235,14 @@ var VehicleModCollection = class {
11967
11235
  return Color.fromRgb(color[0], color[1], color[2]);
11968
11236
  }
11969
11237
  set CustomPrimaryColor(color) {
11970
- SetVehicleCustomPrimaryColour(
11971
- this._owner.Handle,
11972
- color.r,
11973
- color.g,
11974
- color.b
11975
- );
11238
+ SetVehicleCustomPrimaryColour(this._owner.Handle, color.r, color.g, color.b);
11976
11239
  }
11977
11240
  get CustomSecondaryColor() {
11978
11241
  const color = GetVehicleCustomSecondaryColour(this._owner.Handle);
11979
11242
  return Color.fromRgb(color[0], color[1], color[2]);
11980
11243
  }
11981
11244
  set CustomSecondaryColor(color) {
11982
- SetVehicleCustomSecondaryColour(
11983
- this._owner.Handle,
11984
- color.r,
11985
- color.g,
11986
- color.b
11987
- );
11245
+ SetVehicleCustomSecondaryColour(this._owner.Handle, color.r, color.g, color.b);
11988
11246
  }
11989
11247
  get IsPrimaryColorCustom() {
11990
11248
  return GetIsVehiclePrimaryColourCustom(this._owner.Handle);
@@ -12213,13 +11471,14 @@ var Game = class _Game {
12213
11471
  if (typeof input === "undefined") {
12214
11472
  return 0;
12215
11473
  }
12216
- if (!this.useHashCache) {
11474
+ if (!_Game.useHashCache) {
12217
11475
  return GetHashKey(input);
12218
11476
  }
12219
- const _hash = this.hashCache.get(input);
12220
- if (_hash) return _hash;
12221
- const hash = GetHashKey(input);
12222
- this.hashCache.set(input, hash);
11477
+ let hash = _Game.hashCache.get(input);
11478
+ if (!hash) {
11479
+ hash = GetHashKey(input);
11480
+ _Game.hashCache.set(input, hash);
11481
+ }
12223
11482
  return hash;
12224
11483
  }
12225
11484
  static setLocalPlayerGhosted(isGhosted, inverseGhost) {
@@ -12264,7 +11523,7 @@ var Game = class _Game {
12264
11523
  * Gets the current frame rate per second
12265
11524
  */
12266
11525
  static get FPS() {
12267
- return 1 / this.LastFrameTime;
11526
+ return 1 / _Game.LastFrameTime;
12268
11527
  }
12269
11528
  /**
12270
11529
  * Gets the time it currently takes to render a frame, in seconds;
@@ -12277,24 +11536,24 @@ var Game = class _Game {
12277
11536
  */
12278
11537
  static get Player() {
12279
11538
  const handle = PlayerId();
12280
- if (this.cachedPlayer === void 0 || handle !== this.cachedPlayer.Handle) {
12281
- this.cachedPlayer = new Player2(handle);
11539
+ if (_Game.cachedPlayer === void 0 || handle !== _Game.cachedPlayer.Handle) {
11540
+ _Game.cachedPlayer = new Player2(handle);
12282
11541
  }
12283
- return this.cachedPlayer;
11542
+ return _Game.cachedPlayer;
12284
11543
  }
12285
11544
  /**
12286
11545
  * Get the local player character's Ped object.
12287
11546
  * @returns A local player's character.
12288
11547
  */
12289
11548
  static get PlayerPed() {
12290
- return this.Player.Character;
11549
+ return _Game.Player.Character;
12291
11550
  }
12292
11551
  /**
12293
11552
  * Get an iterable list of players currently on server.
12294
11553
  * @returns Iterable list of Player objects.
12295
11554
  */
12296
11555
  static *playerList(excludeLocalPlayer = false) {
12297
- const localPlayer = this.Player;
11556
+ const localPlayer = _Game.Player;
12298
11557
  for (const id of GetActivePlayers()) {
12299
11558
  if (excludeLocalPlayer && localPlayer.Handle === id) {
12300
11559
  continue;
@@ -12307,13 +11566,13 @@ var Game = class _Game {
12307
11566
  * @returns True if enabled.
12308
11567
  */
12309
11568
  static get PlayerVersusPlayer() {
12310
- return this.Player.PvPEnabled;
11569
+ return _Game.Player.PvPEnabled;
12311
11570
  }
12312
11571
  /**
12313
11572
  * Set whether PvP is enabled.
12314
11573
  */
12315
11574
  static set PlayerVersusPlayer(value) {
12316
- this.Player.PvPEnabled = value;
11575
+ _Game.Player.PvPEnabled = value;
12317
11576
  }
12318
11577
  /**
12319
11578
  * Get the maximum wanted level.
@@ -12607,9 +11866,8 @@ var Game = class _Game {
12607
11866
  static doesGXTEntryExist(entry) {
12608
11867
  if (typeof entry === "number") {
12609
11868
  return DoesTextLabelExist(entry.toString());
12610
- } else {
12611
- return DoesTextLabelExist(entry);
12612
11869
  }
11870
+ return DoesTextLabelExist(entry);
12613
11871
  }
12614
11872
  /**
12615
11873
  * Returns a localised string from the games language files with a specified GXT key
@@ -12644,12 +11902,12 @@ var Game = class _Game {
12644
11902
  SetWaypointOff();
12645
11903
  }
12646
11904
  static get WaypointPosition() {
12647
- const waypointBlip = this.getWaypointBlip();
11905
+ const waypointBlip = _Game.getWaypointBlip();
12648
11906
  if (waypointBlip == null) {
12649
11907
  return Vector3.Zero;
12650
11908
  }
12651
11909
  const position = waypointBlip.Position;
12652
- position.z = this.getGroundHeight(position);
11910
+ position.z = _Game.getGroundHeight(position);
12653
11911
  return position;
12654
11912
  }
12655
11913
  static set WaypointPosition(position) {
@@ -12662,6 +11920,153 @@ var Game = class _Game {
12662
11920
  static cachedPlayer;
12663
11921
  };
12664
11922
 
11923
+ // src/fivem/GameplayCamera.ts
11924
+ var GameplayCamera = class _GameplayCamera {
11925
+ static {
11926
+ __name(this, "GameplayCamera");
11927
+ }
11928
+ /**
11929
+ * Get the world position of gameplay camera.
11930
+ */
11931
+ static get Position() {
11932
+ return Vector3.fromArray(GetGameplayCamCoords());
11933
+ }
11934
+ /**
11935
+ * Get the rotation of gameplay camera.
11936
+ */
11937
+ static get Rotation() {
11938
+ return Vector3.fromArray(GetGameplayCamRot(2));
11939
+ }
11940
+ /**
11941
+ * Get the forward vector of gameplay camera.
11942
+ */
11943
+ static get ForwardVector() {
11944
+ const rotation = Vector3.multiply(_GameplayCamera.Rotation, Math.PI / 180);
11945
+ return Vector3.normalize(
11946
+ new Vector3(
11947
+ -Math.sin(rotation.z) * Math.abs(Math.cos(rotation.x)),
11948
+ Math.cos(rotation.z) * Math.abs(Math.cos(rotation.x)),
11949
+ Math.sin(rotation.x)
11950
+ )
11951
+ );
11952
+ }
11953
+ /**
11954
+ * Get the pitch of the gameplay camera relative to player.
11955
+ */
11956
+ static get RelativePitch() {
11957
+ return GetGameplayCamRelativePitch();
11958
+ }
11959
+ /**
11960
+ * Set gameplay camera pitch relative to player.
11961
+ */
11962
+ static set RelativePitch(pitch) {
11963
+ SetGameplayCamRelativePitch(pitch, 1);
11964
+ }
11965
+ /**
11966
+ * Get heading of gameplay camera.
11967
+ */
11968
+ static get RelativeHeading() {
11969
+ return GetGameplayCamRelativeHeading();
11970
+ }
11971
+ /**
11972
+ * Get heading of gameplay camera.
11973
+ */
11974
+ static set RelativeHeading(heading) {
11975
+ SetGameplayCamRelativeHeading(heading);
11976
+ }
11977
+ /**
11978
+ * Clamps the yaw of the gameplay camera.
11979
+ *
11980
+ * @param min The minimum yaw value.
11981
+ * @param max The maximum yaw value.
11982
+ */
11983
+ static clampYaw(min, max) {
11984
+ ClampGameplayCamYaw(min, max);
11985
+ }
11986
+ /**
11987
+ * Clamps the pitch of the gameplay camera.
11988
+ *
11989
+ * @param min The minimum pitch value.
11990
+ * @param max The maximum pitch value.
11991
+ */
11992
+ static clampPitch(min, max) {
11993
+ ClampGameplayCamPitch(min, max);
11994
+ }
11995
+ /**
11996
+ * Gets zoom of the gameplay camera.
11997
+ */
11998
+ static get Zoom() {
11999
+ return GetGameplayCamZoom();
12000
+ }
12001
+ /**
12002
+ * Gets field of view of the gameplay camera.
12003
+ */
12004
+ static get FieldOfView() {
12005
+ return GetGameplayCamFov();
12006
+ }
12007
+ /**
12008
+ * Gets a value indicating whether the gameplay camera is rendering.
12009
+ *
12010
+ * @returns true if the gameplay camera is rendering; otherwise, false.
12011
+ */
12012
+ static get IsRendering() {
12013
+ return IsGameplayCamRendering();
12014
+ }
12015
+ /**
12016
+ * Gets a value indicating whether the aiming camera is rendering.
12017
+ *
12018
+ * @returns true if the aiming camera is rendering; otherwise, false.
12019
+ */
12020
+ static get IsAimCamActive() {
12021
+ return IsAimCamActive();
12022
+ }
12023
+ /**
12024
+ * Gets a value indicating whether the first person aiming camera is rendering.
12025
+ *
12026
+ * @returns true if the first person aiming camera is rendering; otherwise, false.
12027
+ */
12028
+ static get IsFirstPersonAimCamActive() {
12029
+ return IsFirstPersonAimCamActive();
12030
+ }
12031
+ /**
12032
+ * Gets a value indicating whether the gameplay camera is looking behind.
12033
+ *
12034
+ * @returns true if the gameplay camera is looking behind; otherwise, false.
12035
+ */
12036
+ static get IsLookingBehind() {
12037
+ return IsGameplayCamLookingBehind();
12038
+ }
12039
+ /**
12040
+ * Shakes the gameplay camera.
12041
+ *
12042
+ * @param shakeType Type of the shake to apply.
12043
+ * @param amplitude The amplitude of the shaking.
12044
+ */
12045
+ static shake(shakeType, amplitude) {
12046
+ ShakeGameplayCam(Camera.shakeNames[Number(shakeType)], amplitude);
12047
+ }
12048
+ /**
12049
+ * Stops shaking the gameplay camera.
12050
+ */
12051
+ static stopShaking() {
12052
+ StopGameplayCamShaking(true);
12053
+ }
12054
+ /**
12055
+ * Gets a value indicating whether the gameplay camera is shaking.
12056
+ *
12057
+ * @returns true if the gameplay camera is shaking; otherwise, false.
12058
+ */
12059
+ static get IsShaking() {
12060
+ return IsGameplayCamShaking();
12061
+ }
12062
+ /**
12063
+ * Sets the shake amplitude for the gameplay camera.
12064
+ */
12065
+ static set ShakeAmplitude(value) {
12066
+ SetGameplayCamShakeAmplitude(value);
12067
+ }
12068
+ };
12069
+
12665
12070
  // src/fivem/Camera.ts
12666
12071
  var Camera = class _Camera {
12667
12072
  static {
@@ -12727,7 +12132,7 @@ var Camera = class _Camera {
12727
12132
  // return Matrix.Up;
12728
12133
  // }
12729
12134
  get ForwardVector() {
12730
- const rotation = Vector3.multiply(this.Rotation, Math.PI / 180);
12135
+ const rotation = Vector3.multiply(GameplayCamera.Rotation, Math.PI / 180);
12731
12136
  const normalized = Vector3.normalize(
12732
12137
  new Vector3(
12733
12138
  -Math.sin(rotation.z) * Math.abs(Math.cos(rotation.x)),
@@ -12810,24 +12215,9 @@ var Camera = class _Camera {
12810
12215
  }
12811
12216
  pointAt(target, offset = new Vector3(0, 0, 0)) {
12812
12217
  if (target instanceof BaseEntity) {
12813
- PointCamAtEntity(
12814
- this.handle,
12815
- target.Handle,
12816
- offset.x,
12817
- offset.y,
12818
- offset.z,
12819
- true
12820
- );
12218
+ PointCamAtEntity(this.handle, target.Handle, offset.x, offset.y, offset.z, true);
12821
12219
  } else if (target instanceof PedBone) {
12822
- PointCamAtPedBone(
12823
- this.handle,
12824
- target.Owner.Handle,
12825
- target.Index,
12826
- offset.x,
12827
- offset.y,
12828
- offset.z,
12829
- true
12830
- );
12220
+ PointCamAtPedBone(this.handle, target.Owner.Handle, target.Index, offset.x, offset.y, offset.z, true);
12831
12221
  } else {
12832
12222
  PointCamAtCoord(this.handle, target.x, target.y, target.z);
12833
12223
  }
@@ -12836,37 +12226,16 @@ var Camera = class _Camera {
12836
12226
  StopCamPointing(this.handle);
12837
12227
  }
12838
12228
  interpTo(to, duration, easePosition, easeRotation) {
12839
- SetCamActiveWithInterp(
12840
- to.handle,
12841
- this.handle,
12842
- duration,
12843
- Number(easePosition),
12844
- Number(easeRotation)
12845
- );
12229
+ SetCamActiveWithInterp(to.handle, this.handle, duration, Number(easePosition), Number(easeRotation));
12846
12230
  }
12847
12231
  get IsInterpolating() {
12848
12232
  return IsCamInterpolating(this.handle);
12849
12233
  }
12850
12234
  attachTo(object, offset) {
12851
12235
  if (object instanceof BaseEntity) {
12852
- AttachCamToEntity(
12853
- this.handle,
12854
- object.Handle,
12855
- offset.x,
12856
- offset.y,
12857
- offset.z,
12858
- true
12859
- );
12236
+ AttachCamToEntity(this.handle, object.Handle, offset.x, offset.y, offset.z, true);
12860
12237
  } else if (object instanceof PedBone) {
12861
- AttachCamToPedBone(
12862
- this.handle,
12863
- object.Owner.Handle,
12864
- object.Index,
12865
- offset.x,
12866
- offset.y,
12867
- offset.z,
12868
- true
12869
- );
12238
+ AttachCamToPedBone(this.handle, object.Owner.Handle, object.Index, offset.x, offset.y, offset.z, true);
12870
12239
  }
12871
12240
  }
12872
12241
  detach() {
@@ -12880,153 +12249,6 @@ var Camera = class _Camera {
12880
12249
  }
12881
12250
  };
12882
12251
 
12883
- // src/fivem/GameplayCamera.ts
12884
- var GameplayCamera = class {
12885
- static {
12886
- __name(this, "GameplayCamera");
12887
- }
12888
- /**
12889
- * Get the world position of gameplay camera.
12890
- */
12891
- static get Position() {
12892
- return Vector3.fromArray(GetGameplayCamCoords());
12893
- }
12894
- /**
12895
- * Get the rotation of gameplay camera.
12896
- */
12897
- static get Rotation() {
12898
- return Vector3.fromArray(GetGameplayCamRot(2));
12899
- }
12900
- /**
12901
- * Get the forward vector of gameplay camera.
12902
- */
12903
- static get ForwardVector() {
12904
- const rotation = Vector3.multiply(this.Rotation, Math.PI / 180);
12905
- return Vector3.normalize(
12906
- new Vector3(
12907
- -Math.sin(rotation.z) * Math.abs(Math.cos(rotation.x)),
12908
- Math.cos(rotation.z) * Math.abs(Math.cos(rotation.x)),
12909
- Math.sin(rotation.x)
12910
- )
12911
- );
12912
- }
12913
- /**
12914
- * Get the pitch of the gameplay camera relative to player.
12915
- */
12916
- static get RelativePitch() {
12917
- return GetGameplayCamRelativePitch();
12918
- }
12919
- /**
12920
- * Set gameplay camera pitch relative to player.
12921
- */
12922
- static set RelativePitch(pitch) {
12923
- SetGameplayCamRelativePitch(pitch, 1);
12924
- }
12925
- /**
12926
- * Get heading of gameplay camera.
12927
- */
12928
- static get RelativeHeading() {
12929
- return GetGameplayCamRelativeHeading();
12930
- }
12931
- /**
12932
- * Get heading of gameplay camera.
12933
- */
12934
- static set RelativeHeading(heading) {
12935
- SetGameplayCamRelativeHeading(heading);
12936
- }
12937
- /**
12938
- * Clamps the yaw of the gameplay camera.
12939
- *
12940
- * @param min The minimum yaw value.
12941
- * @param max The maximum yaw value.
12942
- */
12943
- static clampYaw(min, max) {
12944
- ClampGameplayCamYaw(min, max);
12945
- }
12946
- /**
12947
- * Clamps the pitch of the gameplay camera.
12948
- *
12949
- * @param min The minimum pitch value.
12950
- * @param max The maximum pitch value.
12951
- */
12952
- static clampPitch(min, max) {
12953
- ClampGameplayCamPitch(min, max);
12954
- }
12955
- /**
12956
- * Gets zoom of the gameplay camera.
12957
- */
12958
- static get Zoom() {
12959
- return GetGameplayCamZoom();
12960
- }
12961
- /**
12962
- * Gets field of view of the gameplay camera.
12963
- */
12964
- static get FieldOfView() {
12965
- return GetGameplayCamFov();
12966
- }
12967
- /**
12968
- * Gets a value indicating whether the gameplay camera is rendering.
12969
- *
12970
- * @returns true if the gameplay camera is rendering; otherwise, false.
12971
- */
12972
- static get IsRendering() {
12973
- return IsGameplayCamRendering();
12974
- }
12975
- /**
12976
- * Gets a value indicating whether the aiming camera is rendering.
12977
- *
12978
- * @returns true if the aiming camera is rendering; otherwise, false.
12979
- */
12980
- static get IsAimCamActive() {
12981
- return IsAimCamActive();
12982
- }
12983
- /**
12984
- * Gets a value indicating whether the first person aiming camera is rendering.
12985
- *
12986
- * @returns true if the first person aiming camera is rendering; otherwise, false.
12987
- */
12988
- static get IsFirstPersonAimCamActive() {
12989
- return IsFirstPersonAimCamActive();
12990
- }
12991
- /**
12992
- * Gets a value indicating whether the gameplay camera is looking behind.
12993
- *
12994
- * @returns true if the gameplay camera is looking behind; otherwise, false.
12995
- */
12996
- static get IsLookingBehind() {
12997
- return IsGameplayCamLookingBehind();
12998
- }
12999
- /**
13000
- * Shakes the gameplay camera.
13001
- *
13002
- * @param shakeType Type of the shake to apply.
13003
- * @param amplitude The amplitude of the shaking.
13004
- */
13005
- static shake(shakeType, amplitude) {
13006
- ShakeGameplayCam(Camera.shakeNames[Number(shakeType)], amplitude);
13007
- }
13008
- /**
13009
- * Stops shaking the gameplay camera.
13010
- */
13011
- static stopShaking() {
13012
- StopGameplayCamShaking(true);
13013
- }
13014
- /**
13015
- * Gets a value indicating whether the gameplay camera is shaking.
13016
- *
13017
- * @returns true if the gameplay camera is shaking; otherwise, false.
13018
- */
13019
- static get IsShaking() {
13020
- return IsGameplayCamShaking();
13021
- }
13022
- /**
13023
- * Sets the shake amplitude for the gameplay camera.
13024
- */
13025
- static set ShakeAmplitude(value) {
13026
- SetGameplayCamShakeAmplitude(value);
13027
- }
13028
- };
13029
-
13030
12252
  // src/fivem/Pickup.ts
13031
12253
  var Pickup = class {
13032
12254
  static {
@@ -13112,7 +12334,9 @@ var RaycastResult = class {
13112
12334
  return this.result === 2 /* Ready */;
13113
12335
  }
13114
12336
  applyShapeTestResults() {
13115
- const [result, hit, endCoords, surfaceNormal, materialHash, entityHit] = GetShapeTestResultIncludingMaterial(this.handle);
12337
+ const [result, hit, endCoords, surfaceNormal, materialHash, entityHit] = GetShapeTestResultIncludingMaterial(
12338
+ this.handle
12339
+ );
13116
12340
  this.result = result;
13117
12341
  if (!this.HasResolved || this.WasDiscarded) return;
13118
12342
  this.hitSomethingArg = hit;
@@ -13237,14 +12461,7 @@ var Rope = class {
13237
12461
  * @param position Location where the rope is to be attached.
13238
12462
  */
13239
12463
  attachEntity(entity, position) {
13240
- AttachRopeToEntity(
13241
- this.handle,
13242
- entity.Handle,
13243
- position.x,
13244
- position.y,
13245
- position.z,
13246
- false
13247
- );
12464
+ AttachRopeToEntity(this.handle, entity.Handle, position.x, position.y, position.z, false);
13248
12465
  }
13249
12466
  /**
13250
12467
  * Attach the rope between two entities at given locations on the entities.
@@ -13385,11 +12602,7 @@ var World = class {
13385
12602
  */
13386
12603
  static set CurrentDate(date) {
13387
12604
  SetClockDate(date.getDate(), date.getMonth(), date.getFullYear());
13388
- NetworkOverrideClockTime(
13389
- date.getHours(),
13390
- date.getMinutes(),
13391
- date.getSeconds()
13392
- );
12605
+ NetworkOverrideClockTime(date.getHours(), date.getMinutes(), date.getSeconds());
13393
12606
  }
13394
12607
  /**
13395
12608
  * Disables all emissive textures, street/building/vehicle lights. "EMP" effect.
@@ -13547,11 +12760,7 @@ var World = class {
13547
12760
  */
13548
12761
  static get WeatherTransition() {
13549
12762
  const transition = GetWeatherTypeTransition();
13550
- return [
13551
- this.weatherDict[transition[0]],
13552
- this.weatherDict[transition[1]],
13553
- transition[2]
13554
- ];
12763
+ return [this.weatherDict[transition[0]], this.weatherDict[transition[1]], transition[2]];
13555
12764
  }
13556
12765
  /**
13557
12766
  * Doesn't work
@@ -13591,9 +12800,7 @@ var World = class {
13591
12800
  */
13592
12801
  static createBlip(position, radius) {
13593
12802
  if (radius !== null && radius !== void 0) {
13594
- return new Blip(
13595
- AddBlipForRadius(position.x, position.y, position.z, radius)
13596
- );
12803
+ return new Blip(AddBlipForRadius(position.x, position.y, position.z, radius));
13597
12804
  }
13598
12805
  return new Blip(AddBlipForCoord(position.x, position.y, position.z));
13599
12806
  }
@@ -13623,7 +12830,7 @@ var World = class {
13623
12830
  * @param fieldOfView Field of view angle of camera.
13624
12831
  * @returns Camera object.
13625
12832
  */
13626
- static createCameraWithParams(cameraType = "DEFAULT_SCRIPTED_CAMERA" /* Scripted */, position, rotation, fieldOfView) {
12833
+ static createCameraWithParams(cameraType = "DEFAULT_SCRIPTED_CAMERA" /* Scripted */, position = Vector3.Zero, rotation = Vector3.Zero, fieldOfView = 90) {
13627
12834
  return new Camera(
13628
12835
  CreateCamWithParams(
13629
12836
  cameraType,
@@ -13658,16 +12865,7 @@ var World = class {
13658
12865
  if (!model.IsPed || !await model.request(1e3)) {
13659
12866
  return null;
13660
12867
  }
13661
- const ped = CreatePed(
13662
- -1,
13663
- model.Hash,
13664
- position.x,
13665
- position.y,
13666
- position.z,
13667
- heading,
13668
- isNetwork,
13669
- pinToScript
13670
- );
12868
+ const ped = CreatePed(-1, model.Hash, position.x, position.y, position.z, heading, isNetwork, pinToScript);
13671
12869
  model.markAsNoLongerNeeded();
13672
12870
  if (ped === 0) {
13673
12871
  return null;
@@ -13707,15 +12905,7 @@ var World = class {
13707
12905
  if (!model.IsVehicle || !await model.request(1e3)) {
13708
12906
  return null;
13709
12907
  }
13710
- const vehicle = CreateVehicle(
13711
- model.Hash,
13712
- position.x,
13713
- position.y,
13714
- position.z,
13715
- heading,
13716
- isNetwork,
13717
- pinToScript
13718
- );
12908
+ const vehicle = CreateVehicle(model.Hash, position.x, position.y, position.z, heading, isNetwork, pinToScript);
13719
12909
  if (vehicle === 0) {
13720
12910
  return null;
13721
12911
  }
@@ -13852,17 +13042,7 @@ var World = class {
13852
13042
  true,
13853
13043
  model.Hash
13854
13044
  );
13855
- else
13856
- handle = CreatePickup(
13857
- type,
13858
- position.x,
13859
- position.y,
13860
- position.z,
13861
- 0,
13862
- value,
13863
- true,
13864
- model.Hash
13865
- );
13045
+ else handle = CreatePickup(type, position.x, position.y, position.z, 0, value, true, model.Hash);
13866
13046
  model.markAsNoLongerNeeded();
13867
13047
  if (handle === 0) {
13868
13048
  return null;
@@ -13882,17 +13062,7 @@ var World = class {
13882
13062
  if (!await model.request(1e3)) {
13883
13063
  return null;
13884
13064
  }
13885
- const handle = CreateAmbientPickup(
13886
- type,
13887
- position.x,
13888
- position.y,
13889
- position.z,
13890
- 0,
13891
- value,
13892
- model.Hash,
13893
- false,
13894
- true
13895
- );
13065
+ const handle = CreateAmbientPickup(type, position.x, position.y, position.z, 0, value, model.Hash, false, true);
13896
13066
  model.markAsNoLongerNeeded();
13897
13067
  if (handle === 0) {
13898
13068
  return null;
@@ -13961,16 +13131,7 @@ var World = class {
13961
13131
  * @param intensity Intensity of the light ("alpha").
13962
13132
  */
13963
13133
  static drawLightWithRange(pos, color, range, intensity) {
13964
- DrawLightWithRange(
13965
- pos.x,
13966
- pos.y,
13967
- pos.z,
13968
- color.r,
13969
- color.g,
13970
- color.b,
13971
- range,
13972
- intensity
13973
- );
13134
+ DrawLightWithRange(pos.x, pos.y, pos.z, color.r, color.g, color.b, range, intensity);
13974
13135
  }
13975
13136
  /**
13976
13137
  * Creates a light in the world. More configurable than World.drawLightWithRange.
@@ -14041,18 +13202,7 @@ var World = class {
14041
13202
  * @param color RGB color of line.
14042
13203
  */
14043
13204
  static drawLine(start, end, color) {
14044
- DrawLine(
14045
- start.x,
14046
- start.y,
14047
- start.z,
14048
- end.x,
14049
- end.y,
14050
- end.z,
14051
- color.r,
14052
- color.g,
14053
- color.b,
14054
- color.a
14055
- );
13205
+ DrawLine(start.x, start.y, start.z, end.x, end.y, end.z, color.r, color.g, color.b, color.a);
14056
13206
  }
14057
13207
  /**
14058
13208
  * Draw polygon in the world.
@@ -14133,10 +13283,7 @@ var World = class {
14133
13283
  );
14134
13284
  }
14135
13285
  static raycastDirection(useExpensiveRaycast, source2, direction, maxDistance, losFlags = 511 /* All */, shapeTestOptions = SHAPE_TEST_DEFAULT, ignoreEntity) {
14136
- const target = Vector3.add(
14137
- source2,
14138
- Vector3.multiply(direction, maxDistance)
14139
- );
13286
+ const target = Vector3.add(source2, Vector3.multiply(direction, maxDistance));
14140
13287
  if (useExpensiveRaycast) {
14141
13288
  return new SynchronousRaycastResult(
14142
13289
  StartExpensiveSynchronousShapeTestLosProbe(
@@ -14195,16 +13342,7 @@ var World = class {
14195
13342
  * Gets the closest object of this model
14196
13343
  */
14197
13344
  static getClosestObject(model, coords, radius = 25, isMission = false) {
14198
- const prop = GetClosestObjectOfType(
14199
- coords.x,
14200
- coords.y,
14201
- coords.z,
14202
- radius,
14203
- model.Hash,
14204
- isMission,
14205
- false,
14206
- false
14207
- );
13345
+ const prop = GetClosestObjectOfType(coords.x, coords.y, coords.z, radius, model.Hash, isMission, false, false);
14208
13346
  if (prop !== 0) {
14209
13347
  return new Prop(prop);
14210
13348
  }
@@ -14433,15 +13571,7 @@ var ParticleEffect = class {
14433
13571
  this.rotation = rotation;
14434
13572
  if (this.IsActive) {
14435
13573
  const off = this.offset;
14436
- SetParticleFxLoopedOffsets(
14437
- this.Handle,
14438
- off.x,
14439
- off.y,
14440
- off.z,
14441
- rotation.x,
14442
- rotation.y,
14443
- rotation.z
14444
- );
13574
+ SetParticleFxLoopedOffsets(this.Handle, off.x, off.y, off.z, rotation.x, rotation.y, rotation.z);
14445
13575
  }
14446
13576
  }
14447
13577
  /**
@@ -14675,17 +13805,9 @@ var RelationshipGroup = class {
14675
13805
  * @param biDirectionally If target group should have same relationship towards this.
14676
13806
  */
14677
13807
  setRelationshipBetweenGroups(targetGroup, relationship, biDirectionally = false) {
14678
- SetRelationshipBetweenGroups(
14679
- Number(relationship),
14680
- this.Hash,
14681
- targetGroup.Hash
14682
- );
13808
+ SetRelationshipBetweenGroups(Number(relationship), this.Hash, targetGroup.Hash);
14683
13809
  if (biDirectionally) {
14684
- SetRelationshipBetweenGroups(
14685
- Number(relationship),
14686
- targetGroup.Hash,
14687
- this.Hash
14688
- );
13810
+ SetRelationshipBetweenGroups(Number(relationship), targetGroup.Hash, this.Hash);
14689
13811
  }
14690
13812
  }
14691
13813
  /**
@@ -14696,17 +13818,9 @@ var RelationshipGroup = class {
14696
13818
  * @param biDirectionally Whether the target group should also clear the relationship.
14697
13819
  */
14698
13820
  clearRelationshipBetweenGroups(targetGroup, relationship, biDirectionally = false) {
14699
- ClearRelationshipBetweenGroups(
14700
- Number(relationship),
14701
- this.Hash,
14702
- targetGroup.Hash
14703
- );
13821
+ ClearRelationshipBetweenGroups(Number(relationship), this.Hash, targetGroup.Hash);
14704
13822
  if (biDirectionally) {
14705
- ClearRelationshipBetweenGroups(
14706
- Number(relationship),
14707
- targetGroup.Hash,
14708
- this.Hash
14709
- );
13823
+ ClearRelationshipBetweenGroups(Number(relationship), targetGroup.Hash, this.Hash);
14710
13824
  }
14711
13825
  }
14712
13826
  /**
@@ -14802,15 +13916,7 @@ var NetworkedScene = class {
14802
13916
  );
14803
13917
  }
14804
13918
  addEntity(entity, animDict, animName, speed, speedMultiplier, flag) {
14805
- NetworkAddEntityToSynchronisedScene(
14806
- entity.Handle,
14807
- this.scene,
14808
- animDict,
14809
- animName,
14810
- speed,
14811
- speedMultiplier,
14812
- flag
14813
- );
13919
+ NetworkAddEntityToSynchronisedScene(entity.Handle, this.scene, animDict, animName, speed, speedMultiplier, flag);
14814
13920
  }
14815
13921
  start() {
14816
13922
  NetworkStartSynchronisedScene(this.scene);
@@ -14841,24 +13947,17 @@ var NetworkedMapEventManager = class {
14841
13947
  #syncedCalls = /* @__PURE__ */ new Map();
14842
13948
  constructor() {
14843
13949
  $CLIENT: {
14844
- RegisterResourceAsEventHandler(
14845
- `${GlobalData.CurrentResource}:syncChanges`
14846
- );
14847
- addRawEventListener(
14848
- `${GlobalData.CurrentResource}:syncChanges`,
14849
- (msgpack_data) => {
14850
- const data = msgpack_unpack(msgpack_data);
14851
- const syncName = data[0];
14852
- const syncData = data[1];
14853
- const map = this.#syncedCalls.get(syncName);
14854
- if (!map) {
14855
- throw new Error(
14856
- `Tried to sync changes for a networked map but ${syncName} does't exist.`
14857
- );
14858
- }
14859
- map.handleSync(syncData);
13950
+ RegisterResourceAsEventHandler(`${GlobalData.CurrentResource}:syncChanges`);
13951
+ addRawEventListener(`${GlobalData.CurrentResource}:syncChanges`, (msgpack_data) => {
13952
+ const data = msgpack_unpack(msgpack_data);
13953
+ const syncName = data[0];
13954
+ const syncData = data[1];
13955
+ const map = this.#syncedCalls.get(syncName);
13956
+ if (!map) {
13957
+ throw new Error(`Tried to sync changes for a networked map but ${syncName} does't exist.`);
14860
13958
  }
14861
- );
13959
+ map.handleSync(syncData);
13960
+ });
14862
13961
  }
14863
13962
  }
14864
13963
  addNetworkedMap(map) {
@@ -14942,11 +14041,7 @@ var Command = class {
14942
14041
  this.params = params;
14943
14042
  this.#handler = handler;
14944
14043
  this.name = `/${name}`;
14945
- registerCommand(
14946
- name,
14947
- (source2, args, raw) => this.call(source2, args, raw),
14948
- restricted
14949
- );
14044
+ registerCommand(name, (source2, args, raw) => this.call(source2, args, raw), restricted);
14950
14045
  if (params) {
14951
14046
  for (const parameter of params) {
14952
14047
  if (parameter.type) {
@@ -14983,8 +14078,7 @@ var Command = class {
14983
14078
  case "playerId":
14984
14079
  $CLIENT: {
14985
14080
  value = arg === "me" ? GetPlayerServerId(PlayerId()) : +arg;
14986
- if (!value || GetPlayerFromServerId(value) === -1)
14987
- value = void 0;
14081
+ if (!value || GetPlayerFromServerId(value) === -1) value = void 0;
14988
14082
  }
14989
14083
  break;
14990
14084
  case "longString":
@@ -15007,10 +14101,8 @@ var Command = class {
15007
14101
  try {
15008
14102
  await this.#handler(parsed);
15009
14103
  } catch (err) {
15010
- Citizen.trace(
15011
- `^1command '${raw.split(" ")[0] || raw}' failed to execute!^0
15012
- ${err.message}`
15013
- );
14104
+ Citizen.trace(`^1command '${raw.split(" ")[0] || raw}' failed to execute!^0
14105
+ ${err.message}`);
15014
14106
  }
15015
14107
  }
15016
14108
  };
@@ -15266,42 +14358,29 @@ var Container = class {
15266
14358
  const h = this.size.height / resolution.height;
15267
14359
  const x = (this.pos.X + offset.width) / resolution.width + w * 0.5;
15268
14360
  const y = (this.pos.Y + offset.height) / resolution.height + h * 0.5;
15269
- DrawRect(
15270
- x,
15271
- y,
15272
- w,
15273
- h,
15274
- this.color.r,
15275
- this.color.g,
15276
- this.color.b,
15277
- this.color.a
15278
- );
14361
+ DrawRect(x, y, w, h, this.color.r, this.color.g, this.color.b, this.color.a);
15279
14362
  for (const item of this.items) {
15280
- item.draw(
15281
- new Size(this.pos.X + offset.width, this.pos.Y + offset.height),
15282
- resolution
15283
- );
14363
+ item.draw(new Size(this.pos.X + offset.width, this.pos.Y + offset.height), resolution);
15284
14364
  }
15285
14365
  }
15286
14366
  };
15287
14367
 
15288
14368
  // src/fivem/ui/Effects.ts
15289
- var Effects = class {
14369
+ var Effects = class _Effects {
15290
14370
  static {
15291
14371
  __name(this, "Effects");
15292
14372
  }
15293
14373
  static start(effectName, duration = 0, looped = false) {
15294
- StartScreenEffect(this.effectToString(effectName), duration, looped);
14374
+ StartScreenEffect(_Effects.effectToString(effectName), duration, looped);
15295
14375
  }
15296
14376
  static stop(screenEffect) {
15297
14377
  if (typeof screenEffect === "undefined") {
15298
- StopAllScreenEffects();
15299
- } else {
15300
- StopScreenEffect(this.effectToString(screenEffect));
14378
+ return StopAllScreenEffects();
15301
14379
  }
14380
+ StopScreenEffect(_Effects.effectToString(screenEffect));
15302
14381
  }
15303
14382
  static isActive(screenEffect) {
15304
- return GetScreenEffectIsActive(this.effectToString(screenEffect));
14383
+ return GetScreenEffectIsActive(_Effects.effectToString(screenEffect));
15305
14384
  }
15306
14385
  static effects = [
15307
14386
  "SwitchHUDIn",
@@ -15388,8 +14467,8 @@ var Effects = class {
15388
14467
  ];
15389
14468
  static effectToString(screenEffect) {
15390
14469
  const effect = Number(screenEffect);
15391
- if (effect >= 0 && effect <= this.effects.length) {
15392
- return this.effects[effect];
14470
+ if (effect >= 0 && effect <= _Effects.effects.length) {
14471
+ return _Effects.effects[effect];
15393
14472
  }
15394
14473
  return "INVALID";
15395
14474
  }
@@ -15514,23 +14593,12 @@ var Scaleform = class {
15514
14593
  static {
15515
14594
  __name(this, "Scaleform");
15516
14595
  }
15517
- static render2DMasked(scaleform1, scaleform2) {
15518
- return new Promise(async (resolve) => {
15519
- if (scaleform1.IsLoaded && scaleform2.IsLoaded) {
15520
- DrawScaleformMovieFullscreenMasked(
15521
- scaleform1.Handle,
15522
- scaleform2.Handle,
15523
- 255,
15524
- 255,
15525
- 255,
15526
- 255
15527
- );
15528
- } else {
15529
- await scaleform1.load();
15530
- await scaleform2.load();
15531
- }
15532
- resolve();
15533
- });
14596
+ static async render2DMasked(scaleform1, scaleform2) {
14597
+ if (!scaleform1.IsLoaded) await scaleform1.load();
14598
+ if (!scaleform2.IsLoaded) await scaleform2.load();
14599
+ if (scaleform1.IsLoaded && scaleform2.IsLoaded) {
14600
+ DrawScaleformMovieFullscreenMasked(scaleform1.Handle, scaleform2.Handle, 255, 255, 255, 255);
14601
+ }
15534
14602
  }
15535
14603
  handle;
15536
14604
  name;
@@ -15615,15 +14683,7 @@ var Scaleform = class {
15615
14683
  * @param param5
15616
14684
  */
15617
14685
  callStringMethod(name, param1 = "", param2 = "", param3 = "", param4 = "", param5 = "") {
15618
- CallScaleformMovieMethodWithString(
15619
- this.handle,
15620
- name,
15621
- param1,
15622
- param2,
15623
- param3,
15624
- param4,
15625
- param5
15626
- );
14686
+ CallScaleformMovieMethodWithString(this.handle, name, param1, param2, param3, param4, param5);
15627
14687
  }
15628
14688
  /**
15629
14689
  * Calls a number method on the scaleform.
@@ -15636,15 +14696,7 @@ var Scaleform = class {
15636
14696
  * @param param5
15637
14697
  */
15638
14698
  callNumberMethod(name, param1 = -1, param2 = -1, param3 = -1, param4 = -1, param5 = -1) {
15639
- CallScaleformMovieMethodWithNumber(
15640
- this.handle,
15641
- name,
15642
- param1,
15643
- param2,
15644
- param3,
15645
- param4,
15646
- param5
15647
- );
14699
+ CallScaleformMovieMethodWithNumber(this.handle, name, param1, param2, param3, param4, param5);
15648
14700
  }
15649
14701
  /**
15650
14702
  * Calls a number & string method on the scaleform.
@@ -15698,90 +14750,59 @@ var Scaleform = class {
15698
14750
  }
15699
14751
  }, 0);
15700
14752
  }
15701
- render2D() {
15702
- return new Promise(async (resolve) => {
15703
- if (this.IsLoaded) {
15704
- DrawScaleformMovieFullscreen(this.handle, 255, 255, 255, 255, 0);
15705
- } else {
15706
- await this.load();
15707
- }
15708
- resolve();
15709
- });
15710
- }
15711
- render2DScreenSpace(location, size2) {
15712
- return new Promise(async (resolve) => {
15713
- if (this.IsLoaded) {
15714
- const x = location.x;
15715
- const y = location.y;
15716
- const width = size2.x;
15717
- const height = size2.y;
15718
- DrawScaleformMovie(
15719
- this.handle,
15720
- x + width / 2,
15721
- y + height / 2,
15722
- width,
15723
- height,
15724
- 255,
15725
- 255,
15726
- 255,
15727
- 255,
15728
- 0
15729
- );
15730
- } else {
15731
- await this.load();
15732
- }
15733
- resolve();
15734
- });
15735
- }
15736
- render3D(position, rotation, scale) {
15737
- return new Promise(async (resolve) => {
15738
- if (this.IsLoaded) {
15739
- DrawScaleformMovie_3dNonAdditive(
15740
- this.handle,
15741
- position.x,
15742
- position.y,
15743
- position.z,
15744
- rotation.x,
15745
- rotation.y,
15746
- rotation.z,
15747
- 2,
15748
- 2,
15749
- 1,
15750
- scale.x,
15751
- scale.y,
15752
- scale.z,
15753
- 2
15754
- );
15755
- } else {
15756
- await this.load();
15757
- }
15758
- resolve();
15759
- });
14753
+ async render2D() {
14754
+ if (!this.IsLoaded) await this.load();
14755
+ if (!this.IsLoaded) return;
14756
+ DrawScaleformMovieFullscreen(this.handle, 255, 255, 255, 255, 0);
14757
+ }
14758
+ async render2DScreenSpace(location, size2) {
14759
+ if (this.IsLoaded) await this.load();
14760
+ if (!this.IsLoaded) return;
14761
+ const x = location.x;
14762
+ const y = location.y;
14763
+ const width = size2.x;
14764
+ const height = size2.y;
14765
+ DrawScaleformMovie(this.handle, x + width / 2, y + height / 2, width, height, 255, 255, 255, 255, 0);
14766
+ }
14767
+ async render3D(position, rotation, scale) {
14768
+ if (this.IsLoaded) await this.load();
14769
+ if (!this.IsLoaded) return;
14770
+ DrawScaleformMovie_3dNonAdditive(
14771
+ this.handle,
14772
+ position.x,
14773
+ position.y,
14774
+ position.z,
14775
+ rotation.x,
14776
+ rotation.y,
14777
+ rotation.z,
14778
+ 2,
14779
+ 2,
14780
+ 1,
14781
+ scale.x,
14782
+ scale.y,
14783
+ scale.z,
14784
+ 2
14785
+ );
15760
14786
  }
15761
- render3DAdditive(position, rotation, scale) {
15762
- return new Promise(async (resolve) => {
15763
- if (this.IsLoaded) {
15764
- DrawScaleformMovie_3d(
15765
- this.handle,
15766
- position.x,
15767
- position.y,
15768
- position.z,
15769
- rotation.x,
15770
- rotation.y,
15771
- rotation.z,
15772
- 2,
15773
- 2,
15774
- 1,
15775
- scale.x,
15776
- scale.y,
15777
- scale.z,
15778
- 2
15779
- );
15780
- } else {
15781
- await this.load();
15782
- }
15783
- resolve();
15784
- });
14787
+ async render3DAdditive(position, rotation, scale) {
14788
+ if (this.IsLoaded) await this.load();
14789
+ if (!this.IsLoaded) return;
14790
+ DrawScaleformMovie_3d(
14791
+ this.handle,
14792
+ position.x,
14793
+ position.y,
14794
+ position.z,
14795
+ rotation.x,
14796
+ rotation.y,
14797
+ rotation.z,
14798
+ 2,
14799
+ 2,
14800
+ 1,
14801
+ scale.x,
14802
+ scale.y,
14803
+ scale.z,
14804
+ 2
14805
+ );
15785
14806
  }
15786
14807
  load() {
15787
14808
  return new Promise((resolve) => {
@@ -15795,9 +14816,7 @@ var Scaleform = class {
15795
14816
  resolve(true);
15796
14817
  } else if (GetGameTimer() - start > 5e3) {
15797
14818
  clearInterval(interval);
15798
- console.log(
15799
- `^1[fivemjs/client] Could not load scaleform ${this.name}!^7`
15800
- );
14819
+ console.log(`^1[fivemjs/client] Could not load scaleform ${this.name}!^7`);
15801
14820
  resolve(false);
15802
14821
  }
15803
14822
  }, 0);
@@ -15831,9 +14850,7 @@ var InstructionalButtons = class {
15831
14850
  BeginScaleformMovieMethod(this.scaleform.Handle, "SET_DATA_SLOT");
15832
14851
  PushScaleformMovieFunctionParameterInt(index);
15833
14852
  for (let i = button.controls.length - 1; i >= 0; i--) {
15834
- PushScaleformMovieMethodParameterButtonName(
15835
- GetControlInstructionalButton(2, button.controls[i], true)
15836
- );
14853
+ PushScaleformMovieMethodParameterButtonName(GetControlInstructionalButton(2, button.controls[i], true));
15837
14854
  }
15838
14855
  PushScaleformMovieMethodParameterString(button.label);
15839
14856
  EndScaleformMovieMethod();
@@ -15847,7 +14864,7 @@ var InstructionalButtons = class {
15847
14864
  };
15848
14865
 
15849
14866
  // src/fivem/ui/LoadingPrompt.ts
15850
- var LoadingPrompt = class {
14867
+ var LoadingPrompt = class _LoadingPrompt {
15851
14868
  static {
15852
14869
  __name(this, "LoadingPrompt");
15853
14870
  }
@@ -15858,8 +14875,8 @@ var LoadingPrompt = class {
15858
14875
  * @param spinnerType Type of spinner.
15859
14876
  */
15860
14877
  static show(loadingText = "", spinnerType = 5 /* RegularClockwise */) {
15861
- if (this.IsActive) {
15862
- this.hide();
14878
+ if (_LoadingPrompt.IsActive) {
14879
+ _LoadingPrompt.hide();
15863
14880
  }
15864
14881
  if (loadingText === "") {
15865
14882
  BeginTextCommandBusyString("");
@@ -15870,7 +14887,7 @@ var LoadingPrompt = class {
15870
14887
  EndTextCommandBusyString(Number(spinnerType));
15871
14888
  }
15872
14889
  static hide() {
15873
- if (this.IsActive) {
14890
+ if (_LoadingPrompt.IsActive) {
15874
14891
  RemoveLoadingPrompt();
15875
14892
  }
15876
14893
  }
@@ -15919,7 +14936,7 @@ var Screen = class {
15919
14936
  return GetAspectRatio(false);
15920
14937
  }
15921
14938
  static showSubtitle(message, duration = 2500) {
15922
- const strings = String2.stringToArray(message);
14939
+ const strings = _String.stringToArray(message);
15923
14940
  BeginTextCommandPrint("CELL_EMAIL_BCON");
15924
14941
  strings.forEach((element) => {
15925
14942
  AddTextComponentSubstringPlayerName(element);
@@ -15927,7 +14944,7 @@ var Screen = class {
15927
14944
  EndTextCommandPrint(duration, true);
15928
14945
  }
15929
14946
  static displayHelpTextThisFrame(message) {
15930
- const strings = String2.stringToArray(message);
14947
+ const strings = _String.stringToArray(message);
15931
14948
  BeginTextCommandDisplayHelp("CELL_EMAIL_BCON");
15932
14949
  strings.forEach((element) => {
15933
14950
  AddTextComponentSubstringPlayerName(element);
@@ -15935,7 +14952,7 @@ var Screen = class {
15935
14952
  EndTextCommandDisplayHelp(0, false, false, -1);
15936
14953
  }
15937
14954
  static showNotification(message, blinking = false) {
15938
- const strings = String2.stringToArray(message);
14955
+ const strings = _String.stringToArray(message);
15939
14956
  SetNotificationTextEntry("CELL_EMAIL_BCON");
15940
14957
  strings.forEach((element) => {
15941
14958
  AddTextComponentSubstringPlayerName(element);
@@ -15943,7 +14960,7 @@ var Screen = class {
15943
14960
  return new Notification(DrawNotification(blinking, true));
15944
14961
  }
15945
14962
  static showAdvancedNotification(message, title, subtitle, iconSet, icon, bgColor = -1 /* NONE */, flashColor = Color.Transparent, blinking = false, type = 0 /* Default */, showInBrief = true, sound = true) {
15946
- const strings = String2.stringToArray(message);
14963
+ const strings = _String.stringToArray(message);
15947
14964
  SetNotificationTextEntry("CELL_EMAIL_BCON");
15948
14965
  strings.forEach((element) => {
15949
14966
  AddTextComponentSubstringPlayerName(element);
@@ -15952,12 +14969,7 @@ var Screen = class {
15952
14969
  SetNotificationBackgroundColor(Number(bgColor));
15953
14970
  }
15954
14971
  if (flashColor !== Color.Transparent && blinking) {
15955
- SetNotificationFlashColor(
15956
- flashColor.r,
15957
- flashColor.g,
15958
- flashColor.b,
15959
- flashColor.a
15960
- );
14972
+ SetNotificationFlashColor(flashColor.r, flashColor.g, flashColor.b, flashColor.a);
15961
14973
  }
15962
14974
  if (sound) {
15963
14975
  Audio.playSoundFrontEnd("DELETE", "HUD_DEATHMATCH_SOUNDSET");
@@ -15966,15 +14978,8 @@ var Screen = class {
15966
14978
  return new Notification(DrawNotification(blinking, showInBrief));
15967
14979
  }
15968
14980
  static worldToScreen(position, scaleWidth = false) {
15969
- const coords = GetScreenCoordFromWorldCoord(
15970
- position.x,
15971
- position.y,
15972
- position.z
15973
- );
15974
- return new Size(
15975
- coords[1] * (scaleWidth ? this.ScaledWidth : this.Width),
15976
- coords[2] * this.Height
15977
- );
14981
+ const coords = GetScreenCoordFromWorldCoord(position.x, position.y, position.z);
14982
+ return new Size(coords[1] * (scaleWidth ? this.ScaledWidth : this.Width), coords[2] * this.Height);
15978
14983
  }
15979
14984
  };
15980
14985
 
@@ -16037,19 +15042,7 @@ var Sprite = class {
16037
15042
  const h = size2.height / resolution.height;
16038
15043
  const x = pos.X / resolution.width + w * 0.5;
16039
15044
  const y = pos.Y / resolution.height + h * 0.5;
16040
- DrawSprite(
16041
- textureDictionary,
16042
- textureName,
16043
- x,
16044
- y,
16045
- w,
16046
- h,
16047
- heading,
16048
- color.r,
16049
- color.g,
16050
- color.b,
16051
- color.a
16052
- );
15045
+ DrawSprite(textureDictionary, textureName, x, y, w, h, heading, color.r, color.g, color.b, color.a);
16053
15046
  }
16054
15047
  };
16055
15048
 
@@ -16159,18 +15152,7 @@ var Text = class _Text {
16159
15152
  outline = typeof outline === "boolean" ? outline : outline;
16160
15153
  wordWrap = wordWrap || this.wordWrap;
16161
15154
  }
16162
- _Text.draw(
16163
- arg1,
16164
- arg2,
16165
- scale,
16166
- color,
16167
- font,
16168
- alignment,
16169
- dropShadow,
16170
- outline,
16171
- wordWrap,
16172
- resolution
16173
- );
15155
+ _Text.draw(arg1, arg2, scale, color, font, alignment, dropShadow, outline, wordWrap, resolution);
16174
15156
  }
16175
15157
  };
16176
15158
 
@@ -16250,10 +15232,7 @@ var Timerbar = class {
16250
15232
  this.sprite = new Sprite(
16251
15233
  "timerbars",
16252
15234
  "all_black_bg",
16253
- new Point(
16254
- Screen.ScaledWidth * 0.918 - safeZoneX,
16255
- Screen.Height * 0.984 - safeZoneY
16256
- ),
15235
+ new Point(Screen.ScaledWidth * 0.918 - safeZoneX, Screen.Height * 0.984 - safeZoneY),
16257
15236
  new Size(Screen.ScaledWidth * 0.165, Screen.Height * 0.035),
16258
15237
  0,
16259
15238
  new Color(255, 255, 255, 160)
@@ -16361,34 +15340,15 @@ setTick(() => {
16361
15340
  }
16362
15341
  activeTimerBars.forEach((timerbar) => {
16363
15342
  const drawY = 0.984 - loadingPromptOffset - safeZoneY - activeTimerBars.indexOf(timerbar) * 0.038;
16364
- DrawSprite(
16365
- "timerbars",
16366
- "all_black_bg",
16367
- 0.918 - safeZoneX,
16368
- drawY,
16369
- 0.165,
16370
- 0.035,
16371
- 0,
16372
- 255,
16373
- 255,
16374
- 255,
16375
- 160
16376
- );
16377
- drawText(
16378
- timerbar.Title,
16379
- [
16380
- 0.918 - safeZoneX + 0.012,
16381
- drawY - 9e-3 - (timerbar.PlayerStyle ? 625e-5 : 0)
16382
- ],
16383
- {
16384
- align: 2,
16385
- color: timerbar.TextColor,
16386
- font: timerbar.PlayerStyle ? 4 : 0,
16387
- outline: false,
16388
- scale: timerbar.PlayerStyle ? 0.465 : 0.3,
16389
- shadow: timerbar.PlayerStyle
16390
- }
16391
- );
15343
+ DrawSprite("timerbars", "all_black_bg", 0.918 - safeZoneX, drawY, 0.165, 0.035, 0, 255, 255, 255, 160);
15344
+ drawText(timerbar.Title, [0.918 - safeZoneX + 0.012, drawY - 9e-3 - (timerbar.PlayerStyle ? 625e-5 : 0)], {
15345
+ align: 2,
15346
+ color: timerbar.TextColor,
15347
+ font: timerbar.PlayerStyle ? 4 : 0,
15348
+ outline: false,
15349
+ scale: timerbar.PlayerStyle ? 0.465 : 0.3,
15350
+ shadow: timerbar.PlayerStyle
15351
+ });
16392
15352
  if (timerbar.UseProgressBar) {
16393
15353
  const pbarX = 0.918 - safeZoneX + 0.047;
16394
15354
  const pbarY = drawY + 15e-4;
@@ -16490,24 +15450,9 @@ var UIMenuGridPanel = class extends AbstractUIMenuPanel {
16490
15450
  constructor(topText, leftText, rightText, bottomText, circlePosition) {
16491
15451
  super();
16492
15452
  this._setCirclePosition = circlePosition || new Point(0.5, 0.5);
16493
- this.background = new Sprite(
16494
- "commonmenu",
16495
- "gradient_bgd",
16496
- new Point(),
16497
- new Size(431, 275)
16498
- );
16499
- this._grid = new Sprite(
16500
- "pause_menu_pages_char_mom_dad",
16501
- "nose_grid",
16502
- new Point(),
16503
- new Size(200, 200)
16504
- );
16505
- this._circle = new Sprite(
16506
- "mpinventory",
16507
- "in_world_circle",
16508
- new Point(),
16509
- new Size(20, 20)
16510
- );
15453
+ this.background = new Sprite("commonmenu", "gradient_bgd", new Point(), new Size(431, 275));
15454
+ this._grid = new Sprite("pause_menu_pages_char_mom_dad", "nose_grid", new Point(), new Size(200, 200));
15455
+ this._circle = new Sprite("mpinventory", "in_world_circle", new Point(), new Size(20, 20));
16511
15456
  this.TopText = topText ?? "";
16512
15457
  this.LeftText = leftText ?? "";
16513
15458
  this.RightText = rightText ?? "";
@@ -16652,14 +15597,7 @@ var UIMenuGridPanel = class extends AbstractUIMenuPanel {
16652
15597
  _setText(name, value) {
16653
15598
  if (value && value.trim() !== "") {
16654
15599
  if (!this[name]) {
16655
- this[name] = new Text(
16656
- value,
16657
- new Point(),
16658
- 0.35,
16659
- Color.White,
16660
- 0 /* ChaletLondon */,
16661
- 1 /* Centered */
16662
- );
15600
+ this[name] = new Text(value, new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 1 /* Centered */);
16663
15601
  } else {
16664
15602
  this[name].caption = value;
16665
15603
  }
@@ -16716,37 +15654,11 @@ var UIMenuColorPanel = class extends AbstractUIMenuPanel {
16716
15654
  _index = 0;
16717
15655
  constructor(title, colors) {
16718
15656
  super();
16719
- this.background = new Sprite(
16720
- "commonmenu",
16721
- "gradient_bgd",
16722
- new Point(),
16723
- new Size(431, 112)
16724
- );
16725
- this._leftArrow = new Sprite(
16726
- "commonmenu",
16727
- "arrowleft",
16728
- new Point(),
16729
- new Size(30, 30)
16730
- );
16731
- this._rightArrow = new Sprite(
16732
- "commonmenu",
16733
- "arrowright",
16734
- new Point(),
16735
- new Size(30, 30)
16736
- );
16737
- this._selectedRectangle = new Rectangle(
16738
- new Point(),
16739
- new Size(44.5, 8),
16740
- Color.White
16741
- );
16742
- this._text = new Text(
16743
- "",
16744
- new Point(),
16745
- 0.35,
16746
- Color.White,
16747
- 0 /* ChaletLondon */,
16748
- 1 /* Centered */
16749
- );
15657
+ this.background = new Sprite("commonmenu", "gradient_bgd", new Point(), new Size(431, 112));
15658
+ this._leftArrow = new Sprite("commonmenu", "arrowleft", new Point(), new Size(30, 30));
15659
+ this._rightArrow = new Sprite("commonmenu", "arrowright", new Point(), new Size(30, 30));
15660
+ this._selectedRectangle = new Rectangle(new Point(), new Size(44.5, 8), Color.White);
15661
+ this._text = new Text("", new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 1 /* Centered */);
16750
15662
  this.Title = title;
16751
15663
  this.Colors = colors;
16752
15664
  }
@@ -16808,15 +15720,8 @@ var UIMenuColorPanel = class extends AbstractUIMenuPanel {
16808
15720
  const current = this.Color;
16809
15721
  if (!last || last.a !== current.a || last.r !== current.r || last.g !== current.g || last.b !== current.b) {
16810
15722
  this._lastColor = current;
16811
- if (this.ParentMenu)
16812
- this.ParentMenu.panelActivated.emit(
16813
- this.parentItem,
16814
- this,
16815
- this.Index,
16816
- current
16817
- );
16818
- if (this.parentItem)
16819
- this.parentItem.panelActivated.emit(this, this.Index, current);
15723
+ if (this.ParentMenu) this.ParentMenu.panelActivated.emit(this.parentItem, this, this.Index, current);
15724
+ if (this.parentItem) this.parentItem.panelActivated.emit(this, this.Index, current);
16820
15725
  }
16821
15726
  }
16822
15727
  setVerticalPosition(y) {
@@ -16913,19 +15818,13 @@ var UIMenuColorPanel = class extends AbstractUIMenuPanel {
16913
15818
  _processControls() {
16914
15819
  if (Game.isDisabledControlJustPressed(0, 24 /* Attack */)) {
16915
15820
  if (this.ParentMenu) {
16916
- if (this.ParentMenu.isMouseInBounds(
16917
- this._leftArrow.pos,
16918
- this._leftArrow.size
16919
- )) {
15821
+ if (this.ParentMenu.isMouseInBounds(this._leftArrow.pos, this._leftArrow.size)) {
16920
15822
  this._goLeft();
16921
- } else if (this.ParentMenu.isMouseInBounds(
16922
- this._rightArrow.pos,
16923
- this._rightArrow.size
16924
- )) {
15823
+ } else if (this.ParentMenu.isMouseInBounds(this._rightArrow.pos, this._rightArrow.size)) {
16925
15824
  this._goRight();
16926
15825
  }
16927
15826
  this._bar.forEach(async (colorRect, index) => {
16928
- if (this.ParentMenu && this.ParentMenu.isMouseInBounds(colorRect.pos, colorRect.size)) {
15827
+ if (this.ParentMenu?.isMouseInBounds(colorRect.pos, colorRect.size)) {
16929
15828
  this.Index = this._min + index;
16930
15829
  }
16931
15830
  });
@@ -16949,47 +15848,13 @@ var UIMenuPercentagePanel = class extends AbstractUIMenuPanel {
16949
15848
  _backgroundBar;
16950
15849
  constructor(title = "", percentage = 0, minText, maxText) {
16951
15850
  super();
16952
- this.background = new Sprite(
16953
- "commonmenu",
16954
- "gradient_bgd",
16955
- new Point(),
16956
- new Size(431, 76)
16957
- );
15851
+ this.background = new Sprite("commonmenu", "gradient_bgd", new Point(), new Size(431, 76));
16958
15852
  const barSize = new Size(413, 10);
16959
- this._activeBar = new Rectangle(
16960
- new Point(),
16961
- barSize,
16962
- Color.fromRgb(245, 245, 245)
16963
- );
16964
- this._backgroundBar = new Rectangle(
16965
- new Point(),
16966
- { ...barSize },
16967
- Color.fromRgb(87, 87, 87)
16968
- );
16969
- this._title = new Text(
16970
- "",
16971
- new Point(),
16972
- 0.35,
16973
- Color.White,
16974
- 0 /* ChaletLondon */,
16975
- 1 /* Centered */
16976
- );
16977
- this._minText = new Text(
16978
- "",
16979
- new Point(),
16980
- 0.35,
16981
- Color.White,
16982
- 0 /* ChaletLondon */,
16983
- 1 /* Centered */
16984
- );
16985
- this._maxText = new Text(
16986
- "",
16987
- new Point(),
16988
- 0.35,
16989
- Color.White,
16990
- 0 /* ChaletLondon */,
16991
- 1 /* Centered */
16992
- );
15853
+ this._activeBar = new Rectangle(new Point(), barSize, Color.fromRgb(245, 245, 245));
15854
+ this._backgroundBar = new Rectangle(new Point(), { ...barSize }, Color.fromRgb(87, 87, 87));
15855
+ this._title = new Text("", new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 1 /* Centered */);
15856
+ this._minText = new Text("", new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 1 /* Centered */);
15857
+ this._maxText = new Text("", new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 1 /* Centered */);
16993
15858
  this.Title = title;
16994
15859
  this.MinText = minText || "0%";
16995
15860
  this.MaxText = maxText || "100%";
@@ -17063,10 +15928,7 @@ var UIMenuPercentagePanel = class extends AbstractUIMenuPanel {
17063
15928
  _processControls() {
17064
15929
  if (!this._pressed && Game.isDisabledControlJustPressed(0, 24 /* Attack */) && this.ParentMenu?.isMouseInBounds(
17065
15930
  new Point(this._backgroundBar.pos.X, this._backgroundBar.pos.Y - 4),
17066
- new Size(
17067
- this._backgroundBar.size.width,
17068
- this._backgroundBar.size.height + 8
17069
- )
15931
+ new Size(this._backgroundBar.size.width, this._backgroundBar.size.height + 8)
17070
15932
  )) {
17071
15933
  this._pressed = true;
17072
15934
  (async () => {
@@ -17103,11 +15965,7 @@ var UIMenuStatisticsPanel = class extends AbstractUIMenuPanel {
17103
15965
  _items = [];
17104
15966
  constructor(item, divider = true) {
17105
15967
  super();
17106
- this.background = new Rectangle(
17107
- new Point(),
17108
- new Size(431, 47),
17109
- new Color(0, 0, 0, 170)
17110
- );
15968
+ this.background = new Rectangle(new Point(), new Size(431, 47), new Color(0, 0, 0, 170));
17111
15969
  if (item) {
17112
15970
  this.addItem(item);
17113
15971
  }
@@ -17187,24 +16045,11 @@ var UIMenuStatisticsPanelItem = class {
17187
16045
  backgroundBar;
17188
16046
  divider = [];
17189
16047
  constructor(name, percentage = 0) {
17190
- this.text = new Text(
17191
- "",
17192
- new Point(),
17193
- 0.35,
17194
- Color.White,
17195
- 0 /* ChaletLondon */,
17196
- 0 /* Left */
17197
- );
17198
- this.backgroundBar = new Rectangle(
17199
- new Point(),
17200
- new Size(200, 10),
17201
- Color.fromArgb(100, 87, 87, 87)
17202
- );
16048
+ this.text = new Text("", new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 0 /* Left */);
16049
+ this.backgroundBar = new Rectangle(new Point(), new Size(200, 10), Color.fromArgb(100, 87, 87, 87));
17203
16050
  this.activeBar = new Rectangle(new Point(), new Size(0, 10), Color.White);
17204
16051
  for (let i = 1; i <= 4; i++) {
17205
- this.divider.push(
17206
- new Rectangle(new Point(), new Size(2, 10), Color.Black)
17207
- );
16052
+ this.divider.push(new Rectangle(new Point(), new Size(2, 10), Color.Black));
17208
16053
  }
17209
16054
  this.Name = name;
17210
16055
  this.Percentage = percentage;
@@ -17600,19 +16445,8 @@ var UIMenuItem = class _UIMenuItem {
17600
16445
  _event = { event: "", args: [] };
17601
16446
  _panels = [];
17602
16447
  constructor(text, description) {
17603
- this.rectangle = new Rectangle(
17604
- new Point(),
17605
- new Size(431, 38),
17606
- this._backColor
17607
- );
17608
- this.text = new Text(
17609
- "",
17610
- new Point(),
17611
- 0.33,
17612
- this._foreColor,
17613
- 0 /* ChaletLondon */,
17614
- 0 /* Left */
17615
- );
16448
+ this.rectangle = new Rectangle(new Point(), new Size(431, 38), this._backColor);
16449
+ this.text = new Text("", new Point(), 0.33, this._foreColor, 0 /* ChaletLondon */, 0 /* Left */);
17616
16450
  this.selectedSprite = new Sprite(
17617
16451
  "commonmenu",
17618
16452
  "gradient_nav",
@@ -17623,14 +16457,7 @@ var UIMenuItem = class _UIMenuItem {
17623
16457
  );
17624
16458
  this.badgeLeft = new Sprite("", "");
17625
16459
  this.badgeRight = new Sprite("", "");
17626
- this.labelText = new Text(
17627
- "",
17628
- new Point(),
17629
- 0.35,
17630
- this._foreColor,
17631
- 0,
17632
- 2 /* Right */
17633
- );
16460
+ this.labelText = new Text("", new Point(), 0.35, this._foreColor, 0, 2 /* Right */);
17634
16461
  this.Text = text;
17635
16462
  this.Description = description ?? "";
17636
16463
  }
@@ -17790,19 +16617,9 @@ var UIMenuItem = class _UIMenuItem {
17790
16617
  let aggregatePixels = 0;
17791
16618
  let output = "";
17792
16619
  const words = input.split(" ");
17793
- const spaceWidth = String2.measureString(
17794
- " ",
17795
- 0 /* ChaletLondon */,
17796
- 0.33,
17797
- Menu.screenWidth
17798
- );
16620
+ const spaceWidth = _String.measureString(" ", 0 /* ChaletLondon */, 0.33, Menu.screenWidth);
17799
16621
  for (const word of words) {
17800
- const offset = String2.measureString(
17801
- word,
17802
- 0 /* ChaletLondon */,
17803
- 0.33,
17804
- Menu.screenWidth
17805
- );
16622
+ const offset = _String.measureString(word, 0 /* ChaletLondon */, 0.33, Menu.screenWidth);
17806
16623
  aggregatePixels += offset;
17807
16624
  if (aggregatePixels > maxPixelsPerLine) {
17808
16625
  output = `${output}
@@ -18354,12 +17171,7 @@ var UIMenuCheckboxItem = class extends UIMenuItem {
18354
17171
  _checkboxSprite;
18355
17172
  constructor(text, checked = false, description, style = 0 /* Tick */) {
18356
17173
  super(text, description);
18357
- this._checkboxSprite = new Sprite(
18358
- "commonmenu",
18359
- "",
18360
- new Point(410, 95),
18361
- new Size(50, 50)
18362
- );
17174
+ this._checkboxSprite = new Sprite("commonmenu", "", new Point(410, 95), new Size(50, 50));
18363
17175
  this.Checked = checked;
18364
17176
  this.Style = style;
18365
17177
  }
@@ -18423,26 +17235,9 @@ var UIMenuListItem = class extends UIMenuItem {
18423
17235
  _textWidth = 0;
18424
17236
  constructor(text, items, startIndex = 0, description, arrowOnlyOnSelected = true) {
18425
17237
  super(text, description);
18426
- this._leftArrow = new Sprite(
18427
- "commonmenu",
18428
- "arrowleft",
18429
- new Point(),
18430
- new Size(30, 30)
18431
- );
18432
- this._rightArrow = new Sprite(
18433
- "commonmenu",
18434
- "arrowright",
18435
- new Point(),
18436
- new Size(30, 30)
18437
- );
18438
- this._itemText = new Text(
18439
- "",
18440
- new Point(),
18441
- 0.35,
18442
- Color.White,
18443
- 0 /* ChaletLondon */,
18444
- 2 /* Right */
18445
- );
17238
+ this._leftArrow = new Sprite("commonmenu", "arrowleft", new Point(), new Size(30, 30));
17239
+ this._rightArrow = new Sprite("commonmenu", "arrowright", new Point(), new Size(30, 30));
17240
+ this._itemText = new Text("", new Point(), 0.35, Color.White, 0 /* ChaletLondon */, 2 /* Right */);
18446
17241
  this.ArrowOnlyOnSelected = arrowOnlyOnSelected;
18447
17242
  this.Items = items;
18448
17243
  this.Index = startIndex;
@@ -18504,12 +17299,7 @@ var UIMenuListItem = class extends UIMenuItem {
18504
17299
  if (this._textWidth === void 0) {
18505
17300
  const caption = this._getSelectedItemCaption();
18506
17301
  this._itemText.caption = caption;
18507
- this._textWidth = String2.measureString(
18508
- caption,
18509
- this._itemText.font,
18510
- this._itemText.scale,
18511
- Menu.screenWidth
18512
- );
17302
+ this._textWidth = _String.measureString(caption, this._itemText.font, this._itemText.scale, Menu.screenWidth);
18513
17303
  }
18514
17304
  this._rightArrow.pos.X = this.offset.X + (this.parent ? this.parent.WidthOffset : 0) + 400;
18515
17305
  this._itemText.pos.X = this._rightArrow.pos.X + 5;
@@ -18586,33 +17376,11 @@ var UIMenuSliderItem = class extends UIMenuItem {
18586
17376
  _rightSliderBadgeSprite;
18587
17377
  constructor(text, items, startIndex = 0, description, showDivider = false, arrowOnlyOnSelected = false) {
18588
17378
  super(text, description);
18589
- this._background = new Rectangle(
18590
- new Point(),
18591
- new Size(150, 9),
18592
- new Color(4, 32, 57)
18593
- );
18594
- this._slider = new Rectangle(
18595
- new Point(),
18596
- new Size(75, 9),
18597
- new Color(57, 116, 200)
18598
- );
18599
- this._divider = new Rectangle(
18600
- new Point(),
18601
- new Size(2.5, 20),
18602
- Color.WhiteSmoke
18603
- );
18604
- this._leftArrow = new Sprite(
18605
- "commonmenutu",
18606
- "arrowleft",
18607
- new Point(),
18608
- new Size(15, 15)
18609
- );
18610
- this._rightArrow = new Sprite(
18611
- "commonmenutu",
18612
- "arrowright",
18613
- new Point(),
18614
- new Size(15, 15)
18615
- );
17379
+ this._background = new Rectangle(new Point(), new Size(150, 9), new Color(4, 32, 57));
17380
+ this._slider = new Rectangle(new Point(), new Size(75, 9), new Color(57, 116, 200));
17381
+ this._divider = new Rectangle(new Point(), new Size(2.5, 20), Color.WhiteSmoke);
17382
+ this._leftArrow = new Sprite("commonmenutu", "arrowleft", new Point(), new Size(15, 15));
17383
+ this._rightArrow = new Sprite("commonmenutu", "arrowright", new Point(), new Size(15, 15));
18616
17384
  this._leftSliderBadgeSprite = new Sprite("", "");
18617
17385
  this._rightSliderBadgeSprite = new Sprite("", "");
18618
17386
  this.ArrowOnlyOnSelected = arrowOnlyOnSelected;
@@ -18715,34 +17483,22 @@ var UIMenuSliderItem = class extends UIMenuItem {
18715
17483
  this._leftSliderBadgeSprite.pos.X = 0;
18716
17484
  }
18717
17485
  if (this._rightSliderBadge !== 0 /* None */) {
18718
- const widthOffset = UIMenuItem.getBadgeSpriteWidthOffset(
18719
- this._rightSliderBadgeSprite
18720
- );
17486
+ const widthOffset = UIMenuItem.getBadgeSpriteWidthOffset(this._rightSliderBadgeSprite);
18721
17487
  this._background.pos.X -= 40;
18722
17488
  this._rightSliderBadgeSprite.pos.X = 431 + x;
18723
17489
  this._rightSliderBadgeSprite.pos.X -= this._rightSliderBadgeSprite.size.width + widthOffset;
18724
- this._rightSliderBadgeSprite.textureName = this.badgeToTextureName(
18725
- this._rightSliderBadge
18726
- );
18727
- this._rightSliderBadgeSprite.color = this.badgeToColor(
18728
- this._rightSliderBadge
18729
- );
17490
+ this._rightSliderBadgeSprite.textureName = this.badgeToTextureName(this._rightSliderBadge);
17491
+ this._rightSliderBadgeSprite.color = this.badgeToColor(this._rightSliderBadge);
18730
17492
  this._rightSliderBadgeSprite.draw(Menu.screenResolution);
18731
17493
  } else {
18732
17494
  this._background.pos.X -= this._rightArrow.size.width / 2;
18733
17495
  }
18734
17496
  if (this._leftSliderBadge !== 0 /* None */) {
18735
- const widthOffset = UIMenuItem.getBadgeSpriteWidthOffset(
18736
- this._leftSliderBadgeSprite
18737
- );
17497
+ const widthOffset = UIMenuItem.getBadgeSpriteWidthOffset(this._leftSliderBadgeSprite);
18738
17498
  this._leftSliderBadgeSprite.pos.X -= this._leftSliderBadgeSprite.size.width + widthOffset;
18739
17499
  this._leftSliderBadgeSprite.pos.X += this._background.pos.X;
18740
- this._leftSliderBadgeSprite.textureName = this.badgeToTextureName(
18741
- this._leftSliderBadge
18742
- );
18743
- this._leftSliderBadgeSprite.color = this.badgeToColor(
18744
- this._leftSliderBadge
18745
- );
17500
+ this._leftSliderBadgeSprite.textureName = this.badgeToTextureName(this._leftSliderBadge);
17501
+ this._leftSliderBadgeSprite.color = this.badgeToColor(this._leftSliderBadge);
18746
17502
  this._leftSliderBadgeSprite.draw(Menu.screenResolution);
18747
17503
  }
18748
17504
  const sliderXOffset = (this._background.size.width - this._slider.size.width) / (this._items.length - 1) * this.Index;
@@ -18786,10 +17542,7 @@ var Menu = class _Menu {
18786
17542
  static screenAspectRatio = IsDuplicityVersion() ? 0 : Screen.AspectRatio;
18787
17543
  static screenHeight = 1080;
18788
17544
  static screenWidth = _Menu.screenHeight * _Menu.screenAspectRatio;
18789
- static screenResolution = new Size(
18790
- _Menu.screenWidth,
18791
- _Menu.screenHeight
18792
- );
17545
+ static screenResolution = new Size(_Menu.screenWidth, _Menu.screenHeight);
18793
17546
  id = Crypto.uuidv4();
18794
17547
  visible = false;
18795
17548
  parentMenu;
@@ -18839,11 +17592,7 @@ var Menu = class _Menu {
18839
17592
  _background;
18840
17593
  constructor(title, subtitle, offset = new Point(), spriteLibrary = "commonmenu", spriteName = "interaction_bgd") {
18841
17594
  this._offset = offset;
18842
- this._mainMenu = new Container(
18843
- new Point(),
18844
- new Size(700, 500),
18845
- Color.Transparent
18846
- );
17595
+ this._mainMenu = new Container(new Point(), new Size(700, 500), Color.Transparent);
18847
17596
  this._logo = new Sprite(
18848
17597
  spriteLibrary || "",
18849
17598
  spriteName || "",
@@ -18884,36 +17633,18 @@ var Menu = class _Menu {
18884
17633
  0,
18885
17634
  2 /* Right */
18886
17635
  );
18887
- this._upAndDownSprite = new Sprite(
18888
- "commonmenu",
18889
- "shop_arrows_upanddown",
18890
- new Point(),
18891
- new Size(50, 50)
18892
- );
17636
+ this._upAndDownSprite = new Sprite("commonmenu", "shop_arrows_upanddown", new Point(), new Size(50, 50));
18893
17637
  const extraRectanglePos = new Point(this._offset.X);
18894
17638
  const extraRectangleSize = new Size(431, 18);
18895
17639
  const extraRectangleColor = new Color(0, 0, 0, 200);
18896
- this._extraRectangleUp = new Rectangle(
18897
- extraRectanglePos,
18898
- extraRectangleSize,
18899
- extraRectangleColor
18900
- );
17640
+ this._extraRectangleUp = new Rectangle(extraRectanglePos, extraRectangleSize, extraRectangleColor);
18901
17641
  this._extraRectangleDown = new Rectangle(
18902
17642
  { ...extraRectanglePos },
18903
17643
  { ...extraRectangleSize },
18904
17644
  { ...extraRectangleColor }
18905
17645
  );
18906
- this._descriptionBar = new Rectangle(
18907
- new Point(this._offset.X),
18908
- new Size(431, 4),
18909
- Color.Black
18910
- );
18911
- this._descriptionRectangle = new Sprite(
18912
- "commonmenu",
18913
- "gradient_bgd",
18914
- new Point(this._offset.X),
18915
- new Size(431, 30)
18916
- );
17646
+ this._descriptionBar = new Rectangle(new Point(this._offset.X), new Size(431, 4), Color.Black);
17647
+ this._descriptionRectangle = new Sprite("commonmenu", "gradient_bgd", new Point(this._offset.X), new Size(431, 30));
18917
17648
  this._descriptionText = new Text(
18918
17649
  "Description",
18919
17650
  new Point(this._offset.X + 8),
@@ -19035,13 +17766,7 @@ var Menu = class _Menu {
19035
17766
  addNewSubMenu(text, description, inherit = true) {
19036
17767
  let menu;
19037
17768
  if (inherit) {
19038
- menu = new _Menu(
19039
- this._title.caption,
19040
- text,
19041
- this._offset,
19042
- this._logo.TextureDict,
19043
- this._logo.textureName
19044
- );
17769
+ menu = new _Menu(this._title.caption, text, this._offset, this._logo.TextureDict, this._logo.textureName);
19045
17770
  menu.Alignment = this.Alignment;
19046
17771
  menu.WidthOffset = this.WidthOffset;
19047
17772
  menu._settings = this._settings;
@@ -19128,10 +17853,7 @@ var Menu = class _Menu {
19128
17853
  this._recalculateDescriptionPosition();
19129
17854
  }
19130
17855
  open() {
19131
- this._playSoundAndReleaseId(
19132
- this.Settings.audio.back,
19133
- this.Settings.audio.library
19134
- );
17856
+ this._playSoundAndReleaseId(this.Settings.audio.back, this.Settings.audio.library);
19135
17857
  this.visible = true;
19136
17858
  this._justOpened = true;
19137
17859
  if (!this.parentMenu && this.Settings.resetCursorOnOpen) {
@@ -19141,10 +17863,7 @@ var Menu = class _Menu {
19141
17863
  this.menuOpen.emit();
19142
17864
  }
19143
17865
  close() {
19144
- this._playSoundAndReleaseId(
19145
- this.Settings.audio.back,
19146
- this.Settings.audio.library
19147
- );
17866
+ this._playSoundAndReleaseId(this.Settings.audio.back, this.Settings.audio.library);
19148
17867
  this.visible = false;
19149
17868
  this.refreshIndex();
19150
17869
  this.menuClose.emit();
@@ -19156,10 +17875,7 @@ var Menu = class _Menu {
19156
17875
  return;
19157
17876
  }
19158
17877
  item.Index -= 1;
19159
- this._playSoundAndReleaseId(
19160
- this.Settings.audio.leftRight,
19161
- this.Settings.audio.library
19162
- );
17878
+ this._playSoundAndReleaseId(this.Settings.audio.leftRight, this.Settings.audio.library);
19163
17879
  this.listChange.emit(item, item.Index, item.SelectedItem);
19164
17880
  item.listChanged.emit(item.Index, item.SelectedItem);
19165
17881
  } else if (item instanceof UIMenuSliderItem) {
@@ -19167,10 +17883,7 @@ var Menu = class _Menu {
19167
17883
  return;
19168
17884
  }
19169
17885
  item.Index -= 1;
19170
- this._playSoundAndReleaseId(
19171
- this.Settings.audio.leftRight,
19172
- this.Settings.audio.library
19173
- );
17886
+ this._playSoundAndReleaseId(this.Settings.audio.leftRight, this.Settings.audio.library);
19174
17887
  this.sliderChange.emit(item, item.Index, item.indexToItem(item.Index));
19175
17888
  item.sliderChanged.emit(item.Index, item.indexToItem(item.Index));
19176
17889
  }
@@ -19182,18 +17895,12 @@ var Menu = class _Menu {
19182
17895
  return;
19183
17896
  }
19184
17897
  item.Index += 1;
19185
- this._playSoundAndReleaseId(
19186
- this.Settings.audio.leftRight,
19187
- this.Settings.audio.library
19188
- );
17898
+ this._playSoundAndReleaseId(this.Settings.audio.leftRight, this.Settings.audio.library);
19189
17899
  this.listChange.emit(item, item.Index, item.SelectedItem);
19190
17900
  item.listChanged.emit(item.Index, item.SelectedItem);
19191
17901
  } else if (item instanceof UIMenuSliderItem) {
19192
17902
  item.Index += 1;
19193
- this._playSoundAndReleaseId(
19194
- this.Settings.audio.leftRight,
19195
- this.Settings.audio.library
19196
- );
17903
+ this._playSoundAndReleaseId(this.Settings.audio.leftRight, this.Settings.audio.library);
19197
17904
  this.sliderChange.emit(item, item.Index, item.indexToItem(item.Index));
19198
17905
  item.sliderChanged.emit(item.Index, item.indexToItem(item.Index));
19199
17906
  }
@@ -19201,16 +17908,10 @@ var Menu = class _Menu {
19201
17908
  selectItem() {
19202
17909
  const item = this.CurrentItem;
19203
17910
  if (!item.enabled) {
19204
- this._playSoundAndReleaseId(
19205
- this.Settings.audio.error,
19206
- this.Settings.audio.library
19207
- );
17911
+ this._playSoundAndReleaseId(this.Settings.audio.error, this.Settings.audio.library);
19208
17912
  return;
19209
17913
  }
19210
- this._playSoundAndReleaseId(
19211
- this.Settings.audio.select,
19212
- this.Settings.audio.library
19213
- );
17914
+ this._playSoundAndReleaseId(this.Settings.audio.select, this.Settings.audio.library);
19214
17915
  if (item instanceof UIMenuCheckboxItem) {
19215
17916
  item.Checked = !item.Checked;
19216
17917
  this.checkboxChange.emit(item, item.Checked);
@@ -19275,10 +17976,7 @@ var Menu = class _Menu {
19275
17976
  this.goUp();
19276
17977
  } else {
19277
17978
  this.CurrentItem.selected = true;
19278
- this._playSoundAndReleaseId(
19279
- this.Settings.audio.upDown,
19280
- this.Settings.audio.library
19281
- );
17979
+ this._playSoundAndReleaseId(this.Settings.audio.upDown, this.Settings.audio.library);
19282
17980
  this.indexChange.emit(this.CurrentSelection);
19283
17981
  }
19284
17982
  }
@@ -19305,18 +18003,12 @@ var Menu = class _Menu {
19305
18003
  this.goDown();
19306
18004
  } else {
19307
18005
  this.CurrentItem.selected = true;
19308
- this._playSoundAndReleaseId(
19309
- this.Settings.audio.upDown,
19310
- this.Settings.audio.library
19311
- );
18006
+ this._playSoundAndReleaseId(this.Settings.audio.upDown, this.Settings.audio.library);
19312
18007
  this.indexChange.emit(this.CurrentSelection);
19313
18008
  }
19314
18009
  }
19315
18010
  goBack() {
19316
- this._playSoundAndReleaseId(
19317
- this.Settings.audio.back,
19318
- this.Settings.audio.library
19319
- );
18011
+ this._playSoundAndReleaseId(this.Settings.audio.back, this.Settings.audio.library);
19320
18012
  this.visible = false;
19321
18013
  if (this.parentMenu != null) {
19322
18014
  this.parentMenu.visible = true;
@@ -19336,18 +18028,10 @@ var Menu = class _Menu {
19336
18028
  }
19337
18029
  Hud.showCursorThisFrame();
19338
18030
  if (this.Settings.mouseEdgeEnabled) {
19339
- if (this.isMouseInBounds(
19340
- new Point(),
19341
- new Size(30, _Menu.screenHeight),
19342
- false
19343
- )) {
18031
+ if (this.isMouseInBounds(new Point(), new Size(30, _Menu.screenHeight), false)) {
19344
18032
  GameplayCamera.RelativeHeading += 1;
19345
18033
  Hud.CursorSprite = 6 /* LeftArrow */;
19346
- } else if (this.isMouseInBounds(
19347
- new Point(_Menu.screenWidth - 30),
19348
- new Size(30, _Menu.screenHeight),
19349
- false
19350
- )) {
18034
+ } else if (this.isMouseInBounds(new Point(_Menu.screenWidth - 30), new Size(30, _Menu.screenHeight), false)) {
19351
18035
  GameplayCamera.RelativeHeading -= 1;
19352
18036
  Hud.CursorSprite = 7 /* RightArrow */;
19353
18037
  } else {
@@ -19357,7 +18041,8 @@ var Menu = class _Menu {
19357
18041
  if (this._mousePressed) {
19358
18042
  return;
19359
18043
  }
19360
- let hoveredItem, hoveredItemIndex;
18044
+ let hoveredItem;
18045
+ let hoveredItemIndex = 0;
19361
18046
  const limit = this.items.length > this._maxItemsOnScreen + 1 ? this._maxItem : this.items.length - 1;
19362
18047
  for (let i = this._minItem; i <= limit; i++) {
19363
18048
  const item = this.items[i];
@@ -19389,17 +18074,11 @@ var Menu = class _Menu {
19389
18074
  this.selectItem();
19390
18075
  }
19391
18076
  } else {
19392
- this._playSoundAndReleaseId(
19393
- this.Settings.audio.error,
19394
- this.Settings.audio.library
19395
- );
18077
+ this._playSoundAndReleaseId(this.Settings.audio.error, this.Settings.audio.library);
19396
18078
  }
19397
18079
  } else {
19398
- this._playSoundAndReleaseId(
19399
- this.Settings.audio.error,
19400
- this.Settings.audio.library
19401
- );
19402
- this.CurrentSelection = hoveredItemIndex ?? 0;
18080
+ this._playSoundAndReleaseId(this.Settings.audio.error, this.Settings.audio.library);
18081
+ this.CurrentSelection = hoveredItemIndex;
19403
18082
  this.indexChange.emit(this.CurrentSelection);
19404
18083
  }
19405
18084
  await Wait(this._navigationDelay);
@@ -19414,17 +18093,11 @@ var Menu = class _Menu {
19414
18093
  }
19415
18094
  }
19416
18095
  } else {
19417
- this._playSoundAndReleaseId(
19418
- this.Settings.audio.error,
19419
- this.Settings.audio.library
19420
- );
18096
+ this._playSoundAndReleaseId(this.Settings.audio.error, this.Settings.audio.library);
19421
18097
  }
19422
18098
  } else {
19423
- this._playSoundAndReleaseId(
19424
- this.Settings.audio.error,
19425
- this.Settings.audio.library
19426
- );
19427
- this.CurrentSelection = hoveredItemIndex ?? 0;
18099
+ this._playSoundAndReleaseId(this.Settings.audio.error, this.Settings.audio.library);
18100
+ this.CurrentSelection = hoveredItemIndex;
19428
18101
  this.indexChange.emit(this.CurrentSelection);
19429
18102
  }
19430
18103
  await Wait(125);
@@ -19435,10 +18108,7 @@ var Menu = class _Menu {
19435
18108
  if (this.items.length <= this._maxItemsOnScreen + 1 || this._mousePressed) {
19436
18109
  return;
19437
18110
  }
19438
- if (this.isMouseInBounds(
19439
- this._extraRectangleUp.pos,
19440
- this._extraRectangleUp.size
19441
- )) {
18111
+ if (this.isMouseInBounds(this._extraRectangleUp.pos, this._extraRectangleUp.size)) {
19442
18112
  this._extraRectangleUp.color = Color.fromRgb(30, 30, 30);
19443
18113
  if (Game.isDisabledControlJustPressed(0, 24 /* Attack */)) {
19444
18114
  (async () => {
@@ -19458,10 +18128,7 @@ var Menu = class _Menu {
19458
18128
  if (this._mousePressed) {
19459
18129
  return;
19460
18130
  }
19461
- if (this.isMouseInBounds(
19462
- this._extraRectangleDown.pos,
19463
- this._extraRectangleDown.size
19464
- )) {
18131
+ if (this.isMouseInBounds(this._extraRectangleDown.pos, this._extraRectangleDown.size)) {
19465
18132
  this._extraRectangleDown.color = Color.fromRgb(30, 30, 30);
19466
18133
  if (Game.isDisabledControlJustPressed(0, 24 /* Attack */)) {
19467
18134
  (async () => {
@@ -19607,22 +18274,18 @@ var Menu = class _Menu {
19607
18274
  this._background.draw(_Menu.screenResolution);
19608
18275
  if (this.items.length > 0) {
19609
18276
  let hasDescription = false;
19610
- if (this.CurrentItem.Description && this.CurrentItem.Description !== "")
19611
- hasDescription = true;
18277
+ if (this.CurrentItem.Description && this.CurrentItem.Description !== "") hasDescription = true;
19612
18278
  this.CurrentItem.selected = true;
19613
18279
  if (hasDescription) {
19614
18280
  this._recalculateDescriptionPosition();
19615
18281
  this._descriptionText.caption = this.CurrentItem.FormattedDescription;
19616
18282
  const numLines = this._descriptionText.caption.split("\n").length;
19617
- this._descriptionRectangle.size = new Size(
19618
- 431 + this._widthOffset,
19619
- numLines * 25 + 15
19620
- );
18283
+ this._descriptionRectangle.size = new Size(431 + this._widthOffset, numLines * 25 + 15);
19621
18284
  this._descriptionBar.draw(void 0, _Menu.screenResolution);
19622
18285
  this._descriptionRectangle.draw(_Menu.screenResolution);
19623
18286
  this._descriptionText.draw(void 0, _Menu.screenResolution);
19624
18287
  }
19625
- if (this.CurrentItem.Panels && this.CurrentItem.Panels.length) {
18288
+ if (this.CurrentItem.Panels?.length) {
19626
18289
  let offset = this._calculatePanelPosition(hasDescription);
19627
18290
  for (let i = 0; i < this.CurrentItem.Panels.length; i++) {
19628
18291
  if (i > 0) {
@@ -19720,12 +18383,7 @@ var MenuSettings = class {
19720
18383
  error: "ERROR"
19721
18384
  };
19722
18385
  enabledControls = {
19723
- [2 /* GamePad */]: [
19724
- 2 /* LookUpDown */,
19725
- 1 /* LookLeftRight */,
19726
- 25 /* Aim */,
19727
- 24 /* Attack */
19728
- ],
18386
+ [2 /* GamePad */]: [2 /* LookUpDown */, 1 /* LookLeftRight */, 25 /* Aim */, 24 /* Attack */],
19729
18387
  [0 /* MouseAndKeyboard */]: [
19730
18388
  201 /* FrontendAccept */,
19731
18389
  195 /* FrontendAxisX */,
@@ -20068,7 +18726,6 @@ export {
20068
18726
  Size,
20069
18727
  SpeechModifier,
20070
18728
  Sprite,
20071
- String2 as String,
20072
18729
  SynchronousRaycastResult,
20073
18730
  TaskSequence,
20074
18731
  Tasks,
@@ -20130,6 +18787,7 @@ export {
20130
18787
  WeatherTypeHash,
20131
18788
  World,
20132
18789
  ZoneID,
18790
+ _String,
20133
18791
  enumValues,
20134
18792
  getStringFromUInt8Array,
20135
18793
  getUInt32FromUint8Array