@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,211 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../../../../utils';
|
|
2
|
+
import { AbstractUIMenuPanel } from './';
|
|
3
|
+
import { Rectangle, Sprite, Text } from '../../../';
|
|
4
|
+
import { Alignment, Control, Font } from '../../../../enums';
|
|
5
|
+
import { Game, Menu } from '../../../../';
|
|
6
|
+
export class UIMenuColorPanel extends AbstractUIMenuPanel {
|
|
7
|
+
constructor(title, colors) {
|
|
8
|
+
super();
|
|
9
|
+
this._title = '';
|
|
10
|
+
this._colors = [];
|
|
11
|
+
this._bar = [];
|
|
12
|
+
this._lastColor = Color.empty;
|
|
13
|
+
// Pagination
|
|
14
|
+
this._min = 0;
|
|
15
|
+
this._max = 8;
|
|
16
|
+
this._total = 9;
|
|
17
|
+
this._index = 0;
|
|
18
|
+
this.background = new Sprite('commonmenu', 'gradient_bgd', new Point(), new Size(431, 112));
|
|
19
|
+
this._leftArrow = new Sprite('commonmenu', 'arrowleft', new Point(), new Size(30, 30));
|
|
20
|
+
this._rightArrow = new Sprite('commonmenu', 'arrowright', new Point(), new Size(30, 30));
|
|
21
|
+
this._selectedRectangle = new Rectangle(new Point(), new Size(44.5, 8), Color.white);
|
|
22
|
+
this._text = new Text('', new Point(), 0.35, Color.white, Font.ChaletLondon, Alignment.Centered);
|
|
23
|
+
this.Title = title;
|
|
24
|
+
this.Colors = colors;
|
|
25
|
+
}
|
|
26
|
+
get Title() {
|
|
27
|
+
return this._title;
|
|
28
|
+
}
|
|
29
|
+
set Title(value) {
|
|
30
|
+
this._title = value ? value.trim() : '';
|
|
31
|
+
this._updateText();
|
|
32
|
+
}
|
|
33
|
+
get Colors() {
|
|
34
|
+
return this._colors;
|
|
35
|
+
}
|
|
36
|
+
set Colors(value) {
|
|
37
|
+
if (!value) {
|
|
38
|
+
value = [];
|
|
39
|
+
}
|
|
40
|
+
this._colors = value;
|
|
41
|
+
this._bar = [];
|
|
42
|
+
const colorRectangles = value.slice(0, this._total).map(color => {
|
|
43
|
+
return new Rectangle(new Point(0, 0), new Size(44.5, 44.5), color);
|
|
44
|
+
});
|
|
45
|
+
this._bar.push(...colorRectangles);
|
|
46
|
+
this._refreshIndex();
|
|
47
|
+
this._updateSelection(true);
|
|
48
|
+
}
|
|
49
|
+
get Color() {
|
|
50
|
+
return this._colors[this.Index];
|
|
51
|
+
}
|
|
52
|
+
set Color(value) {
|
|
53
|
+
const index = this._colors.findIndex(c => {
|
|
54
|
+
return c.a === value.a && c.r === value.r && c.g === value.g && c.b === value.b;
|
|
55
|
+
});
|
|
56
|
+
if (index !== -1) {
|
|
57
|
+
this.Index = index;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
get Index() {
|
|
61
|
+
return this._index % this._colors.length;
|
|
62
|
+
}
|
|
63
|
+
set Index(value) {
|
|
64
|
+
value = 1000000 - (1000000 % this._colors.length) + value;
|
|
65
|
+
if (this.Index === value % this._colors.length) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this._index = value;
|
|
69
|
+
const currentSelection = this.Index;
|
|
70
|
+
if (currentSelection > this._max) {
|
|
71
|
+
this._min = currentSelection - this._total + 1;
|
|
72
|
+
this._max = currentSelection;
|
|
73
|
+
}
|
|
74
|
+
else if (currentSelection < this._min) {
|
|
75
|
+
this._min = currentSelection;
|
|
76
|
+
this._max = currentSelection + this._total - 1;
|
|
77
|
+
}
|
|
78
|
+
this._updateSelection();
|
|
79
|
+
}
|
|
80
|
+
updateParentItem() {
|
|
81
|
+
const last = this._lastColor;
|
|
82
|
+
const current = this.Color;
|
|
83
|
+
if (!last ||
|
|
84
|
+
last.a !== current.a ||
|
|
85
|
+
last.r !== current.r ||
|
|
86
|
+
last.g !== current.g ||
|
|
87
|
+
last.b !== current.b) {
|
|
88
|
+
this._lastColor = current;
|
|
89
|
+
if (this.ParentMenu)
|
|
90
|
+
this.ParentMenu.panelActivated.emit(this.parentItem, this, this.Index, current);
|
|
91
|
+
if (this.parentItem)
|
|
92
|
+
this.parentItem.panelActivated.emit(this, this.Index, current);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
setVerticalPosition(y) {
|
|
96
|
+
super.setVerticalPosition(y);
|
|
97
|
+
this._selectedRectangle.pos.Y = y + 47;
|
|
98
|
+
this._leftArrow.pos.Y = y + 15;
|
|
99
|
+
this._rightArrow.pos.Y = y + 15;
|
|
100
|
+
this._text.pos.Y = y + 15;
|
|
101
|
+
this._bar.forEach(async (colorRect) => {
|
|
102
|
+
colorRect.pos.Y = y + 55;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
draw() {
|
|
106
|
+
if (this.enabled) {
|
|
107
|
+
super.draw();
|
|
108
|
+
const x = (this.parentItem ? this.parentItem.offset.X : 0) +
|
|
109
|
+
(this.ParentMenu ? this.ParentMenu.WidthOffset / 2 : 0);
|
|
110
|
+
this._selectedRectangle.pos.X = x + 15 + 44.5 * (this.Index - this._min);
|
|
111
|
+
this._leftArrow.pos.X = x + 7.5;
|
|
112
|
+
this._rightArrow.pos.X = x + 393.5;
|
|
113
|
+
this._text.pos.X = x + 215.5;
|
|
114
|
+
this._leftArrow.draw(Menu.screenResolution);
|
|
115
|
+
this._rightArrow.draw(Menu.screenResolution);
|
|
116
|
+
this._text.draw(undefined, Menu.screenResolution);
|
|
117
|
+
this._selectedRectangle.draw(undefined, Menu.screenResolution);
|
|
118
|
+
this._bar.forEach(async (colorRect, index) => {
|
|
119
|
+
colorRect.pos.X = x + 15 + 44.5 * index;
|
|
120
|
+
colorRect.draw(undefined, Menu.screenResolution);
|
|
121
|
+
});
|
|
122
|
+
this._processControls();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
_refreshIndex() {
|
|
126
|
+
if (!this._colors.length) {
|
|
127
|
+
this._index = 1000;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this._index = 1000 - (1000 % this._colors.length);
|
|
131
|
+
}
|
|
132
|
+
this._max = this._total - 1;
|
|
133
|
+
this._min = 0;
|
|
134
|
+
}
|
|
135
|
+
_updateSelection(preventUpdate = false) {
|
|
136
|
+
if (!preventUpdate) {
|
|
137
|
+
this.updateParentItem();
|
|
138
|
+
}
|
|
139
|
+
this._bar.forEach(async (colorRect, index) => {
|
|
140
|
+
colorRect.color = this._colors[this._min + index];
|
|
141
|
+
});
|
|
142
|
+
this._updateText();
|
|
143
|
+
}
|
|
144
|
+
_updateText() {
|
|
145
|
+
this._text.caption = `${this._title} [${this.Index + 1 || 0} / ${this._colors.length}]`;
|
|
146
|
+
}
|
|
147
|
+
_goLeft() {
|
|
148
|
+
if (this._colors.length > this._total) {
|
|
149
|
+
if (this.Index <= this._min) {
|
|
150
|
+
if (this.Index === 0) {
|
|
151
|
+
this._min = this._colors.length - this._total;
|
|
152
|
+
this._max = this._colors.length - 1;
|
|
153
|
+
this._index = 1000 - (1000 % this._colors.length);
|
|
154
|
+
this._index += this._colors.length - 1;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this._min--;
|
|
158
|
+
this._max--;
|
|
159
|
+
this._index--;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
this._index--;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this._index--;
|
|
168
|
+
}
|
|
169
|
+
this._updateSelection();
|
|
170
|
+
}
|
|
171
|
+
_goRight() {
|
|
172
|
+
if (this._colors.length > this._total) {
|
|
173
|
+
if (this.Index >= this._max) {
|
|
174
|
+
if (this.Index === this._colors.length - 1) {
|
|
175
|
+
this._min = 0;
|
|
176
|
+
this._max = this._total - 1;
|
|
177
|
+
this._index = 1000 - (1000 % this._colors.length);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
this._min++;
|
|
181
|
+
this._max++;
|
|
182
|
+
this._index++;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
this._index++;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
this._index++;
|
|
191
|
+
}
|
|
192
|
+
this._updateSelection();
|
|
193
|
+
}
|
|
194
|
+
_processControls() {
|
|
195
|
+
if (Game.isDisabledControlJustPressed(0, Control.Attack)) {
|
|
196
|
+
if (this.ParentMenu) {
|
|
197
|
+
if (this.ParentMenu.isMouseInBounds(this._leftArrow.pos, this._leftArrow.size)) {
|
|
198
|
+
this._goLeft();
|
|
199
|
+
}
|
|
200
|
+
else if (this.ParentMenu.isMouseInBounds(this._rightArrow.pos, this._rightArrow.size)) {
|
|
201
|
+
this._goRight();
|
|
202
|
+
}
|
|
203
|
+
this._bar.forEach(async (colorRect, index) => {
|
|
204
|
+
if (this.ParentMenu && this.ParentMenu.isMouseInBounds(colorRect.pos, colorRect.size)) {
|
|
205
|
+
this.Index = this._min + index;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Point } from '../../../../utils';
|
|
2
|
+
import { AbstractUIMenuPanel } from './';
|
|
3
|
+
import { Sprite } from '../../../';
|
|
4
|
+
export declare class UIMenuGridPanel extends AbstractUIMenuPanel {
|
|
5
|
+
protected readonly background: Sprite;
|
|
6
|
+
private _isCircleLocked;
|
|
7
|
+
private _pressed;
|
|
8
|
+
private _lockXAxis;
|
|
9
|
+
private _lockYAxis;
|
|
10
|
+
private _topText;
|
|
11
|
+
private _leftText;
|
|
12
|
+
private _rightText;
|
|
13
|
+
private _bottomText;
|
|
14
|
+
private _lastCirclePosition;
|
|
15
|
+
private readonly _grid;
|
|
16
|
+
private readonly _circle;
|
|
17
|
+
private readonly _setCirclePosition;
|
|
18
|
+
constructor(topText?: string, leftText?: string, rightText?: string, bottomText?: string, circlePosition?: Point);
|
|
19
|
+
get TopText(): string;
|
|
20
|
+
set TopText(value: string);
|
|
21
|
+
get LeftText(): string;
|
|
22
|
+
set LeftText(value: string);
|
|
23
|
+
get RightText(): string;
|
|
24
|
+
set RightText(value: string);
|
|
25
|
+
get BottomText(): string;
|
|
26
|
+
set BottomText(value: string);
|
|
27
|
+
get CirclePosition(): Point;
|
|
28
|
+
set CirclePosition(position: Point);
|
|
29
|
+
set CirclePositionX(x: number);
|
|
30
|
+
set CirclePositionY(y: number);
|
|
31
|
+
get LockXAxis(): boolean;
|
|
32
|
+
set LockXAxis(value: boolean);
|
|
33
|
+
get LockYAxis(): boolean;
|
|
34
|
+
set LockYAxis(value: boolean);
|
|
35
|
+
updateParentItem(): void;
|
|
36
|
+
setVerticalPosition(y: number): void;
|
|
37
|
+
draw(): void;
|
|
38
|
+
private _setText;
|
|
39
|
+
private _processControls;
|
|
40
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
import { Color, Point, Size, Wait } from '../../../../utils';
|
|
3
|
+
import { AbstractUIMenuPanel } from './';
|
|
4
|
+
import { Menu, Sprite, Text } from '../../../';
|
|
5
|
+
import { Alignment, Control, Font } from '../../../../enums';
|
|
6
|
+
import { Game } from '../../../../Game';
|
|
7
|
+
export class UIMenuGridPanel extends AbstractUIMenuPanel {
|
|
8
|
+
constructor(topText, leftText, rightText, bottomText, circlePosition) {
|
|
9
|
+
super();
|
|
10
|
+
this._isCircleLocked = false;
|
|
11
|
+
this._pressed = false;
|
|
12
|
+
this._lockXAxis = false;
|
|
13
|
+
this._lockYAxis = false;
|
|
14
|
+
this._setCirclePosition = circlePosition || new Point(0.5, 0.5);
|
|
15
|
+
this.background = new Sprite('commonmenu', 'gradient_bgd', new Point(), new Size(431, 275));
|
|
16
|
+
this._grid = new Sprite('pause_menu_pages_char_mom_dad', 'nose_grid', new Point(), new Size(200, 200));
|
|
17
|
+
this._circle = new Sprite('mpinventory', 'in_world_circle', new Point(), new Size(20, 20));
|
|
18
|
+
this.TopText = topText ?? '';
|
|
19
|
+
this.LeftText = leftText ?? '';
|
|
20
|
+
this.RightText = rightText ?? '';
|
|
21
|
+
this.BottomText = bottomText ?? '';
|
|
22
|
+
this._lastCirclePosition = this._setCirclePosition;
|
|
23
|
+
}
|
|
24
|
+
get TopText() {
|
|
25
|
+
return this._topText ? this._topText.caption : '';
|
|
26
|
+
}
|
|
27
|
+
set TopText(value) {
|
|
28
|
+
this._setText('_topText', value);
|
|
29
|
+
}
|
|
30
|
+
get LeftText() {
|
|
31
|
+
return this._leftText ? this._leftText.caption : '';
|
|
32
|
+
}
|
|
33
|
+
set LeftText(value) {
|
|
34
|
+
this._setText('_leftText', value);
|
|
35
|
+
}
|
|
36
|
+
get RightText() {
|
|
37
|
+
return this._rightText ? this._rightText.caption : '';
|
|
38
|
+
}
|
|
39
|
+
set RightText(value) {
|
|
40
|
+
this._setText('_rightText', value);
|
|
41
|
+
}
|
|
42
|
+
get BottomText() {
|
|
43
|
+
return this._bottomText ? this._bottomText.caption : '';
|
|
44
|
+
}
|
|
45
|
+
set BottomText(value) {
|
|
46
|
+
this._setText('_bottomText', value);
|
|
47
|
+
}
|
|
48
|
+
get CirclePosition() {
|
|
49
|
+
return new Point(Math.round(((this._circle.pos.X - (this._grid.pos.X + 20) + this._circle.size.width / 2) /
|
|
50
|
+
(this._grid.size.width - 40)) *
|
|
51
|
+
100) / 100, Math.round(((this._circle.pos.Y - (this._grid.pos.Y + 20) + this._circle.size.height / 2) /
|
|
52
|
+
(this._grid.size.height - 40)) *
|
|
53
|
+
100) / 100);
|
|
54
|
+
}
|
|
55
|
+
set CirclePosition(position) {
|
|
56
|
+
this.CirclePositionX = position.X;
|
|
57
|
+
this.CirclePositionY = position.Y;
|
|
58
|
+
}
|
|
59
|
+
set CirclePositionX(x) {
|
|
60
|
+
if (this._isCircleLocked && this._lockXAxis) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
x = x >= 0 && x <= 1 ? x : 0;
|
|
64
|
+
this._setCirclePosition.X = x;
|
|
65
|
+
this._circle.pos.X =
|
|
66
|
+
this._grid.pos.X + 20 + (this._grid.size.width - 40) * x - this._circle.size.width / 2;
|
|
67
|
+
}
|
|
68
|
+
set CirclePositionY(y) {
|
|
69
|
+
if (this._isCircleLocked && this._lockYAxis) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
y = y >= 0 && y <= 1 ? y : 0;
|
|
73
|
+
this._setCirclePosition.Y = y;
|
|
74
|
+
this._circle.pos.Y =
|
|
75
|
+
this._grid.pos.Y + 20 + (this._grid.size.height - 40) * y - this._circle.size.height / 2;
|
|
76
|
+
}
|
|
77
|
+
get LockXAxis() {
|
|
78
|
+
return this._lockXAxis;
|
|
79
|
+
}
|
|
80
|
+
set LockXAxis(value) {
|
|
81
|
+
this._lockXAxis = value;
|
|
82
|
+
if (value) {
|
|
83
|
+
if (this._lockYAxis) {
|
|
84
|
+
this._lockYAxis = false;
|
|
85
|
+
}
|
|
86
|
+
this.CirclePositionX = 0.5;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
get LockYAxis() {
|
|
90
|
+
return this._lockYAxis;
|
|
91
|
+
}
|
|
92
|
+
set LockYAxis(value) {
|
|
93
|
+
this._lockYAxis = value;
|
|
94
|
+
if (value) {
|
|
95
|
+
if (this._lockXAxis) {
|
|
96
|
+
this._lockXAxis = false;
|
|
97
|
+
}
|
|
98
|
+
this.CirclePositionY = 0.5;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
updateParentItem() {
|
|
102
|
+
const last = this._lastCirclePosition;
|
|
103
|
+
const current = this.CirclePosition;
|
|
104
|
+
if (!last || last.X !== current.X || last.Y !== current.Y) {
|
|
105
|
+
this._lastCirclePosition = current;
|
|
106
|
+
if (this.ParentMenu && this.parentItem) {
|
|
107
|
+
this.ParentMenu.panelActivated.emit(this.parentItem, this, current);
|
|
108
|
+
this.parentItem.panelActivated.emit(this, current);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
setVerticalPosition(y) {
|
|
113
|
+
super.setVerticalPosition(y);
|
|
114
|
+
this._grid.pos.Y = y + 37.5;
|
|
115
|
+
if (this._topText) {
|
|
116
|
+
this._topText.pos.Y = y + 5;
|
|
117
|
+
}
|
|
118
|
+
if (this._leftText) {
|
|
119
|
+
this._leftText.pos.Y = y + 120;
|
|
120
|
+
}
|
|
121
|
+
if (this._rightText) {
|
|
122
|
+
this._rightText.pos.Y = y + 120;
|
|
123
|
+
}
|
|
124
|
+
if (this._bottomText) {
|
|
125
|
+
this._bottomText.pos.Y = y + 240;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
draw() {
|
|
129
|
+
if (this.enabled) {
|
|
130
|
+
super.draw();
|
|
131
|
+
const x = this.parentItem?.offset.X ?? 0 + (this.ParentMenu?.WidthOffset ?? 0) / 2;
|
|
132
|
+
this._grid.pos.X = x + 115.5;
|
|
133
|
+
if (!this._isCircleLocked) {
|
|
134
|
+
this.CirclePosition = this._setCirclePosition;
|
|
135
|
+
this._isCircleLocked = true;
|
|
136
|
+
}
|
|
137
|
+
this._grid.draw(Menu.screenResolution);
|
|
138
|
+
this._circle.draw(Menu.screenResolution);
|
|
139
|
+
if (this._topText) {
|
|
140
|
+
this._topText.pos.X = x + 215.5;
|
|
141
|
+
this._topText.draw(undefined, Menu.screenResolution);
|
|
142
|
+
}
|
|
143
|
+
if (this._leftText) {
|
|
144
|
+
this._leftText.pos.X = x + 57.75;
|
|
145
|
+
this._leftText.draw(undefined, Menu.screenResolution);
|
|
146
|
+
}
|
|
147
|
+
if (this._rightText) {
|
|
148
|
+
this._rightText.pos.X = x + 373.25;
|
|
149
|
+
this._rightText.draw(undefined, Menu.screenResolution);
|
|
150
|
+
}
|
|
151
|
+
if (this._bottomText) {
|
|
152
|
+
this._bottomText.pos.X = x + 215.5;
|
|
153
|
+
this._bottomText.draw(undefined, Menu.screenResolution);
|
|
154
|
+
}
|
|
155
|
+
this._processControls();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
_setText(name, value) {
|
|
159
|
+
if (value && value.trim() !== '') {
|
|
160
|
+
// @ts-ignore
|
|
161
|
+
if (!this[name]) {
|
|
162
|
+
// @ts-ignore
|
|
163
|
+
this[name] = new Text(value, new Point(), 0.35, Color.white, Font.ChaletLondon, Alignment.Centered);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
// @ts-ignore
|
|
167
|
+
this[name].caption = value;
|
|
168
|
+
}
|
|
169
|
+
// @ts-ignore
|
|
170
|
+
}
|
|
171
|
+
else if (this[name]) {
|
|
172
|
+
// @ts-ignore
|
|
173
|
+
delete this[name];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
_processControls() {
|
|
177
|
+
if (!this._pressed &&
|
|
178
|
+
Game.isDisabledControlJustPressed(0, Control.Attack) &&
|
|
179
|
+
this.ParentMenu?.isMouseInBounds(this._grid.pos, this._grid.size)) {
|
|
180
|
+
this._pressed = true;
|
|
181
|
+
(async () => {
|
|
182
|
+
const drawOffset = this.ParentMenu?.DrawOffset ?? new Point(0, 0);
|
|
183
|
+
while (Game.isDisabledControlPressed(0, Control.Attack)) {
|
|
184
|
+
await Wait(0);
|
|
185
|
+
let cX = (GetControlNormal(0, Control.CursorX) - drawOffset.X) * Menu.screenWidth;
|
|
186
|
+
let cY = (GetControlNormal(0, Control.CursorY) - drawOffset.Y) * Menu.screenHeight;
|
|
187
|
+
cX -= this._circle.size.width / 2;
|
|
188
|
+
cY -= this._circle.size.height / 2;
|
|
189
|
+
this._circle.pos.X =
|
|
190
|
+
cX > this._grid.pos.X + 10 + this._grid.size.width - (this._lockXAxis ? 120 : 40)
|
|
191
|
+
? this._grid.pos.X + 10 + this._grid.size.width - (this._lockXAxis ? 120 : 40)
|
|
192
|
+
: cX < this._grid.pos.X + (this._lockXAxis ? 100 : 20) - this._circle.size.width / 2
|
|
193
|
+
? this._grid.pos.X + (this._lockXAxis ? 100 : 20) - this._circle.size.width / 2
|
|
194
|
+
: cX;
|
|
195
|
+
this._circle.pos.Y =
|
|
196
|
+
cY > this._grid.pos.Y + 10 + this._grid.size.height - (this._lockYAxis ? 120 : 40)
|
|
197
|
+
? this._grid.pos.Y + 10 + this._grid.size.height - (this._lockYAxis ? 120 : 40)
|
|
198
|
+
: cY < this._grid.pos.Y + (this._lockYAxis ? 100 : 20) - this._circle.size.height / 2
|
|
199
|
+
? this._grid.pos.Y + (this._lockYAxis ? 100 : 20) - this._circle.size.height / 2
|
|
200
|
+
: cY;
|
|
201
|
+
}
|
|
202
|
+
this.updateParentItem();
|
|
203
|
+
this._pressed = false;
|
|
204
|
+
})();
|
|
205
|
+
const interval = setInterval(async () => {
|
|
206
|
+
if (Game.isDisabledControlPressed(0, Control.Attack)) {
|
|
207
|
+
this.updateParentItem();
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
clearInterval(interval);
|
|
211
|
+
}
|
|
212
|
+
}, 75);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AbstractUIMenuPanel } from './';
|
|
2
|
+
import { Sprite } from '../../../';
|
|
3
|
+
export declare class UIMenuPercentagePanel extends AbstractUIMenuPanel {
|
|
4
|
+
protected readonly background: Sprite;
|
|
5
|
+
private _pressed;
|
|
6
|
+
private _lastPercentage;
|
|
7
|
+
private readonly _title;
|
|
8
|
+
private readonly _minText;
|
|
9
|
+
private readonly _maxText;
|
|
10
|
+
private readonly _activeBar;
|
|
11
|
+
private readonly _backgroundBar;
|
|
12
|
+
constructor(title?: string, percentage?: number, minText?: string, maxText?: string);
|
|
13
|
+
get Title(): string;
|
|
14
|
+
set Title(value: string);
|
|
15
|
+
get MinText(): string;
|
|
16
|
+
set MinText(value: string);
|
|
17
|
+
get MaxText(): string;
|
|
18
|
+
set MaxText(value: string);
|
|
19
|
+
get Percentage(): number;
|
|
20
|
+
set Percentage(value: number);
|
|
21
|
+
updateParentItem(): void;
|
|
22
|
+
setVerticalPosition(y: number): void;
|
|
23
|
+
draw(): void;
|
|
24
|
+
private _processControls;
|
|
25
|
+
private _getProgress;
|
|
26
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Color, Point, Size } from '../../../../utils';
|
|
2
|
+
import { AbstractUIMenuPanel } from './';
|
|
3
|
+
import { Menu, Rectangle, Sprite, Text } from '../../../';
|
|
4
|
+
import { Alignment, Control, Font } from '../../../../enums';
|
|
5
|
+
import { Game, Wait } from '../../../../';
|
|
6
|
+
export class UIMenuPercentagePanel extends AbstractUIMenuPanel {
|
|
7
|
+
constructor(title = '', percentage = 0, minText, maxText) {
|
|
8
|
+
super();
|
|
9
|
+
this._pressed = false;
|
|
10
|
+
this.background = new Sprite('commonmenu', 'gradient_bgd', new Point(), new Size(431, 76));
|
|
11
|
+
const barSize = new Size(413, 10);
|
|
12
|
+
this._activeBar = new Rectangle(new Point(), barSize, Color.fromRgb(245, 245, 245));
|
|
13
|
+
this._backgroundBar = new Rectangle(new Point(), { ...barSize }, Color.fromRgb(87, 87, 87));
|
|
14
|
+
this._title = new Text('', new Point(), 0.35, Color.white, Font.ChaletLondon, Alignment.Centered);
|
|
15
|
+
this._minText = new Text('', new Point(), 0.35, Color.white, Font.ChaletLondon, Alignment.Centered);
|
|
16
|
+
this._maxText = new Text('', new Point(), 0.35, Color.white, Font.ChaletLondon, Alignment.Centered);
|
|
17
|
+
this.Title = title;
|
|
18
|
+
this.MinText = minText || '0%';
|
|
19
|
+
this.MaxText = maxText || '100%';
|
|
20
|
+
this.Percentage = percentage;
|
|
21
|
+
this._lastPercentage = percentage;
|
|
22
|
+
}
|
|
23
|
+
get Title() {
|
|
24
|
+
return this._title.caption;
|
|
25
|
+
}
|
|
26
|
+
set Title(value) {
|
|
27
|
+
this._title.caption = value ? value.trim() : '';
|
|
28
|
+
}
|
|
29
|
+
get MinText() {
|
|
30
|
+
return this._minText.caption;
|
|
31
|
+
}
|
|
32
|
+
set MinText(value) {
|
|
33
|
+
this._minText.caption = value ? value.trim() : '';
|
|
34
|
+
}
|
|
35
|
+
get MaxText() {
|
|
36
|
+
return this._maxText.caption;
|
|
37
|
+
}
|
|
38
|
+
set MaxText(value) {
|
|
39
|
+
this._maxText.caption = value ? value.trim() : '';
|
|
40
|
+
}
|
|
41
|
+
get Percentage() {
|
|
42
|
+
const progress = this._activeBar.size.width / this._backgroundBar.size.width;
|
|
43
|
+
return Math.round(progress * 100) / 100;
|
|
44
|
+
}
|
|
45
|
+
set Percentage(value) {
|
|
46
|
+
value = value || 0;
|
|
47
|
+
value = value < 0 ? 0 : value > 1 ? 1 : value;
|
|
48
|
+
this._activeBar.size.width = this._backgroundBar.size.width * value;
|
|
49
|
+
}
|
|
50
|
+
updateParentItem() {
|
|
51
|
+
const last = this._lastPercentage;
|
|
52
|
+
const current = this.Percentage;
|
|
53
|
+
if (last !== current) {
|
|
54
|
+
this._lastPercentage = current;
|
|
55
|
+
if (this.ParentMenu && this.parentItem) {
|
|
56
|
+
this.ParentMenu.panelActivated.emit(this.parentItem, this, current);
|
|
57
|
+
this.parentItem.panelActivated.emit(this, current);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
setVerticalPosition(y) {
|
|
62
|
+
super.setVerticalPosition(y);
|
|
63
|
+
this._activeBar.pos.Y = y + 50;
|
|
64
|
+
this._backgroundBar.pos.Y = y + 50;
|
|
65
|
+
y += 15;
|
|
66
|
+
this._minText.pos.Y = y;
|
|
67
|
+
this._title.pos.Y = y;
|
|
68
|
+
this._maxText.pos.Y = y;
|
|
69
|
+
}
|
|
70
|
+
draw() {
|
|
71
|
+
if (this.enabled) {
|
|
72
|
+
super.draw();
|
|
73
|
+
const x = this.parentItem?.offset.X ?? 0 + (this.ParentMenu?.WidthOffset ?? 0) / 2;
|
|
74
|
+
this._activeBar.pos.X = x + 9;
|
|
75
|
+
this._backgroundBar.pos.X = x + 9;
|
|
76
|
+
this._minText.pos.X = x + 25;
|
|
77
|
+
this._title.pos.X = x + 215.5;
|
|
78
|
+
this._maxText.pos.X = x + 398;
|
|
79
|
+
this._backgroundBar.draw(undefined, Menu.screenResolution);
|
|
80
|
+
this._activeBar.draw(undefined, Menu.screenResolution);
|
|
81
|
+
this._minText.draw(undefined, Menu.screenResolution);
|
|
82
|
+
this._title.draw(undefined, Menu.screenResolution);
|
|
83
|
+
this._maxText.draw(undefined, Menu.screenResolution);
|
|
84
|
+
this._processControls();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
_processControls() {
|
|
88
|
+
if (!this._pressed &&
|
|
89
|
+
Game.isDisabledControlJustPressed(0, Control.Attack) &&
|
|
90
|
+
this.ParentMenu?.isMouseInBounds(new Point(this._backgroundBar.pos.X, this._backgroundBar.pos.Y - 4), new Size(this._backgroundBar.size.width, this._backgroundBar.size.height + 8))) {
|
|
91
|
+
this._pressed = true;
|
|
92
|
+
(async () => {
|
|
93
|
+
while (Game.isDisabledControlPressed(0, Control.Attack)) {
|
|
94
|
+
await Wait(0);
|
|
95
|
+
this._activeBar.size.width = this._getProgress();
|
|
96
|
+
}
|
|
97
|
+
this.updateParentItem();
|
|
98
|
+
this._pressed = false;
|
|
99
|
+
})();
|
|
100
|
+
const interval = setInterval(async () => {
|
|
101
|
+
if (Game.isDisabledControlPressed(0, Control.Attack)) {
|
|
102
|
+
this.updateParentItem();
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
clearInterval(interval);
|
|
106
|
+
}
|
|
107
|
+
}, 75);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
_getProgress() {
|
|
111
|
+
const drawOffset = this.ParentMenu?.DrawOffset ?? new Point(0, 0);
|
|
112
|
+
const progress = (GetControlNormal(0, 239) - drawOffset.X) * Menu.screenWidth - this._activeBar.pos.X;
|
|
113
|
+
return progress < 0 ? 0 : progress > 413 ? 413 : progress;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AbstractUIMenuPanel, UIMenuStatisticsPanelItem } from './';
|
|
2
|
+
import { Rectangle } from '../../../';
|
|
3
|
+
export declare class UIMenuStatisticsPanel extends AbstractUIMenuPanel {
|
|
4
|
+
protected readonly background: Rectangle;
|
|
5
|
+
private _divider;
|
|
6
|
+
private _items;
|
|
7
|
+
constructor(item?: UIMenuStatisticsPanelItem[] | UIMenuStatisticsPanelItem, divider?: boolean);
|
|
8
|
+
get Divider(): boolean;
|
|
9
|
+
set Divider(value: boolean);
|
|
10
|
+
get Items(): UIMenuStatisticsPanelItem[];
|
|
11
|
+
set Items(value: UIMenuStatisticsPanelItem[]);
|
|
12
|
+
addItem(item: UIMenuStatisticsPanelItem | UIMenuStatisticsPanelItem[]): void;
|
|
13
|
+
removeItem(itemOrIndex: UIMenuStatisticsPanelItem | number): void;
|
|
14
|
+
setVerticalPosition(y: number): void;
|
|
15
|
+
draw(): void;
|
|
16
|
+
}
|