@nativewrappers/fivem 0.0.1
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/LICENSE +21 -0
- package/README.md +33 -0
- package/lib/client/Audio.d.ts +17 -0
- package/lib/client/Audio.js +92 -0
- package/lib/client/Blip.d.ts +39 -0
- package/lib/client/Blip.js +104 -0
- package/lib/client/Camera.d.ts +46 -0
- package/lib/client/Camera.js +161 -0
- package/lib/client/Checkpoint.d.ts +18 -0
- package/lib/client/Checkpoint.js +42 -0
- package/lib/client/Events.d.ts +11 -0
- package/lib/client/Events.js +73 -0
- package/lib/client/Game.d.ts +283 -0
- package/lib/client/Game.js +451 -0
- package/lib/client/GameplayCamera.d.ts +102 -0
- package/lib/client/GameplayCamera.js +141 -0
- package/lib/client/Model.d.ts +134 -0
- package/lib/client/Model.js +198 -0
- package/lib/client/NetworkedScene.d.ts +10 -0
- package/lib/client/NetworkedScene.js +17 -0
- package/lib/client/ParticleEffect.d.ts +80 -0
- package/lib/client/ParticleEffect.js +120 -0
- package/lib/client/ParticleEffectAsset.d.ts +54 -0
- package/lib/client/ParticleEffectAsset.js +104 -0
- package/lib/client/Pickup.d.ts +9 -0
- package/lib/client/Pickup.js +18 -0
- package/lib/client/Raycast.d.ts +49 -0
- package/lib/client/Raycast.js +70 -0
- package/lib/client/RelationshipGroup.d.ts +49 -0
- package/lib/client/RelationshipGroup.js +63 -0
- package/lib/client/Rope.d.ts +99 -0
- package/lib/client/Rope.js +125 -0
- package/lib/client/TaskSequence.d.ts +15 -0
- package/lib/client/TaskSequence.js +43 -0
- package/lib/client/Tasks.d.ts +66 -0
- package/lib/client/Tasks.js +236 -0
- package/lib/client/World.d.ts +402 -0
- package/lib/client/World.js +726 -0
- package/lib/client/cfx/StateBagChangeHandler.d.ts +3 -0
- package/lib/client/cfx/StateBagChangeHandler.js +1 -0
- package/lib/client/cfx/index.d.ts +7 -0
- package/lib/client/cfx/index.js +1 -0
- package/lib/client/enums/Alignment.d.ts +5 -0
- package/lib/client/enums/Alignment.js +6 -0
- package/lib/client/enums/AnimationFlags.d.ts +9 -0
- package/lib/client/enums/AnimationFlags.js +10 -0
- package/lib/client/enums/AudioFlag.d.ts +37 -0
- package/lib/client/enums/AudioFlag.js +38 -0
- package/lib/client/enums/BadgeStyle.d.ts +182 -0
- package/lib/client/enums/BadgeStyle.js +183 -0
- package/lib/client/enums/Blip.d.ts +223 -0
- package/lib/client/enums/Blip.js +225 -0
- package/lib/client/enums/Bone.d.ts +101 -0
- package/lib/client/enums/Bone.js +103 -0
- package/lib/client/enums/CameraShake.d.ts +13 -0
- package/lib/client/enums/CameraShake.js +14 -0
- package/lib/client/enums/CameraTypes.d.ts +7 -0
- package/lib/client/enums/CameraTypes.js +8 -0
- package/lib/client/enums/CheckboxStyle.d.ts +4 -0
- package/lib/client/enums/CheckboxStyle.js +5 -0
- package/lib/client/enums/Checkpoint.d.ts +62 -0
- package/lib/client/enums/Checkpoint.js +67 -0
- package/lib/client/enums/ClassTypes.d.ts +11 -0
- package/lib/client/enums/ClassTypes.js +12 -0
- package/lib/client/enums/CloudHat.d.ts +26 -0
- package/lib/client/enums/CloudHat.js +27 -0
- package/lib/client/enums/Control.d.ts +360 -0
- package/lib/client/enums/Control.js +361 -0
- package/lib/client/enums/CursorSprite.d.ts +14 -0
- package/lib/client/enums/CursorSprite.js +15 -0
- package/lib/client/enums/Driving.d.ts +32 -0
- package/lib/client/enums/Driving.js +34 -0
- package/lib/client/enums/ExplosionType.d.ts +44 -0
- package/lib/client/enums/ExplosionType.js +45 -0
- package/lib/client/enums/FiringPattern.d.ts +19 -0
- package/lib/client/enums/FiringPattern.js +20 -0
- package/lib/client/enums/Font.d.ts +7 -0
- package/lib/client/enums/Font.js +8 -0
- package/lib/client/enums/ForceType.d.ts +8 -0
- package/lib/client/enums/ForceType.js +9 -0
- package/lib/client/enums/Gender.d.ts +4 -0
- package/lib/client/enums/Gender.js +5 -0
- package/lib/client/enums/HelmetType.d.ts +5 -0
- package/lib/client/enums/HelmetType.js +6 -0
- package/lib/client/enums/HudColor.d.ts +183 -0
- package/lib/client/enums/HudColor.js +184 -0
- package/lib/client/enums/HudComponent.d.ts +53 -0
- package/lib/client/enums/HudComponent.js +54 -0
- package/lib/client/enums/InputMode.d.ts +4 -0
- package/lib/client/enums/InputMode.js +5 -0
- package/lib/client/enums/IntersectOptions.d.ts +15 -0
- package/lib/client/enums/IntersectOptions.js +16 -0
- package/lib/client/enums/InvertAxis.d.ts +9 -0
- package/lib/client/enums/InvertAxis.js +7 -0
- package/lib/client/enums/Language.d.ts +14 -0
- package/lib/client/enums/Language.js +15 -0
- package/lib/client/enums/LeaveVehicleFlags.d.ts +10 -0
- package/lib/client/enums/LeaveVehicleFlags.js +11 -0
- package/lib/client/enums/LoadingSpinnerType.d.ts +7 -0
- package/lib/client/enums/LoadingSpinnerType.js +8 -0
- package/lib/client/enums/MarkerType.d.ts +49 -0
- package/lib/client/enums/MarkerType.js +50 -0
- package/lib/client/enums/MenuAlignment.d.ts +4 -0
- package/lib/client/enums/MenuAlignment.js +5 -0
- package/lib/client/enums/NotificationType.d.ts +10 -0
- package/lib/client/enums/NotificationType.js +11 -0
- package/lib/client/enums/Parachute.d.ts +13 -0
- package/lib/client/enums/Parachute.js +15 -0
- package/lib/client/enums/PickupType.d.ts +73 -0
- package/lib/client/enums/PickupType.js +74 -0
- package/lib/client/enums/RadioStation.d.ts +24 -0
- package/lib/client/enums/RadioStation.js +25 -0
- package/lib/client/enums/RagdollType.d.ts +6 -0
- package/lib/client/enums/RagdollType.js +7 -0
- package/lib/client/enums/Relationship.d.ts +9 -0
- package/lib/client/enums/Relationship.js +10 -0
- package/lib/client/enums/RopeType.d.ts +5 -0
- package/lib/client/enums/RopeType.js +6 -0
- package/lib/client/enums/ScreenEffect.d.ts +83 -0
- package/lib/client/enums/ScreenEffect.js +84 -0
- package/lib/client/enums/SpeechModifier.d.ts +39 -0
- package/lib/client/enums/SpeechModifier.js +40 -0
- package/lib/client/enums/Vehicle.d.ts +358 -0
- package/lib/client/enums/Vehicle.js +376 -0
- package/lib/client/enums/Weather.d.ts +21 -0
- package/lib/client/enums/Weather.js +22 -0
- package/lib/client/enums/ZoneID.d.ts +94 -0
- package/lib/client/enums/ZoneID.js +95 -0
- package/lib/client/enums/index.d.ts +42 -0
- package/lib/client/enums/index.js +42 -0
- package/lib/client/hashes/MaterialHash.d.ts +216 -0
- package/lib/client/hashes/MaterialHash.js +217 -0
- package/lib/client/hashes/PedHash.d.ts +724 -0
- package/lib/client/hashes/PedHash.js +725 -0
- package/lib/client/hashes/VehicleHash.d.ts +522 -0
- package/lib/client/hashes/VehicleHash.js +523 -0
- package/lib/client/hashes/WeaponHash.d.ts +147 -0
- package/lib/client/hashes/WeaponHash.js +161 -0
- package/lib/client/hashes/WeatherTypeHash.d.ts +21 -0
- package/lib/client/hashes/WeatherTypeHash.js +22 -0
- package/lib/client/hashes/index.d.ts +5 -0
- package/lib/client/hashes/index.js +5 -0
- package/lib/client/index.d.ts +24 -0
- package/lib/client/index.js +25 -0
- package/lib/client/interfaces/Dimensions.d.ts +5 -0
- package/lib/client/interfaces/Dimensions.js +1 -0
- package/lib/client/models/BaseEntity.d.ts +169 -0
- package/lib/client/models/BaseEntity.js +459 -0
- package/lib/client/models/Entity.d.ts +9 -0
- package/lib/client/models/Entity.js +24 -0
- package/lib/client/models/EntityBone.d.ts +12 -0
- package/lib/client/models/EntityBone.js +24 -0
- package/lib/client/models/EntityBoneCollection.d.ts +11 -0
- package/lib/client/models/EntityBoneCollection.js +16 -0
- package/lib/client/models/Ped.d.ts +199 -0
- package/lib/client/models/Ped.js +685 -0
- package/lib/client/models/PedBone.d.ts +6 -0
- package/lib/client/models/PedBone.js +9 -0
- package/lib/client/models/PedBoneCollection.d.ts +8 -0
- package/lib/client/models/PedBoneCollection.js +19 -0
- package/lib/client/models/Player.d.ts +63 -0
- package/lib/client/models/Player.js +174 -0
- package/lib/client/models/Prop.d.ts +11 -0
- package/lib/client/models/Prop.js +26 -0
- package/lib/client/models/Vehicle.d.ts +171 -0
- package/lib/client/models/Vehicle.js +551 -0
- package/lib/client/models/VehicleDoor.d.ts +19 -0
- package/lib/client/models/VehicleDoor.js +42 -0
- package/lib/client/models/VehicleDoorCollection.d.ts +14 -0
- package/lib/client/models/VehicleDoorCollection.js +61 -0
- package/lib/client/models/VehicleMod.d.ts +16 -0
- package/lib/client/models/VehicleMod.js +33 -0
- package/lib/client/models/VehicleModCollection.d.ts +61 -0
- package/lib/client/models/VehicleModCollection.js +227 -0
- package/lib/client/models/VehicleToggleMod.d.ts +14 -0
- package/lib/client/models/VehicleToggleMod.js +27 -0
- package/lib/client/models/VehicleWheel.d.ts +11 -0
- package/lib/client/models/VehicleWheel.js +21 -0
- package/lib/client/models/VehicleWheelCollection.d.ts +13 -0
- package/lib/client/models/VehicleWheelCollection.js +56 -0
- package/lib/client/models/VehicleWindow.d.ts +16 -0
- package/lib/client/models/VehicleWindow.js +33 -0
- package/lib/client/models/VehicleWindowCollection.d.ts +14 -0
- package/lib/client/models/VehicleWindowCollection.js +55 -0
- package/lib/client/models/index.d.ts +18 -0
- package/lib/client/models/index.js +18 -0
- package/lib/client/types/EntityType.d.ts +2 -0
- package/lib/client/types/EntityType.js +1 -0
- package/lib/client/ui/Container.d.ts +11 -0
- package/lib/client/ui/Container.js +28 -0
- package/lib/client/ui/Effects.d.ts +8 -0
- package/lib/client/ui/Effects.js +106 -0
- package/lib/client/ui/Fading.d.ts +41 -0
- package/lib/client/ui/Fading.js +69 -0
- package/lib/client/ui/Hud.d.ts +16 -0
- package/lib/client/ui/Hud.js +39 -0
- package/lib/client/ui/InstructionalButtons.d.ts +33 -0
- package/lib/client/ui/InstructionalButtons.js +53 -0
- package/lib/client/ui/LoadingPrompt.d.ts +27 -0
- package/lib/client/ui/LoadingPrompt.js +45 -0
- package/lib/client/ui/Notification.d.ts +5 -0
- package/lib/client/ui/Notification.js +8 -0
- package/lib/client/ui/Rectangle.d.ts +10 -0
- package/lib/client/ui/Rectangle.js +37 -0
- package/lib/client/ui/Scaleform.d.ts +106 -0
- package/lib/client/ui/Scaleform.js +234 -0
- package/lib/client/ui/Screen.d.ts +16 -0
- package/lib/client/ui/Screen.js +72 -0
- package/lib/client/ui/Sprite.d.ts +17 -0
- package/lib/client/ui/Sprite.js +53 -0
- package/lib/client/ui/Text.d.ts +31 -0
- package/lib/client/ui/Text.js +102 -0
- package/lib/client/ui/Timerbar.d.ts +44 -0
- package/lib/client/ui/Timerbar.js +241 -0
- package/lib/client/ui/index.d.ts +15 -0
- package/lib/client/ui/index.js +15 -0
- package/lib/client/ui/interfaces/IButton.d.ts +5 -0
- package/lib/client/ui/interfaces/IButton.js +1 -0
- package/lib/client/ui/interfaces/IDrawable.d.ts +7 -0
- package/lib/client/ui/interfaces/IDrawable.js +1 -0
- package/lib/client/ui/interfaces/index.d.ts +2 -0
- package/lib/client/ui/interfaces/index.js +1 -0
- package/lib/client/ui/menu/Menu.d.ts +108 -0
- package/lib/client/ui/menu/Menu.js +802 -0
- package/lib/client/ui/menu/MenuControl.d.ts +6 -0
- package/lib/client/ui/menu/MenuControl.js +11 -0
- package/lib/client/ui/menu/MenuControls.d.ts +9 -0
- package/lib/client/ui/menu/MenuControls.js +11 -0
- package/lib/client/ui/menu/MenuSettings.d.ts +20 -0
- package/lib/client/ui/menu/MenuSettings.js +51 -0
- package/lib/client/ui/menu/index.d.ts +6 -0
- package/lib/client/ui/menu/index.js +6 -0
- package/lib/client/ui/menu/items/UIMenuCheckboxItem.d.ts +20 -0
- package/lib/client/ui/menu/items/UIMenuCheckboxItem.js +57 -0
- package/lib/client/ui/menu/items/UIMenuItem.d.ts +78 -0
- package/lib/client/ui/menu/items/UIMenuItem.js +1090 -0
- package/lib/client/ui/menu/items/UIMenuListItem.d.ts +31 -0
- package/lib/client/ui/menu/items/UIMenuListItem.js +110 -0
- package/lib/client/ui/menu/items/UIMenuSeparatorItem.d.ts +11 -0
- package/lib/client/ui/menu/items/UIMenuSeparatorItem.js +29 -0
- package/lib/client/ui/menu/items/UIMenuSliderItem.d.ts +47 -0
- package/lib/client/ui/menu/items/UIMenuSliderItem.js +173 -0
- package/lib/client/ui/menu/items/index.d.ts +6 -0
- package/lib/client/ui/menu/items/index.js +6 -0
- package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +17 -0
- package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.js +43 -0
- package/lib/client/ui/menu/items/panels/UIMenuColorPanel.d.ts +36 -0
- package/lib/client/ui/menu/items/panels/UIMenuColorPanel.js +211 -0
- package/lib/client/ui/menu/items/panels/UIMenuGridPanel.d.ts +40 -0
- package/lib/client/ui/menu/items/panels/UIMenuGridPanel.js +215 -0
- package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.d.ts +26 -0
- package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.js +115 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.d.ts +16 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.js +77 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +13 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.js +32 -0
- package/lib/client/ui/menu/items/panels/index.d.ts +6 -0
- package/lib/client/ui/menu/items/panels/index.js +6 -0
- package/lib/client/ui/menu/modules/ListItem.d.ts +6 -0
- package/lib/client/ui/menu/modules/ListItem.js +8 -0
- package/lib/client/ui/menu/modules/index.d.ts +1 -0
- package/lib/client/ui/menu/modules/index.js +1 -0
- package/lib/client/utils/Animations.d.ts +19 -0
- package/lib/client/utils/Animations.js +55 -0
- package/lib/client/utils/Color.d.ts +15 -0
- package/lib/client/utils/Color.js +22 -0
- package/lib/client/utils/Crypto.d.ts +3 -0
- package/lib/client/utils/Crypto.js +25 -0
- package/lib/client/utils/LiteEvent.d.ts +13 -0
- package/lib/client/utils/LiteEvent.js +21 -0
- package/lib/client/utils/Maths.d.ts +4 -0
- package/lib/client/utils/Maths.js +10 -0
- package/lib/client/utils/Point.d.ts +9 -0
- package/lib/client/utils/Point.js +28 -0
- package/lib/client/utils/PointF.d.ts +12 -0
- package/lib/client/utils/PointF.js +11 -0
- package/lib/client/utils/Quaternion.d.ts +10 -0
- package/lib/client/utils/Quaternion.js +23 -0
- package/lib/client/utils/Size.d.ts +5 -0
- package/lib/client/utils/Size.js +6 -0
- package/lib/client/utils/String.d.ts +6 -0
- package/lib/client/utils/String.js +25 -0
- package/lib/client/utils/Vector2.d.ts +54 -0
- package/lib/client/utils/Vector2.js +106 -0
- package/lib/client/utils/Vector3.d.ts +69 -0
- package/lib/client/utils/Vector3.js +140 -0
- package/lib/client/utils/Vector4.d.ts +62 -0
- package/lib/client/utils/Vector4.js +124 -0
- package/lib/client/utils/enumValues.d.ts +12 -0
- package/lib/client/utils/enumValues.js +14 -0
- package/lib/client/utils/getStringFromUInt8Array.d.ts +8 -0
- package/lib/client/utils/getStringFromUInt8Array.js +10 -0
- package/lib/client/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/lib/client/utils/getUInt32FromUint8Array.js +8 -0
- package/lib/client/utils/index.d.ts +10 -0
- package/lib/client/utils/index.js +10 -0
- package/lib/client/weapon/DlcWeaponData.d.ts +43 -0
- package/lib/client/weapon/DlcWeaponData.js +44 -0
- package/lib/client/weapon/Mk2WeaponHash.d.ts +18 -0
- package/lib/client/weapon/Mk2WeaponHash.js +25 -0
- package/lib/client/weapon/Weapon.d.ts +169 -0
- package/lib/client/weapon/Weapon.js +267 -0
- package/lib/client/weapon/WeaponAsset.d.ts +55 -0
- package/lib/client/weapon/WeaponAsset.js +83 -0
- package/lib/client/weapon/WeaponCollection.d.ts +90 -0
- package/lib/client/weapon/WeaponCollection.js +186 -0
- package/lib/client/weapon/WeaponDisplayNameByHash.d.ts +6 -0
- package/lib/client/weapon/WeaponDisplayNameByHash.js +75 -0
- package/lib/client/weapon/WeaponGroup.d.ts +18 -0
- package/lib/client/weapon/WeaponGroup.js +19 -0
- package/lib/client/weapon/WeaponHudStats.d.ts +27 -0
- package/lib/client/weapon/WeaponHudStats.js +38 -0
- package/lib/client/weapon/WeaponLivery.d.ts +13 -0
- package/lib/client/weapon/WeaponLivery.js +14 -0
- package/lib/client/weapon/WeaponLiveryColor.d.ts +34 -0
- package/lib/client/weapon/WeaponLiveryColor.js +35 -0
- package/lib/client/weapon/WeaponTint.d.ts +42 -0
- package/lib/client/weapon/WeaponTint.js +43 -0
- package/lib/client/weapon/index.d.ts +8 -0
- package/lib/client/weapon/index.js +8 -0
- package/lib/client/weaponComponent/ComponentAttachmentPoint.d.ts +18 -0
- package/lib/client/weaponComponent/ComponentAttachmentPoint.js +19 -0
- package/lib/client/weaponComponent/ComponentAttachmentPointByHash.d.ts +7 -0
- package/lib/client/weaponComponent/ComponentAttachmentPointByHash.js +309 -0
- package/lib/client/weaponComponent/ComponentDisplayNameByHash.d.ts +6 -0
- package/lib/client/weaponComponent/ComponentDisplayNameByHash.js +280 -0
- package/lib/client/weaponComponent/DlcWeaponComponentData.d.ts +40 -0
- package/lib/client/weaponComponent/DlcWeaponComponentData.js +44 -0
- package/lib/client/weaponComponent/InvalidWeaponComponent.d.ts +12 -0
- package/lib/client/weaponComponent/InvalidWeaponComponent.js +28 -0
- package/lib/client/weaponComponent/WeaponComponent.d.ts +81 -0
- package/lib/client/weaponComponent/WeaponComponent.js +119 -0
- package/lib/client/weaponComponent/WeaponComponentCollection.d.ts +108 -0
- package/lib/client/weaponComponent/WeaponComponentCollection.js +172 -0
- package/lib/client/weaponComponent/WeaponComponentHash.d.ts +671 -0
- package/lib/client/weaponComponent/WeaponComponentHash.js +887 -0
- package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.d.ts +8 -0
- package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.js +823 -0
- package/lib/client/weaponComponent/WeaponComponentHudStats.d.ts +27 -0
- package/lib/client/weaponComponent/WeaponComponentHudStats.js +34 -0
- package/lib/client/weaponComponent/index.d.ts +5 -0
- package/lib/client/weaponComponent/index.js +5 -0
- package/lib/common/Convar.d.ts +8 -0
- package/lib/common/Convar.js +20 -0
- package/lib/common/Kvp.d.ts +91 -0
- package/lib/common/Kvp.js +161 -0
- package/lib/common/Resource.d.ts +14 -0
- package/lib/common/Resource.js +35 -0
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.js +5 -0
- package/lib/common/types.d.ts +6 -0
- package/lib/common/types.js +1 -0
- package/lib/common/utils/Color.d.ts +10 -0
- package/lib/common/utils/Color.js +17 -0
- package/lib/common/utils/Maths.d.ts +4 -0
- package/lib/common/utils/Maths.js +10 -0
- package/lib/common/utils/PointF.d.ts +12 -0
- package/lib/common/utils/PointF.js +11 -0
- package/lib/common/utils/Quaternion.d.ts +10 -0
- package/lib/common/utils/Quaternion.js +23 -0
- package/lib/common/utils/Vector2.d.ts +58 -0
- package/lib/common/utils/Vector2.js +113 -0
- package/lib/common/utils/Vector3.d.ts +73 -0
- package/lib/common/utils/Vector3.js +147 -0
- package/lib/common/utils/Vector4.d.ts +66 -0
- package/lib/common/utils/Vector4.js +131 -0
- package/lib/common/utils/cleanPlayerName.d.ts +6 -0
- package/lib/common/utils/cleanPlayerName.js +27 -0
- package/lib/common/utils/enumValues.d.ts +12 -0
- package/lib/common/utils/enumValues.js +14 -0
- package/lib/common/utils/getStringFromUInt8Array.d.ts +8 -0
- package/lib/common/utils/getStringFromUInt8Array.js +10 -0
- package/lib/common/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/lib/common/utils/getUInt32FromUint8Array.js +8 -0
- package/lib/common/utils/index.d.ts +12 -0
- package/lib/common/utils/index.js +12 -0
- package/lib/server/Anticheat.d.ts +0 -0
- package/lib/server/Anticheat.js +25 -0
- package/lib/server/Events.d.ts +35 -0
- package/lib/server/Events.js +102 -0
- package/lib/server/Game.d.ts +56 -0
- package/lib/server/Game.js +86 -0
- package/lib/server/cfx/StateBagChangeHandler.d.ts +9 -0
- package/lib/server/cfx/StateBagChangeHandler.js +4 -0
- package/lib/server/cfx/index.d.ts +7 -0
- package/lib/server/cfx/index.js +1 -0
- package/lib/server/entities/BaseEntity.d.ts +115 -0
- package/lib/server/entities/BaseEntity.js +161 -0
- package/lib/server/entities/Entity.d.ts +18 -0
- package/lib/server/entities/Entity.js +22 -0
- package/lib/server/entities/Ped.d.ts +87 -0
- package/lib/server/entities/Ped.js +122 -0
- package/lib/server/entities/Player.d.ts +163 -0
- package/lib/server/entities/Player.js +235 -0
- package/lib/server/entities/Prop.d.ts +32 -0
- package/lib/server/entities/Prop.js +42 -0
- package/lib/server/entities/Vehicle.d.ts +230 -0
- package/lib/server/entities/Vehicle.js +331 -0
- package/lib/server/entities/index.d.ts +5 -0
- package/lib/server/entities/index.js +5 -0
- package/lib/server/enum/ClassTypes.d.ts +11 -0
- package/lib/server/enum/ClassTypes.js +12 -0
- package/lib/server/enum/PopulationType.d.ts +13 -0
- package/lib/server/enum/PopulationType.js +14 -0
- package/lib/server/enum/VehicleLockStatus.d.ts +9 -0
- package/lib/server/enum/VehicleLockStatus.js +10 -0
- package/lib/server/enum/VehicleType.d.ts +10 -0
- package/lib/server/enum/VehicleType.js +11 -0
- package/lib/server/enum/eEntityType.d.ts +5 -0
- package/lib/server/enum/eEntityType.js +6 -0
- package/lib/server/enum/index.d.ts +5 -0
- package/lib/server/enum/index.js +5 -0
- package/lib/server/index.d.ts +7 -0
- package/lib/server/index.js +7 -0
- package/lib/server/type/Anticheat.d.ts +471 -0
- package/lib/server/type/Anticheat.js +160 -0
- package/lib/server/type/Hash.d.ts +3 -0
- package/lib/server/type/Hash.js +2 -0
- package/lib/server/utils/index.d.ts +1 -0
- package/lib/server/utils/index.js +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScreenEffect } from '../enums';
|
|
2
|
+
export declare abstract class Effects {
|
|
3
|
+
static start(effectName: ScreenEffect, duration?: number, looped?: boolean): void;
|
|
4
|
+
static stop(screenEffect?: ScreenEffect): void;
|
|
5
|
+
static isActive(screenEffect: ScreenEffect): boolean;
|
|
6
|
+
private static readonly effects;
|
|
7
|
+
private static effectToString;
|
|
8
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export class Effects {
|
|
2
|
+
static start(effectName, duration = 0, looped = false) {
|
|
3
|
+
StartScreenEffect(this.effectToString(effectName), duration, looped);
|
|
4
|
+
}
|
|
5
|
+
static stop(screenEffect) {
|
|
6
|
+
if (typeof screenEffect === 'undefined') {
|
|
7
|
+
StopAllScreenEffects();
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
StopScreenEffect(this.effectToString(screenEffect));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
static isActive(screenEffect) {
|
|
14
|
+
return GetScreenEffectIsActive(this.effectToString(screenEffect));
|
|
15
|
+
}
|
|
16
|
+
static effectToString(screenEffect) {
|
|
17
|
+
const effect = Number(screenEffect);
|
|
18
|
+
if (effect >= 0 && effect <= this.effects.length) {
|
|
19
|
+
return this.effects[effect];
|
|
20
|
+
}
|
|
21
|
+
return 'INVALID';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
Effects.effects = [
|
|
25
|
+
'SwitchHUDIn',
|
|
26
|
+
'SwitchHUDOut',
|
|
27
|
+
'FocusIn',
|
|
28
|
+
'FocusOut',
|
|
29
|
+
'MinigameEndNeutral',
|
|
30
|
+
'MinigameEndTrevor',
|
|
31
|
+
'MinigameEndFranklin',
|
|
32
|
+
'MinigameEndMichael',
|
|
33
|
+
'MinigameTransitionOut',
|
|
34
|
+
'MinigameTransitionIn',
|
|
35
|
+
'SwitchShortNeutralIn',
|
|
36
|
+
'SwitchShortFranklinIn',
|
|
37
|
+
'SwitchShortTrevorIn',
|
|
38
|
+
'SwitchShortMichaelIn',
|
|
39
|
+
'SwitchOpenMichaelIn',
|
|
40
|
+
'SwitchOpenFranklinIn',
|
|
41
|
+
'SwitchOpenTrevorIn',
|
|
42
|
+
'SwitchHUDMichaelOut',
|
|
43
|
+
'SwitchHUDFranklinOut',
|
|
44
|
+
'SwitchHUDTrevorOut',
|
|
45
|
+
'SwitchShortFranklinMid',
|
|
46
|
+
'SwitchShortMichaelMid',
|
|
47
|
+
'SwitchShortTrevorMid',
|
|
48
|
+
'DeathFailOut',
|
|
49
|
+
'CamPushInNeutral',
|
|
50
|
+
'CamPushInFranklin',
|
|
51
|
+
'CamPushInMichael',
|
|
52
|
+
'CamPushInTrevor',
|
|
53
|
+
'SwitchSceneFranklin',
|
|
54
|
+
'SwitchSceneTrevor',
|
|
55
|
+
'SwitchSceneMichael',
|
|
56
|
+
'SwitchSceneNeutral',
|
|
57
|
+
'MP_Celeb_Win',
|
|
58
|
+
'MP_Celeb_Win_Out',
|
|
59
|
+
'MP_Celeb_Lose',
|
|
60
|
+
'MP_Celeb_Lose_Out',
|
|
61
|
+
'DeathFailNeutralIn',
|
|
62
|
+
'DeathFailMPDark',
|
|
63
|
+
'DeathFailMPIn',
|
|
64
|
+
'MP_Celeb_Preload_Fade',
|
|
65
|
+
'PeyoteEndOut',
|
|
66
|
+
'PeyoteEndIn',
|
|
67
|
+
'PeyoteIn',
|
|
68
|
+
'PeyoteOut',
|
|
69
|
+
'MP_race_crash',
|
|
70
|
+
'SuccessFranklin',
|
|
71
|
+
'SuccessTrevor',
|
|
72
|
+
'SuccessMichael',
|
|
73
|
+
'DrugsMichaelAliensFightIn',
|
|
74
|
+
'DrugsMichaelAliensFight',
|
|
75
|
+
'DrugsMichaelAliensFightOut',
|
|
76
|
+
'DrugsTrevorClownsFightIn',
|
|
77
|
+
'DrugsTrevorClownsFight',
|
|
78
|
+
'DrugsTrevorClownsFightOut',
|
|
79
|
+
'HeistCelebPass',
|
|
80
|
+
'HeistCelebPassBW',
|
|
81
|
+
'HeistCelebEnd',
|
|
82
|
+
'HeistCelebToast',
|
|
83
|
+
'MenuMGHeistIn',
|
|
84
|
+
'MenuMGTournamentIn',
|
|
85
|
+
'MenuMGSelectionIn',
|
|
86
|
+
'ChopVision',
|
|
87
|
+
'DMT_flight_intro',
|
|
88
|
+
'DMT_flight',
|
|
89
|
+
'DrugsDrivingIn',
|
|
90
|
+
'DrugsDrivingOut',
|
|
91
|
+
'SwitchOpenNeutralFIB5',
|
|
92
|
+
'HeistLocate',
|
|
93
|
+
'MP_job_load',
|
|
94
|
+
'RaceTurbo',
|
|
95
|
+
'MP_intro_logo',
|
|
96
|
+
'HeistTripSkipFade',
|
|
97
|
+
'MenuMGHeistOut',
|
|
98
|
+
'MP_corona_switch',
|
|
99
|
+
'MenuMGSelectionTint',
|
|
100
|
+
'SuccessNeutral',
|
|
101
|
+
'ExplosionJosh3',
|
|
102
|
+
'SniperOverlay',
|
|
103
|
+
'RampageOut',
|
|
104
|
+
'Rampage',
|
|
105
|
+
'Dont_tazeme_bro',
|
|
106
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static class for screen fading
|
|
3
|
+
*/
|
|
4
|
+
export declare abstract class Fading {
|
|
5
|
+
/**
|
|
6
|
+
* Gets whether the screen is faded in
|
|
7
|
+
*
|
|
8
|
+
* @returns True or false
|
|
9
|
+
*/
|
|
10
|
+
static get IsFadedIn(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Gets whether the screen is faded out
|
|
13
|
+
*
|
|
14
|
+
* @returns True or false
|
|
15
|
+
*/
|
|
16
|
+
static get IsFadedOut(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Gets whether the screen is currently fading in
|
|
19
|
+
*
|
|
20
|
+
* @returns True or false
|
|
21
|
+
*/
|
|
22
|
+
static get IsFadingIn(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Gets whether the screen is currently fading out
|
|
25
|
+
*
|
|
26
|
+
* @returns True or false
|
|
27
|
+
*/
|
|
28
|
+
static get IsFadingOut(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Fade in the screen for a certain duration.
|
|
31
|
+
*
|
|
32
|
+
* @param duration Time to fade in
|
|
33
|
+
*/
|
|
34
|
+
static fadeIn(duration: number): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Fade out the screen for a certain duration.
|
|
37
|
+
*
|
|
38
|
+
* @param duration Time to fade out
|
|
39
|
+
*/
|
|
40
|
+
static fadeOut(duration: number): Promise<void>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static class for screen fading
|
|
3
|
+
*/
|
|
4
|
+
export class Fading {
|
|
5
|
+
/**
|
|
6
|
+
* Gets whether the screen is faded in
|
|
7
|
+
*
|
|
8
|
+
* @returns True or false
|
|
9
|
+
*/
|
|
10
|
+
static get IsFadedIn() {
|
|
11
|
+
return IsScreenFadedIn();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Gets whether the screen is faded out
|
|
15
|
+
*
|
|
16
|
+
* @returns True or false
|
|
17
|
+
*/
|
|
18
|
+
static get IsFadedOut() {
|
|
19
|
+
return IsScreenFadedOut();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets whether the screen is currently fading in
|
|
23
|
+
*
|
|
24
|
+
* @returns True or false
|
|
25
|
+
*/
|
|
26
|
+
static get IsFadingIn() {
|
|
27
|
+
return IsScreenFadingIn();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets whether the screen is currently fading out
|
|
31
|
+
*
|
|
32
|
+
* @returns True or false
|
|
33
|
+
*/
|
|
34
|
+
static get IsFadingOut() {
|
|
35
|
+
return IsScreenFadingOut();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fade in the screen for a certain duration.
|
|
39
|
+
*
|
|
40
|
+
* @param duration Time to fade in
|
|
41
|
+
*/
|
|
42
|
+
static fadeIn(duration) {
|
|
43
|
+
return new Promise(resolve => {
|
|
44
|
+
DoScreenFadeIn(duration);
|
|
45
|
+
const interval = setInterval(() => {
|
|
46
|
+
if (this.IsFadedIn) {
|
|
47
|
+
clearInterval(interval);
|
|
48
|
+
resolve();
|
|
49
|
+
}
|
|
50
|
+
}, 0);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Fade out the screen for a certain duration.
|
|
55
|
+
*
|
|
56
|
+
* @param duration Time to fade out
|
|
57
|
+
*/
|
|
58
|
+
static fadeOut(duration) {
|
|
59
|
+
return new Promise(resolve => {
|
|
60
|
+
DoScreenFadeOut(duration);
|
|
61
|
+
const interval = setInterval(() => {
|
|
62
|
+
if (this.IsFadedOut) {
|
|
63
|
+
clearInterval(interval);
|
|
64
|
+
resolve();
|
|
65
|
+
}
|
|
66
|
+
}, 0);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CursorSprite, HudComponent } from '../enums';
|
|
2
|
+
import { Point } from '../utils';
|
|
3
|
+
export declare abstract class Hud {
|
|
4
|
+
static isComponentActive(component: HudComponent): boolean;
|
|
5
|
+
static showComponentThisFrame(component: HudComponent): void;
|
|
6
|
+
static hideComponentThisFrame(component: HudComponent): void;
|
|
7
|
+
static showCursorThisFrame(): void;
|
|
8
|
+
static set CursorPosition(position: Point);
|
|
9
|
+
static get CursorSprite(): CursorSprite;
|
|
10
|
+
static set CursorSprite(sprite: CursorSprite);
|
|
11
|
+
static get IsVisible(): boolean;
|
|
12
|
+
static set IsVisible(toggle: boolean);
|
|
13
|
+
static get IsRadarVisible(): boolean;
|
|
14
|
+
static set IsRadarVisible(toggle: boolean);
|
|
15
|
+
static set RadarZoom(zoomLevel: number);
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CursorSprite } from '../enums';
|
|
2
|
+
export class Hud {
|
|
3
|
+
static isComponentActive(component) {
|
|
4
|
+
return IsHudComponentActive(Number(component));
|
|
5
|
+
}
|
|
6
|
+
static showComponentThisFrame(component) {
|
|
7
|
+
ShowHudComponentThisFrame(Number(component));
|
|
8
|
+
}
|
|
9
|
+
static hideComponentThisFrame(component) {
|
|
10
|
+
HideHudComponentThisFrame(Number(component));
|
|
11
|
+
}
|
|
12
|
+
static showCursorThisFrame() {
|
|
13
|
+
ShowCursorThisFrame();
|
|
14
|
+
}
|
|
15
|
+
static set CursorPosition(position) {
|
|
16
|
+
SetCursorLocation(position.X, position.Y);
|
|
17
|
+
}
|
|
18
|
+
static get CursorSprite() {
|
|
19
|
+
return CursorSprite.DownArrow;
|
|
20
|
+
}
|
|
21
|
+
static set CursorSprite(sprite) {
|
|
22
|
+
SetCursorSprite(Number(sprite));
|
|
23
|
+
}
|
|
24
|
+
static get IsVisible() {
|
|
25
|
+
return !(IsHudHidden() || !IsHudPreferenceSwitchedOn());
|
|
26
|
+
}
|
|
27
|
+
static set IsVisible(toggle) {
|
|
28
|
+
DisplayHud(toggle);
|
|
29
|
+
}
|
|
30
|
+
static get IsRadarVisible() {
|
|
31
|
+
return !(IsRadarHidden() || IsRadarPreferenceSwitchedOn());
|
|
32
|
+
}
|
|
33
|
+
static set IsRadarVisible(toggle) {
|
|
34
|
+
DisplayRadar(toggle);
|
|
35
|
+
}
|
|
36
|
+
static set RadarZoom(zoomLevel) {
|
|
37
|
+
SetRadarZoom(zoomLevel);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IButton } from './interfaces/IButton';
|
|
2
|
+
/**
|
|
3
|
+
* Draw native instructional buttons in the bottom left of the screen using scaleform
|
|
4
|
+
*
|
|
5
|
+
* Example:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { InstructionalButtons, Control } from '@nativewrappers/client';
|
|
9
|
+
*
|
|
10
|
+
* const buttons = new InstructionalButtons([
|
|
11
|
+
* {controls: [Control.Context], label: "Interact with Bob"},
|
|
12
|
+
* {controls: [Control.Detonate], label: "Say hello to Alice"}
|
|
13
|
+
* ])
|
|
14
|
+
*
|
|
15
|
+
* setTick(() => {
|
|
16
|
+
* buttons.draw()
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class InstructionalButtons {
|
|
21
|
+
private scaleform;
|
|
22
|
+
/**
|
|
23
|
+
* Draws native instructional buttons
|
|
24
|
+
*
|
|
25
|
+
* @param buttons Array of instructional buttons to be drawn
|
|
26
|
+
*/
|
|
27
|
+
constructor(buttons: IButton[]);
|
|
28
|
+
private pushButton;
|
|
29
|
+
/**
|
|
30
|
+
* Renders the instructional button scaleform
|
|
31
|
+
*/
|
|
32
|
+
draw(): Promise<void>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Scaleform } from './Scaleform';
|
|
2
|
+
/**
|
|
3
|
+
* Draw native instructional buttons in the bottom left of the screen using scaleform
|
|
4
|
+
*
|
|
5
|
+
* Example:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { InstructionalButtons, Control } from '@nativewrappers/client';
|
|
9
|
+
*
|
|
10
|
+
* const buttons = new InstructionalButtons([
|
|
11
|
+
* {controls: [Control.Context], label: "Interact with Bob"},
|
|
12
|
+
* {controls: [Control.Detonate], label: "Say hello to Alice"}
|
|
13
|
+
* ])
|
|
14
|
+
*
|
|
15
|
+
* setTick(() => {
|
|
16
|
+
* buttons.draw()
|
|
17
|
+
* })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class InstructionalButtons {
|
|
21
|
+
/**
|
|
22
|
+
* Draws native instructional buttons
|
|
23
|
+
*
|
|
24
|
+
* @param buttons Array of instructional buttons to be drawn
|
|
25
|
+
*/
|
|
26
|
+
constructor(buttons) {
|
|
27
|
+
this.scaleform = new Scaleform('INSTRUCTIONAL_BUTTONS');
|
|
28
|
+
this.scaleform.callFunction('CLEAR_ALL');
|
|
29
|
+
this.scaleform.callFunction('SET_CLEAR_SPACE', 200);
|
|
30
|
+
buttons.forEach((button, index) => {
|
|
31
|
+
this.pushButton(button, index);
|
|
32
|
+
});
|
|
33
|
+
this.scaleform.callFunction('DRAW_INSTRUCTIONAL_BUTTONS');
|
|
34
|
+
this.scaleform.callFunction('SET_BACKGROUND_COLOUR', 0, 0, 0, 80);
|
|
35
|
+
}
|
|
36
|
+
pushButton(button, index) {
|
|
37
|
+
BeginScaleformMovieMethod(this.scaleform.Handle, 'SET_DATA_SLOT');
|
|
38
|
+
PushScaleformMovieFunctionParameterInt(index);
|
|
39
|
+
// Looping backwards here since scaleform is using a stack so the first control ends up being the last
|
|
40
|
+
// So looping backwards makes more sense here so that the controls are rendered in the order they're defined
|
|
41
|
+
for (let i = button.controls.length - 1; i >= 0; i--) {
|
|
42
|
+
PushScaleformMovieMethodParameterButtonName(GetControlInstructionalButton(2, button.controls[i], true));
|
|
43
|
+
}
|
|
44
|
+
PushScaleformMovieMethodParameterString(button.label);
|
|
45
|
+
EndScaleformMovieMethod();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Renders the instructional button scaleform
|
|
49
|
+
*/
|
|
50
|
+
async draw() {
|
|
51
|
+
await this.scaleform.render2D();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LoadingSpinnerType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
* Show and hide loading prompt on the bottom right of the screen.
|
|
4
|
+
*
|
|
5
|
+
* Example:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { LoadingPrompt } from '@nativewrappers/client/ui';
|
|
9
|
+
*
|
|
10
|
+
* LoadingPrompt.show("Hello World");
|
|
11
|
+
*
|
|
12
|
+
* setTimeout(() => {
|
|
13
|
+
* LoadingPrompt.hide();
|
|
14
|
+
* }, 10000)'
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class LoadingPrompt {
|
|
18
|
+
/**
|
|
19
|
+
* Shows a loading prompt.
|
|
20
|
+
*
|
|
21
|
+
* @param loadingText Text to be displayed inside loading prompt.
|
|
22
|
+
* @param spinnerType Type of spinner.
|
|
23
|
+
*/
|
|
24
|
+
static show(loadingText?: string, spinnerType?: LoadingSpinnerType): void;
|
|
25
|
+
static hide(): void;
|
|
26
|
+
static get IsActive(): boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LoadingSpinnerType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
* Show and hide loading prompt on the bottom right of the screen.
|
|
4
|
+
*
|
|
5
|
+
* Example:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { LoadingPrompt } from '@nativewrappers/client/ui';
|
|
9
|
+
*
|
|
10
|
+
* LoadingPrompt.show("Hello World");
|
|
11
|
+
*
|
|
12
|
+
* setTimeout(() => {
|
|
13
|
+
* LoadingPrompt.hide();
|
|
14
|
+
* }, 10000)'
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export class LoadingPrompt {
|
|
18
|
+
/**
|
|
19
|
+
* Shows a loading prompt.
|
|
20
|
+
*
|
|
21
|
+
* @param loadingText Text to be displayed inside loading prompt.
|
|
22
|
+
* @param spinnerType Type of spinner.
|
|
23
|
+
*/
|
|
24
|
+
static show(loadingText = '', spinnerType = LoadingSpinnerType.RegularClockwise) {
|
|
25
|
+
if (this.IsActive) {
|
|
26
|
+
this.hide();
|
|
27
|
+
}
|
|
28
|
+
if (loadingText === '') {
|
|
29
|
+
BeginTextCommandBusyString('');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
BeginTextCommandBusyString('STRING');
|
|
33
|
+
AddTextComponentSubstringPlayerName(loadingText);
|
|
34
|
+
}
|
|
35
|
+
EndTextCommandBusyString(Number(spinnerType));
|
|
36
|
+
}
|
|
37
|
+
static hide() {
|
|
38
|
+
if (this.IsActive) {
|
|
39
|
+
RemoveLoadingPrompt();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static get IsActive() {
|
|
43
|
+
return IsLoadingPromptBeingDisplayed();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../utils';
|
|
2
|
+
import { IDrawable } from './';
|
|
3
|
+
export declare class Rectangle implements IDrawable {
|
|
4
|
+
pos: Point;
|
|
5
|
+
size: Size;
|
|
6
|
+
color: Color;
|
|
7
|
+
constructor(pos: Point, size: Size, color: Color);
|
|
8
|
+
draw(offset?: Size, resolution?: Size): void;
|
|
9
|
+
draw(pos: Point, size: Size, color: Color, resolution?: Size): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Point, Size } from '../utils';
|
|
2
|
+
import { Screen } from './';
|
|
3
|
+
export class Rectangle {
|
|
4
|
+
constructor(pos, size, color) {
|
|
5
|
+
this.pos = pos;
|
|
6
|
+
this.size = size;
|
|
7
|
+
this.color = color;
|
|
8
|
+
}
|
|
9
|
+
draw(arg1, arg2, color, resolution) {
|
|
10
|
+
resolution = color === undefined ? arg2 : resolution;
|
|
11
|
+
resolution = resolution || new Size(Screen.ScaledWidth, Screen.Height);
|
|
12
|
+
if (color === undefined) {
|
|
13
|
+
if (arg1 && arg1 instanceof Size) {
|
|
14
|
+
arg1 = new Point(this.pos.X + arg1.width, this.pos.Y + arg1.height);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
arg1 = this.pos;
|
|
18
|
+
}
|
|
19
|
+
arg2 = this.size;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if (!arg1) {
|
|
23
|
+
arg1 = this.pos;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
arg1 = arg1;
|
|
27
|
+
}
|
|
28
|
+
arg2 = arg2 || this.size;
|
|
29
|
+
}
|
|
30
|
+
color = color || this.color;
|
|
31
|
+
const w = arg2.width / resolution.width;
|
|
32
|
+
const h = arg2.height / resolution.height;
|
|
33
|
+
const x = arg1.X / resolution.width + w * 0.5;
|
|
34
|
+
const y = arg1.Y / resolution.height + h * 0.5;
|
|
35
|
+
DrawRect(x, y, w, h, color.r, color.g, color.b, color.a);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { PointF, Vector3 } from '../utils';
|
|
2
|
+
/**
|
|
3
|
+
* Scaleforms will automatically load when calling any of the render functions.
|
|
4
|
+
*
|
|
5
|
+
* Example:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { Scaleform } from '@nativewrappers/client/ui';
|
|
9
|
+
*
|
|
10
|
+
* const scaleform = new Cfx.Scaleform("MIDSIZED_MESSAGE");
|
|
11
|
+
*
|
|
12
|
+
* scaleform.callFunction("SHOW_MIDSIZED_MESSAGE", ["Title", "Message"]);
|
|
13
|
+
*
|
|
14
|
+
* setTick(() => {
|
|
15
|
+
* await scaleform.render2D();
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class Scaleform {
|
|
20
|
+
static render2DMasked(scaleform1: Scaleform, scaleform2: Scaleform): Promise<void>;
|
|
21
|
+
protected handle: number;
|
|
22
|
+
protected name: string;
|
|
23
|
+
protected loaded: boolean;
|
|
24
|
+
constructor(name: string);
|
|
25
|
+
/**
|
|
26
|
+
* Get the handle of the scaleform.
|
|
27
|
+
*/
|
|
28
|
+
get Handle(): number;
|
|
29
|
+
/**
|
|
30
|
+
* Get whether the handle is a valid handle.
|
|
31
|
+
*/
|
|
32
|
+
get IsValid(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Get whether the scaleform is loaded.
|
|
35
|
+
*/
|
|
36
|
+
get IsLoaded(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Dispose the scaleform allowing the GTA engine to free memory when wanted.
|
|
39
|
+
*/
|
|
40
|
+
dispose(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Call a function on the scaleform.
|
|
43
|
+
*
|
|
44
|
+
* @param name Name of the function
|
|
45
|
+
* @param args Additional arguments
|
|
46
|
+
*/
|
|
47
|
+
callFunction(name: string, ...args: unknown[]): void;
|
|
48
|
+
/**
|
|
49
|
+
* Calls a void method on the scaleform.
|
|
50
|
+
*
|
|
51
|
+
* @param name Name of the function
|
|
52
|
+
*/
|
|
53
|
+
callVoidMethod(name: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Calls a string method on the scaleform.
|
|
56
|
+
*
|
|
57
|
+
* @param name Name of the function
|
|
58
|
+
* @param param1
|
|
59
|
+
* @param param2
|
|
60
|
+
* @param param3
|
|
61
|
+
* @param param4
|
|
62
|
+
* @param param5
|
|
63
|
+
*/
|
|
64
|
+
callStringMethod(name: string, param1?: string, param2?: string, param3?: string, param4?: string, param5?: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* Calls a number method on the scaleform.
|
|
67
|
+
*
|
|
68
|
+
* @param name Name of the function
|
|
69
|
+
* @param param1
|
|
70
|
+
* @param param2
|
|
71
|
+
* @param param3
|
|
72
|
+
* @param param4
|
|
73
|
+
* @param param5
|
|
74
|
+
*/
|
|
75
|
+
callNumberMethod(name: string, param1?: number, param2?: number, param3?: number, param4?: number, param5?: number): void;
|
|
76
|
+
/**
|
|
77
|
+
* Calls a number & string method on the scaleform.
|
|
78
|
+
*
|
|
79
|
+
* @param name Name of the function
|
|
80
|
+
* @param fParam1
|
|
81
|
+
* @param fParam2
|
|
82
|
+
* @param fParam3
|
|
83
|
+
* @param fParam4
|
|
84
|
+
* @param fParam5
|
|
85
|
+
* @param sParam1
|
|
86
|
+
* @param sParam2
|
|
87
|
+
* @param sParam3
|
|
88
|
+
* @param sParam4
|
|
89
|
+
* @param sParam5
|
|
90
|
+
*/
|
|
91
|
+
callSharedMethod(name: string, fParam1?: number, fParam2?: number, fParam3?: number, fParam4?: number, fParam5?: number, sParam1?: string, sParam2?: string, sParam3?: string, sParam4?: string, sParam5?: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* Sets a duration the scaleform should be shown.
|
|
94
|
+
* Useful for showing a scaleform for a known amount of time, such as messages.
|
|
95
|
+
*
|
|
96
|
+
* This only works for any scaleform using {@linkcode render2D};
|
|
97
|
+
*
|
|
98
|
+
* @param duration Duration in milliseconds
|
|
99
|
+
*/
|
|
100
|
+
setDuration(duration: number): void;
|
|
101
|
+
render2D(): Promise<void>;
|
|
102
|
+
render2DScreenSpace(location: PointF, size: PointF): Promise<void>;
|
|
103
|
+
render3D(position: Vector3, rotation: Vector3, scale: Vector3): Promise<void>;
|
|
104
|
+
render3DAdditive(position: Vector3, rotation: Vector3, scale: Vector3): Promise<void>;
|
|
105
|
+
load(): Promise<boolean>;
|
|
106
|
+
}
|