@nativewrappers/fivem 0.0.42 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{client/Audio.d.ts → Audio.d.ts} +3 -3
- package/{client/Audio.js → Audio.js} +44 -43
- package/{client/Blip.d.ts → Blip.d.ts} +3 -3
- package/{client/Blip.js → Blip.js} +4 -3
- package/{client/Camera.d.ts → Camera.d.ts} +4 -4
- package/{client/Camera.js → Camera.js} +18 -17
- package/{client/Checkpoint.d.ts → Checkpoint.d.ts} +2 -2
- package/{client/Checkpoint.js → Checkpoint.js} +7 -6
- package/{client/Events.js → Events.js} +23 -23
- package/{client/Game.d.ts → Game.d.ts} +4 -3
- package/{client/Game.js → Game.js} +16 -10
- package/{client/GameplayCamera.d.ts → GameplayCamera.d.ts} +2 -2
- package/{client/GameplayCamera.js → GameplayCamera.js} +2 -2
- package/{client/Model.d.ts → Model.d.ts} +4 -2
- package/{client/Model.js → Model.js} +19 -5
- package/{client/NetworkedScene.d.ts → NetworkedScene.d.ts} +2 -2
- package/{client/NetworkedScene.js → NetworkedScene.js} +1 -0
- package/{client/ParticleEffect.d.ts → ParticleEffect.d.ts} +3 -3
- package/{client/ParticleEffect.js → ParticleEffect.js} +11 -8
- package/{client/ParticleEffectAsset.d.ts → ParticleEffectAsset.d.ts} +3 -3
- package/{client/ParticleEffectAsset.js → ParticleEffectAsset.js} +4 -3
- package/{client/Pickup.d.ts → Pickup.d.ts} +1 -1
- package/{client/Pickup.js → Pickup.js} +2 -1
- package/{client/Raycast.d.ts → Raycast.d.ts} +3 -3
- package/{client/Raycast.js → Raycast.js} +10 -3
- package/{client/RelationshipGroup.d.ts → RelationshipGroup.d.ts} +1 -1
- package/{client/RelationshipGroup.js → RelationshipGroup.js} +4 -0
- package/{client/Rope.d.ts → Rope.d.ts} +2 -2
- package/{client/Rope.js → Rope.js} +6 -2
- package/{client/TaskSequence.d.ts → TaskSequence.d.ts} +1 -1
- package/{client/TaskSequence.js → TaskSequence.js} +5 -2
- package/{client/Tasks.d.ts → Tasks.d.ts} +5 -5
- package/{client/Tasks.js → Tasks.js} +7 -6
- package/{client/World.d.ts → World.d.ts} +20 -12
- package/{client/World.js → World.js} +66 -62
- package/{client/cfx → cfx}/index.d.ts +1 -1
- package/{client/enums → enums}/RaycastEnums.js +3 -1
- package/enums/index.d.ts +42 -0
- package/enums/index.js +42 -0
- package/hashes/index.d.ts +5 -0
- package/hashes/index.js +5 -0
- package/index.d.ts +24 -0
- package/index.js +25 -0
- package/{client/interfaces → interfaces}/Dimensions.d.ts +1 -1
- package/{client/models → models}/BaseEntity.d.ts +26 -26
- package/{client/models → models}/BaseEntity.js +32 -30
- package/{client/models → models}/EntityBone.d.ts +2 -2
- package/{client/models → models}/EntityBone.js +4 -2
- package/{client/models → models}/EntityBoneCollection.d.ts +2 -2
- package/{client/models → models}/EntityBoneCollection.js +5 -2
- package/{client/models → models}/Ped.d.ts +20 -9
- package/{client/models → models}/Ped.js +66 -56
- package/{client/models → models}/PedBone.d.ts +2 -2
- package/{client/models → models}/PedBone.js +1 -1
- package/{client/models → models}/PedBoneCollection.d.ts +1 -1
- package/{client/models → models}/PedBoneCollection.js +4 -2
- package/{client/models → models}/Player.d.ts +3 -3
- package/{client/models → models}/Player.js +12 -9
- package/{client/models → models}/Prop.d.ts +2 -2
- package/{client/models → models}/Prop.js +4 -4
- package/{client/models → models}/Vehicle.d.ts +6 -6
- package/{client/models → models}/Vehicle.js +22 -16
- package/{client/models → models}/VehicleDoor.d.ts +2 -2
- package/{client/models → models}/VehicleDoor.js +2 -0
- package/{client/models → models}/VehicleDoorCollection.d.ts +3 -3
- package/{client/models → models}/VehicleDoorCollection.js +16 -15
- package/{client/models → models}/VehicleMod.d.ts +2 -2
- package/{client/models → models}/VehicleMod.js +2 -0
- package/{client/models → models}/VehicleModCollection.d.ts +5 -5
- package/{client/models → models}/VehicleModCollection.js +20 -19
- package/{client/models → models}/VehicleToggleMod.d.ts +2 -2
- package/{client/models → models}/VehicleToggleMod.js +2 -0
- package/{client/models → models}/VehicleWheel.d.ts +1 -1
- package/{client/models → models}/VehicleWheel.js +2 -0
- package/{client/models → models}/VehicleWheelCollection.d.ts +3 -3
- package/{client/models → models}/VehicleWheelCollection.js +15 -14
- package/{client/models → models}/VehicleWindow.d.ts +2 -2
- package/{client/models → models}/VehicleWindow.js +2 -0
- package/{client/models → models}/VehicleWindowCollection.d.ts +3 -3
- package/{client/models → models}/VehicleWindowCollection.js +13 -12
- package/models/index.d.ts +18 -0
- package/models/index.js +19 -0
- package/package.json +6 -30
- package/{client/ui → ui}/Container.d.ts +2 -2
- package/{client/ui → ui}/Container.js +6 -3
- package/{client/ui → ui}/Effects.d.ts +1 -1
- package/ui/Effects.js +106 -0
- package/{client/ui → ui}/Fading.js +2 -2
- package/{client/ui → ui}/Hud.d.ts +2 -2
- package/{client/ui → ui}/Hud.js +1 -1
- package/{client/ui → ui}/InstructionalButtons.d.ts +1 -1
- package/{client/ui → ui}/InstructionalButtons.js +8 -7
- package/{client/ui → ui}/LoadingPrompt.d.ts +1 -1
- package/{client/ui → ui}/LoadingPrompt.js +5 -5
- package/{client/ui → ui}/Notification.js +1 -0
- package/{client/ui → ui}/Rectangle.d.ts +2 -2
- package/{client/ui → ui}/Rectangle.js +5 -2
- package/{client/ui → ui}/Scaleform.d.ts +1 -1
- package/{client/ui → ui}/Scaleform.js +10 -8
- package/{client/ui → ui}/Screen.d.ts +3 -3
- package/{client/ui → ui}/Screen.js +13 -13
- package/{client/ui → ui}/Sprite.d.ts +1 -1
- package/{client/ui → ui}/Sprite.js +10 -3
- package/{client/ui → ui}/Text.d.ts +3 -3
- package/{client/ui → ui}/Text.js +19 -7
- package/{client/ui → ui}/Timerbar.d.ts +1 -1
- package/{client/ui → ui}/Timerbar.js +37 -30
- package/ui/index.d.ts +15 -0
- package/ui/index.js +15 -0
- package/{client/ui → ui}/interfaces/IButton.d.ts +1 -1
- package/{client/ui → ui}/interfaces/IDrawable.d.ts +1 -1
- package/ui/interfaces/index.d.ts +2 -0
- package/{client/ui → ui}/menu/Menu.d.ts +4 -4
- package/{client/ui → ui}/menu/Menu.js +96 -67
- package/{client/ui → ui}/menu/MenuControl.js +1 -0
- package/{client/ui → ui}/menu/MenuControls.d.ts +1 -1
- package/ui/menu/MenuControls.js +9 -0
- package/{client/ui → ui}/menu/MenuSettings.d.ts +1 -1
- package/ui/menu/MenuSettings.js +54 -0
- package/ui/menu/index.d.ts +6 -0
- package/ui/menu/index.js +6 -0
- package/{client/ui → ui}/menu/items/UIMenuCheckboxItem.d.ts +3 -3
- package/{client/ui → ui}/menu/items/UIMenuCheckboxItem.js +17 -15
- package/{client/ui → ui}/menu/items/UIMenuItem.d.ts +4 -4
- package/{client/ui → ui}/menu/items/UIMenuItem.js +276 -255
- package/{client/ui → ui}/menu/items/UIMenuListItem.d.ts +3 -3
- package/{client/ui → ui}/menu/items/UIMenuListItem.js +28 -19
- package/{client/ui → ui}/menu/items/UIMenuSeparatorItem.d.ts +1 -1
- package/{client/ui → ui}/menu/items/UIMenuSeparatorItem.js +10 -10
- package/{client/ui → ui}/menu/items/UIMenuSliderItem.d.ts +3 -3
- package/{client/ui → ui}/menu/items/UIMenuSliderItem.js +45 -27
- package/ui/menu/items/index.d.ts +6 -0
- package/ui/menu/items/index.js +6 -0
- package/{client/ui → ui}/menu/items/panels/AbstractUIMenuPanel.d.ts +3 -3
- package/{client/ui → ui}/menu/items/panels/AbstractUIMenuPanel.js +9 -8
- package/{client/ui → ui}/menu/items/panels/UIMenuColorPanel.d.ts +3 -3
- package/{client/ui → ui}/menu/items/panels/UIMenuColorPanel.js +29 -23
- package/{client/ui → ui}/menu/items/panels/UIMenuGridPanel.d.ts +3 -3
- package/{client/ui → ui}/menu/items/panels/UIMenuGridPanel.js +86 -40
- package/{client/ui → ui}/menu/items/panels/UIMenuPercentagePanel.d.ts +2 -2
- package/{client/ui → ui}/menu/items/panels/UIMenuPercentagePanel.js +27 -18
- package/{client/ui → ui}/menu/items/panels/UIMenuStatisticsPanel.d.ts +2 -2
- package/{client/ui → ui}/menu/items/panels/UIMenuStatisticsPanel.js +10 -8
- package/{client/ui → ui}/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +1 -1
- package/{client/ui → ui}/menu/items/panels/UIMenuStatisticsPanelItem.js +10 -7
- package/ui/menu/items/panels/index.d.ts +6 -0
- package/ui/menu/items/panels/index.js +6 -0
- package/{client/ui → ui}/menu/modules/ListItem.js +4 -2
- package/ui/menu/modules/index.d.ts +1 -0
- package/ui/menu/modules/index.js +1 -0
- package/{client/utils → utils}/Animations.js +2 -2
- package/{client/utils → utils}/Crypto.js +5 -5
- package/{client/utils → utils}/LiteEvent.js +3 -5
- package/{client/utils → utils}/Point.js +5 -3
- package/{common/utils → utils}/PointF.js +3 -0
- package/{client/utils → utils}/Quaternion.d.ts +1 -1
- package/{client/utils → utils}/Quaternion.js +5 -1
- package/{client/utils → utils}/Size.js +2 -0
- package/{client/utils → utils}/String.d.ts +1 -1
- package/{client/utils → utils}/String.js +3 -3
- package/{client/utils → utils}/enumValues.js +2 -2
- package/{client/utils → utils}/getStringFromUInt8Array.js +1 -1
- package/utils/index.d.ts +9 -0
- package/utils/index.js +9 -0
- package/{client/weapon → weapon}/DlcWeaponData.d.ts +1 -1
- package/{client/weapon → weapon}/DlcWeaponData.js +3 -3
- package/{client/weapon → weapon}/Weapon.d.ts +10 -10
- package/{client/weapon → weapon}/Weapon.js +17 -14
- package/{client/weapon → weapon}/WeaponAsset.d.ts +1 -1
- package/{client/weapon → weapon}/WeaponAsset.js +4 -3
- package/{client/weapon → weapon}/WeaponCollection.d.ts +3 -3
- package/{client/weapon → weapon}/WeaponCollection.js +4 -3
- package/{client/weapon → weapon}/WeaponDisplayNameByHash.d.ts +1 -1
- package/weapon/WeaponDisplayNameByHash.js +75 -0
- package/{client/weapon → weapon}/WeaponHudStats.d.ts +1 -1
- package/{client/weapon → weapon}/WeaponHudStats.js +4 -4
- package/weapon/index.d.ts +8 -0
- package/weapon/index.js +8 -0
- package/{client/weaponComponent → weaponComponent}/ComponentAttachmentPointByHash.d.ts +2 -2
- package/{client/weaponComponent → weaponComponent}/ComponentAttachmentPointByHash.js +355 -91
- package/{client/weaponComponent → weaponComponent}/ComponentDisplayNameByHash.d.ts +1 -1
- package/weaponComponent/ComponentDisplayNameByHash.js +280 -0
- package/{client/weaponComponent → weaponComponent}/DlcWeaponComponentData.d.ts +1 -1
- package/{client/weaponComponent → weaponComponent}/DlcWeaponComponentData.js +2 -2
- package/{client/weaponComponent → weaponComponent}/InvalidWeaponComponent.d.ts +4 -4
- package/{client/weaponComponent → weaponComponent}/InvalidWeaponComponent.js +5 -5
- package/{client/weaponComponent → weaponComponent}/WeaponComponent.d.ts +6 -6
- package/{client/weaponComponent → weaponComponent}/WeaponComponent.js +15 -11
- package/{client/weaponComponent → weaponComponent}/WeaponComponentCollection.d.ts +4 -4
- package/{client/weaponComponent → weaponComponent}/WeaponComponentCollection.js +13 -11
- package/{client/weaponComponent → weaponComponent}/WeaponComponentHashesByWeaponHash.d.ts +2 -2
- package/{client/weaponComponent → weaponComponent}/WeaponComponentHashesByWeaponHash.js +13 -7
- package/{client/weaponComponent → weaponComponent}/WeaponComponentHudStats.d.ts +1 -1
- package/{client/weaponComponent → weaponComponent}/WeaponComponentHudStats.js +4 -4
- package/weaponComponent/index.d.ts +5 -0
- package/weaponComponent/index.js +5 -0
- package/README.md +0 -41
- package/client/enums/index.d.ts +0 -42
- package/client/enums/index.js +0 -42
- package/client/hashes/index.d.ts +0 -5
- package/client/hashes/index.js +0 -5
- package/client/index.d.ts +0 -24
- package/client/index.js +0 -25
- package/client/models/index.d.ts +0 -18
- package/client/models/index.js +0 -19
- package/client/ui/Effects.js +0 -106
- package/client/ui/index.d.ts +0 -15
- package/client/ui/index.js +0 -15
- package/client/ui/interfaces/index.d.ts +0 -2
- package/client/ui/menu/MenuControls.js +0 -11
- package/client/ui/menu/MenuSettings.js +0 -51
- package/client/ui/menu/index.d.ts +0 -6
- package/client/ui/menu/index.js +0 -6
- package/client/ui/menu/items/index.d.ts +0 -6
- package/client/ui/menu/items/index.js +0 -6
- package/client/ui/menu/items/panels/index.d.ts +0 -6
- package/client/ui/menu/items/panels/index.js +0 -6
- package/client/ui/menu/modules/index.d.ts +0 -1
- package/client/ui/menu/modules/index.js +0 -1
- package/client/utils/PointF.js +0 -11
- package/client/utils/index.d.ts +0 -9
- package/client/utils/index.js +0 -9
- package/client/weapon/WeaponDisplayNameByHash.js +0 -75
- package/client/weapon/index.d.ts +0 -8
- package/client/weapon/index.js +0 -8
- package/client/weaponComponent/ComponentDisplayNameByHash.js +0 -280
- package/client/weaponComponent/index.d.ts +0 -5
- package/client/weaponComponent/index.js +0 -5
- package/common/Convar.d.ts +0 -8
- package/common/Convar.js +0 -20
- package/common/Kvp.d.ts +0 -91
- package/common/Kvp.js +0 -161
- package/common/Resource.d.ts +0 -14
- package/common/Resource.js +0 -35
- package/common/index.d.ts +0 -5
- package/common/index.js +0 -5
- package/common/types.d.ts +0 -5
- package/common/types.js +0 -1
- package/common/utils/ClassTypes.d.ts +0 -11
- package/common/utils/ClassTypes.js +0 -12
- package/common/utils/Color.d.ts +0 -14
- package/common/utils/Color.js +0 -21
- package/common/utils/Maths.d.ts +0 -4
- package/common/utils/Maths.js +0 -10
- package/common/utils/PointF.d.ts +0 -12
- package/common/utils/Quaternion.d.ts +0 -10
- package/common/utils/Quaternion.js +0 -23
- package/common/utils/Vector.d.ts +0 -390
- package/common/utils/Vector.js +0 -546
- package/common/utils/Vector2.d.ts +0 -1
- package/common/utils/Vector2.js +0 -1
- package/common/utils/Vector3.d.ts +0 -1
- package/common/utils/Vector3.js +0 -1
- package/common/utils/Vector4.d.ts +0 -1
- package/common/utils/Vector4.js +0 -1
- package/common/utils/cleanPlayerName.d.ts +0 -6
- package/common/utils/cleanPlayerName.js +0 -27
- package/common/utils/enumValues.d.ts +0 -12
- package/common/utils/enumValues.js +0 -14
- package/common/utils/getStringFromUInt8Array.d.ts +0 -8
- package/common/utils/getStringFromUInt8Array.js +0 -10
- package/common/utils/getUInt32FromUint8Array.d.ts +0 -8
- package/common/utils/getUInt32FromUint8Array.js +0 -8
- package/common/utils/index.d.ts +0 -12
- package/common/utils/index.js +0 -12
- package/server/Events.d.ts +0 -16
- package/server/Events.js +0 -79
- package/server/Game.d.ts +0 -25
- package/server/Game.js +0 -55
- package/server/cfx/StateBagChangeHandler.d.ts +0 -3
- package/server/cfx/StateBagChangeHandler.js +0 -1
- package/server/cfx/index.d.ts +0 -6
- package/server/cfx/index.js +0 -1
- package/server/entities/BaseEntity.d.ts +0 -47
- package/server/entities/BaseEntity.js +0 -109
- package/server/entities/Entity.d.ts +0 -6
- package/server/entities/Entity.js +0 -12
- package/server/entities/Ped.d.ts +0 -32
- package/server/entities/Ped.js +0 -81
- package/server/entities/Player.d.ts +0 -63
- package/server/entities/Player.js +0 -135
- package/server/entities/Prop.d.ts +0 -14
- package/server/entities/Prop.js +0 -32
- package/server/entities/Vehicle.d.ts +0 -67
- package/server/entities/Vehicle.js +0 -175
- package/server/entities/index.d.ts +0 -5
- package/server/entities/index.js +0 -5
- package/server/enum/PopulationType.d.ts +0 -13
- package/server/enum/PopulationType.js +0 -14
- package/server/enum/VehicleLockStatus.d.ts +0 -9
- package/server/enum/VehicleLockStatus.js +0 -10
- package/server/enum/VehicleType.d.ts +0 -10
- package/server/enum/VehicleType.js +0 -11
- package/server/enum/eEntityType.d.ts +0 -5
- package/server/enum/eEntityType.js +0 -6
- package/server/enum/index.d.ts +0 -4
- package/server/enum/index.js +0 -4
- package/server/index.d.ts +0 -7
- package/server/index.js +0 -7
- package/server/type/Anticheat.d.ts +0 -153
- package/server/type/Anticheat.js +0 -1
- package/server/type/Hash.d.ts +0 -1
- package/server/type/Hash.js +0 -1
- package/server/utils/index.d.ts +0 -1
- package/server/utils/index.js +0 -1
- /package/{client/Events.d.ts → Events.d.ts} +0 -0
- /package/{client/cfx → cfx}/StateBagChangeHandler.d.ts +0 -0
- /package/{client/cfx → cfx}/StateBagChangeHandler.js +0 -0
- /package/{client/cfx → cfx}/index.js +0 -0
- /package/{client/enums → enums}/Alignment.d.ts +0 -0
- /package/{client/enums → enums}/Alignment.js +0 -0
- /package/{client/enums → enums}/AnimationFlags.d.ts +0 -0
- /package/{client/enums → enums}/AnimationFlags.js +0 -0
- /package/{client/enums → enums}/AudioFlag.d.ts +0 -0
- /package/{client/enums → enums}/AudioFlag.js +0 -0
- /package/{client/enums → enums}/BadgeStyle.d.ts +0 -0
- /package/{client/enums → enums}/BadgeStyle.js +0 -0
- /package/{client/enums → enums}/Blip.d.ts +0 -0
- /package/{client/enums → enums}/Blip.js +0 -0
- /package/{client/enums → enums}/Bone.d.ts +0 -0
- /package/{client/enums → enums}/Bone.js +0 -0
- /package/{client/enums → enums}/CameraShake.d.ts +0 -0
- /package/{client/enums → enums}/CameraShake.js +0 -0
- /package/{client/enums → enums}/CameraTypes.d.ts +0 -0
- /package/{client/enums → enums}/CameraTypes.js +0 -0
- /package/{client/enums → enums}/CheckboxStyle.d.ts +0 -0
- /package/{client/enums → enums}/CheckboxStyle.js +0 -0
- /package/{client/enums → enums}/Checkpoint.d.ts +0 -0
- /package/{client/enums → enums}/Checkpoint.js +0 -0
- /package/{client/enums → enums}/CloudHat.d.ts +0 -0
- /package/{client/enums → enums}/CloudHat.js +0 -0
- /package/{client/enums → enums}/Control.d.ts +0 -0
- /package/{client/enums → enums}/Control.js +0 -0
- /package/{client/enums → enums}/CursorSprite.d.ts +0 -0
- /package/{client/enums → enums}/CursorSprite.js +0 -0
- /package/{client/enums → enums}/Driving.d.ts +0 -0
- /package/{client/enums → enums}/Driving.js +0 -0
- /package/{client/enums → enums}/ExplosionType.d.ts +0 -0
- /package/{client/enums → enums}/ExplosionType.js +0 -0
- /package/{client/enums → enums}/FiringPattern.d.ts +0 -0
- /package/{client/enums → enums}/FiringPattern.js +0 -0
- /package/{client/enums → enums}/Font.d.ts +0 -0
- /package/{client/enums → enums}/Font.js +0 -0
- /package/{client/enums → enums}/ForceType.d.ts +0 -0
- /package/{client/enums → enums}/ForceType.js +0 -0
- /package/{client/enums → enums}/Gender.d.ts +0 -0
- /package/{client/enums → enums}/Gender.js +0 -0
- /package/{client/enums → enums}/HelmetType.d.ts +0 -0
- /package/{client/enums → enums}/HelmetType.js +0 -0
- /package/{client/enums → enums}/HudColor.d.ts +0 -0
- /package/{client/enums → enums}/HudColor.js +0 -0
- /package/{client/enums → enums}/HudComponent.d.ts +0 -0
- /package/{client/enums → enums}/HudComponent.js +0 -0
- /package/{client/enums → enums}/InputMode.d.ts +0 -0
- /package/{client/enums → enums}/InputMode.js +0 -0
- /package/{client/enums → enums}/InvertAxis.d.ts +0 -0
- /package/{client/enums → enums}/InvertAxis.js +0 -0
- /package/{client/enums → enums}/Language.d.ts +0 -0
- /package/{client/enums → enums}/Language.js +0 -0
- /package/{client/enums → enums}/LeaveVehicleFlags.d.ts +0 -0
- /package/{client/enums → enums}/LeaveVehicleFlags.js +0 -0
- /package/{client/enums → enums}/LoadingSpinnerType.d.ts +0 -0
- /package/{client/enums → enums}/LoadingSpinnerType.js +0 -0
- /package/{client/enums → enums}/MarkerType.d.ts +0 -0
- /package/{client/enums → enums}/MarkerType.js +0 -0
- /package/{client/enums → enums}/MenuAlignment.d.ts +0 -0
- /package/{client/enums → enums}/MenuAlignment.js +0 -0
- /package/{client/enums → enums}/NotificationType.d.ts +0 -0
- /package/{client/enums → enums}/NotificationType.js +0 -0
- /package/{client/enums → enums}/Parachute.d.ts +0 -0
- /package/{client/enums → enums}/Parachute.js +0 -0
- /package/{client/enums → enums}/PickupType.d.ts +0 -0
- /package/{client/enums → enums}/PickupType.js +0 -0
- /package/{client/enums → enums}/RadioStation.d.ts +0 -0
- /package/{client/enums → enums}/RadioStation.js +0 -0
- /package/{client/enums → enums}/RagdollType.d.ts +0 -0
- /package/{client/enums → enums}/RagdollType.js +0 -0
- /package/{client/enums → enums}/RaycastEnums.d.ts +0 -0
- /package/{client/enums → enums}/Relationship.d.ts +0 -0
- /package/{client/enums → enums}/Relationship.js +0 -0
- /package/{client/enums → enums}/RopeType.d.ts +0 -0
- /package/{client/enums → enums}/RopeType.js +0 -0
- /package/{client/enums → enums}/ScreenEffect.d.ts +0 -0
- /package/{client/enums → enums}/ScreenEffect.js +0 -0
- /package/{client/enums → enums}/SpeechModifier.d.ts +0 -0
- /package/{client/enums → enums}/SpeechModifier.js +0 -0
- /package/{client/enums → enums}/Vehicle.d.ts +0 -0
- /package/{client/enums → enums}/Vehicle.js +0 -0
- /package/{client/enums → enums}/Weather.d.ts +0 -0
- /package/{client/enums → enums}/Weather.js +0 -0
- /package/{client/enums → enums}/ZoneID.d.ts +0 -0
- /package/{client/enums → enums}/ZoneID.js +0 -0
- /package/{client/hashes → hashes}/MaterialHash.d.ts +0 -0
- /package/{client/hashes → hashes}/MaterialHash.js +0 -0
- /package/{client/hashes → hashes}/PedHash.d.ts +0 -0
- /package/{client/hashes → hashes}/PedHash.js +0 -0
- /package/{client/hashes → hashes}/VehicleHash.d.ts +0 -0
- /package/{client/hashes → hashes}/VehicleHash.js +0 -0
- /package/{client/hashes → hashes}/WeaponHash.d.ts +0 -0
- /package/{client/hashes → hashes}/WeaponHash.js +0 -0
- /package/{client/hashes → hashes}/WeatherTypeHash.d.ts +0 -0
- /package/{client/hashes → hashes}/WeatherTypeHash.js +0 -0
- /package/{client/interfaces → interfaces}/Dimensions.js +0 -0
- /package/{client/models → models}/Entity.d.ts +0 -0
- /package/{client/models → models}/Entity.js +0 -0
- /package/{client/ui → ui}/Fading.d.ts +0 -0
- /package/{client/ui → ui}/Notification.d.ts +0 -0
- /package/{client/ui → ui}/interfaces/IButton.js +0 -0
- /package/{client/ui → ui}/interfaces/IDrawable.js +0 -0
- /package/{client/ui → ui}/interfaces/index.js +0 -0
- /package/{client/ui → ui}/menu/MenuControl.d.ts +0 -0
- /package/{client/ui → ui}/menu/modules/ListItem.d.ts +0 -0
- /package/{client/utils → utils}/Animations.d.ts +0 -0
- /package/{client/utils → utils}/Crypto.d.ts +0 -0
- /package/{client/utils → utils}/LiteEvent.d.ts +0 -0
- /package/{client/utils → utils}/Maths.d.ts +0 -0
- /package/{client/utils → utils}/Maths.js +0 -0
- /package/{client/utils → utils}/Point.d.ts +0 -0
- /package/{client/utils → utils}/PointF.d.ts +0 -0
- /package/{client/utils → utils}/Size.d.ts +0 -0
- /package/{client/utils → utils}/enumValues.d.ts +0 -0
- /package/{client/utils → utils}/getStringFromUInt8Array.d.ts +0 -0
- /package/{client/utils → utils}/getUInt32FromUint8Array.d.ts +0 -0
- /package/{client/utils → utils}/getUInt32FromUint8Array.js +0 -0
- /package/{client/weapon → weapon}/Mk2WeaponHash.d.ts +0 -0
- /package/{client/weapon → weapon}/Mk2WeaponHash.js +0 -0
- /package/{client/weapon → weapon}/WeaponGroup.d.ts +0 -0
- /package/{client/weapon → weapon}/WeaponGroup.js +0 -0
- /package/{client/weapon → weapon}/WeaponLivery.d.ts +0 -0
- /package/{client/weapon → weapon}/WeaponLivery.js +0 -0
- /package/{client/weapon → weapon}/WeaponLiveryColor.d.ts +0 -0
- /package/{client/weapon → weapon}/WeaponLiveryColor.js +0 -0
- /package/{client/weapon → weapon}/WeaponTint.d.ts +0 -0
- /package/{client/weapon → weapon}/WeaponTint.js +0 -0
- /package/{client/weaponComponent → weaponComponent}/ComponentAttachmentPoint.d.ts +0 -0
- /package/{client/weaponComponent → weaponComponent}/ComponentAttachmentPoint.js +0 -0
- /package/{client/weaponComponent → weaponComponent}/WeaponComponentHash.d.ts +0 -0
- /package/{client/weaponComponent → weaponComponent}/WeaponComponentHash.js +0 -0
|
@@ -1,22 +1,29 @@
|
|
|
1
|
-
import { Color, Point, Size } from
|
|
2
|
-
import { AbstractUIMenuPanel } from
|
|
3
|
-
import { Menu, Rectangle, Sprite, Text } from
|
|
4
|
-
import { Alignment, Control, Font } from
|
|
5
|
-
import { Game, Wait } from
|
|
1
|
+
import { Color, Point, Size } from "../../../../utils";
|
|
2
|
+
import { AbstractUIMenuPanel } from "./";
|
|
3
|
+
import { Menu, Rectangle, Sprite, Text } from "../../../";
|
|
4
|
+
import { Alignment, Control, Font } from "../../../../enums";
|
|
5
|
+
import { Game, Wait } from "../../../../";
|
|
6
6
|
export class UIMenuPercentagePanel extends AbstractUIMenuPanel {
|
|
7
|
-
|
|
7
|
+
background;
|
|
8
|
+
_pressed = false;
|
|
9
|
+
_lastPercentage;
|
|
10
|
+
_title;
|
|
11
|
+
_minText;
|
|
12
|
+
_maxText;
|
|
13
|
+
_activeBar;
|
|
14
|
+
_backgroundBar;
|
|
15
|
+
constructor(title = "", percentage = 0, minText, maxText) {
|
|
8
16
|
super();
|
|
9
|
-
this.
|
|
10
|
-
this.background = new Sprite('commonmenu', 'gradient_bgd', new Point(), new Size(431, 76));
|
|
17
|
+
this.background = new Sprite("commonmenu", "gradient_bgd", new Point(), new Size(431, 76));
|
|
11
18
|
const barSize = new Size(413, 10);
|
|
12
19
|
this._activeBar = new Rectangle(new Point(), barSize, Color.fromRgb(245, 245, 245));
|
|
13
20
|
this._backgroundBar = new Rectangle(new Point(), { ...barSize }, Color.fromRgb(87, 87, 87));
|
|
14
|
-
this._title = new Text(
|
|
15
|
-
this._minText = new Text(
|
|
16
|
-
this._maxText = new Text(
|
|
21
|
+
this._title = new Text("", new Point(), 0.35, Color.White, Font.ChaletLondon, Alignment.Centered);
|
|
22
|
+
this._minText = new Text("", new Point(), 0.35, Color.White, Font.ChaletLondon, Alignment.Centered);
|
|
23
|
+
this._maxText = new Text("", new Point(), 0.35, Color.White, Font.ChaletLondon, Alignment.Centered);
|
|
17
24
|
this.Title = title;
|
|
18
|
-
this.MinText = minText ||
|
|
19
|
-
this.MaxText = maxText ||
|
|
25
|
+
this.MinText = minText || "0%";
|
|
26
|
+
this.MaxText = maxText || "100%";
|
|
20
27
|
this.Percentage = percentage;
|
|
21
28
|
this._lastPercentage = percentage;
|
|
22
29
|
}
|
|
@@ -24,19 +31,19 @@ export class UIMenuPercentagePanel extends AbstractUIMenuPanel {
|
|
|
24
31
|
return this._title.caption;
|
|
25
32
|
}
|
|
26
33
|
set Title(value) {
|
|
27
|
-
this._title.caption = value ? value.trim() :
|
|
34
|
+
this._title.caption = value ? value.trim() : "";
|
|
28
35
|
}
|
|
29
36
|
get MinText() {
|
|
30
37
|
return this._minText.caption;
|
|
31
38
|
}
|
|
32
39
|
set MinText(value) {
|
|
33
|
-
this._minText.caption = value ? value.trim() :
|
|
40
|
+
this._minText.caption = value ? value.trim() : "";
|
|
34
41
|
}
|
|
35
42
|
get MaxText() {
|
|
36
43
|
return this._maxText.caption;
|
|
37
44
|
}
|
|
38
45
|
set MaxText(value) {
|
|
39
|
-
this._maxText.caption = value ? value.trim() :
|
|
46
|
+
this._maxText.caption = value ? value.trim() : "";
|
|
40
47
|
}
|
|
41
48
|
get Percentage() {
|
|
42
49
|
const progress = this._activeBar.size.width / this._backgroundBar.size.width;
|
|
@@ -70,7 +77,8 @@ export class UIMenuPercentagePanel extends AbstractUIMenuPanel {
|
|
|
70
77
|
draw() {
|
|
71
78
|
if (this.enabled) {
|
|
72
79
|
super.draw();
|
|
73
|
-
const x = this.parentItem?.offset.X ??
|
|
80
|
+
const x = this.parentItem?.offset.X ??
|
|
81
|
+
0 + (this.ParentMenu?.WidthOffset ?? 0) / 2;
|
|
74
82
|
this._activeBar.pos.X = x + 9;
|
|
75
83
|
this._backgroundBar.pos.X = x + 9;
|
|
76
84
|
this._minText.pos.X = x + 25;
|
|
@@ -109,7 +117,8 @@ export class UIMenuPercentagePanel extends AbstractUIMenuPanel {
|
|
|
109
117
|
}
|
|
110
118
|
_getProgress() {
|
|
111
119
|
const drawOffset = this.ParentMenu?.DrawOffset ?? new Point(0, 0);
|
|
112
|
-
const progress = (GetControlNormal(0, 239) - drawOffset.X) * Menu.screenWidth -
|
|
120
|
+
const progress = (GetControlNormal(0, 239) - drawOffset.X) * Menu.screenWidth -
|
|
121
|
+
this._activeBar.pos.X;
|
|
113
122
|
return progress < 0 ? 0 : progress > 413 ? 413 : progress;
|
|
114
123
|
}
|
|
115
124
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractUIMenuPanel, UIMenuStatisticsPanelItem } from
|
|
2
|
-
import { Rectangle } from
|
|
1
|
+
import { AbstractUIMenuPanel, UIMenuStatisticsPanelItem } from "./";
|
|
2
|
+
import { Rectangle } from "../../../";
|
|
3
3
|
export declare class UIMenuStatisticsPanel extends AbstractUIMenuPanel {
|
|
4
4
|
protected readonly background: Rectangle;
|
|
5
5
|
private _divider;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Color, Point, Size } from
|
|
2
|
-
import { AbstractUIMenuPanel } from
|
|
3
|
-
import { Menu, Rectangle } from
|
|
1
|
+
import { Color, Point, Size } from "../../../../utils";
|
|
2
|
+
import { AbstractUIMenuPanel } from "./";
|
|
3
|
+
import { Menu, Rectangle } from "../../../";
|
|
4
4
|
export class UIMenuStatisticsPanel extends AbstractUIMenuPanel {
|
|
5
|
+
background;
|
|
6
|
+
_divider = true;
|
|
7
|
+
_items = [];
|
|
5
8
|
constructor(item, divider = true) {
|
|
6
9
|
super();
|
|
7
|
-
this._divider = true;
|
|
8
|
-
this._items = [];
|
|
9
10
|
this.background = new Rectangle(new Point(), new Size(431, 47), new Color(0, 0, 0, 170));
|
|
10
11
|
if (item) {
|
|
11
12
|
this.addItem(item);
|
|
@@ -29,11 +30,11 @@ export class UIMenuStatisticsPanel extends AbstractUIMenuPanel {
|
|
|
29
30
|
this._items.push(...items);
|
|
30
31
|
}
|
|
31
32
|
removeItem(itemOrIndex) {
|
|
32
|
-
if (typeof itemOrIndex ===
|
|
33
|
+
if (typeof itemOrIndex === "number") {
|
|
33
34
|
this._items = this._items.filter((i, index) => index !== itemOrIndex);
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
|
-
this._items = this._items.filter(i => i.id !== itemOrIndex.id);
|
|
37
|
+
this._items = this._items.filter((i) => i.id !== itemOrIndex.id);
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
setVerticalPosition(y) {
|
|
@@ -54,7 +55,8 @@ export class UIMenuStatisticsPanel extends AbstractUIMenuPanel {
|
|
|
54
55
|
draw() {
|
|
55
56
|
if (this.enabled) {
|
|
56
57
|
super.draw();
|
|
57
|
-
const x = this.parentItem?.offset.X ??
|
|
58
|
+
const x = this.parentItem?.offset.X ??
|
|
59
|
+
0 + (this.ParentMenu?.WidthOffset ?? 0) / 2;
|
|
58
60
|
this._items.forEach(async (item, index) => {
|
|
59
61
|
const itemCountOffset = 40 * (index + 1);
|
|
60
62
|
item.backgroundBar.pos.X = x + 200;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { Color, Crypto, Point, Size } from
|
|
2
|
-
import { Rectangle, Text } from
|
|
3
|
-
import { Alignment, Font } from
|
|
1
|
+
import { Color, Crypto, Point, Size } from "../../../../utils";
|
|
2
|
+
import { Rectangle, Text } from "../../../";
|
|
3
|
+
import { Alignment, Font } from "../../../../enums";
|
|
4
4
|
export class UIMenuStatisticsPanelItem {
|
|
5
|
+
id = Crypto.uuidv4();
|
|
6
|
+
text;
|
|
7
|
+
activeBar;
|
|
8
|
+
backgroundBar;
|
|
9
|
+
divider = [];
|
|
5
10
|
constructor(name, percentage = 0) {
|
|
6
|
-
this.
|
|
7
|
-
this.divider = [];
|
|
8
|
-
this.text = new Text('', new Point(), 0.35, Color.White, Font.ChaletLondon, Alignment.Left);
|
|
11
|
+
this.text = new Text("", new Point(), 0.35, Color.White, Font.ChaletLondon, Alignment.Left);
|
|
9
12
|
this.backgroundBar = new Rectangle(new Point(), new Size(200, 10), Color.fromArgb(100, 87, 87, 87));
|
|
10
13
|
this.activeBar = new Rectangle(new Point(), new Size(0, 10), Color.White);
|
|
11
14
|
for (let i = 1; i <= 4; i++) {
|
|
@@ -18,7 +21,7 @@ export class UIMenuStatisticsPanelItem {
|
|
|
18
21
|
return this.text.caption;
|
|
19
22
|
}
|
|
20
23
|
set Name(value) {
|
|
21
|
-
this.text.caption = value ? value.trim() :
|
|
24
|
+
this.text.caption = value ? value.trim() : "";
|
|
22
25
|
}
|
|
23
26
|
get Percentage() {
|
|
24
27
|
return this.activeBar.size.width / 200;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AbstractUIMenuPanel } from "./AbstractUIMenuPanel";
|
|
2
|
+
export { UIMenuGridPanel } from "./UIMenuGridPanel";
|
|
3
|
+
export { UIMenuColorPanel } from "./UIMenuColorPanel";
|
|
4
|
+
export { UIMenuPercentagePanel } from "./UIMenuPercentagePanel";
|
|
5
|
+
export { UIMenuStatisticsPanel } from "./UIMenuStatisticsPanel";
|
|
6
|
+
export { UIMenuStatisticsPanelItem } from "./UIMenuStatisticsPanelItem";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AbstractUIMenuPanel } from "./AbstractUIMenuPanel";
|
|
2
|
+
export { UIMenuGridPanel } from "./UIMenuGridPanel";
|
|
3
|
+
export { UIMenuColorPanel } from "./UIMenuColorPanel";
|
|
4
|
+
export { UIMenuPercentagePanel } from "./UIMenuPercentagePanel";
|
|
5
|
+
export { UIMenuStatisticsPanel } from "./UIMenuStatisticsPanel";
|
|
6
|
+
export { UIMenuStatisticsPanelItem } from "./UIMenuStatisticsPanelItem";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Crypto } from
|
|
1
|
+
import { Crypto } from "../../../utils";
|
|
2
2
|
export class ListItem {
|
|
3
|
+
id = Crypto.uuidv4();
|
|
4
|
+
name;
|
|
5
|
+
value;
|
|
3
6
|
constructor(name, value = null) {
|
|
4
|
-
this.id = Crypto.uuidv4();
|
|
5
7
|
this.name = name;
|
|
6
8
|
this.value = value;
|
|
7
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListItem } from "./ListItem";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListItem } from "./ListItem";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wait } from
|
|
1
|
+
import { Wait } from "..";
|
|
2
2
|
/**
|
|
3
3
|
* A utility to load an animation dictionary, anything that loads an animation should RemoveAnimDict after its finish being used.
|
|
4
4
|
* @param animDict the animation dictionary to load
|
|
@@ -39,7 +39,7 @@ export const LoadAnimDictArray = async (animDict, waitTime = 1000) => {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
if (GetGameTimer() - start >= waitTime)
|
|
42
|
-
return [false, animDict.filter(dict => !animsLoaded.has(dict))];
|
|
42
|
+
return [false, animDict.filter((dict) => !animsLoaded.has(dict))];
|
|
43
43
|
await Wait(0);
|
|
44
44
|
}
|
|
45
45
|
return [true, null];
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export class Crypto {
|
|
2
2
|
static uuidv4() {
|
|
3
|
-
let uuid =
|
|
3
|
+
let uuid = "";
|
|
4
4
|
for (let ii = 0; ii < 32; ii += 1) {
|
|
5
5
|
switch (ii) {
|
|
6
6
|
case 8:
|
|
7
7
|
case 20:
|
|
8
|
-
uuid +=
|
|
8
|
+
uuid += "-";
|
|
9
9
|
uuid += ((Math.random() * 16) | 0).toString(16);
|
|
10
10
|
break;
|
|
11
11
|
case 12:
|
|
12
|
-
uuid +=
|
|
13
|
-
uuid +=
|
|
12
|
+
uuid += "-";
|
|
13
|
+
uuid += "4";
|
|
14
14
|
break;
|
|
15
15
|
case 16:
|
|
16
|
-
uuid +=
|
|
16
|
+
uuid += "-";
|
|
17
17
|
uuid += ((Math.random() * 4) | 8).toString(16);
|
|
18
18
|
break;
|
|
19
19
|
default:
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
3
3
|
export class LiteEvent {
|
|
4
|
-
|
|
5
|
-
this.handlers = [];
|
|
6
|
-
}
|
|
4
|
+
handlers = [];
|
|
7
5
|
on(handler) {
|
|
8
6
|
this.handlers.push(handler);
|
|
9
7
|
}
|
|
10
8
|
off(handler) {
|
|
11
|
-
this.handlers = this.handlers.filter(h => h !== handler);
|
|
9
|
+
this.handlers = this.handlers.filter((h) => h !== handler);
|
|
12
10
|
}
|
|
13
11
|
emit(...args) {
|
|
14
|
-
this.handlers.slice(0).forEach(h => {
|
|
12
|
+
this.handlers.slice(0).forEach((h) => {
|
|
15
13
|
h(...args);
|
|
16
14
|
});
|
|
17
15
|
}
|
|
@@ -2,7 +2,7 @@ export class Point {
|
|
|
2
2
|
static parse(arg) {
|
|
3
3
|
let point = new Point();
|
|
4
4
|
if (arg) {
|
|
5
|
-
if (typeof arg ===
|
|
5
|
+
if (typeof arg === "object") {
|
|
6
6
|
if (Array.isArray(arg)) {
|
|
7
7
|
if (arg.length === 2) {
|
|
8
8
|
point = new Point(arg[0], arg[1]);
|
|
@@ -13,14 +13,16 @@ export class Point {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
if (arg.indexOf(
|
|
17
|
-
const arr = arg.split(
|
|
16
|
+
if (arg.indexOf(",") !== -1) {
|
|
17
|
+
const arr = arg.split(",");
|
|
18
18
|
point = new Point(parseFloat(arr[0]), parseFloat(arr[1]));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
return point;
|
|
23
23
|
}
|
|
24
|
+
X;
|
|
25
|
+
Y;
|
|
24
26
|
constructor(x = 0, y = 0) {
|
|
25
27
|
this.X = x;
|
|
26
28
|
this.Y = y;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Font, Screen, Text } from
|
|
2
|
-
import { Maths } from
|
|
1
|
+
import { Font, Screen, Text } from "..";
|
|
2
|
+
import { Maths } from "./Maths";
|
|
3
3
|
export class String {
|
|
4
4
|
static stringToArray(input) {
|
|
5
5
|
let stringsNeeded = 1;
|
|
@@ -13,7 +13,7 @@ export class String {
|
|
|
13
13
|
return outputString;
|
|
14
14
|
}
|
|
15
15
|
static measureStringWidthNoConvert(input, font = Font.ChaletLondon, scale = 0) {
|
|
16
|
-
SetTextEntryForWidth(
|
|
16
|
+
SetTextEntryForWidth("STRING");
|
|
17
17
|
Text.addLongString(input);
|
|
18
18
|
SetTextFont(font);
|
|
19
19
|
SetTextScale(1, scale);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export function* enumValues(enumObj) {
|
|
2
2
|
let isStringEnum = true;
|
|
3
3
|
for (const property in enumObj) {
|
|
4
|
-
if (typeof enumObj[property] ===
|
|
4
|
+
if (typeof enumObj[property] === "number") {
|
|
5
5
|
isStringEnum = false;
|
|
6
6
|
break;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
for (const property in enumObj) {
|
|
10
|
-
if (isStringEnum || typeof enumObj[property] ===
|
|
10
|
+
if (isStringEnum || typeof enumObj[property] === "number") {
|
|
11
11
|
yield enumObj[property];
|
|
12
12
|
}
|
|
13
13
|
}
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { String } from "./String";
|
|
2
|
+
export { LiteEvent } from "./LiteEvent";
|
|
3
|
+
export { PointF } from "./PointF";
|
|
4
|
+
export { Crypto } from "./Crypto";
|
|
5
|
+
export { Point } from "./Point";
|
|
6
|
+
export { Size } from "./Size";
|
|
7
|
+
export { Vector2, Vector3, Vector4, Maths, Color, Quaternion, Delay, enumValues, getStringFromUInt8Array, getUInt32FromUint8Array, } from "../../common/utils/index";
|
|
8
|
+
export declare const Wait: (milliseconds: number) => Promise<void>;
|
|
9
|
+
export * from "./Animations";
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { String } from "./String";
|
|
2
|
+
export { LiteEvent } from "./LiteEvent";
|
|
3
|
+
export { PointF } from "./PointF";
|
|
4
|
+
export { Crypto } from "./Crypto";
|
|
5
|
+
export { Point } from "./Point";
|
|
6
|
+
export { Size } from "./Size";
|
|
7
|
+
export { Vector2, Vector3, Vector4, Maths, Color, Quaternion, Delay, enumValues, getStringFromUInt8Array, getUInt32FromUint8Array, } from "../../common/utils/index";
|
|
8
|
+
export const Wait = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
9
|
+
export * from "./Animations";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getUInt32FromUint8Array } from
|
|
2
|
-
import { getStringFromUInt8Array } from
|
|
1
|
+
import { getUInt32FromUint8Array } from "../utils";
|
|
2
|
+
import { getStringFromUInt8Array } from "../utils";
|
|
3
3
|
/**
|
|
4
4
|
* DlcWeaponData - Mapping of WeaponHash -> DlcWeaponData
|
|
5
5
|
*/
|
|
@@ -21,7 +21,7 @@ function initializeOnce() {
|
|
|
21
21
|
for (let i = 0; i < weaponCount; i++) {
|
|
22
22
|
const buffer = new Uint8Array(14 * intLength + 4 * strLength);
|
|
23
23
|
// https://docs.fivem.net/natives/?_0x79923CD21BECE14E
|
|
24
|
-
Citizen.invokeNative(
|
|
24
|
+
Citizen.invokeNative("0x79923CD21BECE14E", i, buffer, Citizen.returnResultAnyway());
|
|
25
25
|
// noinspection PointlessArithmeticExpressionJS
|
|
26
26
|
const dlcWeaponData = {
|
|
27
27
|
validCheck: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { WeaponComponentCollection } from
|
|
2
|
-
import { Ped } from
|
|
3
|
-
import { AmmoType, WeaponHash } from
|
|
4
|
-
import { Model } from
|
|
5
|
-
import { WeaponTint } from
|
|
6
|
-
import { WeaponGroup } from
|
|
7
|
-
import { WeaponLivery } from
|
|
8
|
-
import { WeaponLiveryColor } from
|
|
9
|
-
import { WeaponHudStats } from
|
|
10
|
-
import { WeaponComponentHash } from
|
|
1
|
+
import { WeaponComponentCollection } from "../weaponComponent/WeaponComponentCollection";
|
|
2
|
+
import { Ped } from "../models";
|
|
3
|
+
import { AmmoType, WeaponHash } from "../hashes";
|
|
4
|
+
import { Model } from "../Model";
|
|
5
|
+
import { WeaponTint } from "./WeaponTint";
|
|
6
|
+
import { WeaponGroup } from "./WeaponGroup";
|
|
7
|
+
import { WeaponLivery } from "./WeaponLivery";
|
|
8
|
+
import { WeaponLiveryColor } from "./WeaponLiveryColor";
|
|
9
|
+
import { WeaponHudStats } from "./WeaponHudStats";
|
|
10
|
+
import { WeaponComponentHash } from "../weaponComponent";
|
|
11
11
|
/**
|
|
12
12
|
* ped weapon
|
|
13
13
|
*
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { WeaponComponentCollection } from
|
|
2
|
-
import { WeaponHash } from
|
|
3
|
-
import { WeaponDisplayNameByHash } from
|
|
4
|
-
import { Game } from
|
|
5
|
-
import { Model } from
|
|
6
|
-
import { WeaponHudStats } from
|
|
7
|
-
import { enumValues } from
|
|
8
|
-
import { Mk2WeaponHash } from
|
|
9
|
-
import { WeaponComponentHashesByWeaponHash } from
|
|
1
|
+
import { WeaponComponentCollection } from "../weaponComponent/WeaponComponentCollection";
|
|
2
|
+
import { WeaponHash } from "../hashes";
|
|
3
|
+
import { WeaponDisplayNameByHash } from "./WeaponDisplayNameByHash";
|
|
4
|
+
import { Game } from "../Game";
|
|
5
|
+
import { Model } from "../Model";
|
|
6
|
+
import { WeaponHudStats } from "./WeaponHudStats";
|
|
7
|
+
import { enumValues } from "../utils";
|
|
8
|
+
import { Mk2WeaponHash } from "./Mk2WeaponHash";
|
|
9
|
+
import { WeaponComponentHashesByWeaponHash } from "../weaponComponent/WeaponComponentHashesByWeaponHash";
|
|
10
10
|
/**
|
|
11
11
|
* ped weapon
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
export class Weapon {
|
|
15
|
+
owner;
|
|
16
|
+
components;
|
|
17
|
+
hash;
|
|
15
18
|
constructor(owner, hash) {
|
|
16
19
|
this.owner = owner;
|
|
17
20
|
this.hash = hash;
|
|
@@ -58,7 +61,7 @@ export class Weapon {
|
|
|
58
61
|
* @constructor
|
|
59
62
|
*/
|
|
60
63
|
get DisplayName() {
|
|
61
|
-
return Weapon.getDisplayNameFromHash(this.hash) ??
|
|
64
|
+
return Weapon.getDisplayNameFromHash(this.hash) ?? "WCT_INVALID";
|
|
62
65
|
}
|
|
63
66
|
/**
|
|
64
67
|
* get weapon localized name
|
|
@@ -152,7 +155,7 @@ export class Weapon {
|
|
|
152
155
|
// GetMaxAmmo
|
|
153
156
|
// https://docs.fivem.net/natives/?_0xDC16122C7A20C933
|
|
154
157
|
// noinspection UnnecessaryLocalVariableJS
|
|
155
|
-
const amount = Citizen.invokeNative(
|
|
158
|
+
const amount = Citizen.invokeNative("0xDC16122C7A20C933", this.owner.Handle, this.hash, Citizen.pointerValueInt(), Citizen.resultAsInteger());
|
|
156
159
|
return amount;
|
|
157
160
|
}
|
|
158
161
|
/**
|
|
@@ -212,7 +215,7 @@ export class Weapon {
|
|
|
212
215
|
* @constructor
|
|
213
216
|
*/
|
|
214
217
|
get IsMk2() {
|
|
215
|
-
return Array.from(enumValues(Mk2WeaponHash)).some(x => x === this.hash);
|
|
218
|
+
return Array.from(enumValues(Mk2WeaponHash)).some((x) => x === this.hash);
|
|
216
219
|
}
|
|
217
220
|
/**
|
|
218
221
|
* set weapon livery, only work for Mk2 weapon
|
|
@@ -248,9 +251,9 @@ export class Weapon {
|
|
|
248
251
|
*/
|
|
249
252
|
static getDisplayNameFromHash(hash) {
|
|
250
253
|
if (!hash) {
|
|
251
|
-
return
|
|
254
|
+
return "WT_INVALID";
|
|
252
255
|
}
|
|
253
|
-
return WeaponDisplayNameByHash.get(hash) ??
|
|
256
|
+
return WeaponDisplayNameByHash.get(hash) ?? "WCT_INVALID";
|
|
254
257
|
}
|
|
255
258
|
/**
|
|
256
259
|
* get component hashes belongs to weapon
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Weapon } from
|
|
2
|
-
import { Game } from
|
|
3
|
-
import { Wait } from
|
|
1
|
+
import { Weapon } from "./Weapon";
|
|
2
|
+
import { Game } from "../Game";
|
|
3
|
+
import { Wait } from "../utils";
|
|
4
4
|
/**
|
|
5
5
|
* weapon asset
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export class WeaponAsset {
|
|
9
|
+
hash;
|
|
9
10
|
constructor(hash) {
|
|
10
11
|
this.hash = hash;
|
|
11
12
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Weapon } from
|
|
2
|
-
import { Prop } from
|
|
1
|
+
import { Weapon } from "./Weapon";
|
|
2
|
+
import { Prop } from "../models";
|
|
3
3
|
/**
|
|
4
4
|
* ped weapons
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export class WeaponCollection {
|
|
8
|
+
owner;
|
|
9
|
+
weapons = new Map();
|
|
8
10
|
constructor(owner) {
|
|
9
|
-
this.weapons = new Map();
|
|
10
11
|
this.owner = owner;
|
|
11
12
|
}
|
|
12
13
|
[Symbol.iterator]() {
|