@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,77 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../../../../utils';
|
|
2
|
+
import { AbstractUIMenuPanel } from './';
|
|
3
|
+
import { Menu, Rectangle } from '../../../';
|
|
4
|
+
export class UIMenuStatisticsPanel extends AbstractUIMenuPanel {
|
|
5
|
+
constructor(item, divider = true) {
|
|
6
|
+
super();
|
|
7
|
+
this._divider = true;
|
|
8
|
+
this._items = [];
|
|
9
|
+
this.background = new Rectangle(new Point(), new Size(431, 47), new Color(170, 0, 0, 0));
|
|
10
|
+
if (item) {
|
|
11
|
+
this.addItem(item);
|
|
12
|
+
}
|
|
13
|
+
this.Divider = divider;
|
|
14
|
+
}
|
|
15
|
+
get Divider() {
|
|
16
|
+
return this._divider;
|
|
17
|
+
}
|
|
18
|
+
set Divider(value) {
|
|
19
|
+
this._divider = value || false;
|
|
20
|
+
}
|
|
21
|
+
get Items() {
|
|
22
|
+
return this._items;
|
|
23
|
+
}
|
|
24
|
+
set Items(value) {
|
|
25
|
+
this._items = value;
|
|
26
|
+
}
|
|
27
|
+
addItem(item) {
|
|
28
|
+
const items = Array.isArray(item) ? item : [item];
|
|
29
|
+
this._items.push(...items);
|
|
30
|
+
}
|
|
31
|
+
removeItem(itemOrIndex) {
|
|
32
|
+
if (typeof itemOrIndex === 'number') {
|
|
33
|
+
this._items = this._items.filter((i, index) => index !== itemOrIndex);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._items = this._items.filter(i => i.id !== itemOrIndex.id);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setVerticalPosition(y) {
|
|
40
|
+
super.setVerticalPosition(y);
|
|
41
|
+
this._items.forEach(async (item, index) => {
|
|
42
|
+
const itemCountOffset = 40 * (index + 1);
|
|
43
|
+
const yOffset = y + itemCountOffset - 22;
|
|
44
|
+
item.backgroundBar.pos.Y = yOffset;
|
|
45
|
+
item.activeBar.pos.Y = yOffset;
|
|
46
|
+
item.text.pos.Y = yOffset - 12;
|
|
47
|
+
if (this._divider) {
|
|
48
|
+
item.divider.forEach(async (divider) => {
|
|
49
|
+
divider.pos.Y = yOffset;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
draw() {
|
|
55
|
+
if (this.enabled) {
|
|
56
|
+
super.draw();
|
|
57
|
+
const x = this.parentItem?.offset.X ?? 0 + (this.ParentMenu?.WidthOffset ?? 0) / 2;
|
|
58
|
+
this._items.forEach(async (item, index) => {
|
|
59
|
+
const itemCountOffset = 40 * (index + 1);
|
|
60
|
+
item.backgroundBar.pos.X = x + 200;
|
|
61
|
+
item.activeBar.pos.X = x + 200;
|
|
62
|
+
item.text.pos.X = x + 13;
|
|
63
|
+
item.backgroundBar.draw(undefined, Menu.screenResolution);
|
|
64
|
+
item.activeBar.draw(undefined, Menu.screenResolution);
|
|
65
|
+
item.text.draw(undefined, Menu.screenResolution);
|
|
66
|
+
if (this._divider) {
|
|
67
|
+
item.divider.forEach(async (divider, index) => {
|
|
68
|
+
const dividerWidthOffset = (index + 1) * 40;
|
|
69
|
+
divider.pos.X = x + dividerWidthOffset + 200;
|
|
70
|
+
this.background.size.height = itemCountOffset + 47 - 39;
|
|
71
|
+
divider.draw(undefined, Menu.screenResolution);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Rectangle, Text } from '../../../';
|
|
2
|
+
export declare class UIMenuStatisticsPanelItem {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly text: Text;
|
|
5
|
+
readonly activeBar: Rectangle;
|
|
6
|
+
readonly backgroundBar: Rectangle;
|
|
7
|
+
readonly divider: Rectangle[];
|
|
8
|
+
constructor(name: string, percentage?: number);
|
|
9
|
+
get Name(): string;
|
|
10
|
+
set Name(value: string);
|
|
11
|
+
get Percentage(): number;
|
|
12
|
+
set Percentage(value: number);
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Color, Crypto, Point, Size } from '../../../../utils';
|
|
2
|
+
import { Rectangle, Text } from '../../../';
|
|
3
|
+
import { Alignment, Font } from '../../../../enums';
|
|
4
|
+
export class UIMenuStatisticsPanelItem {
|
|
5
|
+
constructor(name, percentage = 0) {
|
|
6
|
+
this.id = Crypto.uuidv4();
|
|
7
|
+
this.divider = [];
|
|
8
|
+
this.text = new Text('', new Point(), 0.35, Color.white, Font.ChaletLondon, Alignment.Left);
|
|
9
|
+
this.backgroundBar = new Rectangle(new Point(), new Size(200, 10), Color.fromArgb(100, 87, 87, 87));
|
|
10
|
+
this.activeBar = new Rectangle(new Point(), new Size(0, 10), Color.white);
|
|
11
|
+
for (let i = 1; i <= 4; i++) {
|
|
12
|
+
this.divider.push(new Rectangle(new Point(), new Size(2, 10), Color.black));
|
|
13
|
+
}
|
|
14
|
+
this.Name = name;
|
|
15
|
+
this.Percentage = percentage;
|
|
16
|
+
}
|
|
17
|
+
get Name() {
|
|
18
|
+
return this.text.caption;
|
|
19
|
+
}
|
|
20
|
+
set Name(value) {
|
|
21
|
+
this.text.caption = value ? value.trim() : '';
|
|
22
|
+
}
|
|
23
|
+
get Percentage() {
|
|
24
|
+
return this.activeBar.size.width / 200;
|
|
25
|
+
}
|
|
26
|
+
set Percentage(value) {
|
|
27
|
+
value = value || 0;
|
|
28
|
+
value = Math.round(value * 100) / 100;
|
|
29
|
+
value = value < 0 ? 0 : value > 1 ? 1 : value;
|
|
30
|
+
this.activeBar.size.width = value * 200;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -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';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListItem } from './ListItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ListItem } from './ListItem';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A utility to load an animation dictionary, anything that loads an animation should RemoveAnimDict after its finish being used.
|
|
3
|
+
* @param animDict the animation dictionary to load
|
|
4
|
+
* @param waitTime how long to wait for the dictionary to load
|
|
5
|
+
* @returns {boolean} if the animation successfully loaded
|
|
6
|
+
*/
|
|
7
|
+
export declare const LoadAnimDict: (animDict: string, waitTime?: number) => Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* A utility to load multiple animation dictionary, anything that loads an animation should RemoveAnimDict after its finish being used.
|
|
10
|
+
* @param animDict the animation dictionary to load
|
|
11
|
+
* @param waitTime how long to wait for the dictionary to load
|
|
12
|
+
* @returns if the animation successfully loaded, if the animation failed to load it will return an array of animations that failed to load
|
|
13
|
+
*/
|
|
14
|
+
export declare const LoadAnimDictArray: (animDict: string[], waitTime?: number) => Promise<[boolean, string[] | null]>;
|
|
15
|
+
/**
|
|
16
|
+
* A utility to unload multiple animation dictionary
|
|
17
|
+
* @param animDict the animation dictionaries to unload
|
|
18
|
+
*/
|
|
19
|
+
export declare const RemoveAnimDictArray: (animDict: string[]) => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Wait } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* A utility to load an animation dictionary, anything that loads an animation should RemoveAnimDict after its finish being used.
|
|
4
|
+
* @param animDict the animation dictionary to load
|
|
5
|
+
* @param waitTime how long to wait for the dictionary to load
|
|
6
|
+
* @returns {boolean} if the animation successfully loaded
|
|
7
|
+
*/
|
|
8
|
+
export const LoadAnimDict = async (animDict, waitTime = 1000) => {
|
|
9
|
+
const start = GetGameTimer();
|
|
10
|
+
if (!HasAnimDictLoaded(animDict)) {
|
|
11
|
+
RequestAnimDict(animDict);
|
|
12
|
+
}
|
|
13
|
+
while (!HasAnimDictLoaded(animDict)) {
|
|
14
|
+
if (GetGameTimer() - start >= waitTime)
|
|
15
|
+
return false;
|
|
16
|
+
await Wait(0);
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A utility to load multiple animation dictionary, anything that loads an animation should RemoveAnimDict after its finish being used.
|
|
22
|
+
* @param animDict the animation dictionary to load
|
|
23
|
+
* @param waitTime how long to wait for the dictionary to load
|
|
24
|
+
* @returns if the animation successfully loaded, if the animation failed to load it will return an array of animations that failed to load
|
|
25
|
+
*/
|
|
26
|
+
export const LoadAnimDictArray = async (animDict, waitTime = 1000) => {
|
|
27
|
+
const start = GetGameTimer();
|
|
28
|
+
for (const dict of animDict) {
|
|
29
|
+
if (!HasAnimDictLoaded(dict)) {
|
|
30
|
+
RequestAnimDict(dict);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// TODO: more optimized way to do this
|
|
34
|
+
const animsLoaded = new Set();
|
|
35
|
+
while (animsLoaded.size !== animDict.length) {
|
|
36
|
+
for (const dict of animDict) {
|
|
37
|
+
if (!animsLoaded.has(dict) && HasAnimDictLoaded(dict)) {
|
|
38
|
+
animsLoaded.add(dict);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (GetGameTimer() - start >= waitTime)
|
|
42
|
+
return [false, animDict.filter(dict => !animsLoaded.has(dict))];
|
|
43
|
+
await Wait(0);
|
|
44
|
+
}
|
|
45
|
+
return [true, null];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* A utility to unload multiple animation dictionary
|
|
49
|
+
* @param animDict the animation dictionaries to unload
|
|
50
|
+
*/
|
|
51
|
+
export const RemoveAnimDictArray = (animDict) => {
|
|
52
|
+
for (const dict of animDict) {
|
|
53
|
+
RemoveAnimDict(dict);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class Color {
|
|
2
|
+
static empty: Color;
|
|
3
|
+
static transparent: Color;
|
|
4
|
+
static black: Color;
|
|
5
|
+
static white: Color;
|
|
6
|
+
static whiteSmoke: Color;
|
|
7
|
+
static fromArgb(a: number, r: number, g: number, b: number): Color;
|
|
8
|
+
static fromRgb(r: number, g: number, b: number): Color;
|
|
9
|
+
static fromArray(primitive: [number, number, number] | number[]): Color;
|
|
10
|
+
a: number;
|
|
11
|
+
r: number;
|
|
12
|
+
g: number;
|
|
13
|
+
b: number;
|
|
14
|
+
constructor(a: number | undefined, r: number, g: number, b: number);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class Color {
|
|
2
|
+
static fromArgb(a, r, g, b) {
|
|
3
|
+
return new Color(a, r, g, b);
|
|
4
|
+
}
|
|
5
|
+
static fromRgb(r, g, b) {
|
|
6
|
+
return new Color(255, r, g, b);
|
|
7
|
+
}
|
|
8
|
+
static fromArray(primitive) {
|
|
9
|
+
return new Color(255, primitive[0], primitive[1], primitive[2]);
|
|
10
|
+
}
|
|
11
|
+
constructor(a = 255, r, g, b) {
|
|
12
|
+
this.a = a;
|
|
13
|
+
this.r = r;
|
|
14
|
+
this.g = g;
|
|
15
|
+
this.b = b;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
Color.empty = new Color(0, 0, 0, 0);
|
|
19
|
+
Color.transparent = new Color(0, 0, 0, 0);
|
|
20
|
+
Color.black = new Color(255, 0, 0, 0);
|
|
21
|
+
Color.white = new Color(255, 255, 255, 255);
|
|
22
|
+
Color.whiteSmoke = new Color(255, 245, 245, 245);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class Crypto {
|
|
2
|
+
static uuidv4() {
|
|
3
|
+
let uuid = '';
|
|
4
|
+
for (let ii = 0; ii < 32; ii += 1) {
|
|
5
|
+
switch (ii) {
|
|
6
|
+
case 8:
|
|
7
|
+
case 20:
|
|
8
|
+
uuid += '-';
|
|
9
|
+
uuid += ((Math.random() * 16) | 0).toString(16);
|
|
10
|
+
break;
|
|
11
|
+
case 12:
|
|
12
|
+
uuid += '-';
|
|
13
|
+
uuid += '4';
|
|
14
|
+
break;
|
|
15
|
+
case 16:
|
|
16
|
+
uuid += '-';
|
|
17
|
+
uuid += ((Math.random() * 4) | 8).toString(16);
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
uuid += ((Math.random() * 16) | 0).toString(16);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return uuid;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LiteEvent {
|
|
2
|
+
on(handler: {
|
|
3
|
+
(...args: unknown[]): any;
|
|
4
|
+
}): void;
|
|
5
|
+
off(handler: {
|
|
6
|
+
(...args: unknown[]): any;
|
|
7
|
+
}): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class LiteEvent implements LiteEvent {
|
|
10
|
+
private handlers;
|
|
11
|
+
emit(...args: unknown[]): void;
|
|
12
|
+
expose(): LiteEvent;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
3
|
+
export class LiteEvent {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.handlers = [];
|
|
6
|
+
}
|
|
7
|
+
on(handler) {
|
|
8
|
+
this.handlers.push(handler);
|
|
9
|
+
}
|
|
10
|
+
off(handler) {
|
|
11
|
+
this.handlers = this.handlers.filter(h => h !== handler);
|
|
12
|
+
}
|
|
13
|
+
emit(...args) {
|
|
14
|
+
this.handlers.slice(0).forEach(h => {
|
|
15
|
+
h(...args);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
expose() {
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class Point {
|
|
2
|
+
static parse(arg) {
|
|
3
|
+
let point = new Point();
|
|
4
|
+
if (arg) {
|
|
5
|
+
if (typeof arg === 'object') {
|
|
6
|
+
if (Array.isArray(arg)) {
|
|
7
|
+
if (arg.length === 2) {
|
|
8
|
+
point = new Point(arg[0], arg[1]);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
else if (arg.X && arg.Y) {
|
|
12
|
+
point = new Point(arg.X, arg.Y);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
if (arg.indexOf(',') !== -1) {
|
|
17
|
+
const arr = arg.split(',');
|
|
18
|
+
point = new Point(parseFloat(arr[0]), parseFloat(arr[1]));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return point;
|
|
23
|
+
}
|
|
24
|
+
constructor(x = 0, y = 0) {
|
|
25
|
+
this.X = x;
|
|
26
|
+
this.Y = y;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3';
|
|
2
|
+
export declare class Quaternion {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
w: number;
|
|
7
|
+
constructor(value: number);
|
|
8
|
+
constructor(vector: Vector3, w: number);
|
|
9
|
+
constructor(x: number, y: number, z: number, w: number);
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3';
|
|
2
|
+
export class Quaternion {
|
|
3
|
+
constructor(valueXOrVector, yOrW, z, w) {
|
|
4
|
+
if (valueXOrVector instanceof Vector3) {
|
|
5
|
+
this.x = valueXOrVector.x;
|
|
6
|
+
this.y = valueXOrVector.y;
|
|
7
|
+
this.z = valueXOrVector.z;
|
|
8
|
+
this.w = yOrW ?? 0;
|
|
9
|
+
}
|
|
10
|
+
else if (yOrW === undefined) {
|
|
11
|
+
this.x = valueXOrVector;
|
|
12
|
+
this.y = valueXOrVector;
|
|
13
|
+
this.z = valueXOrVector;
|
|
14
|
+
this.w = valueXOrVector;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.x = valueXOrVector;
|
|
18
|
+
this.y = yOrW;
|
|
19
|
+
this.z = z ?? 0;
|
|
20
|
+
this.w = w ?? 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Font } from '..';
|
|
2
|
+
export declare abstract class String {
|
|
3
|
+
static stringToArray(input: string): string[];
|
|
4
|
+
static measureStringWidthNoConvert(input: string, font?: Font, scale?: number): number;
|
|
5
|
+
static measureString(str: string, font?: Font, scale?: number, screenWidth?: number): number;
|
|
6
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Font, Screen, Text } from '..';
|
|
2
|
+
import { Maths } from './Maths';
|
|
3
|
+
export class String {
|
|
4
|
+
static stringToArray(input) {
|
|
5
|
+
let stringsNeeded = 1;
|
|
6
|
+
if (input.length > 99) {
|
|
7
|
+
stringsNeeded = Math.ceil(input.length / 99);
|
|
8
|
+
}
|
|
9
|
+
const outputString = new Array(stringsNeeded);
|
|
10
|
+
for (let i = 0; i < stringsNeeded; i++) {
|
|
11
|
+
outputString[i] = input.substring(i * 99, i * 99 + Maths.clamp(input.substring(i * 99).length, 0, 99));
|
|
12
|
+
}
|
|
13
|
+
return outputString;
|
|
14
|
+
}
|
|
15
|
+
static measureStringWidthNoConvert(input, font = Font.ChaletLondon, scale = 0) {
|
|
16
|
+
SetTextEntryForWidth('STRING');
|
|
17
|
+
Text.addLongString(input);
|
|
18
|
+
SetTextFont(font);
|
|
19
|
+
SetTextScale(1, scale);
|
|
20
|
+
return GetTextScreenWidth(false);
|
|
21
|
+
}
|
|
22
|
+
static measureString(str, font, scale, screenWidth = Screen.ScaledWidth) {
|
|
23
|
+
return this.measureStringWidthNoConvert(str, font, scale) * screenWidth;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface Vec2 {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export type Vector2Type = Vector2 | Vec2;
|
|
6
|
+
export declare class Vector2 implements Vec2 {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
static create(v1: Vec2 | number): Vector2;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a vector from an array of numbers
|
|
12
|
+
* @param primitive An array of numbers (usually returned by a native)
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
static fromArray(primitive: [number, number] | number[]): Vector2;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an array of vectors from an array number arrays
|
|
18
|
+
* @param primitives A multi-dimensional array of number arrays
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
static fromArrays(primitives: [number, number][] | number[][]): Vector2[];
|
|
22
|
+
static clone(v1: Vec2): Vector2;
|
|
23
|
+
static add(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
24
|
+
static subtract(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
25
|
+
static multiply(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
26
|
+
static divide(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
27
|
+
static dotProduct(v1: Vector2Type, v2: Vector2Type): number;
|
|
28
|
+
static normalize(v: Vector2): Vector2;
|
|
29
|
+
constructor(x: number, y: number);
|
|
30
|
+
clone(): Vector2;
|
|
31
|
+
/**
|
|
32
|
+
* The product of the Euclidean magnitudes of this and another Vector2.
|
|
33
|
+
*
|
|
34
|
+
* @param v Vector2 to find Euclidean magnitude between.
|
|
35
|
+
* @returns Euclidean magnitude with another vector.
|
|
36
|
+
*/
|
|
37
|
+
distanceSquared(v: Vector2Type): number;
|
|
38
|
+
/**
|
|
39
|
+
* The distance between two Vectors.
|
|
40
|
+
*
|
|
41
|
+
* @param v Vector2 to find distance between.
|
|
42
|
+
* @returns Distance between this and another vector.
|
|
43
|
+
*/
|
|
44
|
+
distance(v: Vector2Type): number;
|
|
45
|
+
get normalize(): Vector2;
|
|
46
|
+
dotProduct(v: Vector2Type): number;
|
|
47
|
+
add(v: Vector2Type | number): Vector2;
|
|
48
|
+
subtract(v: Vector2Type): Vector2;
|
|
49
|
+
multiply(v: Vector2Type | number): Vector2;
|
|
50
|
+
divide(v: Vector2Type | number): Vector2;
|
|
51
|
+
toArray(): [number, number];
|
|
52
|
+
replace(v: Vector2Type): void;
|
|
53
|
+
get Length(): number;
|
|
54
|
+
}
|