@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,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scaleforms will automatically load when calling any of the render functions.
|
|
3
|
+
*
|
|
4
|
+
* Example:
|
|
5
|
+
*
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import { Scaleform } from '@nativewrappers/client/ui';
|
|
8
|
+
*
|
|
9
|
+
* const scaleform = new Cfx.Scaleform("MIDSIZED_MESSAGE");
|
|
10
|
+
*
|
|
11
|
+
* scaleform.callFunction("SHOW_MIDSIZED_MESSAGE", ["Title", "Message"]);
|
|
12
|
+
*
|
|
13
|
+
* setTick(() => {
|
|
14
|
+
* await scaleform.render2D();
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export class Scaleform {
|
|
19
|
+
static render2DMasked(scaleform1, scaleform2) {
|
|
20
|
+
return new Promise(async (resolve) => {
|
|
21
|
+
if (scaleform1.IsLoaded && scaleform2.IsLoaded) {
|
|
22
|
+
DrawScaleformMovieFullscreenMasked(scaleform1.Handle, scaleform2.Handle, 255, 255, 255, 255);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
await scaleform1.load();
|
|
26
|
+
await scaleform2.load();
|
|
27
|
+
}
|
|
28
|
+
resolve();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
constructor(name) {
|
|
32
|
+
this.loaded = false;
|
|
33
|
+
this.name = name;
|
|
34
|
+
this.handle = RequestScaleformMovie(this.name);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get the handle of the scaleform.
|
|
38
|
+
*/
|
|
39
|
+
get Handle() {
|
|
40
|
+
return this.handle;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get whether the handle is a valid handle.
|
|
44
|
+
*/
|
|
45
|
+
get IsValid() {
|
|
46
|
+
return this.handle !== 0;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get whether the scaleform is loaded.
|
|
50
|
+
*/
|
|
51
|
+
get IsLoaded() {
|
|
52
|
+
if (!this.loaded) {
|
|
53
|
+
this.loaded = HasScaleformMovieLoaded(this.handle);
|
|
54
|
+
}
|
|
55
|
+
return this.loaded;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Dispose the scaleform allowing the GTA engine to free memory when wanted.
|
|
59
|
+
*/
|
|
60
|
+
dispose() {
|
|
61
|
+
if (this.IsLoaded) {
|
|
62
|
+
SetScaleformMovieAsNoLongerNeeded(this.handle);
|
|
63
|
+
this.loaded = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Call a function on the scaleform.
|
|
68
|
+
*
|
|
69
|
+
* @param name Name of the function
|
|
70
|
+
* @param args Additional arguments
|
|
71
|
+
*/
|
|
72
|
+
callFunction(name, ...args) {
|
|
73
|
+
BeginScaleformMovieMethod(this.handle, name);
|
|
74
|
+
args.forEach(arg => {
|
|
75
|
+
switch (typeof arg) {
|
|
76
|
+
case 'number':
|
|
77
|
+
PushScaleformMovieFunctionParameterInt(arg);
|
|
78
|
+
break;
|
|
79
|
+
case 'string':
|
|
80
|
+
PushScaleformMovieFunctionParameterString(arg);
|
|
81
|
+
break;
|
|
82
|
+
case 'boolean':
|
|
83
|
+
PushScaleformMovieFunctionParameterBool(arg);
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
throw new Error(`Unknown argument type [${typeof arg}] passed to scaleform with handle [${this.handle}], had value of ${arg}`);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
EndScaleformMovieMethod();
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Calls a void method on the scaleform.
|
|
93
|
+
*
|
|
94
|
+
* @param name Name of the function
|
|
95
|
+
*/
|
|
96
|
+
callVoidMethod(name) {
|
|
97
|
+
CallScaleformMovieMethod(this.handle, name);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Calls a string method on the scaleform.
|
|
101
|
+
*
|
|
102
|
+
* @param name Name of the function
|
|
103
|
+
* @param param1
|
|
104
|
+
* @param param2
|
|
105
|
+
* @param param3
|
|
106
|
+
* @param param4
|
|
107
|
+
* @param param5
|
|
108
|
+
*/
|
|
109
|
+
callStringMethod(name, param1 = '', param2 = '', param3 = '', param4 = '', param5 = '') {
|
|
110
|
+
CallScaleformMovieMethodWithString(this.handle, name, param1, param2, param3, param4, param5);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Calls a number method on the scaleform.
|
|
114
|
+
*
|
|
115
|
+
* @param name Name of the function
|
|
116
|
+
* @param param1
|
|
117
|
+
* @param param2
|
|
118
|
+
* @param param3
|
|
119
|
+
* @param param4
|
|
120
|
+
* @param param5
|
|
121
|
+
*/
|
|
122
|
+
callNumberMethod(name, param1 = -1.0, param2 = -1.0, param3 = -1.0, param4 = -1.0, param5 = -1.0) {
|
|
123
|
+
CallScaleformMovieMethodWithNumber(this.handle, name, param1, param2, param3, param4, param5);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Calls a number & string method on the scaleform.
|
|
127
|
+
*
|
|
128
|
+
* @param name Name of the function
|
|
129
|
+
* @param fParam1
|
|
130
|
+
* @param fParam2
|
|
131
|
+
* @param fParam3
|
|
132
|
+
* @param fParam4
|
|
133
|
+
* @param fParam5
|
|
134
|
+
* @param sParam1
|
|
135
|
+
* @param sParam2
|
|
136
|
+
* @param sParam3
|
|
137
|
+
* @param sParam4
|
|
138
|
+
* @param sParam5
|
|
139
|
+
*/
|
|
140
|
+
callSharedMethod(name, fParam1 = -1.0, fParam2 = -1.0, fParam3 = -1.0, fParam4 = -1.0, fParam5 = -1.0, sParam1 = '', sParam2 = '', sParam3 = '', sParam4 = '', sParam5 = '') {
|
|
141
|
+
CallScaleformMovieMethodWithNumberAndString(this.handle, name, fParam1, fParam2, fParam3, fParam4, fParam5, sParam1, sParam2, sParam3, sParam4, sParam5);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Sets a duration the scaleform should be shown.
|
|
145
|
+
* Useful for showing a scaleform for a known amount of time, such as messages.
|
|
146
|
+
*
|
|
147
|
+
* This only works for any scaleform using {@linkcode render2D};
|
|
148
|
+
*
|
|
149
|
+
* @param duration Duration in milliseconds
|
|
150
|
+
*/
|
|
151
|
+
setDuration(duration) {
|
|
152
|
+
if (duration <= 0) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const start = GetGameTimer();
|
|
156
|
+
const interval = setInterval(async () => {
|
|
157
|
+
if (GetGameTimer() - start < duration) {
|
|
158
|
+
await this.render2D();
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
clearInterval(interval);
|
|
162
|
+
}
|
|
163
|
+
}, 0);
|
|
164
|
+
}
|
|
165
|
+
render2D() {
|
|
166
|
+
return new Promise(async (resolve) => {
|
|
167
|
+
if (this.IsLoaded) {
|
|
168
|
+
DrawScaleformMovieFullscreen(this.handle, 255, 255, 255, 255, 0);
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
await this.load();
|
|
172
|
+
}
|
|
173
|
+
resolve();
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
render2DScreenSpace(location, size) {
|
|
177
|
+
return new Promise(async (resolve) => {
|
|
178
|
+
if (this.IsLoaded) {
|
|
179
|
+
const x = location.x; /* UI.Screen.Width*/
|
|
180
|
+
const y = location.y; /* UI.Screen.Height*/
|
|
181
|
+
const width = size.x; /* UI.Screen.Width*/
|
|
182
|
+
const height = size.y; /* UI.Screen.Height*/
|
|
183
|
+
DrawScaleformMovie(this.handle, x + width / 2, y + height / 2, width, height, 255, 255, 255, 255, 0);
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
await this.load();
|
|
187
|
+
}
|
|
188
|
+
resolve();
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
render3D(position, rotation, scale) {
|
|
192
|
+
return new Promise(async (resolve) => {
|
|
193
|
+
if (this.IsLoaded) {
|
|
194
|
+
DrawScaleformMovie_3dNonAdditive(this.handle, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, 2, 2, 1, scale.x, scale.y, scale.z, 2);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
await this.load();
|
|
198
|
+
}
|
|
199
|
+
resolve();
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
render3DAdditive(position, rotation, scale) {
|
|
203
|
+
return new Promise(async (resolve) => {
|
|
204
|
+
if (this.IsLoaded) {
|
|
205
|
+
DrawScaleformMovie_3d(this.handle, position.x, position.y, position.z, rotation.x, rotation.y, rotation.z, 2, 2, 1, scale.x, scale.y, scale.z, 2);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
await this.load();
|
|
209
|
+
}
|
|
210
|
+
resolve();
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
load() {
|
|
214
|
+
return new Promise(resolve => {
|
|
215
|
+
if (this.IsLoaded) {
|
|
216
|
+
resolve(true);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
const start = GetGameTimer();
|
|
220
|
+
const interval = setInterval(() => {
|
|
221
|
+
if (this.IsLoaded) {
|
|
222
|
+
clearInterval(interval);
|
|
223
|
+
resolve(true);
|
|
224
|
+
}
|
|
225
|
+
else if (GetGameTimer() - start > 5000) {
|
|
226
|
+
clearInterval(interval);
|
|
227
|
+
console.log(`^1[fivemjs/client] Could not load scaleform ${this.name}!^7`);
|
|
228
|
+
resolve(false);
|
|
229
|
+
}
|
|
230
|
+
}, 0);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HudColor, NotificationType } from '../enums';
|
|
2
|
+
import { Color, Size, Vector3 } from '../utils';
|
|
3
|
+
import { Notification } from './';
|
|
4
|
+
export declare abstract class Screen {
|
|
5
|
+
static get Resolution(): Size;
|
|
6
|
+
static get ScaledResolution(): Size;
|
|
7
|
+
static get Width(): number;
|
|
8
|
+
static get ScaledWidth(): number;
|
|
9
|
+
static get Height(): number;
|
|
10
|
+
static get AspectRatio(): number;
|
|
11
|
+
static showSubtitle(message: string, duration?: number): void;
|
|
12
|
+
static displayHelpTextThisFrame(message: string): void;
|
|
13
|
+
static showNotification(message: string, blinking?: boolean): Notification;
|
|
14
|
+
static showAdvancedNotification(message: string, title: string, subtitle: string, iconSet: string, icon: string, bgColor?: HudColor, flashColor?: Color, blinking?: boolean, type?: NotificationType, showInBrief?: boolean, sound?: boolean): Notification;
|
|
15
|
+
static worldToScreen(position: Vector3, scaleWidth?: boolean): Size;
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Audio } from '../Audio';
|
|
2
|
+
import { HudColor, NotificationType } from '../enums';
|
|
3
|
+
import { Color, Size, String } from '../utils';
|
|
4
|
+
import { Notification } from './';
|
|
5
|
+
export class Screen {
|
|
6
|
+
static get Resolution() {
|
|
7
|
+
const [width, height] = GetScreenActiveResolution();
|
|
8
|
+
return new Size(width, height);
|
|
9
|
+
}
|
|
10
|
+
static get ScaledResolution() {
|
|
11
|
+
const height = this.Height;
|
|
12
|
+
return new Size(height * this.AspectRatio, height);
|
|
13
|
+
}
|
|
14
|
+
static get Width() {
|
|
15
|
+
return this.Resolution.width;
|
|
16
|
+
}
|
|
17
|
+
static get ScaledWidth() {
|
|
18
|
+
return this.Height * this.AspectRatio;
|
|
19
|
+
}
|
|
20
|
+
static get Height() {
|
|
21
|
+
return this.Resolution.height;
|
|
22
|
+
}
|
|
23
|
+
static get AspectRatio() {
|
|
24
|
+
return GetAspectRatio(false);
|
|
25
|
+
}
|
|
26
|
+
static showSubtitle(message, duration = 2500) {
|
|
27
|
+
const strings = String.stringToArray(message);
|
|
28
|
+
BeginTextCommandPrint('CELL_EMAIL_BCON');
|
|
29
|
+
strings.forEach(element => {
|
|
30
|
+
AddTextComponentSubstringPlayerName(element);
|
|
31
|
+
});
|
|
32
|
+
EndTextCommandPrint(duration, true);
|
|
33
|
+
}
|
|
34
|
+
static displayHelpTextThisFrame(message) {
|
|
35
|
+
const strings = String.stringToArray(message);
|
|
36
|
+
BeginTextCommandDisplayHelp('CELL_EMAIL_BCON');
|
|
37
|
+
strings.forEach(element => {
|
|
38
|
+
AddTextComponentSubstringPlayerName(element);
|
|
39
|
+
});
|
|
40
|
+
EndTextCommandDisplayHelp(0, false, false, -1);
|
|
41
|
+
}
|
|
42
|
+
static showNotification(message, blinking = false) {
|
|
43
|
+
const strings = String.stringToArray(message);
|
|
44
|
+
SetNotificationTextEntry('CELL_EMAIL_BCON');
|
|
45
|
+
strings.forEach(element => {
|
|
46
|
+
AddTextComponentSubstringPlayerName(element);
|
|
47
|
+
});
|
|
48
|
+
return new Notification(DrawNotification(blinking, true));
|
|
49
|
+
}
|
|
50
|
+
static showAdvancedNotification(message, title, subtitle, iconSet, icon, bgColor = HudColor.NONE, flashColor = Color.empty, blinking = false, type = NotificationType.Default, showInBrief = true, sound = true) {
|
|
51
|
+
const strings = String.stringToArray(message);
|
|
52
|
+
SetNotificationTextEntry('CELL_EMAIL_BCON');
|
|
53
|
+
strings.forEach(element => {
|
|
54
|
+
AddTextComponentSubstringPlayerName(element);
|
|
55
|
+
});
|
|
56
|
+
if (bgColor !== HudColor.NONE) {
|
|
57
|
+
SetNotificationBackgroundColor(Number(bgColor));
|
|
58
|
+
}
|
|
59
|
+
if (flashColor !== Color.empty && blinking) {
|
|
60
|
+
SetNotificationFlashColor(flashColor.r, flashColor.g, flashColor.b, flashColor.a);
|
|
61
|
+
}
|
|
62
|
+
if (sound) {
|
|
63
|
+
Audio.playSoundFrontEnd('DELETE', 'HUD_DEATHMATCH_SOUNDSET');
|
|
64
|
+
}
|
|
65
|
+
SetNotificationMessage(iconSet, icon, true, Number(type), title, subtitle);
|
|
66
|
+
return new Notification(DrawNotification(blinking, showInBrief));
|
|
67
|
+
}
|
|
68
|
+
static worldToScreen(position, scaleWidth = false) {
|
|
69
|
+
const coords = GetScreenCoordFromWorldCoord(position.x, position.y, position.z);
|
|
70
|
+
return new Size(coords[1] * (scaleWidth ? this.ScaledWidth : this.Width), coords[2] * this.Height);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../utils';
|
|
2
|
+
export declare class Sprite {
|
|
3
|
+
textureName: string;
|
|
4
|
+
pos: Point;
|
|
5
|
+
size: Size;
|
|
6
|
+
heading: number;
|
|
7
|
+
color: Color;
|
|
8
|
+
visible: boolean;
|
|
9
|
+
private _textureDict;
|
|
10
|
+
constructor(textureDict: string, textureName: string, pos?: Point, size?: Size, heading?: number, color?: Color);
|
|
11
|
+
loadTextureDictionary(): void;
|
|
12
|
+
set TextureDict(v: string);
|
|
13
|
+
get TextureDict(): string;
|
|
14
|
+
get IsTextureDictionaryLoaded(): boolean;
|
|
15
|
+
draw(resolution?: Size): void;
|
|
16
|
+
draw(textureDictionary?: string, textureName?: string, pos?: Point, size?: Size, heading?: number, color?: Color, loadTexture?: boolean, resolution?: Size): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../utils';
|
|
2
|
+
import { Screen } from './';
|
|
3
|
+
export class Sprite {
|
|
4
|
+
constructor(textureDict, textureName, pos, size, heading = 0, color = Color.white) {
|
|
5
|
+
this._textureDict = textureDict;
|
|
6
|
+
this.textureName = textureName;
|
|
7
|
+
this.pos = pos || new Point();
|
|
8
|
+
this.size = size || new Size();
|
|
9
|
+
this.heading = heading || 0;
|
|
10
|
+
this.color = color || Color.white;
|
|
11
|
+
this.visible = true;
|
|
12
|
+
}
|
|
13
|
+
loadTextureDictionary() {
|
|
14
|
+
RequestStreamedTextureDict(this._textureDict, true);
|
|
15
|
+
const interval = setInterval(() => {
|
|
16
|
+
if (this.IsTextureDictionaryLoaded) {
|
|
17
|
+
clearInterval(interval);
|
|
18
|
+
}
|
|
19
|
+
}, 0);
|
|
20
|
+
}
|
|
21
|
+
set TextureDict(v) {
|
|
22
|
+
this._textureDict = v;
|
|
23
|
+
if (!this.IsTextureDictionaryLoaded) {
|
|
24
|
+
this.loadTextureDictionary();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
get TextureDict() {
|
|
28
|
+
return this._textureDict;
|
|
29
|
+
}
|
|
30
|
+
get IsTextureDictionaryLoaded() {
|
|
31
|
+
return HasStreamedTextureDictLoaded(this._textureDict);
|
|
32
|
+
}
|
|
33
|
+
draw(arg1, textureName, pos, size, heading, color, loadTexture = true, resolution) {
|
|
34
|
+
const textureDictionary = arg1 && typeof arg1 === 'string' ? arg1 : this.TextureDict;
|
|
35
|
+
textureName = textureName || this.textureName;
|
|
36
|
+
pos = pos || this.pos;
|
|
37
|
+
size = size || this.size;
|
|
38
|
+
heading = heading || this.heading;
|
|
39
|
+
color = color || this.color;
|
|
40
|
+
if (loadTexture) {
|
|
41
|
+
if (!HasStreamedTextureDictLoaded(textureDictionary)) {
|
|
42
|
+
RequestStreamedTextureDict(textureDictionary, false);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
resolution = arg1 instanceof Size ? arg1 : resolution;
|
|
46
|
+
resolution = resolution || new Size(Screen.ScaledWidth, Screen.Height);
|
|
47
|
+
const w = size.width / resolution.width;
|
|
48
|
+
const h = size.height / resolution.height;
|
|
49
|
+
const x = pos.X / resolution.width + w * 0.5;
|
|
50
|
+
const y = pos.Y / resolution.height + h * 0.5;
|
|
51
|
+
DrawSprite(textureDictionary, textureName, x, y, w, h, heading, color.r, color.g, color.b, color.a);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Alignment, Font } from '../enums';
|
|
2
|
+
import { Color, Point, Size } from '../utils';
|
|
3
|
+
import { IDrawable } from './';
|
|
4
|
+
export declare class Text implements IDrawable {
|
|
5
|
+
static draw(caption: string, pos: Point, scale?: number, color?: Color, font?: Font, alignment?: Alignment, dropShadow?: boolean, outline?: boolean, wordWrap?: Size, resolution?: Size): void;
|
|
6
|
+
static addLongString(str: string): void;
|
|
7
|
+
caption: string;
|
|
8
|
+
pos: Point;
|
|
9
|
+
scale: number;
|
|
10
|
+
color: Color;
|
|
11
|
+
font: Font;
|
|
12
|
+
alignment: Alignment;
|
|
13
|
+
dropShadow: boolean;
|
|
14
|
+
outline: boolean;
|
|
15
|
+
wordWrap: Size;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param caption Text to display
|
|
19
|
+
* @param pos Position of text relative to alignment. In pixels.
|
|
20
|
+
* @param scale Size of text. Default 1.0
|
|
21
|
+
* @param color Color of text. Default black.
|
|
22
|
+
* @param font Font of text. Default Chalet London.
|
|
23
|
+
* @param alignment Alignment of text. Default Left.
|
|
24
|
+
* @param dropShadow
|
|
25
|
+
* @param outline
|
|
26
|
+
* @param wordWrap
|
|
27
|
+
*/
|
|
28
|
+
constructor(caption: string, pos: Point, scale?: number, color?: Color, font?: Font, alignment?: Alignment, dropShadow?: boolean, outline?: boolean, wordWrap?: Size);
|
|
29
|
+
draw(offset?: Size, resolution?: Size): void;
|
|
30
|
+
draw(caption: string, pos: Point, scale: number, color?: Color, font?: Font, alignment?: Alignment, dropShadow?: boolean, outline?: boolean, wordWrap?: Size, resolution?: Size): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Alignment, Font } from '../enums';
|
|
2
|
+
import { Color, Point, Size } from '../utils';
|
|
3
|
+
import { Screen } from './';
|
|
4
|
+
export class Text {
|
|
5
|
+
static draw(caption, pos, scale = 1, color = Color.white, font = Font.ChaletLondon, alignment = Alignment.Left, dropShadow = false, outline = false, wordWrap, resolution) {
|
|
6
|
+
resolution = resolution || new Size(Screen.ScaledWidth, Screen.Height);
|
|
7
|
+
const x = pos.X / resolution.width;
|
|
8
|
+
const y = pos.Y / resolution.height;
|
|
9
|
+
SetTextFont(Number(font));
|
|
10
|
+
SetTextScale(1.0, scale);
|
|
11
|
+
SetTextColour(color.r, color.g, color.b, color.a);
|
|
12
|
+
if (dropShadow) {
|
|
13
|
+
SetTextDropshadow(2, 0, 0, 0, 0);
|
|
14
|
+
}
|
|
15
|
+
if (outline) {
|
|
16
|
+
SetTextOutline();
|
|
17
|
+
}
|
|
18
|
+
switch (alignment) {
|
|
19
|
+
case Alignment.Centered:
|
|
20
|
+
SetTextCentre(true);
|
|
21
|
+
break;
|
|
22
|
+
case Alignment.Right:
|
|
23
|
+
SetTextRightJustify(true);
|
|
24
|
+
if (!wordWrap) {
|
|
25
|
+
SetTextWrap(0.0, x);
|
|
26
|
+
}
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
if (wordWrap) {
|
|
30
|
+
SetTextWrap(x, (pos.X + wordWrap.width) / resolution.width);
|
|
31
|
+
}
|
|
32
|
+
SetTextEntry('STRING');
|
|
33
|
+
Text.addLongString(caption);
|
|
34
|
+
DrawText(x, y);
|
|
35
|
+
}
|
|
36
|
+
static addLongString(str) {
|
|
37
|
+
const strLen = 99;
|
|
38
|
+
for (let i = 0; i < str.length; i += strLen) {
|
|
39
|
+
const substr = str.substr(i, Math.min(strLen, str.length - i));
|
|
40
|
+
AddTextComponentSubstringPlayerName(substr);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param caption Text to display
|
|
46
|
+
* @param pos Position of text relative to alignment. In pixels.
|
|
47
|
+
* @param scale Size of text. Default 1.0
|
|
48
|
+
* @param color Color of text. Default black.
|
|
49
|
+
* @param font Font of text. Default Chalet London.
|
|
50
|
+
* @param alignment Alignment of text. Default Left.
|
|
51
|
+
* @param dropShadow
|
|
52
|
+
* @param outline
|
|
53
|
+
* @param wordWrap
|
|
54
|
+
*/
|
|
55
|
+
constructor(caption, pos, scale = 1, color = Color.white, font = Font.ChaletLondon, alignment = Alignment.Left, dropShadow = false, outline = false, wordWrap = new Size(500, 300)) {
|
|
56
|
+
this.caption = caption;
|
|
57
|
+
this.pos = pos;
|
|
58
|
+
this.scale = scale;
|
|
59
|
+
this.color = color;
|
|
60
|
+
this.font = font;
|
|
61
|
+
this.alignment = alignment;
|
|
62
|
+
this.dropShadow = dropShadow;
|
|
63
|
+
this.outline = outline;
|
|
64
|
+
this.wordWrap = wordWrap;
|
|
65
|
+
}
|
|
66
|
+
draw(arg1, arg2, scale, color, font, alignment, dropShadow, outline, wordWrap, resolution) {
|
|
67
|
+
resolution = arg2 instanceof Size ? arg2 : resolution;
|
|
68
|
+
if (scale === undefined) {
|
|
69
|
+
if (arg1 && arg1 instanceof Size) {
|
|
70
|
+
arg2 = new Point(this.pos.X + arg1.width, this.pos.Y + arg1.height);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
arg2 = this.pos;
|
|
74
|
+
}
|
|
75
|
+
arg1 = this.caption;
|
|
76
|
+
scale = this.scale;
|
|
77
|
+
color = this.color;
|
|
78
|
+
font = this.font;
|
|
79
|
+
alignment = this.alignment;
|
|
80
|
+
dropShadow = this.dropShadow;
|
|
81
|
+
outline = this.outline;
|
|
82
|
+
wordWrap = this.wordWrap;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
arg1 = arg1 || this.caption;
|
|
86
|
+
if (!arg2) {
|
|
87
|
+
arg2 = this.pos;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
arg2 = arg2;
|
|
91
|
+
}
|
|
92
|
+
scale = scale !== undefined && scale !== null ? scale : this.scale;
|
|
93
|
+
color = color || this.color;
|
|
94
|
+
font = font !== undefined && font !== null ? font : this.font;
|
|
95
|
+
alignment = alignment !== undefined && alignment !== null ? alignment : this.alignment;
|
|
96
|
+
dropShadow = typeof dropShadow === 'boolean' ? dropShadow : dropShadow;
|
|
97
|
+
outline = typeof outline === 'boolean' ? outline : outline;
|
|
98
|
+
wordWrap = wordWrap || this.wordWrap;
|
|
99
|
+
}
|
|
100
|
+
Text.draw(arg1, arg2, scale, color, font, alignment, dropShadow, outline, wordWrap, resolution);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Sprite } from './Sprite';
|
|
2
|
+
/**
|
|
3
|
+
* Create a Timerbar. It's automatically added to the internal Timerbar array and drawn in a FIFO (first in, first out) way.
|
|
4
|
+
*
|
|
5
|
+
* ```typescript
|
|
6
|
+
* // Create simple Timerbar
|
|
7
|
+
* const myTimerbar = new Cfx.Timerbar("Hello");
|
|
8
|
+
* myTimerbar.Text = "World";
|
|
9
|
+
*
|
|
10
|
+
* // Disable Timerbar later on
|
|
11
|
+
* myTimerbar.Visible = false;
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class Timerbar {
|
|
15
|
+
private sprite;
|
|
16
|
+
private title;
|
|
17
|
+
private text;
|
|
18
|
+
private useProgressBar;
|
|
19
|
+
private usePlayerStyle;
|
|
20
|
+
private isVisible;
|
|
21
|
+
private pbarValue;
|
|
22
|
+
private textColor;
|
|
23
|
+
private pbarBgColor;
|
|
24
|
+
private pbarFgColor;
|
|
25
|
+
constructor(title: string, useProgressBar?: boolean);
|
|
26
|
+
get Title(): string;
|
|
27
|
+
set Title(value: string);
|
|
28
|
+
get Text(): string;
|
|
29
|
+
set Text(value: string);
|
|
30
|
+
get UseProgressBar(): boolean;
|
|
31
|
+
get Progress(): number;
|
|
32
|
+
set Progress(value: number);
|
|
33
|
+
get Visible(): boolean;
|
|
34
|
+
set Visible(value: boolean);
|
|
35
|
+
get TextColor(): number | number[];
|
|
36
|
+
set TextColor(value: number | number[]);
|
|
37
|
+
get ProgressbarBgColor(): number[] | number;
|
|
38
|
+
set ProgressbarBgColor(value: number[] | number);
|
|
39
|
+
get ProgressbarFgColor(): number[] | number;
|
|
40
|
+
set ProgressbarFgColor(value: number[] | number);
|
|
41
|
+
set PlayerStyle(value: boolean);
|
|
42
|
+
get PlayerStyle(): boolean;
|
|
43
|
+
get Sprite(): Sprite | null;
|
|
44
|
+
}
|