From 1a90fad8ecaad17defd3d4cbae090b8dc4a16434 Mon Sep 17 00:00:00 2001 From: Sergey Yarkov Date: Thu, 6 Aug 2020 19:38:53 +0300 Subject: [PATCH] some commands & admin panel --- client/includes/nativeui/nativeui.js | 2784 +++++++++++++++++ client/includes/nativeui/nativeui.min.js | 1 + client/includes/nativeui/types/NativeUi.d.ts | 141 + .../nativeui/types/enums/Alignment.d.ts | 6 + .../nativeui/types/enums/BadgeStyle.d.ts | 34 + .../nativeui/types/enums/ChangeDirection.d.ts | 5 + .../nativeui/types/enums/Control.d.ts | 349 +++ .../includes/nativeui/types/enums/Font.d.ts | 8 + .../nativeui/types/enums/HudColor.d.ts | 183 ++ .../types/items/UIMenuAutoListItem.d.ts | 36 + .../types/items/UIMenuCheckboxItem.d.ts | 11 + .../types/items/UIMenuDynamicListItem.d.ts | 34 + .../nativeui/types/items/UIMenuItem.d.ts | 51 + .../nativeui/types/items/UIMenuListItem.d.ts | 30 + .../types/items/UIMenuSliderItem.d.ts | 19 + .../nativeui/types/modules/BigMessage.d.ts | 14 + .../nativeui/types/modules/Container.d.ts | 10 + .../nativeui/types/modules/IElement.d.ts | 4 + .../types/modules/InstructionalButton.d.ts | 13 + .../types/modules/ItemsCollection.d.ts | 7 + .../nativeui/types/modules/ListItem.d.ts | 6 + .../nativeui/types/modules/Message.d.ts | 23 + .../types/modules/MidsizedMessage.d.ts | 9 + .../nativeui/types/modules/Rectangle.d.ts | 11 + .../nativeui/types/modules/ResRectangle.d.ts | 10 + .../nativeui/types/modules/ResText.d.ts | 17 + .../nativeui/types/modules/Sprite.d.ts | 19 + .../includes/nativeui/types/modules/Text.d.ts | 16 + .../includes/nativeui/types/utils/Color.d.ts | 12 + .../includes/nativeui/types/utils/Common.d.ts | 3 + .../nativeui/types/utils/LiteEvent.d.ts | 21 + .../includes/nativeui/types/utils/Number.d.ts | 1 + .../includes/nativeui/types/utils/Point.d.ts | 10 + .../nativeui/types/utils/Scaleform.d.ts | 14 + .../includes/nativeui/types/utils/Screen.d.ts | 15 + .../includes/nativeui/types/utils/Size.d.ts | 5 + .../includes/nativeui/types/utils/UUIDV4.d.ts | 1 + client/index.mjs | 28 + client/ui.mjs | 116 + resource.cfg | 5 +- server/index.mjs | 6 + server/modules/commands/admin/kick.mjs | 7 +- server/modules/events/playerConnect.mjs | 9 +- server/modules/events/playerDeath.mjs | 3 +- server/modules/events/ui/getHealth.mjs | 9 + server/modules/events/ui/godMode.mjs | 14 + server/modules/events/ui/kickPlayer.mjs | 12 + server/modules/events/ui/showAdminPanel.mjs | 8 + 48 files changed, 4144 insertions(+), 6 deletions(-) create mode 100644 client/includes/nativeui/nativeui.js create mode 100644 client/includes/nativeui/nativeui.min.js create mode 100644 client/includes/nativeui/types/NativeUi.d.ts create mode 100644 client/includes/nativeui/types/enums/Alignment.d.ts create mode 100644 client/includes/nativeui/types/enums/BadgeStyle.d.ts create mode 100644 client/includes/nativeui/types/enums/ChangeDirection.d.ts create mode 100644 client/includes/nativeui/types/enums/Control.d.ts create mode 100644 client/includes/nativeui/types/enums/Font.d.ts create mode 100644 client/includes/nativeui/types/enums/HudColor.d.ts create mode 100644 client/includes/nativeui/types/items/UIMenuAutoListItem.d.ts create mode 100644 client/includes/nativeui/types/items/UIMenuCheckboxItem.d.ts create mode 100644 client/includes/nativeui/types/items/UIMenuDynamicListItem.d.ts create mode 100644 client/includes/nativeui/types/items/UIMenuItem.d.ts create mode 100644 client/includes/nativeui/types/items/UIMenuListItem.d.ts create mode 100644 client/includes/nativeui/types/items/UIMenuSliderItem.d.ts create mode 100644 client/includes/nativeui/types/modules/BigMessage.d.ts create mode 100644 client/includes/nativeui/types/modules/Container.d.ts create mode 100644 client/includes/nativeui/types/modules/IElement.d.ts create mode 100644 client/includes/nativeui/types/modules/InstructionalButton.d.ts create mode 100644 client/includes/nativeui/types/modules/ItemsCollection.d.ts create mode 100644 client/includes/nativeui/types/modules/ListItem.d.ts create mode 100644 client/includes/nativeui/types/modules/Message.d.ts create mode 100644 client/includes/nativeui/types/modules/MidsizedMessage.d.ts create mode 100644 client/includes/nativeui/types/modules/Rectangle.d.ts create mode 100644 client/includes/nativeui/types/modules/ResRectangle.d.ts create mode 100644 client/includes/nativeui/types/modules/ResText.d.ts create mode 100644 client/includes/nativeui/types/modules/Sprite.d.ts create mode 100644 client/includes/nativeui/types/modules/Text.d.ts create mode 100644 client/includes/nativeui/types/utils/Color.d.ts create mode 100644 client/includes/nativeui/types/utils/Common.d.ts create mode 100644 client/includes/nativeui/types/utils/LiteEvent.d.ts create mode 100644 client/includes/nativeui/types/utils/Number.d.ts create mode 100644 client/includes/nativeui/types/utils/Point.d.ts create mode 100644 client/includes/nativeui/types/utils/Scaleform.d.ts create mode 100644 client/includes/nativeui/types/utils/Screen.d.ts create mode 100644 client/includes/nativeui/types/utils/Size.d.ts create mode 100644 client/includes/nativeui/types/utils/UUIDV4.d.ts create mode 100644 client/ui.mjs create mode 100644 server/modules/events/ui/getHealth.mjs create mode 100644 server/modules/events/ui/godMode.mjs create mode 100644 server/modules/events/ui/kickPlayer.mjs create mode 100644 server/modules/events/ui/showAdminPanel.mjs diff --git a/client/includes/nativeui/nativeui.js b/client/includes/nativeui/nativeui.js new file mode 100644 index 0000000..e7bebba --- /dev/null +++ b/client/includes/nativeui/nativeui.js @@ -0,0 +1,2784 @@ +import { getCursorPos, setInterval, clearInterval, logWarning, emit, logError, clearTimeout, setTimeout, everyTick, getGxtText, showCursor } from 'alt-client'; +import game__default, { requestScaleformMovie, hasScaleformMovieLoaded, beginScaleformMovieMethod, scaleformMovieMethodAddParamBool, scaleformMovieMethodAddParamPlayerNameString, scaleformMovieMethodAddParamFloat, scaleformMovieMethodAddParamInt, endScaleformMovieMethod, endScaleformMovieMethodReturnValue, drawScaleformMovieFullscreen, setScaleformMovieAsNoLongerNeeded } from 'natives'; + +var BadgeStyle; +(function (BadgeStyle) { + BadgeStyle[BadgeStyle["None"] = 0] = "None"; + BadgeStyle[BadgeStyle["BronzeMedal"] = 1] = "BronzeMedal"; + BadgeStyle[BadgeStyle["GoldMedal"] = 2] = "GoldMedal"; + BadgeStyle[BadgeStyle["SilverMedal"] = 3] = "SilverMedal"; + BadgeStyle[BadgeStyle["Alert"] = 4] = "Alert"; + BadgeStyle[BadgeStyle["Crown"] = 5] = "Crown"; + BadgeStyle[BadgeStyle["Ammo"] = 6] = "Ammo"; + BadgeStyle[BadgeStyle["Armour"] = 7] = "Armour"; + BadgeStyle[BadgeStyle["Barber"] = 8] = "Barber"; + BadgeStyle[BadgeStyle["Clothes"] = 9] = "Clothes"; + BadgeStyle[BadgeStyle["Franklin"] = 10] = "Franklin"; + BadgeStyle[BadgeStyle["Bike"] = 11] = "Bike"; + BadgeStyle[BadgeStyle["Car"] = 12] = "Car"; + BadgeStyle[BadgeStyle["Gun"] = 13] = "Gun"; + BadgeStyle[BadgeStyle["Heart"] = 14] = "Heart"; + BadgeStyle[BadgeStyle["Makeup"] = 15] = "Makeup"; + BadgeStyle[BadgeStyle["Mask"] = 16] = "Mask"; + BadgeStyle[BadgeStyle["Michael"] = 17] = "Michael"; + BadgeStyle[BadgeStyle["Star"] = 18] = "Star"; + BadgeStyle[BadgeStyle["Tattoo"] = 19] = "Tattoo"; + BadgeStyle[BadgeStyle["Trevor"] = 20] = "Trevor"; + BadgeStyle[BadgeStyle["Lock"] = 21] = "Lock"; + BadgeStyle[BadgeStyle["Tick"] = 22] = "Tick"; + BadgeStyle[BadgeStyle["Sale"] = 23] = "Sale"; + BadgeStyle[BadgeStyle["ArrowLeft"] = 24] = "ArrowLeft"; + BadgeStyle[BadgeStyle["ArrowRight"] = 25] = "ArrowRight"; + BadgeStyle[BadgeStyle["Audio1"] = 26] = "Audio1"; + BadgeStyle[BadgeStyle["Audio2"] = 27] = "Audio2"; + BadgeStyle[BadgeStyle["Audio3"] = 28] = "Audio3"; + BadgeStyle[BadgeStyle["AudioInactive"] = 29] = "AudioInactive"; + BadgeStyle[BadgeStyle["AudioMute"] = 30] = "AudioMute"; +})(BadgeStyle || (BadgeStyle = {})); +var BadgeStyle$1 = BadgeStyle; + +var Font; +(function (Font) { + Font[Font["ChaletLondon"] = 0] = "ChaletLondon"; + Font[Font["HouseScript"] = 1] = "HouseScript"; + Font[Font["Monospace"] = 2] = "Monospace"; + Font[Font["CharletComprimeColonge"] = 4] = "CharletComprimeColonge"; + Font[Font["Pricedown"] = 7] = "Pricedown"; +})(Font || (Font = {})); +var Font$1 = Font; + +var Alignment; +(function (Alignment) { + Alignment[Alignment["Left"] = 0] = "Left"; + Alignment[Alignment["Centered"] = 1] = "Centered"; + Alignment[Alignment["Right"] = 2] = "Right"; +})(Alignment || (Alignment = {})); +var Alignment$1 = Alignment; + +var Control; +(function (Control) { + Control[Control["NextCamera"] = 0] = "NextCamera"; + Control[Control["LookLeftRight"] = 1] = "LookLeftRight"; + Control[Control["LookUpDown"] = 2] = "LookUpDown"; + Control[Control["LookUpOnly"] = 3] = "LookUpOnly"; + Control[Control["LookDownOnly"] = 4] = "LookDownOnly"; + Control[Control["LookLeftOnly"] = 5] = "LookLeftOnly"; + Control[Control["LookRightOnly"] = 6] = "LookRightOnly"; + Control[Control["CinematicSlowMo"] = 7] = "CinematicSlowMo"; + Control[Control["FlyUpDown"] = 8] = "FlyUpDown"; + Control[Control["FlyLeftRight"] = 9] = "FlyLeftRight"; + Control[Control["ScriptedFlyZUp"] = 10] = "ScriptedFlyZUp"; + Control[Control["ScriptedFlyZDown"] = 11] = "ScriptedFlyZDown"; + Control[Control["WeaponWheelUpDown"] = 12] = "WeaponWheelUpDown"; + Control[Control["WeaponWheelLeftRight"] = 13] = "WeaponWheelLeftRight"; + Control[Control["WeaponWheelNext"] = 14] = "WeaponWheelNext"; + Control[Control["WeaponWheelPrev"] = 15] = "WeaponWheelPrev"; + Control[Control["SelectNextWeapon"] = 16] = "SelectNextWeapon"; + Control[Control["SelectPrevWeapon"] = 17] = "SelectPrevWeapon"; + Control[Control["SkipCutscene"] = 18] = "SkipCutscene"; + Control[Control["CharacterWheel"] = 19] = "CharacterWheel"; + Control[Control["MultiplayerInfo"] = 20] = "MultiplayerInfo"; + Control[Control["Sprint"] = 21] = "Sprint"; + Control[Control["Jump"] = 22] = "Jump"; + Control[Control["Enter"] = 23] = "Enter"; + Control[Control["Attack"] = 24] = "Attack"; + Control[Control["Aim"] = 25] = "Aim"; + Control[Control["LookBehind"] = 26] = "LookBehind"; + Control[Control["Phone"] = 27] = "Phone"; + Control[Control["SpecialAbility"] = 28] = "SpecialAbility"; + Control[Control["SpecialAbilitySecondary"] = 29] = "SpecialAbilitySecondary"; + Control[Control["MoveLeftRight"] = 30] = "MoveLeftRight"; + Control[Control["MoveUpDown"] = 31] = "MoveUpDown"; + Control[Control["MoveUpOnly"] = 32] = "MoveUpOnly"; + Control[Control["MoveDownOnly"] = 33] = "MoveDownOnly"; + Control[Control["MoveLeftOnly"] = 34] = "MoveLeftOnly"; + Control[Control["MoveRightOnly"] = 35] = "MoveRightOnly"; + Control[Control["Duck"] = 36] = "Duck"; + Control[Control["SelectWeapon"] = 37] = "SelectWeapon"; + Control[Control["Pickup"] = 38] = "Pickup"; + Control[Control["SniperZoom"] = 39] = "SniperZoom"; + Control[Control["SniperZoomInOnly"] = 40] = "SniperZoomInOnly"; + Control[Control["SniperZoomOutOnly"] = 41] = "SniperZoomOutOnly"; + Control[Control["SniperZoomInSecondary"] = 42] = "SniperZoomInSecondary"; + Control[Control["SniperZoomOutSecondary"] = 43] = "SniperZoomOutSecondary"; + Control[Control["Cover"] = 44] = "Cover"; + Control[Control["Reload"] = 45] = "Reload"; + Control[Control["Talk"] = 46] = "Talk"; + Control[Control["Detonate"] = 47] = "Detonate"; + Control[Control["HUDSpecial"] = 48] = "HUDSpecial"; + Control[Control["Arrest"] = 49] = "Arrest"; + Control[Control["AccurateAim"] = 50] = "AccurateAim"; + Control[Control["Context"] = 51] = "Context"; + Control[Control["ContextSecondary"] = 52] = "ContextSecondary"; + Control[Control["WeaponSpecial"] = 53] = "WeaponSpecial"; + Control[Control["WeaponSpecial2"] = 54] = "WeaponSpecial2"; + Control[Control["Dive"] = 55] = "Dive"; + Control[Control["DropWeapon"] = 56] = "DropWeapon"; + Control[Control["DropAmmo"] = 57] = "DropAmmo"; + Control[Control["ThrowGrenade"] = 58] = "ThrowGrenade"; + Control[Control["VehicleMoveLeftRight"] = 59] = "VehicleMoveLeftRight"; + Control[Control["VehicleMoveUpDown"] = 60] = "VehicleMoveUpDown"; + Control[Control["VehicleMoveUpOnly"] = 61] = "VehicleMoveUpOnly"; + Control[Control["VehicleMoveDownOnly"] = 62] = "VehicleMoveDownOnly"; + Control[Control["VehicleMoveLeftOnly"] = 63] = "VehicleMoveLeftOnly"; + Control[Control["VehicleMoveRightOnly"] = 64] = "VehicleMoveRightOnly"; + Control[Control["VehicleSpecial"] = 65] = "VehicleSpecial"; + Control[Control["VehicleGunLeftRight"] = 66] = "VehicleGunLeftRight"; + Control[Control["VehicleGunUpDown"] = 67] = "VehicleGunUpDown"; + Control[Control["VehicleAim"] = 68] = "VehicleAim"; + Control[Control["VehicleAttack"] = 69] = "VehicleAttack"; + Control[Control["VehicleAttack2"] = 70] = "VehicleAttack2"; + Control[Control["VehicleAccelerate"] = 71] = "VehicleAccelerate"; + Control[Control["VehicleBrake"] = 72] = "VehicleBrake"; + Control[Control["VehicleDuck"] = 73] = "VehicleDuck"; + Control[Control["VehicleHeadlight"] = 74] = "VehicleHeadlight"; + Control[Control["VehicleExit"] = 75] = "VehicleExit"; + Control[Control["VehicleHandbrake"] = 76] = "VehicleHandbrake"; + Control[Control["VehicleHotwireLeft"] = 77] = "VehicleHotwireLeft"; + Control[Control["VehicleHotwireRight"] = 78] = "VehicleHotwireRight"; + Control[Control["VehicleLookBehind"] = 79] = "VehicleLookBehind"; + Control[Control["VehicleCinCam"] = 80] = "VehicleCinCam"; + Control[Control["VehicleNextRadio"] = 81] = "VehicleNextRadio"; + Control[Control["VehiclePrevRadio"] = 82] = "VehiclePrevRadio"; + Control[Control["VehicleNextRadioTrack"] = 83] = "VehicleNextRadioTrack"; + Control[Control["VehiclePrevRadioTrack"] = 84] = "VehiclePrevRadioTrack"; + Control[Control["VehicleRadioWheel"] = 85] = "VehicleRadioWheel"; + Control[Control["VehicleHorn"] = 86] = "VehicleHorn"; + Control[Control["VehicleFlyThrottleUp"] = 87] = "VehicleFlyThrottleUp"; + Control[Control["VehicleFlyThrottleDown"] = 88] = "VehicleFlyThrottleDown"; + Control[Control["VehicleFlyYawLeft"] = 89] = "VehicleFlyYawLeft"; + Control[Control["VehicleFlyYawRight"] = 90] = "VehicleFlyYawRight"; + Control[Control["VehiclePassengerAim"] = 91] = "VehiclePassengerAim"; + Control[Control["VehiclePassengerAttack"] = 92] = "VehiclePassengerAttack"; + Control[Control["VehicleSpecialAbilityFranklin"] = 93] = "VehicleSpecialAbilityFranklin"; + Control[Control["VehicleStuntUpDown"] = 94] = "VehicleStuntUpDown"; + Control[Control["VehicleCinematicUpDown"] = 95] = "VehicleCinematicUpDown"; + Control[Control["VehicleCinematicUpOnly"] = 96] = "VehicleCinematicUpOnly"; + Control[Control["VehicleCinematicDownOnly"] = 97] = "VehicleCinematicDownOnly"; + Control[Control["VehicleCinematicLeftRight"] = 98] = "VehicleCinematicLeftRight"; + Control[Control["VehicleSelectNextWeapon"] = 99] = "VehicleSelectNextWeapon"; + Control[Control["VehicleSelectPrevWeapon"] = 100] = "VehicleSelectPrevWeapon"; + Control[Control["VehicleRoof"] = 101] = "VehicleRoof"; + Control[Control["VehicleJump"] = 102] = "VehicleJump"; + Control[Control["VehicleGrapplingHook"] = 103] = "VehicleGrapplingHook"; + Control[Control["VehicleShuffle"] = 104] = "VehicleShuffle"; + Control[Control["VehicleDropProjectile"] = 105] = "VehicleDropProjectile"; + Control[Control["VehicleMouseControlOverride"] = 106] = "VehicleMouseControlOverride"; + Control[Control["VehicleFlyRollLeftRight"] = 107] = "VehicleFlyRollLeftRight"; + Control[Control["VehicleFlyRollLeftOnly"] = 108] = "VehicleFlyRollLeftOnly"; + Control[Control["VehicleFlyRollRightOnly"] = 109] = "VehicleFlyRollRightOnly"; + Control[Control["VehicleFlyPitchUpDown"] = 110] = "VehicleFlyPitchUpDown"; + Control[Control["VehicleFlyPitchUpOnly"] = 111] = "VehicleFlyPitchUpOnly"; + Control[Control["VehicleFlyPitchDownOnly"] = 112] = "VehicleFlyPitchDownOnly"; + Control[Control["VehicleFlyUnderCarriage"] = 113] = "VehicleFlyUnderCarriage"; + Control[Control["VehicleFlyAttack"] = 114] = "VehicleFlyAttack"; + Control[Control["VehicleFlySelectNextWeapon"] = 115] = "VehicleFlySelectNextWeapon"; + Control[Control["VehicleFlySelectPrevWeapon"] = 116] = "VehicleFlySelectPrevWeapon"; + Control[Control["VehicleFlySelectTargetLeft"] = 117] = "VehicleFlySelectTargetLeft"; + Control[Control["VehicleFlySelectTargetRight"] = 118] = "VehicleFlySelectTargetRight"; + Control[Control["VehicleFlyVerticalFlightMode"] = 119] = "VehicleFlyVerticalFlightMode"; + Control[Control["VehicleFlyDuck"] = 120] = "VehicleFlyDuck"; + Control[Control["VehicleFlyAttackCamera"] = 121] = "VehicleFlyAttackCamera"; + Control[Control["VehicleFlyMouseControlOverride"] = 122] = "VehicleFlyMouseControlOverride"; + Control[Control["VehicleSubTurnLeftRight"] = 123] = "VehicleSubTurnLeftRight"; + Control[Control["VehicleSubTurnLeftOnly"] = 124] = "VehicleSubTurnLeftOnly"; + Control[Control["VehicleSubTurnRightOnly"] = 125] = "VehicleSubTurnRightOnly"; + Control[Control["VehicleSubPitchUpDown"] = 126] = "VehicleSubPitchUpDown"; + Control[Control["VehicleSubPitchUpOnly"] = 127] = "VehicleSubPitchUpOnly"; + Control[Control["VehicleSubPitchDownOnly"] = 128] = "VehicleSubPitchDownOnly"; + Control[Control["VehicleSubThrottleUp"] = 129] = "VehicleSubThrottleUp"; + Control[Control["VehicleSubThrottleDown"] = 130] = "VehicleSubThrottleDown"; + Control[Control["VehicleSubAscend"] = 131] = "VehicleSubAscend"; + Control[Control["VehicleSubDescend"] = 132] = "VehicleSubDescend"; + Control[Control["VehicleSubTurnHardLeft"] = 133] = "VehicleSubTurnHardLeft"; + Control[Control["VehicleSubTurnHardRight"] = 134] = "VehicleSubTurnHardRight"; + Control[Control["VehicleSubMouseControlOverride"] = 135] = "VehicleSubMouseControlOverride"; + Control[Control["VehiclePushbikePedal"] = 136] = "VehiclePushbikePedal"; + Control[Control["VehiclePushbikeSprint"] = 137] = "VehiclePushbikeSprint"; + Control[Control["VehiclePushbikeFrontBrake"] = 138] = "VehiclePushbikeFrontBrake"; + Control[Control["VehiclePushbikeRearBrake"] = 139] = "VehiclePushbikeRearBrake"; + Control[Control["MeleeAttackLight"] = 140] = "MeleeAttackLight"; + Control[Control["MeleeAttackHeavy"] = 141] = "MeleeAttackHeavy"; + Control[Control["MeleeAttackAlternate"] = 142] = "MeleeAttackAlternate"; + Control[Control["MeleeBlock"] = 143] = "MeleeBlock"; + Control[Control["ParachuteDeploy"] = 144] = "ParachuteDeploy"; + Control[Control["ParachuteDetach"] = 145] = "ParachuteDetach"; + Control[Control["ParachuteTurnLeftRight"] = 146] = "ParachuteTurnLeftRight"; + Control[Control["ParachuteTurnLeftOnly"] = 147] = "ParachuteTurnLeftOnly"; + Control[Control["ParachuteTurnRightOnly"] = 148] = "ParachuteTurnRightOnly"; + Control[Control["ParachutePitchUpDown"] = 149] = "ParachutePitchUpDown"; + Control[Control["ParachutePitchUpOnly"] = 150] = "ParachutePitchUpOnly"; + Control[Control["ParachutePitchDownOnly"] = 151] = "ParachutePitchDownOnly"; + Control[Control["ParachuteBrakeLeft"] = 152] = "ParachuteBrakeLeft"; + Control[Control["ParachuteBrakeRight"] = 153] = "ParachuteBrakeRight"; + Control[Control["ParachuteSmoke"] = 154] = "ParachuteSmoke"; + Control[Control["ParachutePrecisionLanding"] = 155] = "ParachutePrecisionLanding"; + Control[Control["Map"] = 156] = "Map"; + Control[Control["SelectWeaponUnarmed"] = 157] = "SelectWeaponUnarmed"; + Control[Control["SelectWeaponMelee"] = 158] = "SelectWeaponMelee"; + Control[Control["SelectWeaponHandgun"] = 159] = "SelectWeaponHandgun"; + Control[Control["SelectWeaponShotgun"] = 160] = "SelectWeaponShotgun"; + Control[Control["SelectWeaponSmg"] = 161] = "SelectWeaponSmg"; + Control[Control["SelectWeaponAutoRifle"] = 162] = "SelectWeaponAutoRifle"; + Control[Control["SelectWeaponSniper"] = 163] = "SelectWeaponSniper"; + Control[Control["SelectWeaponHeavy"] = 164] = "SelectWeaponHeavy"; + Control[Control["SelectWeaponSpecial"] = 165] = "SelectWeaponSpecial"; + Control[Control["SelectCharacterMichael"] = 166] = "SelectCharacterMichael"; + Control[Control["SelectCharacterFranklin"] = 167] = "SelectCharacterFranklin"; + Control[Control["SelectCharacterTrevor"] = 168] = "SelectCharacterTrevor"; + Control[Control["SelectCharacterMultiplayer"] = 169] = "SelectCharacterMultiplayer"; + Control[Control["SaveReplayClip"] = 170] = "SaveReplayClip"; + Control[Control["SpecialAbilityPC"] = 171] = "SpecialAbilityPC"; + Control[Control["PhoneUp"] = 172] = "PhoneUp"; + Control[Control["PhoneDown"] = 173] = "PhoneDown"; + Control[Control["PhoneLeft"] = 174] = "PhoneLeft"; + Control[Control["PhoneRight"] = 175] = "PhoneRight"; + Control[Control["PhoneSelect"] = 176] = "PhoneSelect"; + Control[Control["PhoneCancel"] = 177] = "PhoneCancel"; + Control[Control["PhoneOption"] = 178] = "PhoneOption"; + Control[Control["PhoneExtraOption"] = 179] = "PhoneExtraOption"; + Control[Control["PhoneScrollForward"] = 180] = "PhoneScrollForward"; + Control[Control["PhoneScrollBackward"] = 181] = "PhoneScrollBackward"; + Control[Control["PhoneCameraFocusLock"] = 182] = "PhoneCameraFocusLock"; + Control[Control["PhoneCameraGrid"] = 183] = "PhoneCameraGrid"; + Control[Control["PhoneCameraSelfie"] = 184] = "PhoneCameraSelfie"; + Control[Control["PhoneCameraDOF"] = 185] = "PhoneCameraDOF"; + Control[Control["PhoneCameraExpression"] = 186] = "PhoneCameraExpression"; + Control[Control["FrontendDown"] = 187] = "FrontendDown"; + Control[Control["FrontendUp"] = 188] = "FrontendUp"; + Control[Control["FrontendLeft"] = 189] = "FrontendLeft"; + Control[Control["FrontendRight"] = 190] = "FrontendRight"; + Control[Control["FrontendRdown"] = 191] = "FrontendRdown"; + Control[Control["FrontendRup"] = 192] = "FrontendRup"; + Control[Control["FrontendRleft"] = 193] = "FrontendRleft"; + Control[Control["FrontendRright"] = 194] = "FrontendRright"; + Control[Control["FrontendAxisX"] = 195] = "FrontendAxisX"; + Control[Control["FrontendAxisY"] = 196] = "FrontendAxisY"; + Control[Control["FrontendRightAxisX"] = 197] = "FrontendRightAxisX"; + Control[Control["FrontendRightAxisY"] = 198] = "FrontendRightAxisY"; + Control[Control["FrontendPause"] = 199] = "FrontendPause"; + Control[Control["FrontendPauseAlternate"] = 200] = "FrontendPauseAlternate"; + Control[Control["FrontendAccept"] = 201] = "FrontendAccept"; + Control[Control["FrontendCancel"] = 202] = "FrontendCancel"; + Control[Control["FrontendX"] = 203] = "FrontendX"; + Control[Control["FrontendY"] = 204] = "FrontendY"; + Control[Control["FrontendLb"] = 205] = "FrontendLb"; + Control[Control["FrontendRb"] = 206] = "FrontendRb"; + Control[Control["FrontendLt"] = 207] = "FrontendLt"; + Control[Control["FrontendRt"] = 208] = "FrontendRt"; + Control[Control["FrontendLs"] = 209] = "FrontendLs"; + Control[Control["FrontendRs"] = 210] = "FrontendRs"; + Control[Control["FrontendLeaderboard"] = 211] = "FrontendLeaderboard"; + Control[Control["FrontendSocialClub"] = 212] = "FrontendSocialClub"; + Control[Control["FrontendSocialClubSecondary"] = 213] = "FrontendSocialClubSecondary"; + Control[Control["FrontendDelete"] = 214] = "FrontendDelete"; + Control[Control["FrontendEndscreenAccept"] = 215] = "FrontendEndscreenAccept"; + Control[Control["FrontendEndscreenExpand"] = 216] = "FrontendEndscreenExpand"; + Control[Control["FrontendSelect"] = 217] = "FrontendSelect"; + Control[Control["ScriptLeftAxisX"] = 218] = "ScriptLeftAxisX"; + Control[Control["ScriptLeftAxisY"] = 219] = "ScriptLeftAxisY"; + Control[Control["ScriptRightAxisX"] = 220] = "ScriptRightAxisX"; + Control[Control["ScriptRightAxisY"] = 221] = "ScriptRightAxisY"; + Control[Control["ScriptRUp"] = 222] = "ScriptRUp"; + Control[Control["ScriptRDown"] = 223] = "ScriptRDown"; + Control[Control["ScriptRLeft"] = 224] = "ScriptRLeft"; + Control[Control["ScriptRRight"] = 225] = "ScriptRRight"; + Control[Control["ScriptLB"] = 226] = "ScriptLB"; + Control[Control["ScriptRB"] = 227] = "ScriptRB"; + Control[Control["ScriptLT"] = 228] = "ScriptLT"; + Control[Control["ScriptRT"] = 229] = "ScriptRT"; + Control[Control["ScriptLS"] = 230] = "ScriptLS"; + Control[Control["ScriptRS"] = 231] = "ScriptRS"; + Control[Control["ScriptPadUp"] = 232] = "ScriptPadUp"; + Control[Control["ScriptPadDown"] = 233] = "ScriptPadDown"; + Control[Control["ScriptPadLeft"] = 234] = "ScriptPadLeft"; + Control[Control["ScriptPadRight"] = 235] = "ScriptPadRight"; + Control[Control["ScriptSelect"] = 236] = "ScriptSelect"; + Control[Control["CursorAccept"] = 237] = "CursorAccept"; + Control[Control["CursorCancel"] = 238] = "CursorCancel"; + Control[Control["CursorX"] = 239] = "CursorX"; + Control[Control["CursorY"] = 240] = "CursorY"; + Control[Control["CursorScrollUp"] = 241] = "CursorScrollUp"; + Control[Control["CursorScrollDown"] = 242] = "CursorScrollDown"; + Control[Control["EnterCheatCode"] = 243] = "EnterCheatCode"; + Control[Control["InteractionMenu"] = 244] = "InteractionMenu"; + Control[Control["MpTextChatAll"] = 245] = "MpTextChatAll"; + Control[Control["MpTextChatTeam"] = 246] = "MpTextChatTeam"; + Control[Control["MpTextChatFriends"] = 247] = "MpTextChatFriends"; + Control[Control["MpTextChatCrew"] = 248] = "MpTextChatCrew"; + Control[Control["PushToTalk"] = 249] = "PushToTalk"; + Control[Control["CreatorLS"] = 250] = "CreatorLS"; + Control[Control["CreatorRS"] = 251] = "CreatorRS"; + Control[Control["CreatorLT"] = 252] = "CreatorLT"; + Control[Control["CreatorRT"] = 253] = "CreatorRT"; + Control[Control["CreatorMenuToggle"] = 254] = "CreatorMenuToggle"; + Control[Control["CreatorAccept"] = 255] = "CreatorAccept"; + Control[Control["CreatorDelete"] = 256] = "CreatorDelete"; + Control[Control["Attack2"] = 257] = "Attack2"; + Control[Control["RappelJump"] = 258] = "RappelJump"; + Control[Control["RappelLongJump"] = 259] = "RappelLongJump"; + Control[Control["RappelSmashWindow"] = 260] = "RappelSmashWindow"; + Control[Control["PrevWeapon"] = 261] = "PrevWeapon"; + Control[Control["NextWeapon"] = 262] = "NextWeapon"; + Control[Control["MeleeAttack1"] = 263] = "MeleeAttack1"; + Control[Control["MeleeAttack2"] = 264] = "MeleeAttack2"; + Control[Control["Whistle"] = 265] = "Whistle"; + Control[Control["MoveLeft"] = 266] = "MoveLeft"; + Control[Control["MoveRight"] = 267] = "MoveRight"; + Control[Control["MoveUp"] = 268] = "MoveUp"; + Control[Control["MoveDown"] = 269] = "MoveDown"; + Control[Control["LookLeft"] = 270] = "LookLeft"; + Control[Control["LookRight"] = 271] = "LookRight"; + Control[Control["LookUp"] = 272] = "LookUp"; + Control[Control["LookDown"] = 273] = "LookDown"; + Control[Control["SniperZoomIn"] = 274] = "SniperZoomIn"; + Control[Control["SniperZoomOut"] = 275] = "SniperZoomOut"; + Control[Control["SniperZoomInAlternate"] = 276] = "SniperZoomInAlternate"; + Control[Control["SniperZoomOutAlternate"] = 277] = "SniperZoomOutAlternate"; + Control[Control["VehicleMoveLeft"] = 278] = "VehicleMoveLeft"; + Control[Control["VehicleMoveRight"] = 279] = "VehicleMoveRight"; + Control[Control["VehicleMoveUp"] = 280] = "VehicleMoveUp"; + Control[Control["VehicleMoveDown"] = 281] = "VehicleMoveDown"; + Control[Control["VehicleGunLeft"] = 282] = "VehicleGunLeft"; + Control[Control["VehicleGunRight"] = 283] = "VehicleGunRight"; + Control[Control["VehicleGunUp"] = 284] = "VehicleGunUp"; + Control[Control["VehicleGunDown"] = 285] = "VehicleGunDown"; + Control[Control["VehicleLookLeft"] = 286] = "VehicleLookLeft"; + Control[Control["VehicleLookRight"] = 287] = "VehicleLookRight"; + Control[Control["ReplayStartStopRecording"] = 288] = "ReplayStartStopRecording"; + Control[Control["ReplayStartStopRecordingSecondary"] = 289] = "ReplayStartStopRecordingSecondary"; + Control[Control["ScaledLookLeftRight"] = 290] = "ScaledLookLeftRight"; + Control[Control["ScaledLookUpDown"] = 291] = "ScaledLookUpDown"; + Control[Control["ScaledLookUpOnly"] = 292] = "ScaledLookUpOnly"; + Control[Control["ScaledLookDownOnly"] = 293] = "ScaledLookDownOnly"; + Control[Control["ScaledLookLeftOnly"] = 294] = "ScaledLookLeftOnly"; + Control[Control["ScaledLookRightOnly"] = 295] = "ScaledLookRightOnly"; + Control[Control["ReplayMarkerDelete"] = 296] = "ReplayMarkerDelete"; + Control[Control["ReplayClipDelete"] = 297] = "ReplayClipDelete"; + Control[Control["ReplayPause"] = 298] = "ReplayPause"; + Control[Control["ReplayRewind"] = 299] = "ReplayRewind"; + Control[Control["ReplayFfwd"] = 300] = "ReplayFfwd"; + Control[Control["ReplayNewmarker"] = 301] = "ReplayNewmarker"; + Control[Control["ReplayRecord"] = 302] = "ReplayRecord"; + Control[Control["ReplayScreenshot"] = 303] = "ReplayScreenshot"; + Control[Control["ReplayHidehud"] = 304] = "ReplayHidehud"; + Control[Control["ReplayStartpoint"] = 305] = "ReplayStartpoint"; + Control[Control["ReplayEndpoint"] = 306] = "ReplayEndpoint"; + Control[Control["ReplayAdvance"] = 307] = "ReplayAdvance"; + Control[Control["ReplayBack"] = 308] = "ReplayBack"; + Control[Control["ReplayTools"] = 309] = "ReplayTools"; + Control[Control["ReplayRestart"] = 310] = "ReplayRestart"; + Control[Control["ReplayShowhotkey"] = 311] = "ReplayShowhotkey"; + Control[Control["ReplayCycleMarkerLeft"] = 312] = "ReplayCycleMarkerLeft"; + Control[Control["ReplayCycleMarkerRight"] = 313] = "ReplayCycleMarkerRight"; + Control[Control["ReplayFOVIncrease"] = 314] = "ReplayFOVIncrease"; + Control[Control["ReplayFOVDecrease"] = 315] = "ReplayFOVDecrease"; + Control[Control["ReplayCameraUp"] = 316] = "ReplayCameraUp"; + Control[Control["ReplayCameraDown"] = 317] = "ReplayCameraDown"; + Control[Control["ReplaySave"] = 318] = "ReplaySave"; + Control[Control["ReplayToggletime"] = 319] = "ReplayToggletime"; + Control[Control["ReplayToggletips"] = 320] = "ReplayToggletips"; + Control[Control["ReplayPreview"] = 321] = "ReplayPreview"; + Control[Control["ReplayToggleTimeline"] = 322] = "ReplayToggleTimeline"; + Control[Control["ReplayTimelinePickupClip"] = 323] = "ReplayTimelinePickupClip"; + Control[Control["ReplayTimelineDuplicateClip"] = 324] = "ReplayTimelineDuplicateClip"; + Control[Control["ReplayTimelinePlaceClip"] = 325] = "ReplayTimelinePlaceClip"; + Control[Control["ReplayCtrl"] = 326] = "ReplayCtrl"; + Control[Control["ReplayTimelineSave"] = 327] = "ReplayTimelineSave"; + Control[Control["ReplayPreviewAudio"] = 328] = "ReplayPreviewAudio"; + Control[Control["VehicleDriveLook"] = 329] = "VehicleDriveLook"; + Control[Control["VehicleDriveLook2"] = 330] = "VehicleDriveLook2"; + Control[Control["VehicleFlyAttack2"] = 331] = "VehicleFlyAttack2"; + Control[Control["RadioWheelUpDown"] = 332] = "RadioWheelUpDown"; + Control[Control["RadioWheelLeftRight"] = 333] = "RadioWheelLeftRight"; + Control[Control["VehicleSlowMoUpDown"] = 334] = "VehicleSlowMoUpDown"; + Control[Control["VehicleSlowMoUpOnly"] = 335] = "VehicleSlowMoUpOnly"; + Control[Control["VehicleSlowMoDownOnly"] = 336] = "VehicleSlowMoDownOnly"; + Control[Control["MapPointOfInterest"] = 337] = "MapPointOfInterest"; + Control[Control["ReplaySnapmaticPhoto"] = 338] = "ReplaySnapmaticPhoto"; + Control[Control["VehicleCarJump"] = 339] = "VehicleCarJump"; + Control[Control["VehicleRocketBoost"] = 340] = "VehicleRocketBoost"; + Control[Control["VehicleParachute"] = 341] = "VehicleParachute"; + Control[Control["VehicleBikeWings"] = 342] = "VehicleBikeWings"; + Control[Control["VehicleFlyBombBay"] = 343] = "VehicleFlyBombBay"; + Control[Control["VehicleFlyCounter"] = 344] = "VehicleFlyCounter"; + Control[Control["VehicleFlyTransform"] = 345] = "VehicleFlyTransform"; +})(Control || (Control = {})); +var Control$1 = Control; + +var HudColor; +(function (HudColor) { + HudColor[HudColor["HUD_COLOUR_PURE_WHITE"] = 0] = "HUD_COLOUR_PURE_WHITE"; + HudColor[HudColor["HUD_COLOUR_WHITE"] = 1] = "HUD_COLOUR_WHITE"; + HudColor[HudColor["HUD_COLOUR_BLACK"] = 2] = "HUD_COLOUR_BLACK"; + HudColor[HudColor["HUD_COLOUR_GREY"] = 3] = "HUD_COLOUR_GREY"; + HudColor[HudColor["HUD_COLOUR_GREYLIGHT"] = 4] = "HUD_COLOUR_GREYLIGHT"; + HudColor[HudColor["HUD_COLOUR_GREYDARK"] = 5] = "HUD_COLOUR_GREYDARK"; + HudColor[HudColor["HUD_COLOUR_RED"] = 6] = "HUD_COLOUR_RED"; + HudColor[HudColor["HUD_COLOUR_REDLIGHT"] = 7] = "HUD_COLOUR_REDLIGHT"; + HudColor[HudColor["HUD_COLOUR_REDDARK"] = 8] = "HUD_COLOUR_REDDARK"; + HudColor[HudColor["HUD_COLOUR_BLUE"] = 9] = "HUD_COLOUR_BLUE"; + HudColor[HudColor["HUD_COLOUR_BLUELIGHT"] = 10] = "HUD_COLOUR_BLUELIGHT"; + HudColor[HudColor["HUD_COLOUR_BLUEDARK"] = 11] = "HUD_COLOUR_BLUEDARK"; + HudColor[HudColor["HUD_COLOUR_YELLOW"] = 12] = "HUD_COLOUR_YELLOW"; + HudColor[HudColor["HUD_COLOUR_YELLOWLIGHT"] = 13] = "HUD_COLOUR_YELLOWLIGHT"; + HudColor[HudColor["HUD_COLOUR_YELLOWDARK"] = 14] = "HUD_COLOUR_YELLOWDARK"; + HudColor[HudColor["HUD_COLOUR_ORANGE"] = 15] = "HUD_COLOUR_ORANGE"; + HudColor[HudColor["HUD_COLOUR_ORANGELIGHT"] = 16] = "HUD_COLOUR_ORANGELIGHT"; + HudColor[HudColor["HUD_COLOUR_ORANGEDARK"] = 17] = "HUD_COLOUR_ORANGEDARK"; + HudColor[HudColor["HUD_COLOUR_GREEN"] = 18] = "HUD_COLOUR_GREEN"; + HudColor[HudColor["HUD_COLOUR_GREENLIGHT"] = 19] = "HUD_COLOUR_GREENLIGHT"; + HudColor[HudColor["HUD_COLOUR_GREENDARK"] = 20] = "HUD_COLOUR_GREENDARK"; + HudColor[HudColor["HUD_COLOUR_PURPLE"] = 21] = "HUD_COLOUR_PURPLE"; + HudColor[HudColor["HUD_COLOUR_PURPLELIGHT"] = 22] = "HUD_COLOUR_PURPLELIGHT"; + HudColor[HudColor["HUD_COLOUR_PURPLEDARK"] = 23] = "HUD_COLOUR_PURPLEDARK"; + HudColor[HudColor["HUD_COLOUR_PINK"] = 24] = "HUD_COLOUR_PINK"; + HudColor[HudColor["HUD_COLOUR_RADAR_HEALTH"] = 25] = "HUD_COLOUR_RADAR_HEALTH"; + HudColor[HudColor["HUD_COLOUR_RADAR_ARMOUR"] = 26] = "HUD_COLOUR_RADAR_ARMOUR"; + HudColor[HudColor["HUD_COLOUR_RADAR_DAMAGE"] = 27] = "HUD_COLOUR_RADAR_DAMAGE"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER1"] = 28] = "HUD_COLOUR_NET_PLAYER1"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER2"] = 29] = "HUD_COLOUR_NET_PLAYER2"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER3"] = 30] = "HUD_COLOUR_NET_PLAYER3"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER4"] = 31] = "HUD_COLOUR_NET_PLAYER4"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER5"] = 32] = "HUD_COLOUR_NET_PLAYER5"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER6"] = 33] = "HUD_COLOUR_NET_PLAYER6"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER7"] = 34] = "HUD_COLOUR_NET_PLAYER7"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER8"] = 35] = "HUD_COLOUR_NET_PLAYER8"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER9"] = 36] = "HUD_COLOUR_NET_PLAYER9"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER10"] = 37] = "HUD_COLOUR_NET_PLAYER10"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER11"] = 38] = "HUD_COLOUR_NET_PLAYER11"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER12"] = 39] = "HUD_COLOUR_NET_PLAYER12"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER13"] = 40] = "HUD_COLOUR_NET_PLAYER13"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER14"] = 41] = "HUD_COLOUR_NET_PLAYER14"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER15"] = 42] = "HUD_COLOUR_NET_PLAYER15"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER16"] = 43] = "HUD_COLOUR_NET_PLAYER16"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER17"] = 44] = "HUD_COLOUR_NET_PLAYER17"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER18"] = 45] = "HUD_COLOUR_NET_PLAYER18"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER19"] = 46] = "HUD_COLOUR_NET_PLAYER19"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER20"] = 47] = "HUD_COLOUR_NET_PLAYER20"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER21"] = 48] = "HUD_COLOUR_NET_PLAYER21"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER22"] = 49] = "HUD_COLOUR_NET_PLAYER22"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER23"] = 50] = "HUD_COLOUR_NET_PLAYER23"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER24"] = 51] = "HUD_COLOUR_NET_PLAYER24"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER25"] = 52] = "HUD_COLOUR_NET_PLAYER25"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER26"] = 53] = "HUD_COLOUR_NET_PLAYER26"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER27"] = 54] = "HUD_COLOUR_NET_PLAYER27"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER28"] = 55] = "HUD_COLOUR_NET_PLAYER28"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER29"] = 56] = "HUD_COLOUR_NET_PLAYER29"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER30"] = 57] = "HUD_COLOUR_NET_PLAYER30"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER31"] = 58] = "HUD_COLOUR_NET_PLAYER31"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER32"] = 59] = "HUD_COLOUR_NET_PLAYER32"; + HudColor[HudColor["HUD_COLOUR_SIMPLEBLIP_DEFAULT"] = 60] = "HUD_COLOUR_SIMPLEBLIP_DEFAULT"; + HudColor[HudColor["HUD_COLOUR_MENU_BLUE"] = 61] = "HUD_COLOUR_MENU_BLUE"; + HudColor[HudColor["HUD_COLOUR_MENU_GREY_LIGHT"] = 62] = "HUD_COLOUR_MENU_GREY_LIGHT"; + HudColor[HudColor["HUD_COLOUR_MENU_BLUE_EXTRA_DARK"] = 63] = "HUD_COLOUR_MENU_BLUE_EXTRA_DARK"; + HudColor[HudColor["HUD_COLOUR_MENU_YELLOW"] = 64] = "HUD_COLOUR_MENU_YELLOW"; + HudColor[HudColor["HUD_COLOUR_MENU_YELLOW_DARK"] = 65] = "HUD_COLOUR_MENU_YELLOW_DARK"; + HudColor[HudColor["HUD_COLOUR_MENU_GREEN"] = 66] = "HUD_COLOUR_MENU_GREEN"; + HudColor[HudColor["HUD_COLOUR_MENU_GREY"] = 67] = "HUD_COLOUR_MENU_GREY"; + HudColor[HudColor["HUD_COLOUR_MENU_GREY_DARK"] = 68] = "HUD_COLOUR_MENU_GREY_DARK"; + HudColor[HudColor["HUD_COLOUR_MENU_HIGHLIGHT"] = 69] = "HUD_COLOUR_MENU_HIGHLIGHT"; + HudColor[HudColor["HUD_COLOUR_MENU_STANDARD"] = 70] = "HUD_COLOUR_MENU_STANDARD"; + HudColor[HudColor["HUD_COLOUR_MENU_DIMMED"] = 71] = "HUD_COLOUR_MENU_DIMMED"; + HudColor[HudColor["HUD_COLOUR_MENU_EXTRA_DIMMED"] = 72] = "HUD_COLOUR_MENU_EXTRA_DIMMED"; + HudColor[HudColor["HUD_COLOUR_BRIEF_TITLE"] = 73] = "HUD_COLOUR_BRIEF_TITLE"; + HudColor[HudColor["HUD_COLOUR_MID_GREY_MP"] = 74] = "HUD_COLOUR_MID_GREY_MP"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER1_DARK"] = 75] = "HUD_COLOUR_NET_PLAYER1_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER2_DARK"] = 76] = "HUD_COLOUR_NET_PLAYER2_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER3_DARK"] = 77] = "HUD_COLOUR_NET_PLAYER3_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER4_DARK"] = 78] = "HUD_COLOUR_NET_PLAYER4_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER5_DARK"] = 79] = "HUD_COLOUR_NET_PLAYER5_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER6_DARK"] = 80] = "HUD_COLOUR_NET_PLAYER6_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER7_DARK"] = 81] = "HUD_COLOUR_NET_PLAYER7_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER8_DARK"] = 82] = "HUD_COLOUR_NET_PLAYER8_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER9_DARK"] = 83] = "HUD_COLOUR_NET_PLAYER9_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER10_DARK"] = 84] = "HUD_COLOUR_NET_PLAYER10_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER11_DARK"] = 85] = "HUD_COLOUR_NET_PLAYER11_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER12_DARK"] = 86] = "HUD_COLOUR_NET_PLAYER12_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER13_DARK"] = 87] = "HUD_COLOUR_NET_PLAYER13_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER14_DARK"] = 88] = "HUD_COLOUR_NET_PLAYER14_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER15_DARK"] = 89] = "HUD_COLOUR_NET_PLAYER15_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER16_DARK"] = 90] = "HUD_COLOUR_NET_PLAYER16_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER17_DARK"] = 91] = "HUD_COLOUR_NET_PLAYER17_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER18_DARK"] = 92] = "HUD_COLOUR_NET_PLAYER18_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER19_DARK"] = 93] = "HUD_COLOUR_NET_PLAYER19_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER20_DARK"] = 94] = "HUD_COLOUR_NET_PLAYER20_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER21_DARK"] = 95] = "HUD_COLOUR_NET_PLAYER21_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER22_DARK"] = 96] = "HUD_COLOUR_NET_PLAYER22_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER23_DARK"] = 97] = "HUD_COLOUR_NET_PLAYER23_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER24_DARK"] = 98] = "HUD_COLOUR_NET_PLAYER24_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER25_DARK"] = 99] = "HUD_COLOUR_NET_PLAYER25_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER26_DARK"] = 100] = "HUD_COLOUR_NET_PLAYER26_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER27_DARK"] = 101] = "HUD_COLOUR_NET_PLAYER27_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER28_DARK"] = 102] = "HUD_COLOUR_NET_PLAYER28_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER29_DARK"] = 103] = "HUD_COLOUR_NET_PLAYER29_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER30_DARK"] = 104] = "HUD_COLOUR_NET_PLAYER30_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER31_DARK"] = 105] = "HUD_COLOUR_NET_PLAYER31_DARK"; + HudColor[HudColor["HUD_COLOUR_NET_PLAYER32_DARK"] = 106] = "HUD_COLOUR_NET_PLAYER32_DARK"; + HudColor[HudColor["HUD_COLOUR_BRONZE"] = 107] = "HUD_COLOUR_BRONZE"; + HudColor[HudColor["HUD_COLOUR_SILVER"] = 108] = "HUD_COLOUR_SILVER"; + HudColor[HudColor["HUD_COLOUR_GOLD"] = 109] = "HUD_COLOUR_GOLD"; + HudColor[HudColor["HUD_COLOUR_PLATINUM"] = 110] = "HUD_COLOUR_PLATINUM"; + HudColor[HudColor["HUD_COLOUR_GANG1"] = 111] = "HUD_COLOUR_GANG1"; + HudColor[HudColor["HUD_COLOUR_GANG2"] = 112] = "HUD_COLOUR_GANG2"; + HudColor[HudColor["HUD_COLOUR_GANG3"] = 113] = "HUD_COLOUR_GANG3"; + HudColor[HudColor["HUD_COLOUR_GANG4"] = 114] = "HUD_COLOUR_GANG4"; + HudColor[HudColor["HUD_COLOUR_SAME_CREW"] = 115] = "HUD_COLOUR_SAME_CREW"; + HudColor[HudColor["HUD_COLOUR_FREEMODE"] = 116] = "HUD_COLOUR_FREEMODE"; + HudColor[HudColor["HUD_COLOUR_PAUSE_BG"] = 117] = "HUD_COLOUR_PAUSE_BG"; + HudColor[HudColor["HUD_COLOUR_FRIENDLY"] = 118] = "HUD_COLOUR_FRIENDLY"; + HudColor[HudColor["HUD_COLOUR_ENEMY"] = 119] = "HUD_COLOUR_ENEMY"; + HudColor[HudColor["HUD_COLOUR_LOCATION"] = 120] = "HUD_COLOUR_LOCATION"; + HudColor[HudColor["HUD_COLOUR_PICKUP"] = 121] = "HUD_COLOUR_PICKUP"; + HudColor[HudColor["HUD_COLOUR_PAUSE_SINGLEPLAYER"] = 122] = "HUD_COLOUR_PAUSE_SINGLEPLAYER"; + HudColor[HudColor["HUD_COLOUR_FREEMODE_DARK"] = 123] = "HUD_COLOUR_FREEMODE_DARK"; + HudColor[HudColor["HUD_COLOUR_INACTIVE_MISSION"] = 124] = "HUD_COLOUR_INACTIVE_MISSION"; + HudColor[HudColor["HUD_COLOUR_DAMAGE"] = 125] = "HUD_COLOUR_DAMAGE"; + HudColor[HudColor["HUD_COLOUR_PINKLIGHT"] = 126] = "HUD_COLOUR_PINKLIGHT"; + HudColor[HudColor["HUD_COLOUR_PM_MITEM_HIGHLIGHT"] = 127] = "HUD_COLOUR_PM_MITEM_HIGHLIGHT"; + HudColor[HudColor["HUD_COLOUR_SCRIPT_VARIABLE"] = 128] = "HUD_COLOUR_SCRIPT_VARIABLE"; + HudColor[HudColor["HUD_COLOUR_YOGA"] = 129] = "HUD_COLOUR_YOGA"; + HudColor[HudColor["HUD_COLOUR_TENNIS"] = 130] = "HUD_COLOUR_TENNIS"; + HudColor[HudColor["HUD_COLOUR_GOLF"] = 131] = "HUD_COLOUR_GOLF"; + HudColor[HudColor["HUD_COLOUR_SHOOTING_RANGE"] = 132] = "HUD_COLOUR_SHOOTING_RANGE"; + HudColor[HudColor["HUD_COLOUR_FLIGHT_SCHOOL"] = 133] = "HUD_COLOUR_FLIGHT_SCHOOL"; + HudColor[HudColor["HUD_COLOUR_NORTH_BLUE"] = 134] = "HUD_COLOUR_NORTH_BLUE"; + HudColor[HudColor["HUD_COLOUR_SOCIAL_CLUB"] = 135] = "HUD_COLOUR_SOCIAL_CLUB"; + HudColor[HudColor["HUD_COLOUR_PLATFORM_BLUE"] = 136] = "HUD_COLOUR_PLATFORM_BLUE"; + HudColor[HudColor["HUD_COLOUR_PLATFORM_GREEN"] = 137] = "HUD_COLOUR_PLATFORM_GREEN"; + HudColor[HudColor["HUD_COLOUR_PLATFORM_GREY"] = 138] = "HUD_COLOUR_PLATFORM_GREY"; + HudColor[HudColor["HUD_COLOUR_FACEBOOK_BLUE"] = 139] = "HUD_COLOUR_FACEBOOK_BLUE"; + HudColor[HudColor["HUD_COLOUR_INGAME_BG"] = 140] = "HUD_COLOUR_INGAME_BG"; + HudColor[HudColor["HUD_COLOUR_DARTS"] = 141] = "HUD_COLOUR_DARTS"; + HudColor[HudColor["HUD_COLOUR_WAYPOINT"] = 142] = "HUD_COLOUR_WAYPOINT"; + HudColor[HudColor["HUD_COLOUR_MICHAEL"] = 143] = "HUD_COLOUR_MICHAEL"; + HudColor[HudColor["HUD_COLOUR_FRANKLIN"] = 144] = "HUD_COLOUR_FRANKLIN"; + HudColor[HudColor["HUD_COLOUR_TREVOR"] = 145] = "HUD_COLOUR_TREVOR"; + HudColor[HudColor["HUD_COLOUR_GOLF_P1"] = 146] = "HUD_COLOUR_GOLF_P1"; + HudColor[HudColor["HUD_COLOUR_GOLF_P2"] = 147] = "HUD_COLOUR_GOLF_P2"; + HudColor[HudColor["HUD_COLOUR_GOLF_P3"] = 148] = "HUD_COLOUR_GOLF_P3"; + HudColor[HudColor["HUD_COLOUR_GOLF_P4"] = 149] = "HUD_COLOUR_GOLF_P4"; + HudColor[HudColor["HUD_COLOUR_WAYPOINTLIGHT"] = 150] = "HUD_COLOUR_WAYPOINTLIGHT"; + HudColor[HudColor["HUD_COLOUR_WAYPOINTDARK"] = 151] = "HUD_COLOUR_WAYPOINTDARK"; + HudColor[HudColor["HUD_COLOUR_PANEL_LIGHT"] = 152] = "HUD_COLOUR_PANEL_LIGHT"; + HudColor[HudColor["HUD_COLOUR_MICHAEL_DARK"] = 153] = "HUD_COLOUR_MICHAEL_DARK"; + HudColor[HudColor["HUD_COLOUR_FRANKLIN_DARK"] = 154] = "HUD_COLOUR_FRANKLIN_DARK"; + HudColor[HudColor["HUD_COLOUR_TREVOR_DARK"] = 155] = "HUD_COLOUR_TREVOR_DARK"; + HudColor[HudColor["HUD_COLOUR_OBJECTIVE_ROUTE"] = 156] = "HUD_COLOUR_OBJECTIVE_ROUTE"; + HudColor[HudColor["HUD_COLOUR_PAUSEMAP_TINT"] = 157] = "HUD_COLOUR_PAUSEMAP_TINT"; + HudColor[HudColor["HUD_COLOUR_PAUSE_DESELECT"] = 158] = "HUD_COLOUR_PAUSE_DESELECT"; + HudColor[HudColor["HUD_COLOUR_PM_WEAPONS_PURCHASABLE"] = 159] = "HUD_COLOUR_PM_WEAPONS_PURCHASABLE"; + HudColor[HudColor["HUD_COLOUR_PM_WEAPONS_LOCKED"] = 160] = "HUD_COLOUR_PM_WEAPONS_LOCKED"; + HudColor[HudColor["HUD_COLOUR_END_SCREEN_BG"] = 161] = "HUD_COLOUR_END_SCREEN_BG"; + HudColor[HudColor["HUD_COLOUR_CHOP"] = 162] = "HUD_COLOUR_CHOP"; + HudColor[HudColor["HUD_COLOUR_PAUSEMAP_TINT_HALF"] = 163] = "HUD_COLOUR_PAUSEMAP_TINT_HALF"; + HudColor[HudColor["HUD_COLOUR_NORTH_BLUE_OFFICIAL"] = 164] = "HUD_COLOUR_NORTH_BLUE_OFFICIAL"; + HudColor[HudColor["HUD_COLOUR_SCRIPT_VARIABLE_2"] = 165] = "HUD_COLOUR_SCRIPT_VARIABLE_2"; + HudColor[HudColor["HUD_COLOUR_H"] = 166] = "HUD_COLOUR_H"; + HudColor[HudColor["HUD_COLOUR_HDARK"] = 167] = "HUD_COLOUR_HDARK"; + HudColor[HudColor["HUD_COLOUR_T"] = 168] = "HUD_COLOUR_T"; + HudColor[HudColor["HUD_COLOUR_TDARK"] = 169] = "HUD_COLOUR_TDARK"; + HudColor[HudColor["HUD_COLOUR_HSHARD"] = 170] = "HUD_COLOUR_HSHARD"; + HudColor[HudColor["HUD_COLOUR_CONTROLLER_MICHAEL"] = 171] = "HUD_COLOUR_CONTROLLER_MICHAEL"; + HudColor[HudColor["HUD_COLOUR_CONTROLLER_FRANKLIN"] = 172] = "HUD_COLOUR_CONTROLLER_FRANKLIN"; + HudColor[HudColor["HUD_COLOUR_CONTROLLER_TREVOR"] = 173] = "HUD_COLOUR_CONTROLLER_TREVOR"; + HudColor[HudColor["HUD_COLOUR_CONTROLLER_CHOP"] = 174] = "HUD_COLOUR_CONTROLLER_CHOP"; + HudColor[HudColor["HUD_COLOUR_VIDEO_EDITOR_VIDEO"] = 175] = "HUD_COLOUR_VIDEO_EDITOR_VIDEO"; + HudColor[HudColor["HUD_COLOUR_VIDEO_EDITOR_AUDIO"] = 176] = "HUD_COLOUR_VIDEO_EDITOR_AUDIO"; + HudColor[HudColor["HUD_COLOUR_VIDEO_EDITOR_TEXT"] = 177] = "HUD_COLOUR_VIDEO_EDITOR_TEXT"; + HudColor[HudColor["HUD_COLOUR_HB_BLUE"] = 178] = "HUD_COLOUR_HB_BLUE"; + HudColor[HudColor["HUD_COLOUR_HB_YELLOW"] = 179] = "HUD_COLOUR_HB_YELLOW"; +})(HudColor || (HudColor = {})); +var HudColor$1 = HudColor; + +var ChangeDirection; +(function (ChangeDirection) { + ChangeDirection[ChangeDirection["Left"] = 0] = "Left"; + ChangeDirection[ChangeDirection["Right"] = 1] = "Right"; +})(ChangeDirection || (ChangeDirection = {})); +var ChangeDirection$1 = ChangeDirection; + +class Color { + constructor(r, g, b, a = 255) { + this.R = r; + this.G = g; + this.B = b; + this.A = a; + } +} +Color.Empty = new Color(0, 0, 0, 0); +Color.Transparent = new Color(0, 0, 0, 0); +Color.Black = new Color(0, 0, 0, 255); +Color.White = new Color(255, 255, 255, 255); +Color.WhiteSmoke = new Color(245, 245, 245, 255); + +class Size { + constructor(w = 0, h = 0) { + this.Width = w; + this.Height = h; + } +} + +class Point { + constructor(x, y) { + this.X = 0; + this.Y = 0; + this.X = x; + this.Y = y; + } + static Parse(arg) { + if (typeof arg === "object") { + if (arg.length) { + return new Point(arg[0], arg[1]); + } + else if (arg.X && arg.Y) { + return new Point(arg.X, arg.Y); + } + } + else if (typeof arg === "string") { + if (arg.indexOf(",") !== -1) { + const arr = arg.split(","); + return new Point(parseFloat(arr[0]), parseFloat(arr[1])); + } + } + return new Point(0, 0); + } +} + +class IElement { + constructor() { + this.Enabled = true; + } +} + +class Text extends IElement { + constructor(caption, pos, scale, color, font, centered) { + super(); + this.Caption = caption; + this.Pos = pos; + this.Scale = scale; + this.Color = color || new Color(255, 255, 255, 255); + this.Font = font || 0; + this.Centered = centered || false; + } + Draw(caption, pos, scale, color, font, centered) { + if (caption && !pos && !scale && !color && !font && !centered) { + pos = new Point(this.Pos.X + caption.Width, this.Pos.Y + caption.Height); + scale = this.Scale; + color = this.Color; + font = this.Font; + centered = this.Centered; + } + const x = pos.X / 1280.0; + const y = pos.Y / 720.0; + game__default.setTextFont(parseInt(font)); + game__default.setTextScale(scale, scale); + game__default.setTextColour(color.R, color.G, color.B, color.A); + game__default.setTextCentre(centered); + game__default.beginTextCommandDisplayText("STRING"); + Text.AddLongString(caption); + game__default.endTextCommandDisplayText(x, y, 0); + } + static AddLongString(text) { + if (!text.length) + return; + const maxStringLength = 99; + for (let i = 0, position; i < text.length; i += maxStringLength) { + let currentText = text.substr(i, i + maxStringLength); + let currentIndex = i; + if ((currentText.match(/~/g) || []).length % 2 !== 0) { + position = currentText.lastIndexOf('~'); + i -= (maxStringLength - position); + } + else { + position = Math.min(maxStringLength, text.length - currentIndex); + } + game__default.addTextComponentSubstringPlayerName(text.substr(currentIndex, position)); + } + } +} + +const gameScreen = game__default.getActiveScreenResolution(0, 0); +class Screen { + static get ResolutionMaintainRatio() { + const ratio = Screen.Width / Screen.Height; + const width = 1080.0 * ratio; + return new Size(width, 1080.0); + } + static MousePosition(relative = false) { + const res = Screen.ResolutionMaintainRatio; + const cursor = getCursorPos(); + let [mouseX, mouseY] = [cursor.x, cursor.y]; + if (relative) + [mouseX, mouseY] = [cursor.x / res.Width, cursor.y / res.Height]; + return { + X: mouseX, + Y: mouseY + }; + } + static IsMouseInBounds(topLeft, boxSize) { + const mousePosition = Screen.MousePosition(); + return (mousePosition.X >= topLeft.X && + mousePosition.X <= topLeft.X + boxSize.Width && + (mousePosition.Y > topLeft.Y && mousePosition.Y < topLeft.Y + boxSize.Height)); + } + static GetTextWidth(text, font, scale) { + game__default.beginTextCommandGetWidth("CELL_EMAIL_BCON"); + Text.AddLongString(text); + game__default.setTextFont(font); + game__default.setTextScale(1.0, scale); + const width = game__default.endTextCommandGetWidth(true); + const res = Screen.ResolutionMaintainRatio; + return res.Width * width; + } + static GetLineCount(text, position, font, scale, wrap) { + game__default.beginTextCommandLineCount("CELL_EMAIL_BCON"); + Text.AddLongString(text); + const res = Screen.ResolutionMaintainRatio; + const x = position.X / res.Width; + const y = position.Y / res.Height; + game__default.setTextFont(font); + game__default.setTextScale(1.0, scale); + if (wrap > 0) { + const start = position.X / res.Width; + const end = start + (wrap / res.Width); + game__default.setTextWrap(x, end); + } + let lineCount = game__default.endTextCommandLineCount(x, y); + return lineCount; + } +} +Screen.Width = gameScreen[1]; +Screen.Height = gameScreen[2]; + +class Sprite { + constructor(textureDict, textureName, pos, size, heading = 0, color = new Color(255, 255, 255)) { + this.TextureDict = textureDict; + this.TextureName = textureName; + this.Pos = pos; + this.Size = size; + this.Heading = heading; + this.Color = color; + this.Visible = true; + } + LoadTextureDictionary() { + this.requestTextureDictPromise(this._textureDict).then((succ) => { }); + } + requestTextureDictPromise(textureDict) { + return new Promise((resolve, reject) => { + game__default.requestStreamedTextureDict(textureDict, true); + let inter = setInterval(() => { + if (game__default.hasStreamedTextureDictLoaded(textureDict)) { + clearInterval(inter); + return resolve(true); + } + }, 10); + }); + } + set TextureDict(v) { + this._textureDict = v; + if (!this.IsTextureDictionaryLoaded) + this.LoadTextureDictionary(); + } + get TextureDict() { + return this._textureDict; + } + get IsTextureDictionaryLoaded() { + return game__default.hasStreamedTextureDictLoaded(this._textureDict); + } + Draw(textureDictionary, textureName, pos, size, heading, color, loadTexture) { + textureDictionary = textureDictionary || this.TextureDict; + textureName = textureName || this.TextureName; + pos = pos || this.Pos; + size = size || this.Size; + heading = heading || this.Heading; + color = color || this.Color; + loadTexture = loadTexture || true; + if (loadTexture) { + if (!game__default.hasStreamedTextureDictLoaded(textureDictionary)) + game__default.requestStreamedTextureDict(textureDictionary, true); + } + const screenw = Screen.Width; + const screenh = Screen.Height; + const height = 1080.0; + const ratio = screenw / screenh; + const width = height * ratio; + const w = this.Size.Width / width; + const h = this.Size.Height / height; + const x = this.Pos.X / width + w * 0.5; + const y = this.Pos.Y / height + h * 0.5; + game__default.drawSprite(textureDictionary, textureName, x, y, w, h, heading, color.R, color.G, color.B, color.A, true); + } +} + +class Rectangle extends IElement { + constructor(pos, size, color) { + super(); + this.Enabled = true; + this.Pos = pos; + this.Size = size; + this.Color = color; + } + Draw(pos, size, color) { + if (!pos) + pos = new Size(0, 0); + if (!size && !color) { + pos = new Point(this.Pos.X + pos.Width, this.Pos.Y + pos.Height); + size = this.Size; + color = this.Color; + } + const w = size.Width / 1280.0; + const h = size.Height / 720.0; + const x = pos.X / 1280.0 + w * 0.5; + const y = pos.Y / 720.0 + h * 0.5; + game__default.drawRect(x, y, w, h, color.R, color.G, color.B, color.A, false); + } +} + +class ResRectangle extends Rectangle { + constructor(pos, size, color) { + super(pos, size, color); + } + Draw(pos, size, color) { + if (!pos) + pos = new Size(); + if (pos && !size && !color) { + pos = new Point(this.Pos.X + pos.Width, this.Pos.Y + pos.Height); + size = this.Size; + color = this.Color; + } + const screenw = Screen.Width; + const screenh = Screen.Height; + const height = 1080.0; + const ratio = screenw / screenh; + const width = height * ratio; + const w = size.Width / width; + const h = size.Height / height; + const x = pos.X / width + w * 0.5; + const y = pos.Y / height + h * 0.5; + game__default.drawRect(x, y, w, h, color.R, color.G, color.B, color.A, false); + } +} + +class ResText extends Text { + constructor(caption, pos, scale, color, font, centered) { + super(caption, pos, scale, color || new Color(255, 255, 255), font || 0, false); + this.TextAlignment = Alignment$1.Left; + this.Wrap = 0; + if (centered) + this.TextAlignment = centered; + } + get WordWrap() { + return new Size(this.Wrap, 0); + } + set WordWrap(value) { + this.Wrap = value.Width; + } + Draw(arg1, pos, scale, color, font, arg2, dropShadow, outline, wordWrap) { + let caption = arg1; + let centered = arg2; + let textAlignment = arg2; + if (!arg1) + arg1 = new Size(0, 0); + if (arg1 && !pos) { + textAlignment = this.TextAlignment; + caption = this.Caption; + pos = new Point(this.Pos.X + arg1.Width, this.Pos.Y + arg1.Height); + scale = this.Scale; + color = this.Color; + font = this.Font; + if (centered == true || centered == false) { + centered = this.Centered; + } + else { + centered = undefined; + dropShadow = this.DropShadow; + outline = this.Outline; + wordWrap = this.WordWrap; + } + } + const screenw = Screen.Width; + const screenh = Screen.Height; + const height = 1080.0; + const ratio = screenw / screenh; + const width = height * ratio; + const x = this.Pos.X / width; + const y = this.Pos.Y / height; + game__default.setTextFont(parseInt(font)); + game__default.setTextScale(1.0, scale); + game__default.setTextColour(color.R, color.G, color.B, color.A); + if (centered !== undefined) { + game__default.setTextCentre(centered); + } + else { + if (dropShadow) + game__default.setTextDropshadow(2, 0, 0, 0, 0); + if (outline) + logWarning("[NativeUI] ResText outline not working!"); + switch (textAlignment) { + case Alignment$1.Centered: + game__default.setTextCentre(true); + break; + case Alignment$1.Right: + game__default.setTextRightJustify(true); + game__default.setTextWrap(0.0, x); + break; + } + if (this.Wrap) { + const xsize = (this.Pos.X + this.Wrap) / width; + game__default.setTextWrap(x, xsize); + } + } + game__default.beginTextCommandDisplayText("CELL_EMAIL_BCON"); + Text.AddLongString(caption); + game__default.endTextCommandDisplayText(x, y, 0); + } +} + +function UUIDV4() { + let uuid = ""; + let ii; + for (ii = 0; ii < 32; ii += 1) { + switch (ii) { + case 8: + case 20: + uuid += "-"; + uuid += ((Math.random() * 16) | 0).toString(16); + break; + case 12: + uuid += "-"; + uuid += "4"; + break; + case 16: + uuid += "-"; + uuid += ((Math.random() * 4) | 8).toString(16); + break; + default: + uuid += ((Math.random() * 16) | 0).toString(16); + } + } + return uuid; +} + +class UIMenuItem { + constructor(text, description = "", data = null) { + this.Id = UUIDV4(); + this.BackColor = UIMenuItem.DefaultBackColor; + this.HighlightedBackColor = UIMenuItem.DefaultHighlightedBackColor; + this.ForeColor = UIMenuItem.DefaultForeColor; + this.HighlightedForeColor = UIMenuItem.DefaultHighlightedForeColor; + this.RightLabel = ""; + this.LeftBadge = BadgeStyle$1.None; + this.RightBadge = BadgeStyle$1.None; + this.Enabled = true; + this.Data = data; + this._rectangle = new ResRectangle(new Point(0, 0), new Size(431, 38), new Color(150, 0, 0, 0)); + this._text = new ResText(text, new Point(8, 0), 0.33, Color.WhiteSmoke, Font$1.ChaletLondon, Alignment$1.Left); + this.Description = description; + this._selectedSprite = new Sprite("commonmenu", "gradient_nav", new Point(0, 0), new Size(431, 38)); + this._badgeLeft = new Sprite("commonmenu", "", new Point(0, 0), new Size(40, 40)); + this._badgeRight = new Sprite("commonmenu", "", new Point(0, 0), new Size(40, 40)); + this._labelText = new ResText("", new Point(0, 0), 0.35, Color.White, 0, Alignment$1.Right); + } + get Text() { + return this._text.Caption; + } + set Text(text) { + this._text.Caption = text; + } + get Description() { + return this._description; + } + set Description(text) { + this._description = text; + if (this.hasOwnProperty('Parent')) { + this.Parent.UpdateDescriptionCaption(); + } + } + SetVerticalPosition(y) { + this._rectangle.Pos = new Point(this.Offset.X, y + 144 + this.Offset.Y); + this._selectedSprite.Pos = new Point(0 + this.Offset.X, y + 144 + this.Offset.Y); + this._text.Pos = new Point(8 + this.Offset.X, y + 147 + this.Offset.Y); + this._badgeLeft.Pos = new Point(0 + this.Offset.X, y + 142 + this.Offset.Y); + this._badgeRight.Pos = new Point(385 + this.Offset.X, y + 142 + this.Offset.Y); + this._labelText.Pos = new Point(420 + this.Offset.X, y + 148 + this.Offset.Y); + } + addEvent(event, ...args) { + this._event = { event: event, args: args }; + } + fireEvent() { + if (this._event) { + emit(this._event.event, ...this._event.args); + } + } + Draw() { + this._rectangle.Size = new Size(431 + this.Parent.WidthOffset, 38); + this._selectedSprite.Size = new Size(431 + this.Parent.WidthOffset, 38); + if (this.Hovered && !this.Selected) { + this._rectangle.Color = new Color(255, 255, 255, 20); + this._rectangle.Draw(); + } + this._selectedSprite.Color = this.Selected + ? this.HighlightedBackColor + : this.BackColor; + this._selectedSprite.Draw(); + this._text.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + if (this.LeftBadge != BadgeStyle$1.None) { + this._text.Pos = new Point(35 + this.Offset.X, this._text.Pos.Y); + this._badgeLeft.TextureDict = this.BadgeToSpriteLib(this.LeftBadge); + this._badgeLeft.TextureName = this.BadgeToSpriteName(this.LeftBadge, this.Selected); + this._badgeLeft.Color = this.IsBagdeWhiteSprite(this.LeftBadge) + ? this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148) + : Color.White; + this._badgeLeft.Draw(); + } + else { + this._text.Pos = new Point(8 + this.Offset.X, this._text.Pos.Y); + } + if (this.RightBadge != BadgeStyle$1.None) { + this._badgeRight.Pos = new Point(385 + this.Offset.X + this.Parent.WidthOffset, this._badgeRight.Pos.Y); + this._badgeRight.TextureDict = this.BadgeToSpriteLib(this.RightBadge); + this._badgeRight.TextureName = this.BadgeToSpriteName(this.RightBadge, this.Selected); + this._badgeRight.Color = this.IsBagdeWhiteSprite(this.RightBadge) + ? this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148) + : Color.White; + this._badgeRight.Draw(); + } + if (this.RightLabel && this.RightLabel !== "") { + this._labelText.Pos = new Point(420 + this.Offset.X + this.Parent.WidthOffset, this._labelText.Pos.Y); + this._labelText.Caption = this.RightLabel; + this._labelText.Color = this._text.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._labelText.Draw(); + } + this._text.Draw(); + } + SetLeftBadge(badge) { + this.LeftBadge = badge; + } + SetRightBadge(badge) { + this.RightBadge = badge; + } + SetRightLabel(text) { + this.RightLabel = text; + } + BadgeToSpriteLib(badge) { + switch (badge) { + case BadgeStyle$1.Sale: + return "mpshopsale"; + case BadgeStyle$1.Audio1: + case BadgeStyle$1.Audio2: + case BadgeStyle$1.Audio3: + case BadgeStyle$1.AudioInactive: + case BadgeStyle$1.AudioMute: + return "mpleaderboard"; + default: + return "commonmenu"; + } + } + BadgeToSpriteName(badge, selected) { + switch (badge) { + case BadgeStyle$1.None: + return ""; + case BadgeStyle$1.BronzeMedal: + return "mp_medal_bronze"; + case BadgeStyle$1.GoldMedal: + return "mp_medal_gold"; + case BadgeStyle$1.SilverMedal: + return "medal_silver"; + case BadgeStyle$1.Alert: + return "mp_alerttriangle"; + case BadgeStyle$1.Crown: + return "mp_hostcrown"; + case BadgeStyle$1.Ammo: + return selected ? "shop_ammo_icon_b" : "shop_ammo_icon_a"; + case BadgeStyle$1.Armour: + return selected ? "shop_armour_icon_b" : "shop_armour_icon_a"; + case BadgeStyle$1.Barber: + return selected ? "shop_barber_icon_b" : "shop_barber_icon_a"; + case BadgeStyle$1.Clothes: + return selected ? "shop_clothing_icon_b" : "shop_clothing_icon_a"; + case BadgeStyle$1.Franklin: + return selected ? "shop_franklin_icon_b" : "shop_franklin_icon_a"; + case BadgeStyle$1.Bike: + return selected ? "shop_garage_bike_icon_b" : "shop_garage_bike_icon_a"; + case BadgeStyle$1.Car: + return selected ? "shop_garage_icon_b" : "shop_garage_icon_a"; + case BadgeStyle$1.Gun: + return selected ? "shop_gunclub_icon_b" : "shop_gunclub_icon_a"; + case BadgeStyle$1.Heart: + return selected ? "shop_health_icon_b" : "shop_health_icon_a"; + case BadgeStyle$1.Lock: + return "shop_lock"; + case BadgeStyle$1.Makeup: + return selected ? "shop_makeup_icon_b" : "shop_makeup_icon_a"; + case BadgeStyle$1.Mask: + return selected ? "shop_mask_icon_b" : "shop_mask_icon_a"; + case BadgeStyle$1.Michael: + return selected ? "shop_michael_icon_b" : "shop_michael_icon_a"; + case BadgeStyle$1.Star: + return "shop_new_star"; + case BadgeStyle$1.Tattoo: + return selected ? "shop_tattoos_icon_b" : "shop_tattoos_icon_a"; + case BadgeStyle$1.Tick: + return "shop_tick_icon"; + case BadgeStyle$1.Trevor: + return selected ? "shop_trevor_icon_b" : "shop_trevor_icon_a"; + case BadgeStyle$1.Sale: + return "saleicon"; + case BadgeStyle$1.ArrowLeft: + return "arrowleft"; + case BadgeStyle$1.ArrowRight: + return "arrowright"; + case BadgeStyle$1.Audio1: + return "leaderboard_audio_1"; + case BadgeStyle$1.Audio2: + return "leaderboard_audio_2"; + case BadgeStyle$1.Audio3: + return "leaderboard_audio_3"; + case BadgeStyle$1.AudioInactive: + return "leaderboard_audio_inactive"; + case BadgeStyle$1.AudioMute: + return "leaderboard_audio_mute"; + default: + return ""; + } + } + IsBagdeWhiteSprite(badge) { + switch (badge) { + case BadgeStyle$1.Lock: + case BadgeStyle$1.Tick: + case BadgeStyle$1.Crown: + return true; + default: + return false; + } + } + BadgeToColor(badge, selected) { + switch (badge) { + case BadgeStyle$1.Lock: + case BadgeStyle$1.Tick: + case BadgeStyle$1.Crown: + return selected + ? new Color(255, 0, 0, 0) + : new Color(255, 255, 255, 255); + default: + return new Color(255, 255, 255, 255); + } + } +} +UIMenuItem.DefaultBackColor = Color.Empty; +UIMenuItem.DefaultHighlightedBackColor = Color.White; +UIMenuItem.DefaultForeColor = Color.WhiteSmoke; +UIMenuItem.DefaultHighlightedForeColor = Color.Black; + +class UIMenuCheckboxItem extends UIMenuItem { + constructor(text, check = false, description = "") { + super(text, description); + this.Checked = false; + const y = 0; + this._checkedSprite = new Sprite("commonmenu", "shop_box_blank", new Point(410, y + 95), new Size(50, 50)); + this.Checked = check; + } + SetVerticalPosition(y) { + super.SetVerticalPosition(y); + this._checkedSprite.Pos = new Point(380 + this.Offset.X + this.Parent.WidthOffset, y + 138 + this.Offset.Y); + } + Draw() { + super.Draw(); + this._checkedSprite.Pos = this._checkedSprite.Pos = new Point(380 + this.Offset.X + this.Parent.WidthOffset, this._checkedSprite.Pos.Y); + const isDefaultHightlitedForeColor = this.HighlightedForeColor == UIMenuItem.DefaultHighlightedForeColor; + if (this.Selected && isDefaultHightlitedForeColor) { + this._checkedSprite.TextureName = this.Checked + ? "shop_box_tickb" + : "shop_box_blankb"; + } + else { + this._checkedSprite.TextureName = this.Checked + ? "shop_box_tick" + : "shop_box_blank"; + } + this._checkedSprite.Color = this.Enabled + ? this.Selected && !isDefaultHightlitedForeColor + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._checkedSprite.Draw(); + } + SetRightBadge(badge) { + return this; + } + SetRightLabel(text) { + return this; + } +} + +class ListItem { + constructor(text = "", data = null) { + this.Id = UUIDV4(); + this.DisplayText = text; + this.Data = data; + } +} + +class ItemsCollection { + constructor(items) { + if (items.length === 0) + throw new Error("ItemsCollection cannot be empty"); + this.items = items; + } + length() { + return this.items.length; + } + getListItems() { + const items = []; + for (const item of this.items) { + if (item instanceof ListItem) { + items.push(item); + } + else if (typeof item == "string") { + items.push(new ListItem(item)); + } + else if (typeof item == "number") { + items.push(new ListItem(item.toString())); + } + } + return items; + } +} + +class UIMenuListItem extends UIMenuItem { + constructor(text, description = "", collection = new ItemsCollection([]), startIndex = 0, data = null) { + super(text, description, data); + this.ScrollingEnabled = true; + this.HoldTimeBeforeScroll = 200; + this._currentOffset = 0; + this._itemsCollection = []; + this._index = 0; + let y = 0; + this.Collection = collection.getListItems(); + this.Index = startIndex; + this._arrowLeft = new Sprite("commonmenu", "arrowleft", new Point(110, 105 + y), new Size(30, 30)); + this._arrowRight = new Sprite("commonmenu", "arrowright", new Point(280, 105 + y), new Size(30, 30)); + this._itemText = new ResText("", new Point(290, y + 104), 0.35, Color.White, Font$1.ChaletLondon, Alignment$1.Right); + } + get Collection() { + return this._itemsCollection; + } + set Collection(v) { + if (!v) + throw new Error("The collection can't be null"); + this._itemsCollection = v; + } + set SelectedItem(v) { + const idx = this.Collection.findIndex(li => li.Id === v.Id); + if (idx > 0) + this.Index = idx; + else + this.Index = 0; + } + get SelectedItem() { + return this.Collection.length > 0 ? this.Collection[this.Index] : null; + } + get SelectedValue() { + return this.SelectedItem == null + ? null + : this.SelectedItem.Data == null + ? this.SelectedItem.DisplayText + : this.SelectedItem.Data; + } + get Index() { + if (this.Collection == null) + return -1; + if (this.Collection != null && this.Collection.length == 0) + return -1; + return this._index % this.Collection.length; + } + set Index(value) { + if (this.Collection == null) + return; + if (this.Collection != null && this.Collection.length == 0) + return; + this._index = 100000000 - (100000000 % this.Collection.length) + value; + const caption = this.Collection.length >= this.Index + ? this.Collection[this.Index].DisplayText + : " "; + this._currentOffset = Screen.GetTextWidth(caption, this._itemText && this._itemText.Font ? this._itemText.Font : 0, 0.35); + } + setCollection(collection) { + this.Collection = collection.getListItems(); + } + setCollectionItem(index, item, resetSelection = true) { + if (index > this.Collection.length) + throw new Error("Index out of bounds"); + if (typeof item === "string") + item = new ListItem(item); + this.Collection.splice(index, 1, item); + if (resetSelection) + this.Index = 0; + } + SetVerticalPosition(y) { + this._arrowLeft.Pos = new Point(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); + this._arrowRight.Pos = new Point(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); + this._itemText.Pos = new Point(300 + this.Offset.X + this.Parent.WidthOffset, y + 147 + this.Offset.Y); + super.SetVerticalPosition(y); + } + SetRightLabel(text) { + return this; + } + SetRightBadge(badge) { + return this; + } + Draw() { + super.Draw(); + const caption = this.Collection.length >= this.Index + ? this.Collection[this.Index].DisplayText + : " "; + const offset = this._currentOffset; + this._itemText.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._itemText.Caption = caption; + this._arrowLeft.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._arrowRight.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._arrowLeft.Pos = new Point(380 - offset + this.Offset.X + this.Parent.WidthOffset, this._arrowLeft.Pos.Y); + if (this.Selected) { + this._arrowLeft.Draw(); + this._arrowRight.Draw(); + this._itemText.Pos = new Point(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); + } + else { + this._itemText.Pos = new Point(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); + } + this._itemText.Draw(); + } +} + +Number.isInteger = Number.isInteger || function (value) { + return typeof value === 'number' && + isFinite(value) && + Math.floor(value) === value; +}; +const fixFloat = (n) => { + return Number.isInteger(n) ? n : parseFloat(n.toFixed(10)); +}; + +class UIMenuAutoListItem extends UIMenuItem { + constructor(text, description = "", lowerThreshold = 0, upperThreshold = 10, startValue = 0, data = null) { + super(text, description, data); + this._currentOffset = 0; + this._leftMoveThreshold = 1; + this._rightMoveThreshold = 1; + this._lowerThreshold = 0; + this._upperThreshold = 10; + this._preCaptionText = ''; + this._postCaptionText = ''; + let y = 0; + this.LowerThreshold = lowerThreshold; + this.UpperThreshold = lowerThreshold > upperThreshold ? lowerThreshold : upperThreshold; + this.SelectedValue = (startValue < lowerThreshold || startValue > upperThreshold) ? lowerThreshold : startValue; + this._arrowLeft = new Sprite("commonmenu", "arrowleft", new Point(110, 105 + y), new Size(30, 30)); + this._arrowRight = new Sprite("commonmenu", "arrowright", new Point(280, 105 + y), new Size(30, 30)); + this._itemText = new ResText("", new Point(290, y + 104), 0.35, Color.White, Font$1.ChaletLondon, Alignment$1.Right); + } + get PreCaptionText() { + return this._preCaptionText; + } + set PreCaptionText(text) { + if (!text) + throw new Error("The pre caption text can't be null"); + if (typeof text !== 'string') + throw new Error("The pre caption text must be a string"); + this._preCaptionText = text; + this._currentOffset = Screen.GetTextWidth(this.PreCaptionText + this._selectedValue.toString() + this.PostCaptionText, this._itemText && this._itemText.Font ? this._itemText.Font : 0, 0.35); + } + get PostCaptionText() { + return this._postCaptionText; + } + set PostCaptionText(text) { + if (!text) + throw new Error("The post caption text can't be null"); + if (typeof text !== 'string') + throw new Error("The post caption text must be a string"); + this._postCaptionText = text; + this._currentOffset = Screen.GetTextWidth(this.PreCaptionText + this._selectedValue.toString() + this.PostCaptionText, this._itemText && this._itemText.Font ? this._itemText.Font : 0, 0.35); + } + get LeftMoveThreshold() { + return this._leftMoveThreshold; + } + set LeftMoveThreshold(value) { + if (!value) + throw new Error("The left threshold can't be null"); + this._leftMoveThreshold = value; + } + get RightMoveThreshold() { + return this._rightMoveThreshold; + } + set RightMoveThreshold(value) { + if (!value) + throw new Error("The right threshold can't be null"); + this._rightMoveThreshold = value; + } + get LowerThreshold() { + return this._lowerThreshold; + } + set LowerThreshold(value) { + if (typeof value !== 'number' && !value) + throw new Error("The lower threshold can't be null"); + this._lowerThreshold = value; + if (this.SelectedValue < value) { + this.SelectedValue = value; + } + } + get UpperThreshold() { + return this._upperThreshold; + } + set UpperThreshold(value) { + if (typeof value !== 'number' && !value) + throw new Error("The upper threshold can't be null"); + this._upperThreshold = value; + if (this.SelectedValue > value) { + this.SelectedValue = value; + } + } + get SelectedValue() { + return this._selectedValue; + } + set SelectedValue(value) { + if (value < this._lowerThreshold || value > this._upperThreshold) + throw new Error("The value can not be outside the lower or upper limits"); + this._selectedValue = fixFloat(value); + this._currentOffset = Screen.GetTextWidth(this.PreCaptionText + this._selectedValue.toString() + this.PostCaptionText, this._itemText && this._itemText.Font ? this._itemText.Font : 0, this._itemText && this._itemText.Scale ? this._itemText.Scale : 0.35); + } + SetVerticalPosition(y) { + this._arrowLeft.Pos = new Point(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); + this._arrowRight.Pos = new Point(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); + this._itemText.Pos = new Point(300 + this.Offset.X + this.Parent.WidthOffset, y + 147 + this.Offset.Y); + super.SetVerticalPosition(y); + } + SetRightLabel(text) { + return this; + } + SetRightBadge(badge) { + return this; + } + Draw() { + super.Draw(); + const offset = this._currentOffset; + this._itemText.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._itemText.Caption = this.PreCaptionText + this._selectedValue + this.PostCaptionText; + this._arrowLeft.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._arrowRight.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._arrowLeft.Pos = new Point(380 - offset + this.Offset.X + this.Parent.WidthOffset, this._arrowLeft.Pos.Y); + if (this.Selected) { + this._arrowLeft.Draw(); + this._arrowRight.Draw(); + this._itemText.Pos = new Point(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); + } + else { + this._itemText.Pos = new Point(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); + } + this._itemText.Draw(); + } +} + +class UIMenuSliderItem extends UIMenuItem { + constructor(text, items, index, description = "", divider = false, data = null) { + super(text, description, data); + const y = 0; + this._items = items; + this._arrowLeft = new Sprite("commonmenutu", "arrowleft", new Point(0, 105 + y), new Size(15, 15)); + this._arrowRight = new Sprite("commonmenutu", "arrowright", new Point(0, 105 + y), new Size(15, 15)); + this._rectangleBackground = new ResRectangle(new Point(0, 0), new Size(150, 9), new Color(4, 32, 57, 255)); + this._rectangleSlider = new ResRectangle(new Point(0, 0), new Size(75, 9), new Color(57, 116, 200, 255)); + if (divider) { + this._rectangleDivider = new ResRectangle(new Point(0, 0), new Size(2.5, 20), Color.WhiteSmoke); + } + else { + this._rectangleDivider = new ResRectangle(new Point(0, 0), new Size(2.5, 20), Color.Transparent); + } + this.Index = index; + } + get Index() { + return this._index % this._items.length; + } + set Index(value) { + this._index = 100000000 - (100000000 % this._items.length) + value; + } + SetVerticalPosition(y) { + this._rectangleBackground.Pos = new Point(250 + this.Offset.X + this.Parent.WidthOffset, y + 158.5 + this.Offset.Y); + this._rectangleSlider.Pos = new Point(250 + this.Offset.X + this.Parent.WidthOffset, y + 158.5 + this.Offset.Y); + this._rectangleDivider.Pos = new Point(323.5 + this.Offset.X + this.Parent.WidthOffset, y + 153 + this.Offset.Y); + this._arrowLeft.Pos = new Point(235 + this.Offset.X + this.Parent.WidthOffset, 155.5 + y + this.Offset.Y); + this._arrowRight.Pos = new Point(400 + this.Offset.X + this.Parent.WidthOffset, 155.5 + y + this.Offset.Y); + super.SetVerticalPosition(y); + } + IndexToItem(index) { + return this._items[index]; + } + Draw() { + super.Draw(); + this._arrowLeft.Color = this.Enabled + ? this.Selected + ? Color.Black + : Color.WhiteSmoke + : new Color(163, 159, 148); + this._arrowRight.Color = this.Enabled + ? this.Selected + ? Color.Black + : Color.WhiteSmoke + : new Color(163, 159, 148); + let offset = ((this._rectangleBackground.Size.Width - this._rectangleSlider.Size.Width) / (this._items.length - 1)) * this.Index; + this._rectangleSlider.Pos = new Point(250 + this.Offset.X + offset + +this.Parent.WidthOffset, this._rectangleSlider.Pos.Y); + if (this.Selected) { + this._arrowLeft.Draw(); + this._arrowRight.Draw(); + } + this._rectangleBackground.Draw(); + this._rectangleSlider.Draw(); + this._rectangleDivider.Draw(); + } + SetRightBadge(badge) { } + SetRightLabel(text) { } +} + +class Container extends Rectangle { + constructor(pos, size, color) { + super(pos, size, color); + this.Items = []; + } + addItem(item) { + this.Items.push(item); + } + Draw(offset) { + if (!this.Enabled) + return; + offset = offset || new Size(); + const screenw = Screen.Width; + const screenh = Screen.Height; + const height = 1080.0; + const ratio = screenw / screenh; + const width = height * ratio; + const w = this.Size.Width / width; + const h = this.Size.Height / height; + const x = (this.Pos.X + offset.Width) / width + w * 0.5; + const y = (this.Pos.Y + offset.Height) / height + h * 0.5; + game__default.drawRect(x, y, w, h, this.Color.R, this.Color.G, this.Color.B, this.Color.A, false); + for (var item of this.Items) + item.Draw(new Size(this.Pos.X + offset.Width, this.Pos.Y + offset.Height)); + } +} + +class Common { + static PlaySound(audioName, audioRef) { + game__default.playSound(-1, audioName, audioRef, false, 0, true); + } +} + +class LiteEvent { + constructor() { + this.handlers = []; + } + on(handler) { + this.handlers.push(handler); + } + off(handler) { + this.handlers = this.handlers.filter(h => h !== handler); + } + emit(...args) { + this.handlers.slice(0).forEach(h => h(...args)); + } + expose() { + return this; + } + count() { + return this.handlers.length; + } +} + +class InstructionalButton { + constructor(text, control, buttonString = null) { + this._itemBind = null; + this.Text = text; + this._buttonControl = control; + this._usingControls = buttonString == null; + this._buttonString = buttonString; + } + get ItemBind() { return this._itemBind; } + BindToItem(item) { + this._itemBind = item; + } + GetButtonId() { + return this._usingControls ? game__default.getControlInstructionalButton(2, this._buttonControl, false) : "t_" + this._buttonString; + } +} + +class Scaleform { + constructor(scaleForm) { + this._handle = 0; + this.scaleForm = scaleForm; + this._handle = requestScaleformMovie(this.scaleForm); + } + get handle() { + return this._handle; + } + get isValid() { + return this._handle != 0; + } + get isLoaded() { + return hasScaleformMovieLoaded(this._handle); + } + callFunctionHead(funcName, ...args) { + if (!this.isValid || !this.isLoaded) + return; + beginScaleformMovieMethod(this._handle, funcName); + args.forEach((arg) => { + switch (typeof arg) { + case "number": + { + if (Number(arg) === arg && arg % 1 !== 0) { + scaleformMovieMethodAddParamFloat(arg); + } + else { + scaleformMovieMethodAddParamInt(arg); + } + } + case "string": + { + scaleformMovieMethodAddParamPlayerNameString(arg); + break; + } + case "boolean": + { + scaleformMovieMethodAddParamBool(arg); + break; + } + default: + { + logError(`Unknown argument type ${typeof arg} = ${arg.toString()} passed to scaleform with handle ${this._handle}`); + } + } + }); + } + callFunction(funcName, ...args) { + this.callFunctionHead(funcName, ...args); + endScaleformMovieMethod(); + } + callFunctionReturn(funcName, ...args) { + this.callFunctionHead(funcName, ...args); + return endScaleformMovieMethodReturnValue(); + } + render2D() { + if (!this.isValid || !this.isLoaded) + return; + drawScaleformMovieFullscreen(this._handle, 255, 255, 255, 255, 0); + } + recreate() { + if (!this.isValid || !this.isLoaded) + return; + setScaleformMovieAsNoLongerNeeded(this._handle); + this._handle = requestScaleformMovie(this.scaleForm); + } + destroy() { + if (!this.isValid) + return; + setScaleformMovieAsNoLongerNeeded(this._handle); + this._handle = 0; + } +} + +class Message { + static Initialize(scaleForm, transitionOutAnimName) { + this._transitionOutAnimName = transitionOutAnimName; + this._scaleform = new Scaleform(scaleForm); + } + static get IsVisible() { + return this._messageVisible; + } + static get Scaleform() { + return this._scaleform; + } + static Load() { + if (this._delayedTransitionInTimeout != null) { + clearTimeout(this._delayedTransitionInTimeout); + this._delayedTransitionInTimeout = null; + } + } + static SetDelayedTransition(messageHandler, time) { + this._delayedTransitionInTimeout = setTimeout(() => { + this._delayedTransitionInTimeout = null; + this.TransitionIn(messageHandler, time); + }, this._transitionOutTimeMs); + } + static ShowCustomShard(funcName, time = 5000, ...funcArgs) { + this.ShowComplexCustomShard(() => { + this._scaleform.callFunction(funcName, ...funcArgs); + }, time); + } + static ShowComplexCustomShard(messageHandler, time = 5000) { + this.Load(); + if (this._messageVisible) { + this.TransitionOut(); + this.SetDelayedTransition(() => messageHandler(), time); + } + else { + this.TransitionIn(messageHandler, time); + } + } + static TransitionOut() { + if (!this._messageVisible) + return; + if (this._transitionOutTimeout != null) { + clearTimeout(this._transitionOutTimeout); + this._transitionOutTimeout = null; + } + if (this._transitionOutFinishedTimeout != null) { + clearTimeout(this._transitionOutFinishedTimeout); + this._transitionOutFinishedTimeout = null; + } + this._scaleform.callFunction(this._transitionOutAnimName); + this._transitionOutFinishedTimeout = setTimeout(() => { + this._messageVisible = false; + this._scaleform.recreate(); + }, this._transitionOutTimeMs); + } + static TransitionIn(messageHandler, transitionOutTime = 500) { + this._messageVisible = true; + messageHandler(); + this.SetTransitionOutTimer(transitionOutTime); + } + static SetTransitionOutTimer(time) { + this._transitionOutTimeout = setTimeout(() => { + this._transitionOutTimeout = null; + this.TransitionOut(); + }, time); + } + static Render() { + if (this._messageVisible) { + this._scaleform.render2D(); + } + } +} +Message._messageVisible = false; +Message._transitionOutTimeout = null; +Message._transitionOutFinishedTimeout = null; +Message._delayedTransitionInTimeout = null; +Message._scaleform = null; +Message._transitionOutTimeMs = 500; +Message._transitionOutAnimName = null; + +class BigMessage extends Message { + static Initialize(scaleForm, transitionOutAnimName) { + super.Initialize(scaleForm, transitionOutAnimName); + everyTick(() => this.Render()); + } + static ShowMissionPassedMessage(msg, subtitle = "", time = 5000) { + this.ShowCustomShard("SHOW_MISSION_PASSED_MESSAGE", time, msg, subtitle, 100, true, 0, true); + } + static ShowColoredShard(msg, desc, textColor, bgColor, time = 5000) { + this.ShowCustomShard("SHOW_SHARD_CENTERED_MP_MESSAGE", time, msg, desc, bgColor, textColor); + } + static ShowOldMessage(msg, time = 5000) { + this.ShowCustomShard("SHOW_MISSION_PASSED_MESSAGE", time, msg); + } + static ShowSimpleShard(title, subtitle = "", time = 5000) { + this.ShowCustomShard("SHOW_SHARD_CREW_RANKUP_MP_MESSAGE", time, title, subtitle); + } + static ShowRankupMessage(msg, subtitle, rank, time = 5000) { + this.ShowCustomShard("SHOW_BIG_MP_MESSAGE", time, msg, subtitle, rank, "", ""); + } + static ShowPlaneMessage(title, planeName, planeHash, time = 5000) { + this.ShowCustomShard("SHOW_PLANE_MESSAGE", time, title, planeName, planeHash, "", ""); + } + static ShowWeaponPurchasedMessage(bigMessage, weaponName, weaponHash, time = 5000) { + this.ShowCustomShard("SHOW_WEAPON_PURCHASED", time, bigMessage, weaponName, weaponHash, "", 100); + } + static ShowWastedMessage(title, message, color, darkenBackground, time = 5000) { + this.ShowCustomShard("SHOW_SHARD_WASTED_MP_MESSAGE", time, title, message, color, darkenBackground); + } + static ShowMpMessageLarge(msg, subtitle = "", time = 5000) { + this.ShowComplexCustomShard(() => { + this.Scaleform.callFunction("SHOW_CENTERED_MP_MESSAGE_LARGE", msg, subtitle, 100, true, 100); + this.Scaleform.callFunction("TRANSITION_IN"); + }, time); + } +} +BigMessage.Initialize("MP_BIG_MESSAGE_FREEMODE", "TRANSITION_OUT"); + +class MidsizedMessage extends Message { + static Initialize(scaleForm, transitionOutAnimName) { + super.Initialize(scaleForm, transitionOutAnimName); + everyTick(() => this.Render()); + } + static ShowMidsizedMessage(title, message = "", time = 5000) { + this.ShowCustomShard("SHOW_MIDSIZED_MESSAGE", time, title, message); + } + static ShowBridgesKnivesProgress(title, totalToDo, message, info, completed, time = 5000) { + this.ShowCustomShard("SHOW_BRIDGES_KNIVES_PROGRESS", time, title, totalToDo, message, info, completed); + } + static ShowCondensedShardMessage(title, message, bgColor, useDarkerShard, time = 5000) { + this.ShowCustomShard("SHOW_COND_SHARD_MESSAGE", time, title, message, bgColor, useDarkerShard); + } + static ShowMidsizedShardMessage(title, message, bgColor, useDarkerShard, useCondensedShard, time = 5000) { + this.ShowCustomShard("SHOW_SHARD_MIDSIZED_MESSAGE", time, title, message, bgColor, useDarkerShard, useCondensedShard); + } +} +MidsizedMessage.Initialize("MIDSIZED_MESSAGE", "SHARD_ANIM_OUT"); + +class UIMenuDynamicListItem extends UIMenuItem { + constructor(text, selectionChangeHandler, description = "", selectedStartValueHandler = null, data = null) { + super(text, description, data); + this._currentOffset = 0; + this._precaptionText = ''; + this._selectedStartValueHandler = null; + this.SelectionChangeHandler = null; + if (!this.isVariableFunction(selectionChangeHandler)) { + logError(`[UIMenuDynamicListItem] ${text} is not created with a valid selectionChangeHandler, needs to be function. Please see docs.`); + } + if (!this.isVariableFunction(selectedStartValueHandler)) { + logError(`[UIMenuDynamicListItem] ${text} is not created with a valid selectedStartValueHandler, needs to be function. Please see docs.`); + } + this.SelectionChangeHandler = selectionChangeHandler; + this._selectedStartValueHandler = selectedStartValueHandler; + let y = 0; + this._arrowLeft = new Sprite("commonmenu", "arrowleft", new Point(110, 105 + y), new Size(30, 30)); + this._arrowRight = new Sprite("commonmenu", "arrowright", new Point(280, 105 + y), new Size(30, 30)); + this._itemText = new ResText("", new Point(290, y + 104), 0.35, Color.White, Font$1.ChaletLondon, Alignment$1.Right); + } + SelectionChangeHandlerPromise(item, selectedValue, changeDirection) { + return new Promise((resolve, reject) => { + let newSelectedValue = this.SelectionChangeHandler(item, selectedValue, changeDirection); + resolve(newSelectedValue); + }); + } + get PreCaptionText() { + return this._precaptionText; + } + set PreCaptionText(text) { + if (!text) + throw new Error("The pre caption text can't be null"); + if (typeof text !== 'string') + throw new Error("The pre caption text must be a string"); + this._precaptionText = text; + this._currentOffset = Screen.GetTextWidth(this.PreCaptionText + this._selectedValue, this._itemText && this._itemText.Font ? this._itemText.Font : 0, 0.35); + } + get SelectedValue() { + return this._selectedValue; + } + set SelectedValue(value) { + this._selectedValue = value; + if (value == undefined) + return; + this._currentOffset = Screen.GetTextWidth(this.PreCaptionText + this._selectedValue, this._itemText && this._itemText.Font ? this._itemText.Font : 0, this._itemText && this._itemText.Scale ? this._itemText.Scale : 0.35); + } + SetVerticalPosition(y) { + this._arrowLeft.Pos = new Point(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); + this._arrowRight.Pos = new Point(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); + this._itemText.Pos = new Point(300 + this.Offset.X + this.Parent.WidthOffset, y + 147 + this.Offset.Y); + super.SetVerticalPosition(y); + } + SetRightLabel(text) { + return this; + } + SetRightBadge(badge) { + return this; + } + Draw() { + super.Draw(); + if (this._selectedValue == undefined) { + if (this._selectedStartValueHandler != null) { + this.SelectedValue = this._selectedStartValueHandler(); + } + else { + this._selectedValue = ""; + } + } + const offset = this._currentOffset; + this._itemText.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._itemText.Caption = this.PreCaptionText + this._selectedValue; + this._arrowLeft.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._arrowRight.Color = this.Enabled + ? this.Selected + ? this.HighlightedForeColor + : this.ForeColor + : new Color(163, 159, 148); + this._arrowLeft.Pos = new Point(380 - offset + this.Offset.X + this.Parent.WidthOffset, this._arrowLeft.Pos.Y); + if (this.Selected) { + this._arrowLeft.Draw(); + this._arrowRight.Draw(); + this._itemText.Pos = new Point(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); + } + else { + this._itemText.Pos = new Point(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); + } + this._itemText.Draw(); + } + isVariableFunction(functionToCheck) { + return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]'; + } +} + +let menuPool = []; +class NativeUI { + constructor(title, subtitle, offset, spriteLibrary, spriteName) { + this._visible = true; + this._counterPretext = ""; + this._counterOverride = undefined; + this._lastUpDownNavigation = 0; + this._lastLeftRightNavigation = 0; + this._extraOffset = 0; + this._buttonsEnabled = true; + this._justOpened = true; + this._justOpenedFromPool = false; + this._justClosedFromPool = false; + this._poolOpening = null; + this._safezoneOffset = new Point(0, 0); + this._activeItem = 1000; + this._maxItemsOnScreen = 9; + this._maxItem = this._maxItemsOnScreen; + this._mouseEdgeEnabled = true; + this._bannerSprite = null; + this._bannerRectangle = null; + this._recalculateDescriptionNextFrame = 1; + this._instructionalButtons = []; + this._defaultTitleScale = 1.15; + this._maxMenuItems = 1000; + this.Id = UUIDV4(); + this.SelectTextLocalized = getGxtText("HUD_INPUT2"); + this.BackTextLocalized = getGxtText("HUD_INPUT3"); + this.WidthOffset = 0; + this.ParentMenu = null; + this.ParentItem = null; + this.MouseControlsEnabled = false; + this.CloseableByUser = true; + this.AUDIO_LIBRARY = "HUD_FRONTEND_DEFAULT_SOUNDSET"; + this.AUDIO_UPDOWN = "NAV_UP_DOWN"; + this.AUDIO_LEFTRIGHT = "NAV_LEFT_RIGHT"; + this.AUDIO_SELECT = "SELECT"; + this.AUDIO_BACK = "BACK"; + this.AUDIO_ERROR = "ERROR"; + this.MenuItems = []; + this.IndexChange = new LiteEvent(); + this.ListChange = new LiteEvent(); + this.AutoListChange = new LiteEvent(); + this.DynamicListChange = new LiteEvent(); + this.SliderChange = new LiteEvent(); + this.CheckboxChange = new LiteEvent(); + this.ItemSelect = new LiteEvent(); + this.MenuOpen = new LiteEvent(); + this.MenuClose = new LiteEvent(); + this.MenuChange = new LiteEvent(); + if (!(offset instanceof Point)) + offset = Point.Parse(offset); + this._spriteLibrary = spriteLibrary || "commonmenu"; + this._spriteName = spriteName || "interaction_bgd"; + this._offset = new Point(offset.X, offset.Y); + this.Children = new Map(); + this._instructionalButtonsScaleform = new Scaleform("instructional_buttons"); + this.UpdateScaleform(); + this._mainMenu = new Container(new Point(0, 0), new Size(700, 500), new Color(0, 0, 0, 0)); + this._bannerSprite = new Sprite(this._spriteLibrary, this._spriteName, new Point(0 + this._offset.X, 0 + this._offset.Y), new Size(431, 107)); + this._mainMenu.addItem((this._titleResText = new ResText(title, new Point(215 + this._offset.X, 20 + this._offset.Y), this._defaultTitleScale, new Color(255, 255, 255), 1, Alignment$1.Centered))); + if (subtitle !== "") { + this._mainMenu.addItem(new ResRectangle(new Point(0 + this._offset.X, 107 + this._offset.Y), new Size(431, 37), new Color(0, 0, 0, 255))); + this._mainMenu.addItem((this._subtitleResText = new ResText(subtitle, new Point(8 + this._offset.X, 110 + this._offset.Y), 0.35, new Color(255, 255, 255), 0, Alignment$1.Left))); + if (subtitle.startsWith("~")) { + this._counterPretext = subtitle.substr(0, 3); + } + this._counterText = new ResText("", new Point(425 + this._offset.X, 110 + this._offset.Y), 0.35, new Color(255, 255, 255), 0, Alignment$1.Right); + this._extraOffset += 37; + } + this._upAndDownSprite = new Sprite("commonmenu", "shop_arrows_upanddown", new Point(190 + this._offset.X, 147 + 37 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset), new Size(50, 50)); + this._extraRectangleUp = new ResRectangle(new Point(0 + this._offset.X, 144 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset), new Size(431, 18), new Color(0, 0, 0, 200)); + this._extraRectangleDown = new ResRectangle(new Point(0 + this._offset.X, 144 + 18 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset), new Size(431, 18), new Color(0, 0, 0, 200)); + this._descriptionBar = new ResRectangle(new Point(this._offset.X, 123), new Size(431, 4), Color.Black); + this._descriptionRectangle = new Sprite("commonmenu", "gradient_bgd", new Point(this._offset.X, 127), new Size(431, 30)); + this._descriptionText = new ResText("", new Point(this._offset.X + 5, 125), 0.35, new Color(255, 255, 255, 255), Font$1.ChaletLondon, Alignment$1.Left); + this._descriptionText.Wrap = 400; + this._background = new Sprite("commonmenu", "gradient_bgd", new Point(this._offset.X, 144 + this._offset.Y - 37 + this._extraOffset), new Size(290, 25)); + this._visible = false; + everyTick(this.render.bind(this)); + } + GetSpriteBanner() { + return this._bannerSprite; + } + GetRectangleBanner() { + return this._bannerRectangle; + } + GetTitle() { + return this._titleResText; + } + get MaxItemsVisible() { + return this._maxItemsOnScreen; + } + set MaxItemsVisible(value) { + this._maxItemsOnScreen = value; + this._maxItem = value; + } + get Title() { + return this._titleResText.Caption; + } + set Title(text) { + this._titleResText.Caption = text; + } + get GetSubTitle() { + return this._titleResText; + } + get SubTitle() { + return this._titleResText.Caption; + } + set SubTitle(text) { + this._subtitleResText.Caption = text; + } + get Visible() { + return this._visible; + } + set Visible(toggle) { + this._visible = toggle; + Common.PlaySound(this.AUDIO_BACK, this.AUDIO_LIBRARY); + this.UpdateScaleform(); + if (toggle) { + this.UpdateDescriptionCaption(); + } + if (this._justOpenedFromPool === true) { + this._justOpenedFromPool = false; + return; + } + if (toggle) { + this._justOpened = true; + this.MenuOpen.emit(); + if (this.ParentMenu === null) { + if (!menuPool.includes(this) && this !== this._poolOpening) { + const previousMenu = (menuPool.length) ? menuPool[menuPool.length - 1] : null; + menuPool.push(this); + if (previousMenu !== this._poolOpening && previousMenu !== null) { + previousMenu._justClosedFromPool = true; + previousMenu.Visible = false; + } + } + } + } + else { + if (this._justClosedFromPool === true) { + this._justClosedFromPool = false; + return; + } + if (this.ParentMenu === null && menuPool.includes(this) && menuPool.length) { + if (menuPool[menuPool.length - 1] === this) { + menuPool.pop(); + this._justOpenedFromPool = true; + if (!menuPool.length) { + this._poolOpening = null; + } + } + if (menuPool.length) { + this._poolOpening = menuPool[menuPool.length - 1]; + menuPool[menuPool.length - 1].Visible = true; + } + } + if (menuPool.length === 0) { + game__default.setMouseCursorSprite(1); + } + } + } + get CurrentSelection() { + return this._activeItem % this.MenuItems.length; + } + set CurrentSelection(v) { + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length) + v; + if (this.CurrentSelection > this._maxItem) { + this._maxItem = this.CurrentSelection; + this._minItem = this.CurrentSelection - this._maxItemsOnScreen; + } + else if (this.CurrentSelection < this._minItem) { + this._maxItem = this._maxItemsOnScreen + this.CurrentSelection; + this._minItem = this.CurrentSelection; + } + this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); + this.UpdateDescriptionCaption(); + } + DisableInstructionalButtons(disable) { + this._buttonsEnabled = !disable; + } + AddInstructionalButton(button) { + this._instructionalButtons.push(button); + } + SetSpriteBannerType(spriteBanner) { + this._bannerRectangle = null; + this.AddSpriteBannerType(spriteBanner); + } + SetRectangleBannerType(rectangle) { + this._bannerSprite = null; + this._bannerRectangle = rectangle; + this._bannerRectangle.Pos = new Point(this._offset.X, this._offset.Y); + this._bannerRectangle.Size = new Size(431 + this.WidthOffset, 107); + } + AddSpriteBannerType(spriteBanner) { + this._bannerSprite = spriteBanner; + this._bannerSprite.Size = new Size(431 + this.WidthOffset, 107); + this._bannerSprite.Pos = new Point(this._offset.X, this._offset.Y); + } + SetNoBannerType() { + this._bannerSprite = null; + this._bannerRectangle = new ResRectangle(new Point(this._offset.X, this._offset.Y), new Size(431 + this.WidthOffset, 107), new Color(0, 0, 0, 0)); + } + RemoveInstructionalButton(button) { + for (let i = 0; i < this._instructionalButtons.length; i++) { + if (this._instructionalButtons[i] === button) { + this._instructionalButtons.splice(i, 1); + } + } + } + RecalculateDescriptionPosition() { + const count = (this.MenuItems.length > this._maxItemsOnScreen + 1) ? this._maxItemsOnScreen + 2 : this.MenuItems.length; + this._descriptionBar.Size = new Size(431 + this.WidthOffset, 4); + this._descriptionRectangle.Size = new Size(431 + this.WidthOffset, 30); + this._descriptionBar.Pos = new Point(this._offset.X, 149 - 37 + this._extraOffset + this._offset.Y); + this._descriptionRectangle.Pos = new Point(this._offset.X, 149 - 37 + this._extraOffset + this._offset.Y); + this._descriptionText.Pos = new Point(this._offset.X + 8, 155 - 37 + this._extraOffset + this._offset.Y); + this._descriptionBar.Pos = new Point(this._offset.X, 38 * count + this._descriptionBar.Pos.Y); + this._descriptionRectangle.Pos = new Point(this._offset.X, 38 * count + this._descriptionRectangle.Pos.Y); + this._descriptionText.Pos = new Point(this._offset.X + 8, 38 * count + this._descriptionText.Pos.Y); + } + SetMenuWidthOffset(widthOffset) { + this.WidthOffset = widthOffset; + if (this._bannerSprite != null) { + this._bannerSprite.Size = new Size(431 + this.WidthOffset, 107); + } + this._mainMenu.Items[0].pos = new Point((this.WidthOffset + this._offset.X + 431) / 2, 20 + this._offset.Y); + if (this._counterText) { + this._counterText.Pos = new Point(425 + this._offset.X + widthOffset, 110 + this._offset.Y); + } + if (this._mainMenu.Items.length >= 2) { + const tmp = this._mainMenu.Items[1]; + tmp.size = new Size(431 + this.WidthOffset, 37); + } + if (this._bannerRectangle != null) { + this._bannerRectangle.Size = new Size(431 + this.WidthOffset, 107); + } + } + AddItem(item) { + if (this._justOpened) + this._justOpened = false; + item.Offset = this._offset; + item.Parent = this; + item.SetVerticalPosition(this.MenuItems.length * 25 - 37 + this._extraOffset); + this.MenuItems.push(item); + this.RefreshIndex(); + } + RemoveItem(item) { + for (let i = 0; i < this.MenuItems.length; i++) { + if (this.MenuItems[i] === item) { + this.MenuItems.splice(i, 1); + break; + } + } + this.RefreshIndex(); + } + RefreshIndex() { + if (this.MenuItems.length == 0) { + this._activeItem = this._maxMenuItems; + this._maxItem = this._maxItemsOnScreen; + this._minItem = 0; + return; + } + for (let i = 0; i < this.MenuItems.length; i++) + this.MenuItems[i].Selected = false; + this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length); + this._maxItem = this._maxItemsOnScreen; + this._minItem = 0; + if (this._visible) { + this.UpdateDescriptionCaption(); + } + } + Clear() { + this.MenuItems = []; + this.RecalculateDescriptionPosition(); + } + Open() { + this.Visible = true; + } + CleanUp(closeChildren = false) { + if (closeChildren) { + this.Children.forEach(m => { + m.Close(true); + }); + } + this.MenuItems.filter(menuItem => menuItem instanceof UIMenuDynamicListItem).forEach((menuItem) => { + menuItem.SelectedValue = undefined; + }); + this.RefreshIndex(); + } + Close(closeChildren = false) { + this.Visible = false; + this.CleanUp(closeChildren); + this.MenuClose.emit(true); + } + GoLeft() { + if (!(this.MenuItems[this.CurrentSelection] instanceof UIMenuListItem) && + !(this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItem) && + !(this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItem) && + !(this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItem) || + !this.MenuItems[this.CurrentSelection].Enabled) + return; + if (this.MenuItems[this.CurrentSelection] instanceof UIMenuListItem) { + const it = this.MenuItems[this.CurrentSelection]; + if (it.Collection.length == 0) + return; + it.Index--; + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.ListChange.emit(it, it.Index); + this.UpdateDescriptionCaption(); + } + else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItem) { + const it = this.MenuItems[this.CurrentSelection]; + if (it.SelectedValue <= it.LowerThreshold) { + it.SelectedValue = it.UpperThreshold; + } + else { + it.SelectedValue -= it.LeftMoveThreshold; + } + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.AutoListChange.emit(it, it.SelectedValue, ChangeDirection$1.Left); + this.UpdateDescriptionCaption(); + } + else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItem) { + const it = this.MenuItems[this.CurrentSelection]; + it.SelectionChangeHandlerPromise(it, it.SelectedValue, ChangeDirection$1.Left).then((newSelectedValue) => { + it.SelectedValue = newSelectedValue; + this.DynamicListChange.emit(it, it.SelectedValue, ChangeDirection$1.Left); + }); + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.UpdateDescriptionCaption(); + } + else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItem) { + const it = this.MenuItems[this.CurrentSelection]; + it.Index = it.Index - 1; + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.SliderChange.emit(it, it.Index, it.IndexToItem(it.Index)); + this.UpdateDescriptionCaption(); + } + } + GoRight() { + if (!(this.MenuItems[this.CurrentSelection] instanceof UIMenuListItem) && + !(this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItem) && + !(this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItem) && + !(this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItem) || + !this.MenuItems[this.CurrentSelection].Enabled) + return; + if (this.MenuItems[this.CurrentSelection] instanceof UIMenuListItem) { + const it = this.MenuItems[this.CurrentSelection]; + if (it.Collection.length == 0) + return; + it.Index++; + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.ListChange.emit(it, it.Index); + this.UpdateDescriptionCaption(); + } + else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItem) { + const it = this.MenuItems[this.CurrentSelection]; + if (it.SelectedValue >= it.UpperThreshold) { + it.SelectedValue = it.LowerThreshold; + } + else { + it.SelectedValue += it.RightMoveThreshold; + } + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.AutoListChange.emit(it, it.SelectedValue, ChangeDirection$1.Right); + this.UpdateDescriptionCaption(); + } + else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItem) { + const it = this.MenuItems[this.CurrentSelection]; + it.SelectionChangeHandlerPromise(it, it.SelectedValue, ChangeDirection$1.Right).then((newSelectedValue) => { + it.SelectedValue = newSelectedValue; + this.DynamicListChange.emit(it, it.SelectedValue, ChangeDirection$1.Right); + }); + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.UpdateDescriptionCaption(); + } + else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItem) { + const it = this.MenuItems[this.CurrentSelection]; + it.Index++; + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.SliderChange.emit(it, it.Index, it.IndexToItem(it.Index)); + this.UpdateDescriptionCaption(); + } + } + SelectItem() { + if (!this.MenuItems[this.CurrentSelection].Enabled) { + Common.PlaySound(this.AUDIO_ERROR, this.AUDIO_LIBRARY); + return; + } + const it = this.MenuItems[this.CurrentSelection]; + if (this.MenuItems[this.CurrentSelection] instanceof UIMenuCheckboxItem) { + it.Checked = !it.Checked; + Common.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY); + this.CheckboxChange.emit(it, it.Checked); + } + else { + Common.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY); + this.ItemSelect.emit(it, this.CurrentSelection); + if (this.Children.has(it.Id)) { + const subMenu = this.Children.get(it.Id); + this.Visible = false; + subMenu.Visible = true; + this.MenuChange.emit(subMenu, true); + } + } + it.fireEvent(); + } + HasCurrentSelectionChildren() { + const it = this.MenuItems[this.CurrentSelection]; + if (this.MenuItems[this.CurrentSelection] instanceof UIMenuItem) { + if (this.Children.has(it.Id)) { + return true; + } + } + return false; + } + IsMouseInListItemArrows(item, topLeft, safezone) { + game__default.beginTextCommandGetWidth("jamyfafi"); + game__default.addTextComponentSubstringPlayerName(item.Text); + let res = Screen.ResolutionMaintainRatio; + let screenw = res.Width; + let screenh = res.Height; + const height = 1080.0; + const ratio = screenw / screenh; + let width = height * ratio; + const labelSize = game__default.endTextCommandGetWidth(false) * width * 0.35; + const labelSizeX = 5 + labelSize + 10; + const arrowSizeX = 431 - labelSizeX; + return Screen.IsMouseInBounds(topLeft, new Size(labelSizeX, 38)) + ? 1 + : Screen.IsMouseInBounds(new Point(topLeft.X + labelSizeX, topLeft.Y), new Size(arrowSizeX, 38)) + ? 2 + : 0; + } + ProcessMouse() { + if (!this.Visible || this._justOpened || this.MenuItems.length == 0 || !this.MouseControlsEnabled) { + this.MenuItems.filter(i => i.Hovered).forEach(i => (i.Hovered = false)); + return; + } + showCursor(true); + let limit = this.MenuItems.length - 1; + let counter = 0; + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + limit = this._maxItem; + if (Screen.IsMouseInBounds(new Point(0, 0), new Size(30, 1080)) && this._mouseEdgeEnabled) { + game__default.setGameplayCamRelativeHeading(game__default.getGameplayCamRelativeHeading() + 5.0); + game__default.setMouseCursorSprite(6); + } + else if (Screen.IsMouseInBounds(new Point(Screen.ResolutionMaintainRatio.Width - 30.0, 0), new Size(30, 1080)) && this._mouseEdgeEnabled) { + game__default.setGameplayCamRelativeHeading(game__default.getGameplayCamRelativeHeading() - 5.0); + game__default.setMouseCursorSprite(7); + } + else if (this._mouseEdgeEnabled) { + game__default.setMouseCursorSprite(1); + } + for (let i = this._minItem; i <= limit; i++) { + let xpos = this._offset.X; + let ypos = this._offset.Y + 144 - 37 + this._extraOffset + counter * 38; + let xsize = 431 + this.WidthOffset; + const ysize = 38; + const uiMenuItem = this.MenuItems[i]; + if (Screen.IsMouseInBounds(new Point(xpos, ypos), new Size(xsize, ysize))) { + uiMenuItem.Hovered = true; + const res = this.IsMouseInListItemArrows(this.MenuItems[i], new Point(xpos, ypos), 0); + if (uiMenuItem.Hovered && res == 1 && (this.MenuItems[i] instanceof UIMenuListItem || this.MenuItems[i] instanceof UIMenuAutoListItem || this.MenuItems[i] instanceof UIMenuDynamicListItem)) { + game__default.setMouseCursorSprite(5); + } + if (game__default.isControlJustReleased(0, 24) || game__default.isDisabledControlJustReleased(0, 24)) + if (uiMenuItem.Selected && uiMenuItem.Enabled) { + if ((this.MenuItems[i] instanceof UIMenuListItem || this.MenuItems[i] instanceof UIMenuAutoListItem || this.MenuItems[i] instanceof UIMenuDynamicListItem) + && this.IsMouseInListItemArrows(this.MenuItems[i], new Point(xpos, ypos), 0) > 0) { + switch (res) { + case 1: + Common.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY); + this.MenuItems[i].fireEvent(); + this.ItemSelect.emit(this.MenuItems[i], i); + break; + case 2: + let it = this.MenuItems[i]; + if ((it.Collection == null ? it.Items.Count : it.Collection.Count) > 0) { + it.Index++; + Common.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); + this.ListChange.emit(it, it.Index); + } + break; + } + } + else + this.SelectItem(); + } + else if (!uiMenuItem.Selected) { + this.CurrentSelection = i; + Common.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); + this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); + this.SelectItem(); + this.UpdateDescriptionCaption(); + this.UpdateScaleform(); + } + else if (!uiMenuItem.Enabled && uiMenuItem.Selected) { + Common.PlaySound(this.AUDIO_ERROR, this.AUDIO_LIBRARY); + } + } + else + uiMenuItem.Hovered = false; + counter++; + } + const extraY = 144 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset + this._safezoneOffset.Y; + const extraX = this._safezoneOffset.X + this._offset.X; + if (this.MenuItems.length <= this._maxItemsOnScreen + 1) + return; + if (Screen.IsMouseInBounds(new Point(extraX, extraY), new Size(431 + this.WidthOffset, 18))) { + this._extraRectangleUp.Color = new Color(30, 30, 30, 255); + if (game__default.isControlJustPressed(0, 24) || game__default.isDisabledControlJustPressed(0, 24)) { + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + this.GoUpOverflow(); + else + this.GoUp(); + } + } + else + this._extraRectangleUp.Color = new Color(0, 0, 0, 200); + if (Screen.IsMouseInBounds(new Point(extraX, extraY + 18), new Size(431 + this.WidthOffset, 18))) { + this._extraRectangleDown.Color = new Color(30, 30, 30, 255); + if (game__default.isControlJustPressed(0, 24) || game__default.isDisabledControlJustPressed(0, 24)) { + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + this.GoDownOverflow(); + else + this.GoDown(); + } + } + else + this._extraRectangleDown.Color = new Color(0, 0, 0, 200); + } + ProcessControl() { + if (!this.Visible) + return; + if (this._justOpened) { + this._justOpened = false; + return; + } + if (game__default.isControlJustReleased(0, 177)) { + this.GoBack(); + } + if (this.MenuItems.length == 0) + return; + if (game__default.isControlPressed(0, 172) && this._lastUpDownNavigation + 120 < Date.now()) { + this._lastUpDownNavigation = Date.now(); + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + this.GoUpOverflow(); + else + this.GoUp(); + this.UpdateScaleform(); + } + else if (game__default.isControlJustReleased(0, 172)) { + this._lastUpDownNavigation = 0; + } + else if (game__default.isControlPressed(0, 173) && this._lastUpDownNavigation + 120 < Date.now()) { + this._lastUpDownNavigation = Date.now(); + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + this.GoDownOverflow(); + else + this.GoDown(); + this.UpdateScaleform(); + } + else if (game__default.isControlJustReleased(0, 173)) { + this._lastUpDownNavigation = 0; + } + else if (game__default.isControlPressed(0, 174) && this._lastLeftRightNavigation + 100 < Date.now()) { + this._lastLeftRightNavigation = Date.now(); + this.GoLeft(); + } + else if (game__default.isControlJustReleased(0, 174)) { + this._lastLeftRightNavigation = 0; + } + else if (game__default.isControlPressed(0, 175) && this._lastLeftRightNavigation + 100 < Date.now()) { + this._lastLeftRightNavigation = Date.now(); + this.GoRight(); + } + else if (game__default.isControlJustReleased(0, 175)) { + this._lastLeftRightNavigation = 0; + } + else if (game__default.isControlJustReleased(0, 201)) { + this.SelectItem(); + } + } + GoUpOverflow() { + if (this.MenuItems.length <= this._maxItemsOnScreen + 1) + return; + if (this._activeItem % this.MenuItems.length <= this._minItem) { + if (this._activeItem % this.MenuItems.length == 0) { + this._minItem = this.MenuItems.length - this._maxItemsOnScreen - 1; + this._maxItem = this.MenuItems.length - 1; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length); + this._activeItem += this.MenuItems.length - 1; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + } + else { + this._minItem--; + this._maxItem--; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem--; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + } + } + else { + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem--; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + } + Common.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); + this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); + this.UpdateDescriptionCaption(); + } + GoUp() { + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + return; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem--; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + Common.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); + this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); + this.UpdateDescriptionCaption(); + } + GoDownOverflow() { + if (this.MenuItems.length <= this._maxItemsOnScreen + 1) + return; + if (this._activeItem % this.MenuItems.length >= this._maxItem) { + if (this._activeItem % this.MenuItems.length == this.MenuItems.length - 1) { + this._minItem = 0; + this._maxItem = this._maxItemsOnScreen; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length); + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + } + else { + this._minItem++; + this._maxItem++; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem++; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + } + } + else { + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem++; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + } + Common.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); + this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); + this.UpdateDescriptionCaption(); + } + GoDown() { + if (this.MenuItems.length > this._maxItemsOnScreen + 1) + return; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; + this._activeItem++; + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + Common.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); + this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); + this.UpdateDescriptionCaption(); + } + GoBack() { + if (this.ParentMenu != null) { + this.Visible = false; + this.ParentMenu.Visible = true; + this.MenuChange.emit(this.ParentMenu, false); + this.MenuClose.emit(false); + } + else if (this.CloseableByUser) { + this.Visible = false; + this.CleanUp(true); + this.MenuClose.emit(false); + } + } + BindMenuToItem(menuToBind, itemToBindTo) { + if (!this.MenuItems.includes(itemToBindTo)) { + this.AddItem(itemToBindTo); + } + menuToBind.ParentMenu = this; + menuToBind.ParentItem = itemToBindTo; + this.Children.set(itemToBindTo.Id, menuToBind); + } + AddSubMenu(subMenu, itemToBindTo) { + this.BindMenuToItem(subMenu, itemToBindTo); + } + ReleaseMenuFromItem(releaseFrom) { + if (!this.Children.has(releaseFrom.Id)) + return false; + const menu = this.Children.get(releaseFrom.Id); + menu.ParentItem = null; + menu.ParentMenu = null; + this.Children.delete(releaseFrom.Id); + return true; + } + UpdateDescriptionCaption() { + if (this.MenuItems.length) { + this._descriptionText.Caption = this.MenuItems[this._activeItem % this.MenuItems.length].Description; + this._descriptionText.Wrap = 400; + this._recalculateDescriptionNextFrame++; + } + } + CalculateDescription() { + if (this.MenuItems.length <= 0) + return; + if (this._recalculateDescriptionNextFrame > 0) { + this._recalculateDescriptionNextFrame--; + } + this.RecalculateDescriptionPosition(); + if (this.MenuItems.length > 0 && this._descriptionText.Caption && this.MenuItems[this._activeItem % this.MenuItems.length].Description.trim() !== "") { + const numLines = Screen.GetLineCount(this._descriptionText.Caption, this._descriptionText.Pos, this._descriptionText.Font, this._descriptionText.Scale, this._descriptionText.Wrap); + this._descriptionRectangle.Size = new Size(431 + this.WidthOffset, (numLines * 25) + 15); + if (numLines === 0) { + this._recalculateDescriptionNextFrame++; + } + } + } + UpdateScaleform() { + if (!this.Visible || !this._buttonsEnabled) + return; + this._instructionalButtonsScaleform.callFunction("CLEAR_ALL"); + this._instructionalButtonsScaleform.callFunction("TOGGLE_MOUSE_BUTTONS", 0); + this._instructionalButtonsScaleform.callFunction("CREATE_CONTAINER"); + this._instructionalButtonsScaleform.callFunction("SET_DATA_SLOT", 0, game__default.getControlInstructionalButton(2, Control$1.PhoneSelect, false), this.SelectTextLocalized); + this._instructionalButtonsScaleform.callFunction("SET_DATA_SLOT", 1, game__default.getControlInstructionalButton(2, Control$1.PhoneCancel, false), this.BackTextLocalized); + let count = 2; + this._instructionalButtons.filter(b => b.ItemBind == null || this.MenuItems[this.CurrentSelection] == b.ItemBind).forEach((button) => { + this._instructionalButtonsScaleform.callFunction("SET_DATA_SLOT", count, button.GetButtonId(), button.Text); + count++; + }); + this._instructionalButtonsScaleform.callFunction("DRAW_INSTRUCTIONAL_BUTTONS", -1); + } + render() { + if (!this.Visible) + return; + if (this._buttonsEnabled) { + game__default.drawScaleformMovieFullscreen(this._instructionalButtonsScaleform.handle, 255, 255, 255, 255, 0); + game__default.hideHudComponentThisFrame(6); + game__default.hideHudComponentThisFrame(7); + game__default.hideHudComponentThisFrame(9); + } + if (this._justOpened) { + if (this._bannerSprite != null && !this._bannerSprite.IsTextureDictionaryLoaded) + this._bannerSprite.LoadTextureDictionary(); + if (!this._background.IsTextureDictionaryLoaded) + this._background.LoadTextureDictionary(); + if (!this._descriptionRectangle.IsTextureDictionaryLoaded) + this._descriptionRectangle.LoadTextureDictionary(); + if (!this._upAndDownSprite.IsTextureDictionaryLoaded) + this._upAndDownSprite.LoadTextureDictionary(); + if (!this._recalculateDescriptionNextFrame) + this._recalculateDescriptionNextFrame++; + } + this._mainMenu.Draw(); + this.ProcessMouse(); + this.ProcessControl(); + this._background.Size = this.MenuItems.length > this._maxItemsOnScreen + 1 + ? new Size(431 + this.WidthOffset, 38 * (this._maxItemsOnScreen + 1)) + : new Size(431 + this.WidthOffset, 38 * this.MenuItems.length); + this._background.Draw(); + if (this._recalculateDescriptionNextFrame) { + this.CalculateDescription(); + } + if (this.MenuItems.length > 0) { + this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; + if (this.MenuItems[this._activeItem % this.MenuItems.length].Description.trim() !== "") { + this._descriptionBar.Draw(); + this._descriptionRectangle.Draw(); + this._descriptionText.Draw(); + } + } + let count = 0; + if (this.MenuItems.length <= this._maxItemsOnScreen + 1) { + for (const item of this.MenuItems) { + item.SetVerticalPosition(count * 38 - 37 + this._extraOffset); + item.Draw(); + count++; + } + if (this._counterText && this._counterOverride) { + this._counterText.Caption = this._counterPretext + this._counterOverride; + this._counterText.Draw(); + } + } + else { + for (let index = this._minItem; index <= this._maxItem; index++) { + let item = this.MenuItems[index]; + item.SetVerticalPosition(count * 38 - 37 + this._extraOffset); + item.Draw(); + count++; + } + this._extraRectangleUp.Size = new Size(431 + this.WidthOffset, 18); + this._extraRectangleDown.Size = new Size(431 + this.WidthOffset, 18); + this._upAndDownSprite.Pos = new Point(190 + this._offset.X + this.WidthOffset / 2, 147 + 37 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset); + this._extraRectangleUp.Draw(); + this._extraRectangleDown.Draw(); + this._upAndDownSprite.Draw(); + if (this._counterText) { + if (!this._counterOverride) { + const cap = this.CurrentSelection + 1 + " / " + this.MenuItems.length; + this._counterText.Caption = this._counterPretext + cap; + } + else { + this._counterText.Caption = this._counterPretext + this._counterOverride; + } + this._counterText.Draw(); + } + } + if (this._bannerRectangle != null) + this._bannerRectangle.Draw(); + if (this._bannerSprite != null) + this._bannerSprite.Draw(); + } +} + +export default NativeUI; +export { Alignment$1 as Alignment, BadgeStyle$1 as BadgeStyle, BigMessage, ChangeDirection$1 as ChangeDirection, Color, Control$1 as Control, Font$1 as Font, HudColor$1 as HudColor, InstructionalButton, ItemsCollection, ListItem, NativeUI as Menu, MidsizedMessage, Point, ResRectangle, Size, Sprite, UIMenuAutoListItem, UIMenuCheckboxItem, UIMenuDynamicListItem, UIMenuItem, UIMenuListItem, UIMenuSliderItem }; diff --git a/client/includes/nativeui/nativeui.min.js b/client/includes/nativeui/nativeui.min.js new file mode 100644 index 0000000..496db30 --- /dev/null +++ b/client/includes/nativeui/nativeui.min.js @@ -0,0 +1 @@ +import{getCursorPos as e,setInterval as t,clearInterval as i,logWarning as s,emit as n,logError as h,clearTimeout as o,setTimeout as r,everyTick as a,getGxtText as l,showCursor as _}from"alt-client";import c,{requestScaleformMovie as O,hasScaleformMovieLoaded as R,beginScaleformMovieMethod as u,scaleformMovieMethodAddParamBool as d,scaleformMovieMethodAddParamPlayerNameString as L,scaleformMovieMethodAddParamFloat as U,scaleformMovieMethodAddParamInt as C,endScaleformMovieMethod as D,endScaleformMovieMethodReturnValue as m,drawScaleformMovieFullscreen as p,setScaleformMovieAsNoLongerNeeded as S}from"natives";var f;!function(e){e[e.None=0]="None",e[e.BronzeMedal=1]="BronzeMedal",e[e.GoldMedal=2]="GoldMedal",e[e.SilverMedal=3]="SilverMedal",e[e.Alert=4]="Alert",e[e.Crown=5]="Crown",e[e.Ammo=6]="Ammo",e[e.Armour=7]="Armour",e[e.Barber=8]="Barber",e[e.Clothes=9]="Clothes",e[e.Franklin=10]="Franklin",e[e.Bike=11]="Bike",e[e.Car=12]="Car",e[e.Gun=13]="Gun",e[e.Heart=14]="Heart",e[e.Makeup=15]="Makeup",e[e.Mask=16]="Mask",e[e.Michael=17]="Michael",e[e.Star=18]="Star",e[e.Tattoo=19]="Tattoo",e[e.Trevor=20]="Trevor",e[e.Lock=21]="Lock",e[e.Tick=22]="Tick",e[e.Sale=23]="Sale",e[e.ArrowLeft=24]="ArrowLeft",e[e.ArrowRight=25]="ArrowRight",e[e.Audio1=26]="Audio1",e[e.Audio2=27]="Audio2",e[e.Audio3=28]="Audio3",e[e.AudioInactive=29]="AudioInactive",e[e.AudioMute=30]="AudioMute"}(f||(f={}));var T,I=f;!function(e){e[e.ChaletLondon=0]="ChaletLondon",e[e.HouseScript=1]="HouseScript",e[e.Monospace=2]="Monospace",e[e.CharletComprimeColonge=4]="CharletComprimeColonge",e[e.Pricedown=7]="Pricedown"}(T||(T={}));var E,g=T;!function(e){e[e.Left=0]="Left",e[e.Centered=1]="Centered",e[e.Right=2]="Right"}(E||(E={}));var A,P=E;!function(e){e[e.NextCamera=0]="NextCamera",e[e.LookLeftRight=1]="LookLeftRight",e[e.LookUpDown=2]="LookUpDown",e[e.LookUpOnly=3]="LookUpOnly",e[e.LookDownOnly=4]="LookDownOnly",e[e.LookLeftOnly=5]="LookLeftOnly",e[e.LookRightOnly=6]="LookRightOnly",e[e.CinematicSlowMo=7]="CinematicSlowMo",e[e.FlyUpDown=8]="FlyUpDown",e[e.FlyLeftRight=9]="FlyLeftRight",e[e.ScriptedFlyZUp=10]="ScriptedFlyZUp",e[e.ScriptedFlyZDown=11]="ScriptedFlyZDown",e[e.WeaponWheelUpDown=12]="WeaponWheelUpDown",e[e.WeaponWheelLeftRight=13]="WeaponWheelLeftRight",e[e.WeaponWheelNext=14]="WeaponWheelNext",e[e.WeaponWheelPrev=15]="WeaponWheelPrev",e[e.SelectNextWeapon=16]="SelectNextWeapon",e[e.SelectPrevWeapon=17]="SelectPrevWeapon",e[e.SkipCutscene=18]="SkipCutscene",e[e.CharacterWheel=19]="CharacterWheel",e[e.MultiplayerInfo=20]="MultiplayerInfo",e[e.Sprint=21]="Sprint",e[e.Jump=22]="Jump",e[e.Enter=23]="Enter",e[e.Attack=24]="Attack",e[e.Aim=25]="Aim",e[e.LookBehind=26]="LookBehind",e[e.Phone=27]="Phone",e[e.SpecialAbility=28]="SpecialAbility",e[e.SpecialAbilitySecondary=29]="SpecialAbilitySecondary",e[e.MoveLeftRight=30]="MoveLeftRight",e[e.MoveUpDown=31]="MoveUpDown",e[e.MoveUpOnly=32]="MoveUpOnly",e[e.MoveDownOnly=33]="MoveDownOnly",e[e.MoveLeftOnly=34]="MoveLeftOnly",e[e.MoveRightOnly=35]="MoveRightOnly",e[e.Duck=36]="Duck",e[e.SelectWeapon=37]="SelectWeapon",e[e.Pickup=38]="Pickup",e[e.SniperZoom=39]="SniperZoom",e[e.SniperZoomInOnly=40]="SniperZoomInOnly",e[e.SniperZoomOutOnly=41]="SniperZoomOutOnly",e[e.SniperZoomInSecondary=42]="SniperZoomInSecondary",e[e.SniperZoomOutSecondary=43]="SniperZoomOutSecondary",e[e.Cover=44]="Cover",e[e.Reload=45]="Reload",e[e.Talk=46]="Talk",e[e.Detonate=47]="Detonate",e[e.HUDSpecial=48]="HUDSpecial",e[e.Arrest=49]="Arrest",e[e.AccurateAim=50]="AccurateAim",e[e.Context=51]="Context",e[e.ContextSecondary=52]="ContextSecondary",e[e.WeaponSpecial=53]="WeaponSpecial",e[e.WeaponSpecial2=54]="WeaponSpecial2",e[e.Dive=55]="Dive",e[e.DropWeapon=56]="DropWeapon",e[e.DropAmmo=57]="DropAmmo",e[e.ThrowGrenade=58]="ThrowGrenade",e[e.VehicleMoveLeftRight=59]="VehicleMoveLeftRight",e[e.VehicleMoveUpDown=60]="VehicleMoveUpDown",e[e.VehicleMoveUpOnly=61]="VehicleMoveUpOnly",e[e.VehicleMoveDownOnly=62]="VehicleMoveDownOnly",e[e.VehicleMoveLeftOnly=63]="VehicleMoveLeftOnly",e[e.VehicleMoveRightOnly=64]="VehicleMoveRightOnly",e[e.VehicleSpecial=65]="VehicleSpecial",e[e.VehicleGunLeftRight=66]="VehicleGunLeftRight",e[e.VehicleGunUpDown=67]="VehicleGunUpDown",e[e.VehicleAim=68]="VehicleAim",e[e.VehicleAttack=69]="VehicleAttack",e[e.VehicleAttack2=70]="VehicleAttack2",e[e.VehicleAccelerate=71]="VehicleAccelerate",e[e.VehicleBrake=72]="VehicleBrake",e[e.VehicleDuck=73]="VehicleDuck",e[e.VehicleHeadlight=74]="VehicleHeadlight",e[e.VehicleExit=75]="VehicleExit",e[e.VehicleHandbrake=76]="VehicleHandbrake",e[e.VehicleHotwireLeft=77]="VehicleHotwireLeft",e[e.VehicleHotwireRight=78]="VehicleHotwireRight",e[e.VehicleLookBehind=79]="VehicleLookBehind",e[e.VehicleCinCam=80]="VehicleCinCam",e[e.VehicleNextRadio=81]="VehicleNextRadio",e[e.VehiclePrevRadio=82]="VehiclePrevRadio",e[e.VehicleNextRadioTrack=83]="VehicleNextRadioTrack",e[e.VehiclePrevRadioTrack=84]="VehiclePrevRadioTrack",e[e.VehicleRadioWheel=85]="VehicleRadioWheel",e[e.VehicleHorn=86]="VehicleHorn",e[e.VehicleFlyThrottleUp=87]="VehicleFlyThrottleUp",e[e.VehicleFlyThrottleDown=88]="VehicleFlyThrottleDown",e[e.VehicleFlyYawLeft=89]="VehicleFlyYawLeft",e[e.VehicleFlyYawRight=90]="VehicleFlyYawRight",e[e.VehiclePassengerAim=91]="VehiclePassengerAim",e[e.VehiclePassengerAttack=92]="VehiclePassengerAttack",e[e.VehicleSpecialAbilityFranklin=93]="VehicleSpecialAbilityFranklin",e[e.VehicleStuntUpDown=94]="VehicleStuntUpDown",e[e.VehicleCinematicUpDown=95]="VehicleCinematicUpDown",e[e.VehicleCinematicUpOnly=96]="VehicleCinematicUpOnly",e[e.VehicleCinematicDownOnly=97]="VehicleCinematicDownOnly",e[e.VehicleCinematicLeftRight=98]="VehicleCinematicLeftRight",e[e.VehicleSelectNextWeapon=99]="VehicleSelectNextWeapon",e[e.VehicleSelectPrevWeapon=100]="VehicleSelectPrevWeapon",e[e.VehicleRoof=101]="VehicleRoof",e[e.VehicleJump=102]="VehicleJump",e[e.VehicleGrapplingHook=103]="VehicleGrapplingHook",e[e.VehicleShuffle=104]="VehicleShuffle",e[e.VehicleDropProjectile=105]="VehicleDropProjectile",e[e.VehicleMouseControlOverride=106]="VehicleMouseControlOverride",e[e.VehicleFlyRollLeftRight=107]="VehicleFlyRollLeftRight",e[e.VehicleFlyRollLeftOnly=108]="VehicleFlyRollLeftOnly",e[e.VehicleFlyRollRightOnly=109]="VehicleFlyRollRightOnly",e[e.VehicleFlyPitchUpDown=110]="VehicleFlyPitchUpDown",e[e.VehicleFlyPitchUpOnly=111]="VehicleFlyPitchUpOnly",e[e.VehicleFlyPitchDownOnly=112]="VehicleFlyPitchDownOnly",e[e.VehicleFlyUnderCarriage=113]="VehicleFlyUnderCarriage",e[e.VehicleFlyAttack=114]="VehicleFlyAttack",e[e.VehicleFlySelectNextWeapon=115]="VehicleFlySelectNextWeapon",e[e.VehicleFlySelectPrevWeapon=116]="VehicleFlySelectPrevWeapon",e[e.VehicleFlySelectTargetLeft=117]="VehicleFlySelectTargetLeft",e[e.VehicleFlySelectTargetRight=118]="VehicleFlySelectTargetRight",e[e.VehicleFlyVerticalFlightMode=119]="VehicleFlyVerticalFlightMode",e[e.VehicleFlyDuck=120]="VehicleFlyDuck",e[e.VehicleFlyAttackCamera=121]="VehicleFlyAttackCamera",e[e.VehicleFlyMouseControlOverride=122]="VehicleFlyMouseControlOverride",e[e.VehicleSubTurnLeftRight=123]="VehicleSubTurnLeftRight",e[e.VehicleSubTurnLeftOnly=124]="VehicleSubTurnLeftOnly",e[e.VehicleSubTurnRightOnly=125]="VehicleSubTurnRightOnly",e[e.VehicleSubPitchUpDown=126]="VehicleSubPitchUpDown",e[e.VehicleSubPitchUpOnly=127]="VehicleSubPitchUpOnly",e[e.VehicleSubPitchDownOnly=128]="VehicleSubPitchDownOnly",e[e.VehicleSubThrottleUp=129]="VehicleSubThrottleUp",e[e.VehicleSubThrottleDown=130]="VehicleSubThrottleDown",e[e.VehicleSubAscend=131]="VehicleSubAscend",e[e.VehicleSubDescend=132]="VehicleSubDescend",e[e.VehicleSubTurnHardLeft=133]="VehicleSubTurnHardLeft",e[e.VehicleSubTurnHardRight=134]="VehicleSubTurnHardRight",e[e.VehicleSubMouseControlOverride=135]="VehicleSubMouseControlOverride",e[e.VehiclePushbikePedal=136]="VehiclePushbikePedal",e[e.VehiclePushbikeSprint=137]="VehiclePushbikeSprint",e[e.VehiclePushbikeFrontBrake=138]="VehiclePushbikeFrontBrake",e[e.VehiclePushbikeRearBrake=139]="VehiclePushbikeRearBrake",e[e.MeleeAttackLight=140]="MeleeAttackLight",e[e.MeleeAttackHeavy=141]="MeleeAttackHeavy",e[e.MeleeAttackAlternate=142]="MeleeAttackAlternate",e[e.MeleeBlock=143]="MeleeBlock",e[e.ParachuteDeploy=144]="ParachuteDeploy",e[e.ParachuteDetach=145]="ParachuteDetach",e[e.ParachuteTurnLeftRight=146]="ParachuteTurnLeftRight",e[e.ParachuteTurnLeftOnly=147]="ParachuteTurnLeftOnly",e[e.ParachuteTurnRightOnly=148]="ParachuteTurnRightOnly",e[e.ParachutePitchUpDown=149]="ParachutePitchUpDown",e[e.ParachutePitchUpOnly=150]="ParachutePitchUpOnly",e[e.ParachutePitchDownOnly=151]="ParachutePitchDownOnly",e[e.ParachuteBrakeLeft=152]="ParachuteBrakeLeft",e[e.ParachuteBrakeRight=153]="ParachuteBrakeRight",e[e.ParachuteSmoke=154]="ParachuteSmoke",e[e.ParachutePrecisionLanding=155]="ParachutePrecisionLanding",e[e.Map=156]="Map",e[e.SelectWeaponUnarmed=157]="SelectWeaponUnarmed",e[e.SelectWeaponMelee=158]="SelectWeaponMelee",e[e.SelectWeaponHandgun=159]="SelectWeaponHandgun",e[e.SelectWeaponShotgun=160]="SelectWeaponShotgun",e[e.SelectWeaponSmg=161]="SelectWeaponSmg",e[e.SelectWeaponAutoRifle=162]="SelectWeaponAutoRifle",e[e.SelectWeaponSniper=163]="SelectWeaponSniper",e[e.SelectWeaponHeavy=164]="SelectWeaponHeavy",e[e.SelectWeaponSpecial=165]="SelectWeaponSpecial",e[e.SelectCharacterMichael=166]="SelectCharacterMichael",e[e.SelectCharacterFranklin=167]="SelectCharacterFranklin",e[e.SelectCharacterTrevor=168]="SelectCharacterTrevor",e[e.SelectCharacterMultiplayer=169]="SelectCharacterMultiplayer",e[e.SaveReplayClip=170]="SaveReplayClip",e[e.SpecialAbilityPC=171]="SpecialAbilityPC",e[e.PhoneUp=172]="PhoneUp",e[e.PhoneDown=173]="PhoneDown",e[e.PhoneLeft=174]="PhoneLeft",e[e.PhoneRight=175]="PhoneRight",e[e.PhoneSelect=176]="PhoneSelect",e[e.PhoneCancel=177]="PhoneCancel",e[e.PhoneOption=178]="PhoneOption",e[e.PhoneExtraOption=179]="PhoneExtraOption",e[e.PhoneScrollForward=180]="PhoneScrollForward",e[e.PhoneScrollBackward=181]="PhoneScrollBackward",e[e.PhoneCameraFocusLock=182]="PhoneCameraFocusLock",e[e.PhoneCameraGrid=183]="PhoneCameraGrid",e[e.PhoneCameraSelfie=184]="PhoneCameraSelfie",e[e.PhoneCameraDOF=185]="PhoneCameraDOF",e[e.PhoneCameraExpression=186]="PhoneCameraExpression",e[e.FrontendDown=187]="FrontendDown",e[e.FrontendUp=188]="FrontendUp",e[e.FrontendLeft=189]="FrontendLeft",e[e.FrontendRight=190]="FrontendRight",e[e.FrontendRdown=191]="FrontendRdown",e[e.FrontendRup=192]="FrontendRup",e[e.FrontendRleft=193]="FrontendRleft",e[e.FrontendRright=194]="FrontendRright",e[e.FrontendAxisX=195]="FrontendAxisX",e[e.FrontendAxisY=196]="FrontendAxisY",e[e.FrontendRightAxisX=197]="FrontendRightAxisX",e[e.FrontendRightAxisY=198]="FrontendRightAxisY",e[e.FrontendPause=199]="FrontendPause",e[e.FrontendPauseAlternate=200]="FrontendPauseAlternate",e[e.FrontendAccept=201]="FrontendAccept",e[e.FrontendCancel=202]="FrontendCancel",e[e.FrontendX=203]="FrontendX",e[e.FrontendY=204]="FrontendY",e[e.FrontendLb=205]="FrontendLb",e[e.FrontendRb=206]="FrontendRb",e[e.FrontendLt=207]="FrontendLt",e[e.FrontendRt=208]="FrontendRt",e[e.FrontendLs=209]="FrontendLs",e[e.FrontendRs=210]="FrontendRs",e[e.FrontendLeaderboard=211]="FrontendLeaderboard",e[e.FrontendSocialClub=212]="FrontendSocialClub",e[e.FrontendSocialClubSecondary=213]="FrontendSocialClubSecondary",e[e.FrontendDelete=214]="FrontendDelete",e[e.FrontendEndscreenAccept=215]="FrontendEndscreenAccept",e[e.FrontendEndscreenExpand=216]="FrontendEndscreenExpand",e[e.FrontendSelect=217]="FrontendSelect",e[e.ScriptLeftAxisX=218]="ScriptLeftAxisX",e[e.ScriptLeftAxisY=219]="ScriptLeftAxisY",e[e.ScriptRightAxisX=220]="ScriptRightAxisX",e[e.ScriptRightAxisY=221]="ScriptRightAxisY",e[e.ScriptRUp=222]="ScriptRUp",e[e.ScriptRDown=223]="ScriptRDown",e[e.ScriptRLeft=224]="ScriptRLeft",e[e.ScriptRRight=225]="ScriptRRight",e[e.ScriptLB=226]="ScriptLB",e[e.ScriptRB=227]="ScriptRB",e[e.ScriptLT=228]="ScriptLT",e[e.ScriptRT=229]="ScriptRT",e[e.ScriptLS=230]="ScriptLS",e[e.ScriptRS=231]="ScriptRS",e[e.ScriptPadUp=232]="ScriptPadUp",e[e.ScriptPadDown=233]="ScriptPadDown",e[e.ScriptPadLeft=234]="ScriptPadLeft",e[e.ScriptPadRight=235]="ScriptPadRight",e[e.ScriptSelect=236]="ScriptSelect",e[e.CursorAccept=237]="CursorAccept",e[e.CursorCancel=238]="CursorCancel",e[e.CursorX=239]="CursorX",e[e.CursorY=240]="CursorY",e[e.CursorScrollUp=241]="CursorScrollUp",e[e.CursorScrollDown=242]="CursorScrollDown",e[e.EnterCheatCode=243]="EnterCheatCode",e[e.InteractionMenu=244]="InteractionMenu",e[e.MpTextChatAll=245]="MpTextChatAll",e[e.MpTextChatTeam=246]="MpTextChatTeam",e[e.MpTextChatFriends=247]="MpTextChatFriends",e[e.MpTextChatCrew=248]="MpTextChatCrew",e[e.PushToTalk=249]="PushToTalk",e[e.CreatorLS=250]="CreatorLS",e[e.CreatorRS=251]="CreatorRS",e[e.CreatorLT=252]="CreatorLT",e[e.CreatorRT=253]="CreatorRT",e[e.CreatorMenuToggle=254]="CreatorMenuToggle",e[e.CreatorAccept=255]="CreatorAccept",e[e.CreatorDelete=256]="CreatorDelete",e[e.Attack2=257]="Attack2",e[e.RappelJump=258]="RappelJump",e[e.RappelLongJump=259]="RappelLongJump",e[e.RappelSmashWindow=260]="RappelSmashWindow",e[e.PrevWeapon=261]="PrevWeapon",e[e.NextWeapon=262]="NextWeapon",e[e.MeleeAttack1=263]="MeleeAttack1",e[e.MeleeAttack2=264]="MeleeAttack2",e[e.Whistle=265]="Whistle",e[e.MoveLeft=266]="MoveLeft",e[e.MoveRight=267]="MoveRight",e[e.MoveUp=268]="MoveUp",e[e.MoveDown=269]="MoveDown",e[e.LookLeft=270]="LookLeft",e[e.LookRight=271]="LookRight",e[e.LookUp=272]="LookUp",e[e.LookDown=273]="LookDown",e[e.SniperZoomIn=274]="SniperZoomIn",e[e.SniperZoomOut=275]="SniperZoomOut",e[e.SniperZoomInAlternate=276]="SniperZoomInAlternate",e[e.SniperZoomOutAlternate=277]="SniperZoomOutAlternate",e[e.VehicleMoveLeft=278]="VehicleMoveLeft",e[e.VehicleMoveRight=279]="VehicleMoveRight",e[e.VehicleMoveUp=280]="VehicleMoveUp",e[e.VehicleMoveDown=281]="VehicleMoveDown",e[e.VehicleGunLeft=282]="VehicleGunLeft",e[e.VehicleGunRight=283]="VehicleGunRight",e[e.VehicleGunUp=284]="VehicleGunUp",e[e.VehicleGunDown=285]="VehicleGunDown",e[e.VehicleLookLeft=286]="VehicleLookLeft",e[e.VehicleLookRight=287]="VehicleLookRight",e[e.ReplayStartStopRecording=288]="ReplayStartStopRecording",e[e.ReplayStartStopRecordingSecondary=289]="ReplayStartStopRecordingSecondary",e[e.ScaledLookLeftRight=290]="ScaledLookLeftRight",e[e.ScaledLookUpDown=291]="ScaledLookUpDown",e[e.ScaledLookUpOnly=292]="ScaledLookUpOnly",e[e.ScaledLookDownOnly=293]="ScaledLookDownOnly",e[e.ScaledLookLeftOnly=294]="ScaledLookLeftOnly",e[e.ScaledLookRightOnly=295]="ScaledLookRightOnly",e[e.ReplayMarkerDelete=296]="ReplayMarkerDelete",e[e.ReplayClipDelete=297]="ReplayClipDelete",e[e.ReplayPause=298]="ReplayPause",e[e.ReplayRewind=299]="ReplayRewind",e[e.ReplayFfwd=300]="ReplayFfwd",e[e.ReplayNewmarker=301]="ReplayNewmarker",e[e.ReplayRecord=302]="ReplayRecord",e[e.ReplayScreenshot=303]="ReplayScreenshot",e[e.ReplayHidehud=304]="ReplayHidehud",e[e.ReplayStartpoint=305]="ReplayStartpoint",e[e.ReplayEndpoint=306]="ReplayEndpoint",e[e.ReplayAdvance=307]="ReplayAdvance",e[e.ReplayBack=308]="ReplayBack",e[e.ReplayTools=309]="ReplayTools",e[e.ReplayRestart=310]="ReplayRestart",e[e.ReplayShowhotkey=311]="ReplayShowhotkey",e[e.ReplayCycleMarkerLeft=312]="ReplayCycleMarkerLeft",e[e.ReplayCycleMarkerRight=313]="ReplayCycleMarkerRight",e[e.ReplayFOVIncrease=314]="ReplayFOVIncrease",e[e.ReplayFOVDecrease=315]="ReplayFOVDecrease",e[e.ReplayCameraUp=316]="ReplayCameraUp",e[e.ReplayCameraDown=317]="ReplayCameraDown",e[e.ReplaySave=318]="ReplaySave",e[e.ReplayToggletime=319]="ReplayToggletime",e[e.ReplayToggletips=320]="ReplayToggletips",e[e.ReplayPreview=321]="ReplayPreview",e[e.ReplayToggleTimeline=322]="ReplayToggleTimeline",e[e.ReplayTimelinePickupClip=323]="ReplayTimelinePickupClip",e[e.ReplayTimelineDuplicateClip=324]="ReplayTimelineDuplicateClip",e[e.ReplayTimelinePlaceClip=325]="ReplayTimelinePlaceClip",e[e.ReplayCtrl=326]="ReplayCtrl",e[e.ReplayTimelineSave=327]="ReplayTimelineSave",e[e.ReplayPreviewAudio=328]="ReplayPreviewAudio",e[e.VehicleDriveLook=329]="VehicleDriveLook",e[e.VehicleDriveLook2=330]="VehicleDriveLook2",e[e.VehicleFlyAttack2=331]="VehicleFlyAttack2",e[e.RadioWheelUpDown=332]="RadioWheelUpDown",e[e.RadioWheelLeftRight=333]="RadioWheelLeftRight",e[e.VehicleSlowMoUpDown=334]="VehicleSlowMoUpDown",e[e.VehicleSlowMoUpOnly=335]="VehicleSlowMoUpOnly",e[e.VehicleSlowMoDownOnly=336]="VehicleSlowMoDownOnly",e[e.MapPointOfInterest=337]="MapPointOfInterest",e[e.ReplaySnapmaticPhoto=338]="ReplaySnapmaticPhoto",e[e.VehicleCarJump=339]="VehicleCarJump",e[e.VehicleRocketBoost=340]="VehicleRocketBoost",e[e.VehicleParachute=341]="VehicleParachute",e[e.VehicleBikeWings=342]="VehicleBikeWings",e[e.VehicleFlyBombBay=343]="VehicleFlyBombBay",e[e.VehicleFlyCounter=344]="VehicleFlyCounter",e[e.VehicleFlyTransform=345]="VehicleFlyTransform"}(A||(A={}));var w,H=A;!function(e){e[e.HUD_COLOUR_PURE_WHITE=0]="HUD_COLOUR_PURE_WHITE",e[e.HUD_COLOUR_WHITE=1]="HUD_COLOUR_WHITE",e[e.HUD_COLOUR_BLACK=2]="HUD_COLOUR_BLACK",e[e.HUD_COLOUR_GREY=3]="HUD_COLOUR_GREY",e[e.HUD_COLOUR_GREYLIGHT=4]="HUD_COLOUR_GREYLIGHT",e[e.HUD_COLOUR_GREYDARK=5]="HUD_COLOUR_GREYDARK",e[e.HUD_COLOUR_RED=6]="HUD_COLOUR_RED",e[e.HUD_COLOUR_REDLIGHT=7]="HUD_COLOUR_REDLIGHT",e[e.HUD_COLOUR_REDDARK=8]="HUD_COLOUR_REDDARK",e[e.HUD_COLOUR_BLUE=9]="HUD_COLOUR_BLUE",e[e.HUD_COLOUR_BLUELIGHT=10]="HUD_COLOUR_BLUELIGHT",e[e.HUD_COLOUR_BLUEDARK=11]="HUD_COLOUR_BLUEDARK",e[e.HUD_COLOUR_YELLOW=12]="HUD_COLOUR_YELLOW",e[e.HUD_COLOUR_YELLOWLIGHT=13]="HUD_COLOUR_YELLOWLIGHT",e[e.HUD_COLOUR_YELLOWDARK=14]="HUD_COLOUR_YELLOWDARK",e[e.HUD_COLOUR_ORANGE=15]="HUD_COLOUR_ORANGE",e[e.HUD_COLOUR_ORANGELIGHT=16]="HUD_COLOUR_ORANGELIGHT",e[e.HUD_COLOUR_ORANGEDARK=17]="HUD_COLOUR_ORANGEDARK",e[e.HUD_COLOUR_GREEN=18]="HUD_COLOUR_GREEN",e[e.HUD_COLOUR_GREENLIGHT=19]="HUD_COLOUR_GREENLIGHT",e[e.HUD_COLOUR_GREENDARK=20]="HUD_COLOUR_GREENDARK",e[e.HUD_COLOUR_PURPLE=21]="HUD_COLOUR_PURPLE",e[e.HUD_COLOUR_PURPLELIGHT=22]="HUD_COLOUR_PURPLELIGHT",e[e.HUD_COLOUR_PURPLEDARK=23]="HUD_COLOUR_PURPLEDARK",e[e.HUD_COLOUR_PINK=24]="HUD_COLOUR_PINK",e[e.HUD_COLOUR_RADAR_HEALTH=25]="HUD_COLOUR_RADAR_HEALTH",e[e.HUD_COLOUR_RADAR_ARMOUR=26]="HUD_COLOUR_RADAR_ARMOUR",e[e.HUD_COLOUR_RADAR_DAMAGE=27]="HUD_COLOUR_RADAR_DAMAGE",e[e.HUD_COLOUR_NET_PLAYER1=28]="HUD_COLOUR_NET_PLAYER1",e[e.HUD_COLOUR_NET_PLAYER2=29]="HUD_COLOUR_NET_PLAYER2",e[e.HUD_COLOUR_NET_PLAYER3=30]="HUD_COLOUR_NET_PLAYER3",e[e.HUD_COLOUR_NET_PLAYER4=31]="HUD_COLOUR_NET_PLAYER4",e[e.HUD_COLOUR_NET_PLAYER5=32]="HUD_COLOUR_NET_PLAYER5",e[e.HUD_COLOUR_NET_PLAYER6=33]="HUD_COLOUR_NET_PLAYER6",e[e.HUD_COLOUR_NET_PLAYER7=34]="HUD_COLOUR_NET_PLAYER7",e[e.HUD_COLOUR_NET_PLAYER8=35]="HUD_COLOUR_NET_PLAYER8",e[e.HUD_COLOUR_NET_PLAYER9=36]="HUD_COLOUR_NET_PLAYER9",e[e.HUD_COLOUR_NET_PLAYER10=37]="HUD_COLOUR_NET_PLAYER10",e[e.HUD_COLOUR_NET_PLAYER11=38]="HUD_COLOUR_NET_PLAYER11",e[e.HUD_COLOUR_NET_PLAYER12=39]="HUD_COLOUR_NET_PLAYER12",e[e.HUD_COLOUR_NET_PLAYER13=40]="HUD_COLOUR_NET_PLAYER13",e[e.HUD_COLOUR_NET_PLAYER14=41]="HUD_COLOUR_NET_PLAYER14",e[e.HUD_COLOUR_NET_PLAYER15=42]="HUD_COLOUR_NET_PLAYER15",e[e.HUD_COLOUR_NET_PLAYER16=43]="HUD_COLOUR_NET_PLAYER16",e[e.HUD_COLOUR_NET_PLAYER17=44]="HUD_COLOUR_NET_PLAYER17",e[e.HUD_COLOUR_NET_PLAYER18=45]="HUD_COLOUR_NET_PLAYER18",e[e.HUD_COLOUR_NET_PLAYER19=46]="HUD_COLOUR_NET_PLAYER19",e[e.HUD_COLOUR_NET_PLAYER20=47]="HUD_COLOUR_NET_PLAYER20",e[e.HUD_COLOUR_NET_PLAYER21=48]="HUD_COLOUR_NET_PLAYER21",e[e.HUD_COLOUR_NET_PLAYER22=49]="HUD_COLOUR_NET_PLAYER22",e[e.HUD_COLOUR_NET_PLAYER23=50]="HUD_COLOUR_NET_PLAYER23",e[e.HUD_COLOUR_NET_PLAYER24=51]="HUD_COLOUR_NET_PLAYER24",e[e.HUD_COLOUR_NET_PLAYER25=52]="HUD_COLOUR_NET_PLAYER25",e[e.HUD_COLOUR_NET_PLAYER26=53]="HUD_COLOUR_NET_PLAYER26",e[e.HUD_COLOUR_NET_PLAYER27=54]="HUD_COLOUR_NET_PLAYER27",e[e.HUD_COLOUR_NET_PLAYER28=55]="HUD_COLOUR_NET_PLAYER28",e[e.HUD_COLOUR_NET_PLAYER29=56]="HUD_COLOUR_NET_PLAYER29",e[e.HUD_COLOUR_NET_PLAYER30=57]="HUD_COLOUR_NET_PLAYER30",e[e.HUD_COLOUR_NET_PLAYER31=58]="HUD_COLOUR_NET_PLAYER31",e[e.HUD_COLOUR_NET_PLAYER32=59]="HUD_COLOUR_NET_PLAYER32",e[e.HUD_COLOUR_SIMPLEBLIP_DEFAULT=60]="HUD_COLOUR_SIMPLEBLIP_DEFAULT",e[e.HUD_COLOUR_MENU_BLUE=61]="HUD_COLOUR_MENU_BLUE",e[e.HUD_COLOUR_MENU_GREY_LIGHT=62]="HUD_COLOUR_MENU_GREY_LIGHT",e[e.HUD_COLOUR_MENU_BLUE_EXTRA_DARK=63]="HUD_COLOUR_MENU_BLUE_EXTRA_DARK",e[e.HUD_COLOUR_MENU_YELLOW=64]="HUD_COLOUR_MENU_YELLOW",e[e.HUD_COLOUR_MENU_YELLOW_DARK=65]="HUD_COLOUR_MENU_YELLOW_DARK",e[e.HUD_COLOUR_MENU_GREEN=66]="HUD_COLOUR_MENU_GREEN",e[e.HUD_COLOUR_MENU_GREY=67]="HUD_COLOUR_MENU_GREY",e[e.HUD_COLOUR_MENU_GREY_DARK=68]="HUD_COLOUR_MENU_GREY_DARK",e[e.HUD_COLOUR_MENU_HIGHLIGHT=69]="HUD_COLOUR_MENU_HIGHLIGHT",e[e.HUD_COLOUR_MENU_STANDARD=70]="HUD_COLOUR_MENU_STANDARD",e[e.HUD_COLOUR_MENU_DIMMED=71]="HUD_COLOUR_MENU_DIMMED",e[e.HUD_COLOUR_MENU_EXTRA_DIMMED=72]="HUD_COLOUR_MENU_EXTRA_DIMMED",e[e.HUD_COLOUR_BRIEF_TITLE=73]="HUD_COLOUR_BRIEF_TITLE",e[e.HUD_COLOUR_MID_GREY_MP=74]="HUD_COLOUR_MID_GREY_MP",e[e.HUD_COLOUR_NET_PLAYER1_DARK=75]="HUD_COLOUR_NET_PLAYER1_DARK",e[e.HUD_COLOUR_NET_PLAYER2_DARK=76]="HUD_COLOUR_NET_PLAYER2_DARK",e[e.HUD_COLOUR_NET_PLAYER3_DARK=77]="HUD_COLOUR_NET_PLAYER3_DARK",e[e.HUD_COLOUR_NET_PLAYER4_DARK=78]="HUD_COLOUR_NET_PLAYER4_DARK",e[e.HUD_COLOUR_NET_PLAYER5_DARK=79]="HUD_COLOUR_NET_PLAYER5_DARK",e[e.HUD_COLOUR_NET_PLAYER6_DARK=80]="HUD_COLOUR_NET_PLAYER6_DARK",e[e.HUD_COLOUR_NET_PLAYER7_DARK=81]="HUD_COLOUR_NET_PLAYER7_DARK",e[e.HUD_COLOUR_NET_PLAYER8_DARK=82]="HUD_COLOUR_NET_PLAYER8_DARK",e[e.HUD_COLOUR_NET_PLAYER9_DARK=83]="HUD_COLOUR_NET_PLAYER9_DARK",e[e.HUD_COLOUR_NET_PLAYER10_DARK=84]="HUD_COLOUR_NET_PLAYER10_DARK",e[e.HUD_COLOUR_NET_PLAYER11_DARK=85]="HUD_COLOUR_NET_PLAYER11_DARK",e[e.HUD_COLOUR_NET_PLAYER12_DARK=86]="HUD_COLOUR_NET_PLAYER12_DARK",e[e.HUD_COLOUR_NET_PLAYER13_DARK=87]="HUD_COLOUR_NET_PLAYER13_DARK",e[e.HUD_COLOUR_NET_PLAYER14_DARK=88]="HUD_COLOUR_NET_PLAYER14_DARK",e[e.HUD_COLOUR_NET_PLAYER15_DARK=89]="HUD_COLOUR_NET_PLAYER15_DARK",e[e.HUD_COLOUR_NET_PLAYER16_DARK=90]="HUD_COLOUR_NET_PLAYER16_DARK",e[e.HUD_COLOUR_NET_PLAYER17_DARK=91]="HUD_COLOUR_NET_PLAYER17_DARK",e[e.HUD_COLOUR_NET_PLAYER18_DARK=92]="HUD_COLOUR_NET_PLAYER18_DARK",e[e.HUD_COLOUR_NET_PLAYER19_DARK=93]="HUD_COLOUR_NET_PLAYER19_DARK",e[e.HUD_COLOUR_NET_PLAYER20_DARK=94]="HUD_COLOUR_NET_PLAYER20_DARK",e[e.HUD_COLOUR_NET_PLAYER21_DARK=95]="HUD_COLOUR_NET_PLAYER21_DARK",e[e.HUD_COLOUR_NET_PLAYER22_DARK=96]="HUD_COLOUR_NET_PLAYER22_DARK",e[e.HUD_COLOUR_NET_PLAYER23_DARK=97]="HUD_COLOUR_NET_PLAYER23_DARK",e[e.HUD_COLOUR_NET_PLAYER24_DARK=98]="HUD_COLOUR_NET_PLAYER24_DARK",e[e.HUD_COLOUR_NET_PLAYER25_DARK=99]="HUD_COLOUR_NET_PLAYER25_DARK",e[e.HUD_COLOUR_NET_PLAYER26_DARK=100]="HUD_COLOUR_NET_PLAYER26_DARK",e[e.HUD_COLOUR_NET_PLAYER27_DARK=101]="HUD_COLOUR_NET_PLAYER27_DARK",e[e.HUD_COLOUR_NET_PLAYER28_DARK=102]="HUD_COLOUR_NET_PLAYER28_DARK",e[e.HUD_COLOUR_NET_PLAYER29_DARK=103]="HUD_COLOUR_NET_PLAYER29_DARK",e[e.HUD_COLOUR_NET_PLAYER30_DARK=104]="HUD_COLOUR_NET_PLAYER30_DARK",e[e.HUD_COLOUR_NET_PLAYER31_DARK=105]="HUD_COLOUR_NET_PLAYER31_DARK",e[e.HUD_COLOUR_NET_PLAYER32_DARK=106]="HUD_COLOUR_NET_PLAYER32_DARK",e[e.HUD_COLOUR_BRONZE=107]="HUD_COLOUR_BRONZE",e[e.HUD_COLOUR_SILVER=108]="HUD_COLOUR_SILVER",e[e.HUD_COLOUR_GOLD=109]="HUD_COLOUR_GOLD",e[e.HUD_COLOUR_PLATINUM=110]="HUD_COLOUR_PLATINUM",e[e.HUD_COLOUR_GANG1=111]="HUD_COLOUR_GANG1",e[e.HUD_COLOUR_GANG2=112]="HUD_COLOUR_GANG2",e[e.HUD_COLOUR_GANG3=113]="HUD_COLOUR_GANG3",e[e.HUD_COLOUR_GANG4=114]="HUD_COLOUR_GANG4",e[e.HUD_COLOUR_SAME_CREW=115]="HUD_COLOUR_SAME_CREW",e[e.HUD_COLOUR_FREEMODE=116]="HUD_COLOUR_FREEMODE",e[e.HUD_COLOUR_PAUSE_BG=117]="HUD_COLOUR_PAUSE_BG",e[e.HUD_COLOUR_FRIENDLY=118]="HUD_COLOUR_FRIENDLY",e[e.HUD_COLOUR_ENEMY=119]="HUD_COLOUR_ENEMY",e[e.HUD_COLOUR_LOCATION=120]="HUD_COLOUR_LOCATION",e[e.HUD_COLOUR_PICKUP=121]="HUD_COLOUR_PICKUP",e[e.HUD_COLOUR_PAUSE_SINGLEPLAYER=122]="HUD_COLOUR_PAUSE_SINGLEPLAYER",e[e.HUD_COLOUR_FREEMODE_DARK=123]="HUD_COLOUR_FREEMODE_DARK",e[e.HUD_COLOUR_INACTIVE_MISSION=124]="HUD_COLOUR_INACTIVE_MISSION",e[e.HUD_COLOUR_DAMAGE=125]="HUD_COLOUR_DAMAGE",e[e.HUD_COLOUR_PINKLIGHT=126]="HUD_COLOUR_PINKLIGHT",e[e.HUD_COLOUR_PM_MITEM_HIGHLIGHT=127]="HUD_COLOUR_PM_MITEM_HIGHLIGHT",e[e.HUD_COLOUR_SCRIPT_VARIABLE=128]="HUD_COLOUR_SCRIPT_VARIABLE",e[e.HUD_COLOUR_YOGA=129]="HUD_COLOUR_YOGA",e[e.HUD_COLOUR_TENNIS=130]="HUD_COLOUR_TENNIS",e[e.HUD_COLOUR_GOLF=131]="HUD_COLOUR_GOLF",e[e.HUD_COLOUR_SHOOTING_RANGE=132]="HUD_COLOUR_SHOOTING_RANGE",e[e.HUD_COLOUR_FLIGHT_SCHOOL=133]="HUD_COLOUR_FLIGHT_SCHOOL",e[e.HUD_COLOUR_NORTH_BLUE=134]="HUD_COLOUR_NORTH_BLUE",e[e.HUD_COLOUR_SOCIAL_CLUB=135]="HUD_COLOUR_SOCIAL_CLUB",e[e.HUD_COLOUR_PLATFORM_BLUE=136]="HUD_COLOUR_PLATFORM_BLUE",e[e.HUD_COLOUR_PLATFORM_GREEN=137]="HUD_COLOUR_PLATFORM_GREEN",e[e.HUD_COLOUR_PLATFORM_GREY=138]="HUD_COLOUR_PLATFORM_GREY",e[e.HUD_COLOUR_FACEBOOK_BLUE=139]="HUD_COLOUR_FACEBOOK_BLUE",e[e.HUD_COLOUR_INGAME_BG=140]="HUD_COLOUR_INGAME_BG",e[e.HUD_COLOUR_DARTS=141]="HUD_COLOUR_DARTS",e[e.HUD_COLOUR_WAYPOINT=142]="HUD_COLOUR_WAYPOINT",e[e.HUD_COLOUR_MICHAEL=143]="HUD_COLOUR_MICHAEL",e[e.HUD_COLOUR_FRANKLIN=144]="HUD_COLOUR_FRANKLIN",e[e.HUD_COLOUR_TREVOR=145]="HUD_COLOUR_TREVOR",e[e.HUD_COLOUR_GOLF_P1=146]="HUD_COLOUR_GOLF_P1",e[e.HUD_COLOUR_GOLF_P2=147]="HUD_COLOUR_GOLF_P2",e[e.HUD_COLOUR_GOLF_P3=148]="HUD_COLOUR_GOLF_P3",e[e.HUD_COLOUR_GOLF_P4=149]="HUD_COLOUR_GOLF_P4",e[e.HUD_COLOUR_WAYPOINTLIGHT=150]="HUD_COLOUR_WAYPOINTLIGHT",e[e.HUD_COLOUR_WAYPOINTDARK=151]="HUD_COLOUR_WAYPOINTDARK",e[e.HUD_COLOUR_PANEL_LIGHT=152]="HUD_COLOUR_PANEL_LIGHT",e[e.HUD_COLOUR_MICHAEL_DARK=153]="HUD_COLOUR_MICHAEL_DARK",e[e.HUD_COLOUR_FRANKLIN_DARK=154]="HUD_COLOUR_FRANKLIN_DARK",e[e.HUD_COLOUR_TREVOR_DARK=155]="HUD_COLOUR_TREVOR_DARK",e[e.HUD_COLOUR_OBJECTIVE_ROUTE=156]="HUD_COLOUR_OBJECTIVE_ROUTE",e[e.HUD_COLOUR_PAUSEMAP_TINT=157]="HUD_COLOUR_PAUSEMAP_TINT",e[e.HUD_COLOUR_PAUSE_DESELECT=158]="HUD_COLOUR_PAUSE_DESELECT",e[e.HUD_COLOUR_PM_WEAPONS_PURCHASABLE=159]="HUD_COLOUR_PM_WEAPONS_PURCHASABLE",e[e.HUD_COLOUR_PM_WEAPONS_LOCKED=160]="HUD_COLOUR_PM_WEAPONS_LOCKED",e[e.HUD_COLOUR_END_SCREEN_BG=161]="HUD_COLOUR_END_SCREEN_BG",e[e.HUD_COLOUR_CHOP=162]="HUD_COLOUR_CHOP",e[e.HUD_COLOUR_PAUSEMAP_TINT_HALF=163]="HUD_COLOUR_PAUSEMAP_TINT_HALF",e[e.HUD_COLOUR_NORTH_BLUE_OFFICIAL=164]="HUD_COLOUR_NORTH_BLUE_OFFICIAL",e[e.HUD_COLOUR_SCRIPT_VARIABLE_2=165]="HUD_COLOUR_SCRIPT_VARIABLE_2",e[e.HUD_COLOUR_H=166]="HUD_COLOUR_H",e[e.HUD_COLOUR_HDARK=167]="HUD_COLOUR_HDARK",e[e.HUD_COLOUR_T=168]="HUD_COLOUR_T",e[e.HUD_COLOUR_TDARK=169]="HUD_COLOUR_TDARK",e[e.HUD_COLOUR_HSHARD=170]="HUD_COLOUR_HSHARD",e[e.HUD_COLOUR_CONTROLLER_MICHAEL=171]="HUD_COLOUR_CONTROLLER_MICHAEL",e[e.HUD_COLOUR_CONTROLLER_FRANKLIN=172]="HUD_COLOUR_CONTROLLER_FRANKLIN",e[e.HUD_COLOUR_CONTROLLER_TREVOR=173]="HUD_COLOUR_CONTROLLER_TREVOR",e[e.HUD_COLOUR_CONTROLLER_CHOP=174]="HUD_COLOUR_CONTROLLER_CHOP",e[e.HUD_COLOUR_VIDEO_EDITOR_VIDEO=175]="HUD_COLOUR_VIDEO_EDITOR_VIDEO",e[e.HUD_COLOUR_VIDEO_EDITOR_AUDIO=176]="HUD_COLOUR_VIDEO_EDITOR_AUDIO",e[e.HUD_COLOUR_VIDEO_EDITOR_TEXT=177]="HUD_COLOUR_VIDEO_EDITOR_TEXT",e[e.HUD_COLOUR_HB_BLUE=178]="HUD_COLOUR_HB_BLUE",e[e.HUD_COLOUR_HB_YELLOW=179]="HUD_COLOUR_HB_YELLOW"}(w||(w={}));var M,x=w;!function(e){e[e.Left=0]="Left",e[e.Right=1]="Right"}(M||(M={}));var N=M;class V{constructor(e,t,i,s=255){this.R=e,this.G=t,this.B=i,this.A=s}}V.Empty=new V(0,0,0,0),V.Transparent=new V(0,0,0,0),V.Black=new V(0,0,0,255),V.White=new V(255,255,255,255),V.WhiteSmoke=new V(245,245,245,255);class y{constructor(e=0,t=0){this.Width=e,this.Height=t}}class F{constructor(e,t){this.X=0,this.Y=0,this.X=e,this.Y=t}static Parse(e){if("object"==typeof e){if(e.length)return new F(e[0],e[1]);if(e.X&&e.Y)return new F(e.X,e.Y)}else if("string"==typeof e&&-1!==e.indexOf(",")){const t=e.split(",");return new F(parseFloat(t[0]),parseFloat(t[1]))}return new F(0,0)}}class b{constructor(){this.Enabled=!0}}class Y extends b{constructor(e,t,i,s,n,h){super(),this.Caption=e,this.Pos=t,this.Scale=i,this.Color=s||new V(255,255,255,255),this.Font=n||0,this.Centered=h||!1}Draw(e,t,i,s,n,h){!e||t||i||s||n||h||(t=new F(this.Pos.X+e.Width,this.Pos.Y+e.Height),i=this.Scale,s=this.Color,n=this.Font,h=this.Centered);const o=t.X/1280,r=t.Y/720;c.setTextFont(parseInt(n)),c.setTextScale(i,i),c.setTextColour(s.R,s.G,s.B,s.A),c.setTextCentre(h),c.beginTextCommandDisplayText("STRING"),Y.AddLongString(e),c.endTextCommandDisplayText(o,r,0)}static AddLongString(e){if(!e.length)return;for(let t,i=0;i=e.X&&i.X<=e.X+t.Width&&i.Y>e.Y&&i.Y0){const e=t.X/h.Width+n/h.Width;c.setTextWrap(o,e)}return c.endTextCommandLineCount(o,r)}}k.Width=W[1],k.Height=W[2];class v{constructor(e,t,i,s,n=0,h=new V(255,255,255)){this.TextureDict=e,this.TextureName=t,this.Pos=i,this.Size=s,this.Heading=n,this.Color=h,this.Visible=!0}LoadTextureDictionary(){this.requestTextureDictPromise(this._textureDict).then(e=>{})}requestTextureDictPromise(e){return new Promise((s,n)=>{c.requestStreamedTextureDict(e,!0);let h=t(()=>{if(c.hasStreamedTextureDictLoaded(e))return i(h),s(!0)},10)})}set TextureDict(e){this._textureDict=e,this.IsTextureDictionaryLoaded||this.LoadTextureDictionary()}get TextureDict(){return this._textureDict}get IsTextureDictionaryLoaded(){return c.hasStreamedTextureDictLoaded(this._textureDict)}Draw(e,t,i,s,n,h,o){e=e||this.TextureDict,t=t||this.TextureName,i=i||this.Pos,s=s||this.Size,n=n||this.Heading,h=h||this.Color,(o=o||!0)&&(c.hasStreamedTextureDictLoaded(e)||c.requestStreamedTextureDict(e,!0));const r=1080*(k.Width/k.Height),a=this.Size.Width/r,l=this.Size.Height/1080,_=this.Pos.X/r+.5*a,O=this.Pos.Y/1080+.5*l;c.drawSprite(e,t,_,O,a,l,n,h.R,h.G,h.B,h.A,!0)}}class B extends b{constructor(e,t,i){super(),this.Enabled=!0,this.Pos=e,this.Size=t,this.Color=i}Draw(e,t,i){e||(e=new y(0,0)),t||i||(e=new F(this.Pos.X+e.Width,this.Pos.Y+e.Height),t=this.Size,i=this.Color);const s=t.Width/1280,n=t.Height/720,h=e.X/1280+.5*s,o=e.Y/720+.5*n;c.drawRect(h,o,s,n,i.R,i.G,i.B,i.A,!1)}}class G extends B{constructor(e,t,i){super(e,t,i)}Draw(e,t,i){e||(e=new y),!e||t||i||(e=new F(this.Pos.X+e.Width,this.Pos.Y+e.Height),t=this.Size,i=this.Color);const s=1080*(k.Width/k.Height),n=t.Width/s,h=t.Height/1080,o=e.X/s+.5*n,r=e.Y/1080+.5*h;c.drawRect(o,r,n,h,i.R,i.G,i.B,i.A,!1)}}class K extends Y{constructor(e,t,i,s,n,h){super(e,t,i,s||new V(255,255,255),n||0,!1),this.TextAlignment=P.Left,this.Wrap=0,h&&(this.TextAlignment=h)}get WordWrap(){return new y(this.Wrap,0)}set WordWrap(e){this.Wrap=e.Width}Draw(e,t,i,n,h,o,r,a,l){let _=e,O=o,R=o;e||(e=new y(0,0)),e&&!t&&(R=this.TextAlignment,_=this.Caption,t=new F(this.Pos.X+e.Width,this.Pos.Y+e.Height),i=this.Scale,n=this.Color,h=this.Font,1==O||0==O?O=this.Centered:(O=void 0,r=this.DropShadow,a=this.Outline,this.WordWrap));const u=1080*(k.Width/k.Height),d=this.Pos.X/u,L=this.Pos.Y/1080;if(c.setTextFont(parseInt(h)),c.setTextScale(1,i),c.setTextColour(n.R,n.G,n.B,n.A),void 0!==O)c.setTextCentre(O);else{switch(r&&c.setTextDropshadow(2,0,0,0,0),a&&s("[NativeUI] ResText outline not working!"),R){case P.Centered:c.setTextCentre(!0);break;case P.Right:c.setTextRightJustify(!0),c.setTextWrap(0,d)}if(this.Wrap){const e=(this.Pos.X+this.Wrap)/u;c.setTextWrap(d,e)}}c.beginTextCommandDisplayText("CELL_EMAIL_BCON"),Y.AddLongString(_),c.endTextCommandDisplayText(d,L,0)}}function X(){let e,t="";for(e=0;e<32;e+=1)switch(e){case 8:case 20:t+="-",t+=(16*Math.random()|0).toString(16);break;case 12:t+="-",t+="4";break;case 16:t+="-",t+=(4*Math.random()|8).toString(16);break;default:t+=(16*Math.random()|0).toString(16)}return t}class z{constructor(e,t="",i=null){this.Id=X(),this.BackColor=z.DefaultBackColor,this.HighlightedBackColor=z.DefaultHighlightedBackColor,this.ForeColor=z.DefaultForeColor,this.HighlightedForeColor=z.DefaultHighlightedForeColor,this.RightLabel="",this.LeftBadge=I.None,this.RightBadge=I.None,this.Enabled=!0,this.Data=i,this._rectangle=new G(new F(0,0),new y(431,38),new V(150,0,0,0)),this._text=new K(e,new F(8,0),.33,V.WhiteSmoke,g.ChaletLondon,P.Left),this.Description=t,this._selectedSprite=new v("commonmenu","gradient_nav",new F(0,0),new y(431,38)),this._badgeLeft=new v("commonmenu","",new F(0,0),new y(40,40)),this._badgeRight=new v("commonmenu","",new F(0,0),new y(40,40)),this._labelText=new K("",new F(0,0),.35,V.White,0,P.Right)}get Text(){return this._text.Caption}set Text(e){this._text.Caption=e}get Description(){return this._description}set Description(e){this._description=e,this.hasOwnProperty("Parent")&&this.Parent.UpdateDescriptionCaption()}SetVerticalPosition(e){this._rectangle.Pos=new F(this.Offset.X,e+144+this.Offset.Y),this._selectedSprite.Pos=new F(0+this.Offset.X,e+144+this.Offset.Y),this._text.Pos=new F(8+this.Offset.X,e+147+this.Offset.Y),this._badgeLeft.Pos=new F(0+this.Offset.X,e+142+this.Offset.Y),this._badgeRight.Pos=new F(385+this.Offset.X,e+142+this.Offset.Y),this._labelText.Pos=new F(420+this.Offset.X,e+148+this.Offset.Y)}addEvent(e,...t){this._event={event:e,args:t}}fireEvent(){this._event&&n(this._event.event,...this._event.args)}Draw(){this._rectangle.Size=new y(431+this.Parent.WidthOffset,38),this._selectedSprite.Size=new y(431+this.Parent.WidthOffset,38),this.Hovered&&!this.Selected&&(this._rectangle.Color=new V(255,255,255,20),this._rectangle.Draw()),this._selectedSprite.Color=this.Selected?this.HighlightedBackColor:this.BackColor,this._selectedSprite.Draw(),this._text.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this.LeftBadge!=I.None?(this._text.Pos=new F(35+this.Offset.X,this._text.Pos.Y),this._badgeLeft.TextureDict=this.BadgeToSpriteLib(this.LeftBadge),this._badgeLeft.TextureName=this.BadgeToSpriteName(this.LeftBadge,this.Selected),this._badgeLeft.Color=this.IsBagdeWhiteSprite(this.LeftBadge)?this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148):V.White,this._badgeLeft.Draw()):this._text.Pos=new F(8+this.Offset.X,this._text.Pos.Y),this.RightBadge!=I.None&&(this._badgeRight.Pos=new F(385+this.Offset.X+this.Parent.WidthOffset,this._badgeRight.Pos.Y),this._badgeRight.TextureDict=this.BadgeToSpriteLib(this.RightBadge),this._badgeRight.TextureName=this.BadgeToSpriteName(this.RightBadge,this.Selected),this._badgeRight.Color=this.IsBagdeWhiteSprite(this.RightBadge)?this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148):V.White,this._badgeRight.Draw()),this.RightLabel&&""!==this.RightLabel&&(this._labelText.Pos=new F(420+this.Offset.X+this.Parent.WidthOffset,this._labelText.Pos.Y),this._labelText.Caption=this.RightLabel,this._labelText.Color=this._text.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._labelText.Draw()),this._text.Draw()}SetLeftBadge(e){this.LeftBadge=e}SetRightBadge(e){this.RightBadge=e}SetRightLabel(e){this.RightLabel=e}BadgeToSpriteLib(e){switch(e){case I.Sale:return"mpshopsale";case I.Audio1:case I.Audio2:case I.Audio3:case I.AudioInactive:case I.AudioMute:return"mpleaderboard";default:return"commonmenu"}}BadgeToSpriteName(e,t){switch(e){case I.None:return"";case I.BronzeMedal:return"mp_medal_bronze";case I.GoldMedal:return"mp_medal_gold";case I.SilverMedal:return"medal_silver";case I.Alert:return"mp_alerttriangle";case I.Crown:return"mp_hostcrown";case I.Ammo:return t?"shop_ammo_icon_b":"shop_ammo_icon_a";case I.Armour:return t?"shop_armour_icon_b":"shop_armour_icon_a";case I.Barber:return t?"shop_barber_icon_b":"shop_barber_icon_a";case I.Clothes:return t?"shop_clothing_icon_b":"shop_clothing_icon_a";case I.Franklin:return t?"shop_franklin_icon_b":"shop_franklin_icon_a";case I.Bike:return t?"shop_garage_bike_icon_b":"shop_garage_bike_icon_a";case I.Car:return t?"shop_garage_icon_b":"shop_garage_icon_a";case I.Gun:return t?"shop_gunclub_icon_b":"shop_gunclub_icon_a";case I.Heart:return t?"shop_health_icon_b":"shop_health_icon_a";case I.Lock:return"shop_lock";case I.Makeup:return t?"shop_makeup_icon_b":"shop_makeup_icon_a";case I.Mask:return t?"shop_mask_icon_b":"shop_mask_icon_a";case I.Michael:return t?"shop_michael_icon_b":"shop_michael_icon_a";case I.Star:return"shop_new_star";case I.Tattoo:return t?"shop_tattoos_icon_b":"shop_tattoos_icon_a";case I.Tick:return"shop_tick_icon";case I.Trevor:return t?"shop_trevor_icon_b":"shop_trevor_icon_a";case I.Sale:return"saleicon";case I.ArrowLeft:return"arrowleft";case I.ArrowRight:return"arrowright";case I.Audio1:return"leaderboard_audio_1";case I.Audio2:return"leaderboard_audio_2";case I.Audio3:return"leaderboard_audio_3";case I.AudioInactive:return"leaderboard_audio_inactive";case I.AudioMute:return"leaderboard_audio_mute";default:return""}}IsBagdeWhiteSprite(e){switch(e){case I.Lock:case I.Tick:case I.Crown:return!0;default:return!1}}BadgeToColor(e,t){switch(e){case I.Lock:case I.Tick:case I.Crown:return t?new V(255,0,0,0):new V(255,255,255,255);default:return new V(255,255,255,255)}}}z.DefaultBackColor=V.Empty,z.DefaultHighlightedBackColor=V.White,z.DefaultForeColor=V.WhiteSmoke,z.DefaultHighlightedForeColor=V.Black;class Z extends z{constructor(e,t=!1,i=""){super(e,i),this.Checked=!1;this._checkedSprite=new v("commonmenu","shop_box_blank",new F(410,95),new y(50,50)),this.Checked=t}SetVerticalPosition(e){super.SetVerticalPosition(e),this._checkedSprite.Pos=new F(380+this.Offset.X+this.Parent.WidthOffset,e+138+this.Offset.Y)}Draw(){super.Draw(),this._checkedSprite.Pos=this._checkedSprite.Pos=new F(380+this.Offset.X+this.Parent.WidthOffset,this._checkedSprite.Pos.Y);const e=this.HighlightedForeColor==z.DefaultHighlightedForeColor;this.Selected&&e?this._checkedSprite.TextureName=this.Checked?"shop_box_tickb":"shop_box_blankb":this._checkedSprite.TextureName=this.Checked?"shop_box_tick":"shop_box_blank",this._checkedSprite.Color=this.Enabled?this.Selected&&!e?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._checkedSprite.Draw()}SetRightBadge(e){return this}SetRightLabel(e){return this}}class J{constructor(e="",t=null){this.Id=X(),this.DisplayText=e,this.Data=t}}class j{constructor(e){if(0===e.length)throw new Error("ItemsCollection cannot be empty");this.items=e}length(){return this.items.length}getListItems(){const e=[];for(const t of this.items)t instanceof J?e.push(t):"string"==typeof t?e.push(new J(t)):"number"==typeof t&&e.push(new J(t.toString()));return e}}class $ extends z{constructor(e,t="",i=new j([]),s=0,n=null){super(e,t,n),this.ScrollingEnabled=!0,this.HoldTimeBeforeScroll=200,this._currentOffset=0,this._itemsCollection=[],this._index=0;this.Collection=i.getListItems(),this.Index=s,this._arrowLeft=new v("commonmenu","arrowleft",new F(110,105),new y(30,30)),this._arrowRight=new v("commonmenu","arrowright",new F(280,105),new y(30,30)),this._itemText=new K("",new F(290,104),.35,V.White,g.ChaletLondon,P.Right)}get Collection(){return this._itemsCollection}set Collection(e){if(!e)throw new Error("The collection can't be null");this._itemsCollection=e}set SelectedItem(e){const t=this.Collection.findIndex(t=>t.Id===e.Id);this.Index=t>0?t:0}get SelectedItem(){return this.Collection.length>0?this.Collection[this.Index]:null}get SelectedValue(){return null==this.SelectedItem?null:null==this.SelectedItem.Data?this.SelectedItem.DisplayText:this.SelectedItem.Data}get Index(){return null==this.Collection||null!=this.Collection&&0==this.Collection.length?-1:this._index%this.Collection.length}set Index(e){if(null==this.Collection)return;if(null!=this.Collection&&0==this.Collection.length)return;this._index=1e8-1e8%this.Collection.length+e;const t=this.Collection.length>=this.Index?this.Collection[this.Index].DisplayText:" ";this._currentOffset=k.GetTextWidth(t,this._itemText&&this._itemText.Font?this._itemText.Font:0,.35)}setCollection(e){this.Collection=e.getListItems()}setCollectionItem(e,t,i=!0){if(e>this.Collection.length)throw new Error("Index out of bounds");"string"==typeof t&&(t=new J(t)),this.Collection.splice(e,1,t),i&&(this.Index=0)}SetVerticalPosition(e){this._arrowLeft.Pos=new F(300+this.Offset.X+this.Parent.WidthOffset,147+e+this.Offset.Y),this._arrowRight.Pos=new F(400+this.Offset.X+this.Parent.WidthOffset,147+e+this.Offset.Y),this._itemText.Pos=new F(300+this.Offset.X+this.Parent.WidthOffset,e+147+this.Offset.Y),super.SetVerticalPosition(e)}SetRightLabel(e){return this}SetRightBadge(e){return this}Draw(){super.Draw();const e=this.Collection.length>=this.Index?this.Collection[this.Index].DisplayText:" ",t=this._currentOffset;this._itemText.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._itemText.Caption=e,this._arrowLeft.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._arrowRight.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._arrowLeft.Pos=new F(380-t+this.Offset.X+this.Parent.WidthOffset,this._arrowLeft.Pos.Y),this.Selected?(this._arrowLeft.Draw(),this._arrowRight.Draw(),this._itemText.Pos=new F(405+this.Offset.X+this.Parent.WidthOffset,this._itemText.Pos.Y)):this._itemText.Pos=new F(420+this.Offset.X+this.Parent.WidthOffset,this._itemText.Pos.Y),this._itemText.Draw()}}Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};class q extends z{constructor(e,t="",i=0,s=10,n=0,h=null){super(e,t,h),this._currentOffset=0,this._leftMoveThreshold=1,this._rightMoveThreshold=1,this._lowerThreshold=0,this._upperThreshold=10,this._preCaptionText="",this._postCaptionText="";this.LowerThreshold=i,this.UpperThreshold=i>s?i:s,this.SelectedValue=ns?i:n,this._arrowLeft=new v("commonmenu","arrowleft",new F(110,105),new y(30,30)),this._arrowRight=new v("commonmenu","arrowright",new F(280,105),new y(30,30)),this._itemText=new K("",new F(290,104),.35,V.White,g.ChaletLondon,P.Right)}get PreCaptionText(){return this._preCaptionText}set PreCaptionText(e){if(!e)throw new Error("The pre caption text can't be null");if("string"!=typeof e)throw new Error("The pre caption text must be a string");this._preCaptionText=e,this._currentOffset=k.GetTextWidth(this.PreCaptionText+this._selectedValue.toString()+this.PostCaptionText,this._itemText&&this._itemText.Font?this._itemText.Font:0,.35)}get PostCaptionText(){return this._postCaptionText}set PostCaptionText(e){if(!e)throw new Error("The post caption text can't be null");if("string"!=typeof e)throw new Error("The post caption text must be a string");this._postCaptionText=e,this._currentOffset=k.GetTextWidth(this.PreCaptionText+this._selectedValue.toString()+this.PostCaptionText,this._itemText&&this._itemText.Font?this._itemText.Font:0,.35)}get LeftMoveThreshold(){return this._leftMoveThreshold}set LeftMoveThreshold(e){if(!e)throw new Error("The left threshold can't be null");this._leftMoveThreshold=e}get RightMoveThreshold(){return this._rightMoveThreshold}set RightMoveThreshold(e){if(!e)throw new Error("The right threshold can't be null");this._rightMoveThreshold=e}get LowerThreshold(){return this._lowerThreshold}set LowerThreshold(e){if("number"!=typeof e&&!e)throw new Error("The lower threshold can't be null");this._lowerThreshold=e,this.SelectedValuee&&(this.SelectedValue=e)}get SelectedValue(){return this._selectedValue}set SelectedValue(e){if(ethis._upperThreshold)throw new Error("The value can not be outside the lower or upper limits");var t;this._selectedValue=(t=e,Number.isInteger(t)?t:parseFloat(t.toFixed(10))),this._currentOffset=k.GetTextWidth(this.PreCaptionText+this._selectedValue.toString()+this.PostCaptionText,this._itemText&&this._itemText.Font?this._itemText.Font:0,this._itemText&&this._itemText.Scale?this._itemText.Scale:.35)}SetVerticalPosition(e){this._arrowLeft.Pos=new F(300+this.Offset.X+this.Parent.WidthOffset,147+e+this.Offset.Y),this._arrowRight.Pos=new F(400+this.Offset.X+this.Parent.WidthOffset,147+e+this.Offset.Y),this._itemText.Pos=new F(300+this.Offset.X+this.Parent.WidthOffset,e+147+this.Offset.Y),super.SetVerticalPosition(e)}SetRightLabel(e){return this}SetRightBadge(e){return this}Draw(){super.Draw();const e=this._currentOffset;this._itemText.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._itemText.Caption=this.PreCaptionText+this._selectedValue+this.PostCaptionText,this._arrowLeft.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._arrowRight.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._arrowLeft.Pos=new F(380-e+this.Offset.X+this.Parent.WidthOffset,this._arrowLeft.Pos.Y),this.Selected?(this._arrowLeft.Draw(),this._arrowRight.Draw(),this._itemText.Pos=new F(405+this.Offset.X+this.Parent.WidthOffset,this._itemText.Pos.Y)):this._itemText.Pos=new F(420+this.Offset.X+this.Parent.WidthOffset,this._itemText.Pos.Y),this._itemText.Draw()}}class Q extends z{constructor(e,t,i,s="",n=!1,h=null){super(e,s,h);this._items=t,this._arrowLeft=new v("commonmenutu","arrowleft",new F(0,105),new y(15,15)),this._arrowRight=new v("commonmenutu","arrowright",new F(0,105),new y(15,15)),this._rectangleBackground=new G(new F(0,0),new y(150,9),new V(4,32,57,255)),this._rectangleSlider=new G(new F(0,0),new y(75,9),new V(57,116,200,255)),this._rectangleDivider=new G(new F(0,0),new y(2.5,20),n?V.WhiteSmoke:V.Transparent),this.Index=i}get Index(){return this._index%this._items.length}set Index(e){this._index=1e8-1e8%this._items.length+e}SetVerticalPosition(e){this._rectangleBackground.Pos=new F(250+this.Offset.X+this.Parent.WidthOffset,e+158.5+this.Offset.Y),this._rectangleSlider.Pos=new F(250+this.Offset.X+this.Parent.WidthOffset,e+158.5+this.Offset.Y),this._rectangleDivider.Pos=new F(323.5+this.Offset.X+this.Parent.WidthOffset,e+153+this.Offset.Y),this._arrowLeft.Pos=new F(235+this.Offset.X+this.Parent.WidthOffset,155.5+e+this.Offset.Y),this._arrowRight.Pos=new F(400+this.Offset.X+this.Parent.WidthOffset,155.5+e+this.Offset.Y),super.SetVerticalPosition(e)}IndexToItem(e){return this._items[e]}Draw(){super.Draw(),this._arrowLeft.Color=this.Enabled?this.Selected?V.Black:V.WhiteSmoke:new V(163,159,148),this._arrowRight.Color=this.Enabled?this.Selected?V.Black:V.WhiteSmoke:new V(163,159,148);let e=(this._rectangleBackground.Size.Width-this._rectangleSlider.Size.Width)/(this._items.length-1)*this.Index;this._rectangleSlider.Pos=new F(250+this.Offset.X+e+ +this.Parent.WidthOffset,this._rectangleSlider.Pos.Y),this.Selected&&(this._arrowLeft.Draw(),this._arrowRight.Draw()),this._rectangleBackground.Draw(),this._rectangleSlider.Draw(),this._rectangleDivider.Draw()}SetRightBadge(e){}SetRightLabel(e){}}class ee extends B{constructor(e,t,i){super(e,t,i),this.Items=[]}addItem(e){this.Items.push(e)}Draw(e){if(!this.Enabled)return;e=e||new y;const t=1080*(k.Width/k.Height),i=this.Size.Width/t,s=this.Size.Height/1080,n=(this.Pos.X+e.Width)/t+.5*i,h=(this.Pos.Y+e.Height)/1080+.5*s;for(var o of(c.drawRect(n,h,i,s,this.Color.R,this.Color.G,this.Color.B,this.Color.A,!1),this.Items))o.Draw(new y(this.Pos.X+e.Width,this.Pos.Y+e.Height))}}class te{static PlaySound(e,t){c.playSound(-1,e,t,!1,0,!0)}}class ie{constructor(){this.handlers=[]}on(e){this.handlers.push(e)}off(e){this.handlers=this.handlers.filter(t=>t!==e)}emit(...e){this.handlers.slice(0).forEach(t=>t(...e))}expose(){return this}count(){return this.handlers.length}}class se{constructor(e,t,i=null){this._itemBind=null,this.Text=e,this._buttonControl=t,this._usingControls=null==i,this._buttonString=i}get ItemBind(){return this._itemBind}BindToItem(e){this._itemBind=e}GetButtonId(){return this._usingControls?c.getControlInstructionalButton(2,this._buttonControl,!1):"t_"+this._buttonString}}class ne{constructor(e){this._handle=0,this.scaleForm=e,this._handle=O(this.scaleForm)}get handle(){return this._handle}get isValid(){return 0!=this._handle}get isLoaded(){return R(this._handle)}callFunctionHead(e,...t){this.isValid&&this.isLoaded&&(u(this._handle,e),t.forEach(e=>{switch(typeof e){case"number":Number(e)===e&&e%1!=0?U(e):C(e);case"string":L(e);break;case"boolean":d(e);break;default:h(`Unknown argument type ${typeof e} = ${e.toString()} passed to scaleform with handle ${this._handle}`)}}))}callFunction(e,...t){this.callFunctionHead(e,...t),D()}callFunctionReturn(e,...t){return this.callFunctionHead(e,...t),m()}render2D(){this.isValid&&this.isLoaded&&p(this._handle,255,255,255,255,0)}recreate(){this.isValid&&this.isLoaded&&(S(this._handle),this._handle=O(this.scaleForm))}destroy(){this.isValid&&(S(this._handle),this._handle=0)}}class he{static Initialize(e,t){this._transitionOutAnimName=t,this._scaleform=new ne(e)}static get IsVisible(){return this._messageVisible}static get Scaleform(){return this._scaleform}static Load(){null!=this._delayedTransitionInTimeout&&(o(this._delayedTransitionInTimeout),this._delayedTransitionInTimeout=null)}static SetDelayedTransition(e,t){this._delayedTransitionInTimeout=r(()=>{this._delayedTransitionInTimeout=null,this.TransitionIn(e,t)},this._transitionOutTimeMs)}static ShowCustomShard(e,t=5e3,...i){this.ShowComplexCustomShard(()=>{this._scaleform.callFunction(e,...i)},t)}static ShowComplexCustomShard(e,t=5e3){this.Load(),this._messageVisible?(this.TransitionOut(),this.SetDelayedTransition(()=>e(),t)):this.TransitionIn(e,t)}static TransitionOut(){this._messageVisible&&(null!=this._transitionOutTimeout&&(o(this._transitionOutTimeout),this._transitionOutTimeout=null),null!=this._transitionOutFinishedTimeout&&(o(this._transitionOutFinishedTimeout),this._transitionOutFinishedTimeout=null),this._scaleform.callFunction(this._transitionOutAnimName),this._transitionOutFinishedTimeout=r(()=>{this._messageVisible=!1,this._scaleform.recreate()},this._transitionOutTimeMs))}static TransitionIn(e,t=500){this._messageVisible=!0,e(),this.SetTransitionOutTimer(t)}static SetTransitionOutTimer(e){this._transitionOutTimeout=r(()=>{this._transitionOutTimeout=null,this.TransitionOut()},e)}static Render(){this._messageVisible&&this._scaleform.render2D()}}he._messageVisible=!1,he._transitionOutTimeout=null,he._transitionOutFinishedTimeout=null,he._delayedTransitionInTimeout=null,he._scaleform=null,he._transitionOutTimeMs=500,he._transitionOutAnimName=null;class oe extends he{static Initialize(e,t){super.Initialize(e,t),a(()=>this.Render())}static ShowMissionPassedMessage(e,t="",i=5e3){this.ShowCustomShard("SHOW_MISSION_PASSED_MESSAGE",i,e,t,100,!0,0,!0)}static ShowColoredShard(e,t,i,s,n=5e3){this.ShowCustomShard("SHOW_SHARD_CENTERED_MP_MESSAGE",n,e,t,s,i)}static ShowOldMessage(e,t=5e3){this.ShowCustomShard("SHOW_MISSION_PASSED_MESSAGE",t,e)}static ShowSimpleShard(e,t="",i=5e3){this.ShowCustomShard("SHOW_SHARD_CREW_RANKUP_MP_MESSAGE",i,e,t)}static ShowRankupMessage(e,t,i,s=5e3){this.ShowCustomShard("SHOW_BIG_MP_MESSAGE",s,e,t,i,"","")}static ShowPlaneMessage(e,t,i,s=5e3){this.ShowCustomShard("SHOW_PLANE_MESSAGE",s,e,t,i,"","")}static ShowWeaponPurchasedMessage(e,t,i,s=5e3){this.ShowCustomShard("SHOW_WEAPON_PURCHASED",s,e,t,i,"",100)}static ShowWastedMessage(e,t,i,s,n=5e3){this.ShowCustomShard("SHOW_SHARD_WASTED_MP_MESSAGE",n,e,t,i,s)}static ShowMpMessageLarge(e,t="",i=5e3){this.ShowComplexCustomShard(()=>{this.Scaleform.callFunction("SHOW_CENTERED_MP_MESSAGE_LARGE",e,t,100,!0,100),this.Scaleform.callFunction("TRANSITION_IN")},i)}}oe.Initialize("MP_BIG_MESSAGE_FREEMODE","TRANSITION_OUT");class re extends he{static Initialize(e,t){super.Initialize(e,t),a(()=>this.Render())}static ShowMidsizedMessage(e,t="",i=5e3){this.ShowCustomShard("SHOW_MIDSIZED_MESSAGE",i,e,t)}static ShowBridgesKnivesProgress(e,t,i,s,n,h=5e3){this.ShowCustomShard("SHOW_BRIDGES_KNIVES_PROGRESS",h,e,t,i,s,n)}static ShowCondensedShardMessage(e,t,i,s,n=5e3){this.ShowCustomShard("SHOW_COND_SHARD_MESSAGE",n,e,t,i,s)}static ShowMidsizedShardMessage(e,t,i,s,n,h=5e3){this.ShowCustomShard("SHOW_SHARD_MIDSIZED_MESSAGE",h,e,t,i,s,n)}}re.Initialize("MIDSIZED_MESSAGE","SHARD_ANIM_OUT");class ae extends z{constructor(e,t,i="",s=null,n=null){super(e,i,n),this._currentOffset=0,this._precaptionText="",this._selectedStartValueHandler=null,this.SelectionChangeHandler=null,this.isVariableFunction(t)||h(`[UIMenuDynamicListItem] ${e} is not created with a valid selectionChangeHandler, needs to be function. Please see docs.`),this.isVariableFunction(s)||h(`[UIMenuDynamicListItem] ${e} is not created with a valid selectedStartValueHandler, needs to be function. Please see docs.`),this.SelectionChangeHandler=t,this._selectedStartValueHandler=s;this._arrowLeft=new v("commonmenu","arrowleft",new F(110,105),new y(30,30)),this._arrowRight=new v("commonmenu","arrowright",new F(280,105),new y(30,30)),this._itemText=new K("",new F(290,104),.35,V.White,g.ChaletLondon,P.Right)}SelectionChangeHandlerPromise(e,t,i){return new Promise((s,n)=>{s(this.SelectionChangeHandler(e,t,i))})}get PreCaptionText(){return this._precaptionText}set PreCaptionText(e){if(!e)throw new Error("The pre caption text can't be null");if("string"!=typeof e)throw new Error("The pre caption text must be a string");this._precaptionText=e,this._currentOffset=k.GetTextWidth(this.PreCaptionText+this._selectedValue,this._itemText&&this._itemText.Font?this._itemText.Font:0,.35)}get SelectedValue(){return this._selectedValue}set SelectedValue(e){this._selectedValue=e,null!=e&&(this._currentOffset=k.GetTextWidth(this.PreCaptionText+this._selectedValue,this._itemText&&this._itemText.Font?this._itemText.Font:0,this._itemText&&this._itemText.Scale?this._itemText.Scale:.35))}SetVerticalPosition(e){this._arrowLeft.Pos=new F(300+this.Offset.X+this.Parent.WidthOffset,147+e+this.Offset.Y),this._arrowRight.Pos=new F(400+this.Offset.X+this.Parent.WidthOffset,147+e+this.Offset.Y),this._itemText.Pos=new F(300+this.Offset.X+this.Parent.WidthOffset,e+147+this.Offset.Y),super.SetVerticalPosition(e)}SetRightLabel(e){return this}SetRightBadge(e){return this}Draw(){super.Draw(),null==this._selectedValue&&(null!=this._selectedStartValueHandler?this.SelectedValue=this._selectedStartValueHandler():this._selectedValue="");const e=this._currentOffset;this._itemText.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._itemText.Caption=this.PreCaptionText+this._selectedValue,this._arrowLeft.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._arrowRight.Color=this.Enabled?this.Selected?this.HighlightedForeColor:this.ForeColor:new V(163,159,148),this._arrowLeft.Pos=new F(380-e+this.Offset.X+this.Parent.WidthOffset,this._arrowLeft.Pos.Y),this.Selected?(this._arrowLeft.Draw(),this._arrowRight.Draw(),this._itemText.Pos=new F(405+this.Offset.X+this.Parent.WidthOffset,this._itemText.Pos.Y)):this._itemText.Pos=new F(420+this.Offset.X+this.Parent.WidthOffset,this._itemText.Pos.Y),this._itemText.Draw()}isVariableFunction(e){return e&&"[object Function]"==={}.toString.call(e)}}let le=[];class _e{constructor(e,t,i,s,n){this._visible=!0,this._counterPretext="",this._counterOverride=void 0,this._lastUpDownNavigation=0,this._lastLeftRightNavigation=0,this._extraOffset=0,this._buttonsEnabled=!0,this._justOpened=!0,this._justOpenedFromPool=!1,this._justClosedFromPool=!1,this._poolOpening=null,this._safezoneOffset=new F(0,0),this._activeItem=1e3,this._maxItemsOnScreen=9,this._maxItem=this._maxItemsOnScreen,this._mouseEdgeEnabled=!0,this._bannerSprite=null,this._bannerRectangle=null,this._recalculateDescriptionNextFrame=1,this._instructionalButtons=[],this._defaultTitleScale=1.15,this._maxMenuItems=1e3,this.Id=X(),this.SelectTextLocalized=l("HUD_INPUT2"),this.BackTextLocalized=l("HUD_INPUT3"),this.WidthOffset=0,this.ParentMenu=null,this.ParentItem=null,this.MouseControlsEnabled=!1,this.CloseableByUser=!0,this.AUDIO_LIBRARY="HUD_FRONTEND_DEFAULT_SOUNDSET",this.AUDIO_UPDOWN="NAV_UP_DOWN",this.AUDIO_LEFTRIGHT="NAV_LEFT_RIGHT",this.AUDIO_SELECT="SELECT",this.AUDIO_BACK="BACK",this.AUDIO_ERROR="ERROR",this.MenuItems=[],this.IndexChange=new ie,this.ListChange=new ie,this.AutoListChange=new ie,this.DynamicListChange=new ie,this.SliderChange=new ie,this.CheckboxChange=new ie,this.ItemSelect=new ie,this.MenuOpen=new ie,this.MenuClose=new ie,this.MenuChange=new ie,i instanceof F||(i=F.Parse(i)),this._spriteLibrary=s||"commonmenu",this._spriteName=n||"interaction_bgd",this._offset=new F(i.X,i.Y),this.Children=new Map,this._instructionalButtonsScaleform=new ne("instructional_buttons"),this.UpdateScaleform(),this._mainMenu=new ee(new F(0,0),new y(700,500),new V(0,0,0,0)),this._bannerSprite=new v(this._spriteLibrary,this._spriteName,new F(0+this._offset.X,0+this._offset.Y),new y(431,107)),this._mainMenu.addItem(this._titleResText=new K(e,new F(215+this._offset.X,20+this._offset.Y),this._defaultTitleScale,new V(255,255,255),1,P.Centered)),""!==t&&(this._mainMenu.addItem(new G(new F(0+this._offset.X,107+this._offset.Y),new y(431,37),new V(0,0,0,255))),this._mainMenu.addItem(this._subtitleResText=new K(t,new F(8+this._offset.X,110+this._offset.Y),.35,new V(255,255,255),0,P.Left)),t.startsWith("~")&&(this._counterPretext=t.substr(0,3)),this._counterText=new K("",new F(425+this._offset.X,110+this._offset.Y),.35,new V(255,255,255),0,P.Right),this._extraOffset+=37),this._upAndDownSprite=new v("commonmenu","shop_arrows_upanddown",new F(190+this._offset.X,147+37*(this._maxItemsOnScreen+1)+this._offset.Y-37+this._extraOffset),new y(50,50)),this._extraRectangleUp=new G(new F(0+this._offset.X,144+38*(this._maxItemsOnScreen+1)+this._offset.Y-37+this._extraOffset),new y(431,18),new V(0,0,0,200)),this._extraRectangleDown=new G(new F(0+this._offset.X,162+38*(this._maxItemsOnScreen+1)+this._offset.Y-37+this._extraOffset),new y(431,18),new V(0,0,0,200)),this._descriptionBar=new G(new F(this._offset.X,123),new y(431,4),V.Black),this._descriptionRectangle=new v("commonmenu","gradient_bgd",new F(this._offset.X,127),new y(431,30)),this._descriptionText=new K("",new F(this._offset.X+5,125),.35,new V(255,255,255,255),g.ChaletLondon,P.Left),this._descriptionText.Wrap=400,this._background=new v("commonmenu","gradient_bgd",new F(this._offset.X,144+this._offset.Y-37+this._extraOffset),new y(290,25)),this._visible=!1,a(this.render.bind(this))}GetSpriteBanner(){return this._bannerSprite}GetRectangleBanner(){return this._bannerRectangle}GetTitle(){return this._titleResText}get MaxItemsVisible(){return this._maxItemsOnScreen}set MaxItemsVisible(e){this._maxItemsOnScreen=e,this._maxItem=e}get Title(){return this._titleResText.Caption}set Title(e){this._titleResText.Caption=e}get GetSubTitle(){return this._titleResText}get SubTitle(){return this._titleResText.Caption}set SubTitle(e){this._subtitleResText.Caption=e}get Visible(){return this._visible}set Visible(e){if(this._visible=e,te.PlaySound(this.AUDIO_BACK,this.AUDIO_LIBRARY),this.UpdateScaleform(),e&&this.UpdateDescriptionCaption(),!0!==this._justOpenedFromPool)if(e){if(this._justOpened=!0,this.MenuOpen.emit(),null===this.ParentMenu&&!le.includes(this)&&this!==this._poolOpening){const e=le.length?le[le.length-1]:null;le.push(this),e!==this._poolOpening&&null!==e&&(e._justClosedFromPool=!0,e.Visible=!1)}}else{if(!0===this._justClosedFromPool)return void(this._justClosedFromPool=!1);null===this.ParentMenu&&le.includes(this)&&le.length&&(le[le.length-1]===this&&(le.pop(),this._justOpenedFromPool=!0,le.length||(this._poolOpening=null)),le.length&&(this._poolOpening=le[le.length-1],le[le.length-1].Visible=!0)),0===le.length&&c.setMouseCursorSprite(1)}else this._justOpenedFromPool=!1}get CurrentSelection(){return this._activeItem%this.MenuItems.length}set CurrentSelection(e){this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!1,this._activeItem=this._maxMenuItems-this._maxMenuItems%this.MenuItems.length+e,this.CurrentSelection>this._maxItem?(this._maxItem=this.CurrentSelection,this._minItem=this.CurrentSelection-this._maxItemsOnScreen):this.CurrentSelectionthis._maxItemsOnScreen+1?this._maxItemsOnScreen+2:this.MenuItems.length;this._descriptionBar.Size=new y(431+this.WidthOffset,4),this._descriptionRectangle.Size=new y(431+this.WidthOffset,30),this._descriptionBar.Pos=new F(this._offset.X,112+this._extraOffset+this._offset.Y),this._descriptionRectangle.Pos=new F(this._offset.X,112+this._extraOffset+this._offset.Y),this._descriptionText.Pos=new F(this._offset.X+8,118+this._extraOffset+this._offset.Y),this._descriptionBar.Pos=new F(this._offset.X,38*e+this._descriptionBar.Pos.Y),this._descriptionRectangle.Pos=new F(this._offset.X,38*e+this._descriptionRectangle.Pos.Y),this._descriptionText.Pos=new F(this._offset.X+8,38*e+this._descriptionText.Pos.Y)}SetMenuWidthOffset(e){if(this.WidthOffset=e,null!=this._bannerSprite&&(this._bannerSprite.Size=new y(431+this.WidthOffset,107)),this._mainMenu.Items[0].pos=new F((this.WidthOffset+this._offset.X+431)/2,20+this._offset.Y),this._counterText&&(this._counterText.Pos=new F(425+this._offset.X+e,110+this._offset.Y)),this._mainMenu.Items.length>=2){this._mainMenu.Items[1].size=new y(431+this.WidthOffset,37)}null!=this._bannerRectangle&&(this._bannerRectangle.Size=new y(431+this.WidthOffset,107))}AddItem(e){this._justOpened&&(this._justOpened=!1),e.Offset=this._offset,e.Parent=this,e.SetVerticalPosition(25*this.MenuItems.length-37+this._extraOffset),this.MenuItems.push(e),this.RefreshIndex()}RemoveItem(e){for(let t=0;t{e.Close(!0)}),this.MenuItems.filter(e=>e instanceof ae).forEach(e=>{e.SelectedValue=void 0}),this.RefreshIndex()}Close(e=!1){this.Visible=!1,this.CleanUp(e),this.MenuClose.emit(!0)}GoLeft(){if((this.MenuItems[this.CurrentSelection]instanceof $||this.MenuItems[this.CurrentSelection]instanceof q||this.MenuItems[this.CurrentSelection]instanceof ae||this.MenuItems[this.CurrentSelection]instanceof Q)&&this.MenuItems[this.CurrentSelection].Enabled)if(this.MenuItems[this.CurrentSelection]instanceof $){const e=this.MenuItems[this.CurrentSelection];if(0==e.Collection.length)return;e.Index--,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.ListChange.emit(e,e.Index),this.UpdateDescriptionCaption()}else if(this.MenuItems[this.CurrentSelection]instanceof q){const e=this.MenuItems[this.CurrentSelection];e.SelectedValue<=e.LowerThreshold?e.SelectedValue=e.UpperThreshold:e.SelectedValue-=e.LeftMoveThreshold,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.AutoListChange.emit(e,e.SelectedValue,N.Left),this.UpdateDescriptionCaption()}else if(this.MenuItems[this.CurrentSelection]instanceof ae){const e=this.MenuItems[this.CurrentSelection];e.SelectionChangeHandlerPromise(e,e.SelectedValue,N.Left).then(t=>{e.SelectedValue=t,this.DynamicListChange.emit(e,e.SelectedValue,N.Left)}),te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.UpdateDescriptionCaption()}else if(this.MenuItems[this.CurrentSelection]instanceof Q){const e=this.MenuItems[this.CurrentSelection];e.Index=e.Index-1,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.SliderChange.emit(e,e.Index,e.IndexToItem(e.Index)),this.UpdateDescriptionCaption()}}GoRight(){if((this.MenuItems[this.CurrentSelection]instanceof $||this.MenuItems[this.CurrentSelection]instanceof q||this.MenuItems[this.CurrentSelection]instanceof ae||this.MenuItems[this.CurrentSelection]instanceof Q)&&this.MenuItems[this.CurrentSelection].Enabled)if(this.MenuItems[this.CurrentSelection]instanceof $){const e=this.MenuItems[this.CurrentSelection];if(0==e.Collection.length)return;e.Index++,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.ListChange.emit(e,e.Index),this.UpdateDescriptionCaption()}else if(this.MenuItems[this.CurrentSelection]instanceof q){const e=this.MenuItems[this.CurrentSelection];e.SelectedValue>=e.UpperThreshold?e.SelectedValue=e.LowerThreshold:e.SelectedValue+=e.RightMoveThreshold,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.AutoListChange.emit(e,e.SelectedValue,N.Right),this.UpdateDescriptionCaption()}else if(this.MenuItems[this.CurrentSelection]instanceof ae){const e=this.MenuItems[this.CurrentSelection];e.SelectionChangeHandlerPromise(e,e.SelectedValue,N.Right).then(t=>{e.SelectedValue=t,this.DynamicListChange.emit(e,e.SelectedValue,N.Right)}),te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.UpdateDescriptionCaption()}else if(this.MenuItems[this.CurrentSelection]instanceof Q){const e=this.MenuItems[this.CurrentSelection];e.Index++,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.SliderChange.emit(e,e.Index,e.IndexToItem(e.Index)),this.UpdateDescriptionCaption()}}SelectItem(){if(!this.MenuItems[this.CurrentSelection].Enabled)return void te.PlaySound(this.AUDIO_ERROR,this.AUDIO_LIBRARY);const e=this.MenuItems[this.CurrentSelection];if(this.MenuItems[this.CurrentSelection]instanceof Z)e.Checked=!e.Checked,te.PlaySound(this.AUDIO_SELECT,this.AUDIO_LIBRARY),this.CheckboxChange.emit(e,e.Checked);else if(te.PlaySound(this.AUDIO_SELECT,this.AUDIO_LIBRARY),this.ItemSelect.emit(e,this.CurrentSelection),this.Children.has(e.Id)){const t=this.Children.get(e.Id);this.Visible=!1,t.Visible=!0,this.MenuChange.emit(t,!0)}e.fireEvent()}HasCurrentSelectionChildren(){const e=this.MenuItems[this.CurrentSelection];return!!(this.MenuItems[this.CurrentSelection]instanceof z&&this.Children.has(e.Id))}IsMouseInListItemArrows(e,t,i){c.beginTextCommandGetWidth("jamyfafi"),c.addTextComponentSubstringPlayerName(e.Text);let s=k.ResolutionMaintainRatio;let n=1080*(s.Width/s.Height);const h=5+c.endTextCommandGetWidth(!1)*n*.35+10,o=431-h;return k.IsMouseInBounds(t,new y(h,38))?1:k.IsMouseInBounds(new F(t.X+h,t.Y),new y(o,38))?2:0}ProcessMouse(){if(!this.Visible||this._justOpened||0==this.MenuItems.length||!this.MouseControlsEnabled)return void this.MenuItems.filter(e=>e.Hovered).forEach(e=>e.Hovered=!1);_(!0);let e=this.MenuItems.length-1,t=0;this.MenuItems.length>this._maxItemsOnScreen+1&&(e=this._maxItem),k.IsMouseInBounds(new F(0,0),new y(30,1080))&&this._mouseEdgeEnabled?(c.setGameplayCamRelativeHeading(c.getGameplayCamRelativeHeading()+5),c.setMouseCursorSprite(6)):k.IsMouseInBounds(new F(k.ResolutionMaintainRatio.Width-30,0),new y(30,1080))&&this._mouseEdgeEnabled?(c.setGameplayCamRelativeHeading(c.getGameplayCamRelativeHeading()-5),c.setMouseCursorSprite(7)):this._mouseEdgeEnabled&&c.setMouseCursorSprite(1);for(let i=this._minItem;i<=e;i++){let e=this._offset.X,s=this._offset.Y+144-37+this._extraOffset+38*t,n=431+this.WidthOffset;const h=38,o=this.MenuItems[i];if(k.IsMouseInBounds(new F(e,s),new y(n,h))){o.Hovered=!0;const t=this.IsMouseInListItemArrows(this.MenuItems[i],new F(e,s),0);if(o.Hovered&&1==t&&(this.MenuItems[i]instanceof $||this.MenuItems[i]instanceof q||this.MenuItems[i]instanceof ae)&&c.setMouseCursorSprite(5),c.isControlJustReleased(0,24)||c.isDisabledControlJustReleased(0,24))if(o.Selected&&o.Enabled)if((this.MenuItems[i]instanceof $||this.MenuItems[i]instanceof q||this.MenuItems[i]instanceof ae)&&this.IsMouseInListItemArrows(this.MenuItems[i],new F(e,s),0)>0)switch(t){case 1:te.PlaySound(this.AUDIO_SELECT,this.AUDIO_LIBRARY),this.MenuItems[i].fireEvent(),this.ItemSelect.emit(this.MenuItems[i],i);break;case 2:let e=this.MenuItems[i];(null==e.Collection?e.Items.Count:e.Collection.Count)>0&&(e.Index++,te.PlaySound(this.AUDIO_LEFTRIGHT,this.AUDIO_LIBRARY),this.ListChange.emit(e,e.Index))}else this.SelectItem();else o.Selected?!o.Enabled&&o.Selected&&te.PlaySound(this.AUDIO_ERROR,this.AUDIO_LIBRARY):(this.CurrentSelection=i,te.PlaySound(this.AUDIO_UPDOWN,this.AUDIO_LIBRARY),this.IndexChange.emit(this.CurrentSelection,this.MenuItems[this._activeItem%this.MenuItems.length]),this.SelectItem(),this.UpdateDescriptionCaption(),this.UpdateScaleform())}else o.Hovered=!1;t++}const i=144+38*(this._maxItemsOnScreen+1)+this._offset.Y-37+this._extraOffset+this._safezoneOffset.Y,s=this._safezoneOffset.X+this._offset.X;this.MenuItems.length<=this._maxItemsOnScreen+1||(k.IsMouseInBounds(new F(s,i),new y(431+this.WidthOffset,18))?(this._extraRectangleUp.Color=new V(30,30,30,255),(c.isControlJustPressed(0,24)||c.isDisabledControlJustPressed(0,24))&&(this.MenuItems.length>this._maxItemsOnScreen+1?this.GoUpOverflow():this.GoUp())):this._extraRectangleUp.Color=new V(0,0,0,200),k.IsMouseInBounds(new F(s,i+18),new y(431+this.WidthOffset,18))?(this._extraRectangleDown.Color=new V(30,30,30,255),(c.isControlJustPressed(0,24)||c.isDisabledControlJustPressed(0,24))&&(this.MenuItems.length>this._maxItemsOnScreen+1?this.GoDownOverflow():this.GoDown())):this._extraRectangleDown.Color=new V(0,0,0,200))}ProcessControl(){this.Visible&&(this._justOpened?this._justOpened=!1:(c.isControlJustReleased(0,177)&&this.GoBack(),0!=this.MenuItems.length&&(c.isControlPressed(0,172)&&this._lastUpDownNavigation+120this._maxItemsOnScreen+1?this.GoUpOverflow():this.GoUp(),this.UpdateScaleform()):c.isControlJustReleased(0,172)?this._lastUpDownNavigation=0:c.isControlPressed(0,173)&&this._lastUpDownNavigation+120this._maxItemsOnScreen+1?this.GoDownOverflow():this.GoDown(),this.UpdateScaleform()):c.isControlJustReleased(0,173)?this._lastUpDownNavigation=0:c.isControlPressed(0,174)&&this._lastLeftRightNavigation+100this._maxItemsOnScreen+1||(this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!1,this._activeItem--,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!0,te.PlaySound(this.AUDIO_UPDOWN,this.AUDIO_LIBRARY),this.IndexChange.emit(this.CurrentSelection,this.MenuItems[this._activeItem%this.MenuItems.length]),this.UpdateDescriptionCaption())}GoDownOverflow(){this.MenuItems.length<=this._maxItemsOnScreen+1||(this._activeItem%this.MenuItems.length>=this._maxItem?this._activeItem%this.MenuItems.length==this.MenuItems.length-1?(this._minItem=0,this._maxItem=this._maxItemsOnScreen,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!1,this._activeItem=this._maxMenuItems-this._maxMenuItems%this.MenuItems.length,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!0):(this._minItem++,this._maxItem++,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!1,this._activeItem++,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!0):(this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!1,this._activeItem++,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!0),te.PlaySound(this.AUDIO_UPDOWN,this.AUDIO_LIBRARY),this.IndexChange.emit(this.CurrentSelection,this.MenuItems[this._activeItem%this.MenuItems.length]),this.UpdateDescriptionCaption())}GoDown(){this.MenuItems.length>this._maxItemsOnScreen+1||(this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!1,this._activeItem++,this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!0,te.PlaySound(this.AUDIO_UPDOWN,this.AUDIO_LIBRARY),this.IndexChange.emit(this.CurrentSelection,this.MenuItems[this._activeItem%this.MenuItems.length]),this.UpdateDescriptionCaption())}GoBack(){null!=this.ParentMenu?(this.Visible=!1,this.ParentMenu.Visible=!0,this.MenuChange.emit(this.ParentMenu,!1),this.MenuClose.emit(!1)):this.CloseableByUser&&(this.Visible=!1,this.CleanUp(!0),this.MenuClose.emit(!1))}BindMenuToItem(e,t){this.MenuItems.includes(t)||this.AddItem(t),e.ParentMenu=this,e.ParentItem=t,this.Children.set(t.Id,e)}AddSubMenu(e,t){this.BindMenuToItem(e,t)}ReleaseMenuFromItem(e){if(!this.Children.has(e.Id))return!1;const t=this.Children.get(e.Id);return t.ParentItem=null,t.ParentMenu=null,this.Children.delete(e.Id),!0}UpdateDescriptionCaption(){this.MenuItems.length&&(this._descriptionText.Caption=this.MenuItems[this._activeItem%this.MenuItems.length].Description,this._descriptionText.Wrap=400,this._recalculateDescriptionNextFrame++)}CalculateDescription(){if(!(this.MenuItems.length<=0)&&(this._recalculateDescriptionNextFrame>0&&this._recalculateDescriptionNextFrame--,this.RecalculateDescriptionPosition(),this.MenuItems.length>0&&this._descriptionText.Caption&&""!==this.MenuItems[this._activeItem%this.MenuItems.length].Description.trim())){const e=k.GetLineCount(this._descriptionText.Caption,this._descriptionText.Pos,this._descriptionText.Font,this._descriptionText.Scale,this._descriptionText.Wrap);this._descriptionRectangle.Size=new y(431+this.WidthOffset,25*e+15),0===e&&this._recalculateDescriptionNextFrame++}}UpdateScaleform(){if(!this.Visible||!this._buttonsEnabled)return;this._instructionalButtonsScaleform.callFunction("CLEAR_ALL"),this._instructionalButtonsScaleform.callFunction("TOGGLE_MOUSE_BUTTONS",0),this._instructionalButtonsScaleform.callFunction("CREATE_CONTAINER"),this._instructionalButtonsScaleform.callFunction("SET_DATA_SLOT",0,c.getControlInstructionalButton(2,H.PhoneSelect,!1),this.SelectTextLocalized),this._instructionalButtonsScaleform.callFunction("SET_DATA_SLOT",1,c.getControlInstructionalButton(2,H.PhoneCancel,!1),this.BackTextLocalized);let e=2;this._instructionalButtons.filter(e=>null==e.ItemBind||this.MenuItems[this.CurrentSelection]==e.ItemBind).forEach(t=>{this._instructionalButtonsScaleform.callFunction("SET_DATA_SLOT",e,t.GetButtonId(),t.Text),e++}),this._instructionalButtonsScaleform.callFunction("DRAW_INSTRUCTIONAL_BUTTONS",-1)}render(){if(!this.Visible)return;this._buttonsEnabled&&(c.drawScaleformMovieFullscreen(this._instructionalButtonsScaleform.handle,255,255,255,255,0),c.hideHudComponentThisFrame(6),c.hideHudComponentThisFrame(7),c.hideHudComponentThisFrame(9)),this._justOpened&&(null==this._bannerSprite||this._bannerSprite.IsTextureDictionaryLoaded||this._bannerSprite.LoadTextureDictionary(),this._background.IsTextureDictionaryLoaded||this._background.LoadTextureDictionary(),this._descriptionRectangle.IsTextureDictionaryLoaded||this._descriptionRectangle.LoadTextureDictionary(),this._upAndDownSprite.IsTextureDictionaryLoaded||this._upAndDownSprite.LoadTextureDictionary(),this._recalculateDescriptionNextFrame||this._recalculateDescriptionNextFrame++),this._mainMenu.Draw(),this.ProcessMouse(),this.ProcessControl(),this._background.Size=this.MenuItems.length>this._maxItemsOnScreen+1?new y(431+this.WidthOffset,38*(this._maxItemsOnScreen+1)):new y(431+this.WidthOffset,38*this.MenuItems.length),this._background.Draw(),this._recalculateDescriptionNextFrame&&this.CalculateDescription(),this.MenuItems.length>0&&(this.MenuItems[this._activeItem%this.MenuItems.length].Selected=!0,""!==this.MenuItems[this._activeItem%this.MenuItems.length].Description.trim()&&(this._descriptionBar.Draw(),this._descriptionRectangle.Draw(),this._descriptionText.Draw()));let e=0;if(this.MenuItems.length<=this._maxItemsOnScreen+1){for(const t of this.MenuItems)t.SetVerticalPosition(38*e-37+this._extraOffset),t.Draw(),e++;this._counterText&&this._counterOverride&&(this._counterText.Caption=this._counterPretext+this._counterOverride,this._counterText.Draw())}else{for(let t=this._minItem;t<=this._maxItem;t++){let i=this.MenuItems[t];i.SetVerticalPosition(38*e-37+this._extraOffset),i.Draw(),e++}if(this._extraRectangleUp.Size=new y(431+this.WidthOffset,18),this._extraRectangleDown.Size=new y(431+this.WidthOffset,18),this._upAndDownSprite.Pos=new F(190+this._offset.X+this.WidthOffset/2,147+37*(this._maxItemsOnScreen+1)+this._offset.Y-37+this._extraOffset),this._extraRectangleUp.Draw(),this._extraRectangleDown.Draw(),this._upAndDownSprite.Draw(),this._counterText){if(this._counterOverride)this._counterText.Caption=this._counterPretext+this._counterOverride;else{const e=this.CurrentSelection+1+" / "+this.MenuItems.length;this._counterText.Caption=this._counterPretext+e}this._counterText.Draw()}}null!=this._bannerRectangle&&this._bannerRectangle.Draw(),null!=this._bannerSprite&&this._bannerSprite.Draw()}}export default _e;export{P as Alignment,I as BadgeStyle,oe as BigMessage,N as ChangeDirection,V as Color,H as Control,g as Font,x as HudColor,se as InstructionalButton,j as ItemsCollection,J as ListItem,_e as Menu,re as MidsizedMessage,F as Point,G as ResRectangle,y as Size,v as Sprite,q as UIMenuAutoListItem,Z as UIMenuCheckboxItem,ae as UIMenuDynamicListItem,z as UIMenuItem,$ as UIMenuListItem,Q as UIMenuSliderItem}; diff --git a/client/includes/nativeui/types/NativeUi.d.ts b/client/includes/nativeui/types/NativeUi.d.ts new file mode 100644 index 0000000..0c2e9ef --- /dev/null +++ b/client/includes/nativeui/types/NativeUi.d.ts @@ -0,0 +1,141 @@ +import BadgeStyle from "./enums/BadgeStyle"; +import Font from "./enums/Font"; +import Alignment from './enums/Alignment'; +import Control from './enums/Control'; +import HudColor from './enums/HudColor'; +import ChangeDirection from './enums/ChangeDirection'; +import UIMenuCheckboxItem from "./items/UIMenuCheckboxItem"; +import UIMenuItem from "./items/UIMenuItem"; +import UIMenuListItem from "./items/UIMenuListItem"; +import UIMenuAutoListItem from "./items/UIMenuAutoListItem"; +import UIMenuSliderItem from "./items/UIMenuSliderItem"; +import ItemsCollection from "./modules/ItemsCollection"; +import ListItem from "./modules/ListItem"; +import ResRectangle from "./modules/ResRectangle"; +import ResText from "./modules/ResText"; +import Sprite from "./modules/Sprite"; +import Color from "./utils/Color"; +import LiteEvent from "./utils/LiteEvent"; +import Point from "./utils/Point"; +import Size from "./utils/Size"; +import InstructionalButton from './modules/InstructionalButton'; +import BigMessage from './modules/BigMessage'; +import MidsizedMessage from './modules/MidsizedMessage'; +import UIMenuDynamicListItem from './items/UIMenuDynamicListItem'; +export default class NativeUI { + private _visible; + private _counterPretext; + private _counterOverride; + private _spriteLibrary; + private _spriteName; + private _offset; + private _lastUpDownNavigation; + private _lastLeftRightNavigation; + private _extraOffset; + private _buttonsEnabled; + private _justOpened; + private _justOpenedFromPool; + private _justClosedFromPool; + private _poolOpening; + private _safezoneOffset; + private _activeItem; + private _maxItemsOnScreen; + private _minItem; + private _maxItem; + private _mouseEdgeEnabled; + private _bannerSprite; + private _bannerRectangle; + private _recalculateDescriptionNextFrame; + private readonly _instructionalButtons; + private readonly _instructionalButtonsScaleform; + private readonly _defaultTitleScale; + private readonly _maxMenuItems; + private readonly _mainMenu; + private readonly _upAndDownSprite; + private readonly _titleResText; + private readonly _subtitleResText; + private readonly _extraRectangleUp; + private readonly _extraRectangleDown; + private readonly _descriptionBar; + private readonly _descriptionRectangle; + private readonly _descriptionText; + private readonly _counterText; + private readonly _background; + readonly Id: string; + readonly SelectTextLocalized: string; + readonly BackTextLocalized: string; + WidthOffset: number; + ParentMenu: NativeUI; + ParentItem: UIMenuItem; + Children: Map; + MouseControlsEnabled: boolean; + CloseableByUser: boolean; + AUDIO_LIBRARY: string; + AUDIO_UPDOWN: string; + AUDIO_LEFTRIGHT: string; + AUDIO_SELECT: string; + AUDIO_BACK: string; + AUDIO_ERROR: string; + MenuItems: (UIMenuItem | UIMenuListItem | UIMenuAutoListItem | UIMenuDynamicListItem | UIMenuSliderItem | UIMenuCheckboxItem)[]; + readonly IndexChange: LiteEvent; + readonly ListChange: LiteEvent; + readonly AutoListChange: LiteEvent; + readonly DynamicListChange: LiteEvent; + readonly SliderChange: LiteEvent; + readonly CheckboxChange: LiteEvent; + readonly ItemSelect: LiteEvent; + readonly MenuOpen: LiteEvent; + readonly MenuClose: LiteEvent; + readonly MenuChange: LiteEvent; + GetSpriteBanner(): Sprite; + GetRectangleBanner(): ResRectangle; + GetTitle(): ResText; + get MaxItemsVisible(): number; + set MaxItemsVisible(value: number); + get Title(): string; + set Title(text: string); + get GetSubTitle(): ResText; + get SubTitle(): string; + set SubTitle(text: string); + get Visible(): boolean; + set Visible(toggle: boolean); + get CurrentSelection(): number; + set CurrentSelection(v: number); + constructor(title: string, subtitle: string, offset: Point, spriteLibrary?: string, spriteName?: string); + DisableInstructionalButtons(disable: boolean): void; + AddInstructionalButton(button: InstructionalButton): void; + SetSpriteBannerType(spriteBanner: Sprite): void; + SetRectangleBannerType(rectangle: ResRectangle): void; + AddSpriteBannerType(spriteBanner: Sprite): void; + SetNoBannerType(): void; + RemoveInstructionalButton(button: InstructionalButton): void; + private RecalculateDescriptionPosition; + SetMenuWidthOffset(widthOffset: number): void; + AddItem(item: UIMenuItem): void; + RemoveItem(item: UIMenuItem): void; + RefreshIndex(): void; + Clear(): void; + Open(): void; + private CleanUp; + Close(closeChildren?: boolean): void; + GoLeft(): void; + GoRight(): void; + SelectItem(): void; + HasCurrentSelectionChildren(): boolean; + IsMouseInListItemArrows(item: UIMenuItem, topLeft: Point, safezone: any): 0 | 1 | 2; + ProcessMouse(): void; + ProcessControl(): void; + GoUpOverflow(): void; + GoUp(): void; + GoDownOverflow(): void; + GoDown(): void; + GoBack(): void; + BindMenuToItem(menuToBind: NativeUI, itemToBindTo: UIMenuItem): void; + AddSubMenu(subMenu: NativeUI, itemToBindTo: UIMenuItem): void; + ReleaseMenuFromItem(releaseFrom: UIMenuItem): boolean; + UpdateDescriptionCaption(): void; + CalculateDescription(): void; + UpdateScaleform(): void; + private render; +} +export { NativeUI as Menu, UIMenuItem, UIMenuListItem, UIMenuAutoListItem, UIMenuDynamicListItem, UIMenuCheckboxItem, UIMenuSliderItem, BadgeStyle, ChangeDirection, Font, Alignment, Control, HudColor, Sprite, ResRectangle, InstructionalButton, Point, Size, Color, ItemsCollection, ListItem, BigMessage, MidsizedMessage }; diff --git a/client/includes/nativeui/types/enums/Alignment.d.ts b/client/includes/nativeui/types/enums/Alignment.d.ts new file mode 100644 index 0000000..43591fb --- /dev/null +++ b/client/includes/nativeui/types/enums/Alignment.d.ts @@ -0,0 +1,6 @@ +export declare enum Alignment { + Left = 0, + Centered = 1, + Right = 2 +} +export default Alignment; diff --git a/client/includes/nativeui/types/enums/BadgeStyle.d.ts b/client/includes/nativeui/types/enums/BadgeStyle.d.ts new file mode 100644 index 0000000..1caa298 --- /dev/null +++ b/client/includes/nativeui/types/enums/BadgeStyle.d.ts @@ -0,0 +1,34 @@ +declare enum BadgeStyle { + None = 0, + BronzeMedal = 1, + GoldMedal = 2, + SilverMedal = 3, + Alert = 4, + Crown = 5, + Ammo = 6, + Armour = 7, + Barber = 8, + Clothes = 9, + Franklin = 10, + Bike = 11, + Car = 12, + Gun = 13, + Heart = 14, + Makeup = 15, + Mask = 16, + Michael = 17, + Star = 18, + Tattoo = 19, + Trevor = 20, + Lock = 21, + Tick = 22, + Sale = 23, + ArrowLeft = 24, + ArrowRight = 25, + Audio1 = 26, + Audio2 = 27, + Audio3 = 28, + AudioInactive = 29, + AudioMute = 30 +} +export default BadgeStyle; diff --git a/client/includes/nativeui/types/enums/ChangeDirection.d.ts b/client/includes/nativeui/types/enums/ChangeDirection.d.ts new file mode 100644 index 0000000..e8f81d5 --- /dev/null +++ b/client/includes/nativeui/types/enums/ChangeDirection.d.ts @@ -0,0 +1,5 @@ +declare enum ChangeDirection { + Left = 0, + Right = 1 +} +export default ChangeDirection; diff --git a/client/includes/nativeui/types/enums/Control.d.ts b/client/includes/nativeui/types/enums/Control.d.ts new file mode 100644 index 0000000..7f8e9e9 --- /dev/null +++ b/client/includes/nativeui/types/enums/Control.d.ts @@ -0,0 +1,349 @@ +declare enum Control { + NextCamera = 0, + LookLeftRight = 1, + LookUpDown = 2, + LookUpOnly = 3, + LookDownOnly = 4, + LookLeftOnly = 5, + LookRightOnly = 6, + CinematicSlowMo = 7, + FlyUpDown = 8, + FlyLeftRight = 9, + ScriptedFlyZUp = 10, + ScriptedFlyZDown = 11, + WeaponWheelUpDown = 12, + WeaponWheelLeftRight = 13, + WeaponWheelNext = 14, + WeaponWheelPrev = 15, + SelectNextWeapon = 16, + SelectPrevWeapon = 17, + SkipCutscene = 18, + CharacterWheel = 19, + MultiplayerInfo = 20, + Sprint = 21, + Jump = 22, + Enter = 23, + Attack = 24, + Aim = 25, + LookBehind = 26, + Phone = 27, + SpecialAbility = 28, + SpecialAbilitySecondary = 29, + MoveLeftRight = 30, + MoveUpDown = 31, + MoveUpOnly = 32, + MoveDownOnly = 33, + MoveLeftOnly = 34, + MoveRightOnly = 35, + Duck = 36, + SelectWeapon = 37, + Pickup = 38, + SniperZoom = 39, + SniperZoomInOnly = 40, + SniperZoomOutOnly = 41, + SniperZoomInSecondary = 42, + SniperZoomOutSecondary = 43, + Cover = 44, + Reload = 45, + Talk = 46, + Detonate = 47, + HUDSpecial = 48, + Arrest = 49, + AccurateAim = 50, + Context = 51, + ContextSecondary = 52, + WeaponSpecial = 53, + WeaponSpecial2 = 54, + Dive = 55, + DropWeapon = 56, + DropAmmo = 57, + ThrowGrenade = 58, + VehicleMoveLeftRight = 59, + VehicleMoveUpDown = 60, + VehicleMoveUpOnly = 61, + VehicleMoveDownOnly = 62, + VehicleMoveLeftOnly = 63, + VehicleMoveRightOnly = 64, + VehicleSpecial = 65, + VehicleGunLeftRight = 66, + VehicleGunUpDown = 67, + VehicleAim = 68, + VehicleAttack = 69, + VehicleAttack2 = 70, + VehicleAccelerate = 71, + VehicleBrake = 72, + VehicleDuck = 73, + VehicleHeadlight = 74, + VehicleExit = 75, + VehicleHandbrake = 76, + VehicleHotwireLeft = 77, + VehicleHotwireRight = 78, + VehicleLookBehind = 79, + VehicleCinCam = 80, + VehicleNextRadio = 81, + VehiclePrevRadio = 82, + VehicleNextRadioTrack = 83, + VehiclePrevRadioTrack = 84, + VehicleRadioWheel = 85, + VehicleHorn = 86, + VehicleFlyThrottleUp = 87, + VehicleFlyThrottleDown = 88, + VehicleFlyYawLeft = 89, + VehicleFlyYawRight = 90, + VehiclePassengerAim = 91, + VehiclePassengerAttack = 92, + VehicleSpecialAbilityFranklin = 93, + VehicleStuntUpDown = 94, + VehicleCinematicUpDown = 95, + VehicleCinematicUpOnly = 96, + VehicleCinematicDownOnly = 97, + VehicleCinematicLeftRight = 98, + VehicleSelectNextWeapon = 99, + VehicleSelectPrevWeapon = 100, + VehicleRoof = 101, + VehicleJump = 102, + VehicleGrapplingHook = 103, + VehicleShuffle = 104, + VehicleDropProjectile = 105, + VehicleMouseControlOverride = 106, + VehicleFlyRollLeftRight = 107, + VehicleFlyRollLeftOnly = 108, + VehicleFlyRollRightOnly = 109, + VehicleFlyPitchUpDown = 110, + VehicleFlyPitchUpOnly = 111, + VehicleFlyPitchDownOnly = 112, + VehicleFlyUnderCarriage = 113, + VehicleFlyAttack = 114, + VehicleFlySelectNextWeapon = 115, + VehicleFlySelectPrevWeapon = 116, + VehicleFlySelectTargetLeft = 117, + VehicleFlySelectTargetRight = 118, + VehicleFlyVerticalFlightMode = 119, + VehicleFlyDuck = 120, + VehicleFlyAttackCamera = 121, + VehicleFlyMouseControlOverride = 122, + VehicleSubTurnLeftRight = 123, + VehicleSubTurnLeftOnly = 124, + VehicleSubTurnRightOnly = 125, + VehicleSubPitchUpDown = 126, + VehicleSubPitchUpOnly = 127, + VehicleSubPitchDownOnly = 128, + VehicleSubThrottleUp = 129, + VehicleSubThrottleDown = 130, + VehicleSubAscend = 131, + VehicleSubDescend = 132, + VehicleSubTurnHardLeft = 133, + VehicleSubTurnHardRight = 134, + VehicleSubMouseControlOverride = 135, + VehiclePushbikePedal = 136, + VehiclePushbikeSprint = 137, + VehiclePushbikeFrontBrake = 138, + VehiclePushbikeRearBrake = 139, + MeleeAttackLight = 140, + MeleeAttackHeavy = 141, + MeleeAttackAlternate = 142, + MeleeBlock = 143, + ParachuteDeploy = 144, + ParachuteDetach = 145, + ParachuteTurnLeftRight = 146, + ParachuteTurnLeftOnly = 147, + ParachuteTurnRightOnly = 148, + ParachutePitchUpDown = 149, + ParachutePitchUpOnly = 150, + ParachutePitchDownOnly = 151, + ParachuteBrakeLeft = 152, + ParachuteBrakeRight = 153, + ParachuteSmoke = 154, + ParachutePrecisionLanding = 155, + Map = 156, + SelectWeaponUnarmed = 157, + SelectWeaponMelee = 158, + SelectWeaponHandgun = 159, + SelectWeaponShotgun = 160, + SelectWeaponSmg = 161, + SelectWeaponAutoRifle = 162, + SelectWeaponSniper = 163, + SelectWeaponHeavy = 164, + SelectWeaponSpecial = 165, + SelectCharacterMichael = 166, + SelectCharacterFranklin = 167, + SelectCharacterTrevor = 168, + SelectCharacterMultiplayer = 169, + SaveReplayClip = 170, + SpecialAbilityPC = 171, + PhoneUp = 172, + PhoneDown = 173, + PhoneLeft = 174, + PhoneRight = 175, + PhoneSelect = 176, + PhoneCancel = 177, + PhoneOption = 178, + PhoneExtraOption = 179, + PhoneScrollForward = 180, + PhoneScrollBackward = 181, + PhoneCameraFocusLock = 182, + PhoneCameraGrid = 183, + PhoneCameraSelfie = 184, + PhoneCameraDOF = 185, + PhoneCameraExpression = 186, + FrontendDown = 187, + FrontendUp = 188, + FrontendLeft = 189, + FrontendRight = 190, + FrontendRdown = 191, + FrontendRup = 192, + FrontendRleft = 193, + FrontendRright = 194, + FrontendAxisX = 195, + FrontendAxisY = 196, + FrontendRightAxisX = 197, + FrontendRightAxisY = 198, + FrontendPause = 199, + FrontendPauseAlternate = 200, + FrontendAccept = 201, + FrontendCancel = 202, + FrontendX = 203, + FrontendY = 204, + FrontendLb = 205, + FrontendRb = 206, + FrontendLt = 207, + FrontendRt = 208, + FrontendLs = 209, + FrontendRs = 210, + FrontendLeaderboard = 211, + FrontendSocialClub = 212, + FrontendSocialClubSecondary = 213, + FrontendDelete = 214, + FrontendEndscreenAccept = 215, + FrontendEndscreenExpand = 216, + FrontendSelect = 217, + ScriptLeftAxisX = 218, + ScriptLeftAxisY = 219, + ScriptRightAxisX = 220, + ScriptRightAxisY = 221, + ScriptRUp = 222, + ScriptRDown = 223, + ScriptRLeft = 224, + ScriptRRight = 225, + ScriptLB = 226, + ScriptRB = 227, + ScriptLT = 228, + ScriptRT = 229, + ScriptLS = 230, + ScriptRS = 231, + ScriptPadUp = 232, + ScriptPadDown = 233, + ScriptPadLeft = 234, + ScriptPadRight = 235, + ScriptSelect = 236, + CursorAccept = 237, + CursorCancel = 238, + CursorX = 239, + CursorY = 240, + CursorScrollUp = 241, + CursorScrollDown = 242, + EnterCheatCode = 243, + InteractionMenu = 244, + MpTextChatAll = 245, + MpTextChatTeam = 246, + MpTextChatFriends = 247, + MpTextChatCrew = 248, + PushToTalk = 249, + CreatorLS = 250, + CreatorRS = 251, + CreatorLT = 252, + CreatorRT = 253, + CreatorMenuToggle = 254, + CreatorAccept = 255, + CreatorDelete = 256, + Attack2 = 257, + RappelJump = 258, + RappelLongJump = 259, + RappelSmashWindow = 260, + PrevWeapon = 261, + NextWeapon = 262, + MeleeAttack1 = 263, + MeleeAttack2 = 264, + Whistle = 265, + MoveLeft = 266, + MoveRight = 267, + MoveUp = 268, + MoveDown = 269, + LookLeft = 270, + LookRight = 271, + LookUp = 272, + LookDown = 273, + SniperZoomIn = 274, + SniperZoomOut = 275, + SniperZoomInAlternate = 276, + SniperZoomOutAlternate = 277, + VehicleMoveLeft = 278, + VehicleMoveRight = 279, + VehicleMoveUp = 280, + VehicleMoveDown = 281, + VehicleGunLeft = 282, + VehicleGunRight = 283, + VehicleGunUp = 284, + VehicleGunDown = 285, + VehicleLookLeft = 286, + VehicleLookRight = 287, + ReplayStartStopRecording = 288, + ReplayStartStopRecordingSecondary = 289, + ScaledLookLeftRight = 290, + ScaledLookUpDown = 291, + ScaledLookUpOnly = 292, + ScaledLookDownOnly = 293, + ScaledLookLeftOnly = 294, + ScaledLookRightOnly = 295, + ReplayMarkerDelete = 296, + ReplayClipDelete = 297, + ReplayPause = 298, + ReplayRewind = 299, + ReplayFfwd = 300, + ReplayNewmarker = 301, + ReplayRecord = 302, + ReplayScreenshot = 303, + ReplayHidehud = 304, + ReplayStartpoint = 305, + ReplayEndpoint = 306, + ReplayAdvance = 307, + ReplayBack = 308, + ReplayTools = 309, + ReplayRestart = 310, + ReplayShowhotkey = 311, + ReplayCycleMarkerLeft = 312, + ReplayCycleMarkerRight = 313, + ReplayFOVIncrease = 314, + ReplayFOVDecrease = 315, + ReplayCameraUp = 316, + ReplayCameraDown = 317, + ReplaySave = 318, + ReplayToggletime = 319, + ReplayToggletips = 320, + ReplayPreview = 321, + ReplayToggleTimeline = 322, + ReplayTimelinePickupClip = 323, + ReplayTimelineDuplicateClip = 324, + ReplayTimelinePlaceClip = 325, + ReplayCtrl = 326, + ReplayTimelineSave = 327, + ReplayPreviewAudio = 328, + VehicleDriveLook = 329, + VehicleDriveLook2 = 330, + VehicleFlyAttack2 = 331, + RadioWheelUpDown = 332, + RadioWheelLeftRight = 333, + VehicleSlowMoUpDown = 334, + VehicleSlowMoUpOnly = 335, + VehicleSlowMoDownOnly = 336, + MapPointOfInterest = 337, + ReplaySnapmaticPhoto = 338, + VehicleCarJump = 339, + VehicleRocketBoost = 340, + VehicleParachute = 341, + VehicleBikeWings = 342, + VehicleFlyBombBay = 343, + VehicleFlyCounter = 344, + VehicleFlyTransform = 345 +} +export default Control; diff --git a/client/includes/nativeui/types/enums/Font.d.ts b/client/includes/nativeui/types/enums/Font.d.ts new file mode 100644 index 0000000..34cbba3 --- /dev/null +++ b/client/includes/nativeui/types/enums/Font.d.ts @@ -0,0 +1,8 @@ +declare enum Font { + ChaletLondon = 0, + HouseScript = 1, + Monospace = 2, + CharletComprimeColonge = 4, + Pricedown = 7 +} +export default Font; diff --git a/client/includes/nativeui/types/enums/HudColor.d.ts b/client/includes/nativeui/types/enums/HudColor.d.ts new file mode 100644 index 0000000..2da252a --- /dev/null +++ b/client/includes/nativeui/types/enums/HudColor.d.ts @@ -0,0 +1,183 @@ +declare enum HudColor { + HUD_COLOUR_PURE_WHITE = 0, + HUD_COLOUR_WHITE = 1, + HUD_COLOUR_BLACK = 2, + HUD_COLOUR_GREY = 3, + HUD_COLOUR_GREYLIGHT = 4, + HUD_COLOUR_GREYDARK = 5, + HUD_COLOUR_RED = 6, + HUD_COLOUR_REDLIGHT = 7, + HUD_COLOUR_REDDARK = 8, + HUD_COLOUR_BLUE = 9, + HUD_COLOUR_BLUELIGHT = 10, + HUD_COLOUR_BLUEDARK = 11, + HUD_COLOUR_YELLOW = 12, + HUD_COLOUR_YELLOWLIGHT = 13, + HUD_COLOUR_YELLOWDARK = 14, + HUD_COLOUR_ORANGE = 15, + HUD_COLOUR_ORANGELIGHT = 16, + HUD_COLOUR_ORANGEDARK = 17, + HUD_COLOUR_GREEN = 18, + HUD_COLOUR_GREENLIGHT = 19, + HUD_COLOUR_GREENDARK = 20, + HUD_COLOUR_PURPLE = 21, + HUD_COLOUR_PURPLELIGHT = 22, + HUD_COLOUR_PURPLEDARK = 23, + HUD_COLOUR_PINK = 24, + HUD_COLOUR_RADAR_HEALTH = 25, + HUD_COLOUR_RADAR_ARMOUR = 26, + HUD_COLOUR_RADAR_DAMAGE = 27, + HUD_COLOUR_NET_PLAYER1 = 28, + HUD_COLOUR_NET_PLAYER2 = 29, + HUD_COLOUR_NET_PLAYER3 = 30, + HUD_COLOUR_NET_PLAYER4 = 31, + HUD_COLOUR_NET_PLAYER5 = 32, + HUD_COLOUR_NET_PLAYER6 = 33, + HUD_COLOUR_NET_PLAYER7 = 34, + HUD_COLOUR_NET_PLAYER8 = 35, + HUD_COLOUR_NET_PLAYER9 = 36, + HUD_COLOUR_NET_PLAYER10 = 37, + HUD_COLOUR_NET_PLAYER11 = 38, + HUD_COLOUR_NET_PLAYER12 = 39, + HUD_COLOUR_NET_PLAYER13 = 40, + HUD_COLOUR_NET_PLAYER14 = 41, + HUD_COLOUR_NET_PLAYER15 = 42, + HUD_COLOUR_NET_PLAYER16 = 43, + HUD_COLOUR_NET_PLAYER17 = 44, + HUD_COLOUR_NET_PLAYER18 = 45, + HUD_COLOUR_NET_PLAYER19 = 46, + HUD_COLOUR_NET_PLAYER20 = 47, + HUD_COLOUR_NET_PLAYER21 = 48, + HUD_COLOUR_NET_PLAYER22 = 49, + HUD_COLOUR_NET_PLAYER23 = 50, + HUD_COLOUR_NET_PLAYER24 = 51, + HUD_COLOUR_NET_PLAYER25 = 52, + HUD_COLOUR_NET_PLAYER26 = 53, + HUD_COLOUR_NET_PLAYER27 = 54, + HUD_COLOUR_NET_PLAYER28 = 55, + HUD_COLOUR_NET_PLAYER29 = 56, + HUD_COLOUR_NET_PLAYER30 = 57, + HUD_COLOUR_NET_PLAYER31 = 58, + HUD_COLOUR_NET_PLAYER32 = 59, + HUD_COLOUR_SIMPLEBLIP_DEFAULT = 60, + HUD_COLOUR_MENU_BLUE = 61, + HUD_COLOUR_MENU_GREY_LIGHT = 62, + HUD_COLOUR_MENU_BLUE_EXTRA_DARK = 63, + HUD_COLOUR_MENU_YELLOW = 64, + HUD_COLOUR_MENU_YELLOW_DARK = 65, + HUD_COLOUR_MENU_GREEN = 66, + HUD_COLOUR_MENU_GREY = 67, + HUD_COLOUR_MENU_GREY_DARK = 68, + HUD_COLOUR_MENU_HIGHLIGHT = 69, + HUD_COLOUR_MENU_STANDARD = 70, + HUD_COLOUR_MENU_DIMMED = 71, + HUD_COLOUR_MENU_EXTRA_DIMMED = 72, + HUD_COLOUR_BRIEF_TITLE = 73, + HUD_COLOUR_MID_GREY_MP = 74, + HUD_COLOUR_NET_PLAYER1_DARK = 75, + HUD_COLOUR_NET_PLAYER2_DARK = 76, + HUD_COLOUR_NET_PLAYER3_DARK = 77, + HUD_COLOUR_NET_PLAYER4_DARK = 78, + HUD_COLOUR_NET_PLAYER5_DARK = 79, + HUD_COLOUR_NET_PLAYER6_DARK = 80, + HUD_COLOUR_NET_PLAYER7_DARK = 81, + HUD_COLOUR_NET_PLAYER8_DARK = 82, + HUD_COLOUR_NET_PLAYER9_DARK = 83, + HUD_COLOUR_NET_PLAYER10_DARK = 84, + HUD_COLOUR_NET_PLAYER11_DARK = 85, + HUD_COLOUR_NET_PLAYER12_DARK = 86, + HUD_COLOUR_NET_PLAYER13_DARK = 87, + HUD_COLOUR_NET_PLAYER14_DARK = 88, + HUD_COLOUR_NET_PLAYER15_DARK = 89, + HUD_COLOUR_NET_PLAYER16_DARK = 90, + HUD_COLOUR_NET_PLAYER17_DARK = 91, + HUD_COLOUR_NET_PLAYER18_DARK = 92, + HUD_COLOUR_NET_PLAYER19_DARK = 93, + HUD_COLOUR_NET_PLAYER20_DARK = 94, + HUD_COLOUR_NET_PLAYER21_DARK = 95, + HUD_COLOUR_NET_PLAYER22_DARK = 96, + HUD_COLOUR_NET_PLAYER23_DARK = 97, + HUD_COLOUR_NET_PLAYER24_DARK = 98, + HUD_COLOUR_NET_PLAYER25_DARK = 99, + HUD_COLOUR_NET_PLAYER26_DARK = 100, + HUD_COLOUR_NET_PLAYER27_DARK = 101, + HUD_COLOUR_NET_PLAYER28_DARK = 102, + HUD_COLOUR_NET_PLAYER29_DARK = 103, + HUD_COLOUR_NET_PLAYER30_DARK = 104, + HUD_COLOUR_NET_PLAYER31_DARK = 105, + HUD_COLOUR_NET_PLAYER32_DARK = 106, + HUD_COLOUR_BRONZE = 107, + HUD_COLOUR_SILVER = 108, + HUD_COLOUR_GOLD = 109, + HUD_COLOUR_PLATINUM = 110, + HUD_COLOUR_GANG1 = 111, + HUD_COLOUR_GANG2 = 112, + HUD_COLOUR_GANG3 = 113, + HUD_COLOUR_GANG4 = 114, + HUD_COLOUR_SAME_CREW = 115, + HUD_COLOUR_FREEMODE = 116, + HUD_COLOUR_PAUSE_BG = 117, + HUD_COLOUR_FRIENDLY = 118, + HUD_COLOUR_ENEMY = 119, + HUD_COLOUR_LOCATION = 120, + HUD_COLOUR_PICKUP = 121, + HUD_COLOUR_PAUSE_SINGLEPLAYER = 122, + HUD_COLOUR_FREEMODE_DARK = 123, + HUD_COLOUR_INACTIVE_MISSION = 124, + HUD_COLOUR_DAMAGE = 125, + HUD_COLOUR_PINKLIGHT = 126, + HUD_COLOUR_PM_MITEM_HIGHLIGHT = 127, + HUD_COLOUR_SCRIPT_VARIABLE = 128, + HUD_COLOUR_YOGA = 129, + HUD_COLOUR_TENNIS = 130, + HUD_COLOUR_GOLF = 131, + HUD_COLOUR_SHOOTING_RANGE = 132, + HUD_COLOUR_FLIGHT_SCHOOL = 133, + HUD_COLOUR_NORTH_BLUE = 134, + HUD_COLOUR_SOCIAL_CLUB = 135, + HUD_COLOUR_PLATFORM_BLUE = 136, + HUD_COLOUR_PLATFORM_GREEN = 137, + HUD_COLOUR_PLATFORM_GREY = 138, + HUD_COLOUR_FACEBOOK_BLUE = 139, + HUD_COLOUR_INGAME_BG = 140, + HUD_COLOUR_DARTS = 141, + HUD_COLOUR_WAYPOINT = 142, + HUD_COLOUR_MICHAEL = 143, + HUD_COLOUR_FRANKLIN = 144, + HUD_COLOUR_TREVOR = 145, + HUD_COLOUR_GOLF_P1 = 146, + HUD_COLOUR_GOLF_P2 = 147, + HUD_COLOUR_GOLF_P3 = 148, + HUD_COLOUR_GOLF_P4 = 149, + HUD_COLOUR_WAYPOINTLIGHT = 150, + HUD_COLOUR_WAYPOINTDARK = 151, + HUD_COLOUR_PANEL_LIGHT = 152, + HUD_COLOUR_MICHAEL_DARK = 153, + HUD_COLOUR_FRANKLIN_DARK = 154, + HUD_COLOUR_TREVOR_DARK = 155, + HUD_COLOUR_OBJECTIVE_ROUTE = 156, + HUD_COLOUR_PAUSEMAP_TINT = 157, + HUD_COLOUR_PAUSE_DESELECT = 158, + HUD_COLOUR_PM_WEAPONS_PURCHASABLE = 159, + HUD_COLOUR_PM_WEAPONS_LOCKED = 160, + HUD_COLOUR_END_SCREEN_BG = 161, + HUD_COLOUR_CHOP = 162, + HUD_COLOUR_PAUSEMAP_TINT_HALF = 163, + HUD_COLOUR_NORTH_BLUE_OFFICIAL = 164, + HUD_COLOUR_SCRIPT_VARIABLE_2 = 165, + HUD_COLOUR_H = 166, + HUD_COLOUR_HDARK = 167, + HUD_COLOUR_T = 168, + HUD_COLOUR_TDARK = 169, + HUD_COLOUR_HSHARD = 170, + HUD_COLOUR_CONTROLLER_MICHAEL = 171, + HUD_COLOUR_CONTROLLER_FRANKLIN = 172, + HUD_COLOUR_CONTROLLER_TREVOR = 173, + HUD_COLOUR_CONTROLLER_CHOP = 174, + HUD_COLOUR_VIDEO_EDITOR_VIDEO = 175, + HUD_COLOUR_VIDEO_EDITOR_AUDIO = 176, + HUD_COLOUR_VIDEO_EDITOR_TEXT = 177, + HUD_COLOUR_HB_BLUE = 178, + HUD_COLOUR_HB_YELLOW = 179 +} +export default HudColor; diff --git a/client/includes/nativeui/types/items/UIMenuAutoListItem.d.ts b/client/includes/nativeui/types/items/UIMenuAutoListItem.d.ts new file mode 100644 index 0000000..f29ff94 --- /dev/null +++ b/client/includes/nativeui/types/items/UIMenuAutoListItem.d.ts @@ -0,0 +1,36 @@ +import BadgeStyle from "../enums/BadgeStyle"; +import ResText from "../modules/ResText"; +import Sprite from "../modules/Sprite"; +import UIMenuItem from "./UIMenuItem"; +export default class UIMenuAutoListItem extends UIMenuItem { + protected _itemText: ResText; + protected _arrowLeft: Sprite; + protected _arrowRight: Sprite; + private _currentOffset; + private _leftMoveThreshold; + private _rightMoveThreshold; + private _lowerThreshold; + private _upperThreshold; + private _preCaptionText; + private _postCaptionText; + private _selectedValue; + get PreCaptionText(): string; + set PreCaptionText(text: string); + get PostCaptionText(): string; + set PostCaptionText(text: string); + get LeftMoveThreshold(): number; + set LeftMoveThreshold(value: number); + get RightMoveThreshold(): number; + set RightMoveThreshold(value: number); + get LowerThreshold(): number; + set LowerThreshold(value: number); + get UpperThreshold(): number; + set UpperThreshold(value: number); + get SelectedValue(): number; + set SelectedValue(value: number); + constructor(text: string, description?: string, lowerThreshold?: number, upperThreshold?: number, startValue?: number, data?: any); + SetVerticalPosition(y: number): void; + SetRightLabel(text: string): this; + SetRightBadge(badge: BadgeStyle): this; + Draw(): void; +} diff --git a/client/includes/nativeui/types/items/UIMenuCheckboxItem.d.ts b/client/includes/nativeui/types/items/UIMenuCheckboxItem.d.ts new file mode 100644 index 0000000..8665610 --- /dev/null +++ b/client/includes/nativeui/types/items/UIMenuCheckboxItem.d.ts @@ -0,0 +1,11 @@ +import BadgeStyle from "../enums/BadgeStyle"; +import UIMenuItem from "./UIMenuItem"; +export default class UIMenuCheckboxItem extends UIMenuItem { + private readonly _checkedSprite; + Checked: boolean; + constructor(text: string, check?: boolean, description?: string); + SetVerticalPosition(y: number): void; + Draw(): void; + SetRightBadge(badge: BadgeStyle): this; + SetRightLabel(text: string): this; +} diff --git a/client/includes/nativeui/types/items/UIMenuDynamicListItem.d.ts b/client/includes/nativeui/types/items/UIMenuDynamicListItem.d.ts new file mode 100644 index 0000000..fb55354 --- /dev/null +++ b/client/includes/nativeui/types/items/UIMenuDynamicListItem.d.ts @@ -0,0 +1,34 @@ +import BadgeStyle from "../enums/BadgeStyle"; +import ChangeDirection from "../enums/ChangeDirection"; +import ResText from "../modules/ResText"; +import Sprite from "../modules/Sprite"; +import UIMenuItem from "./UIMenuItem"; +interface SelectionChangeHandler { + (item: UIMenuDynamicListItem, selectedValue: string, changeDirection: ChangeDirection): string; +} +export default class UIMenuDynamicListItem extends UIMenuItem { + protected _itemText: ResText; + protected _arrowLeft: Sprite; + protected _arrowRight: Sprite; + private _currentOffset; + private _precaptionText; + private _selectedValue; + private readonly _selectedStartValueHandler; + readonly SelectionChangeHandler: SelectionChangeHandler; + SelectionChangeHandlerPromise(item: UIMenuDynamicListItem, selectedValue: string, changeDirection: ChangeDirection): Promise; + get PreCaptionText(): string; + set PreCaptionText(text: string); + get SelectedValue(): string; + set SelectedValue(value: string); + constructor(text: string, selectionChangeHandler: { + (item: UIMenuDynamicListItem, selectedValue: string, changeDirection: ChangeDirection): string; + }, description?: string, selectedStartValueHandler?: { + (): string; + }, data?: any); + SetVerticalPosition(y: number): void; + SetRightLabel(text: string): this; + SetRightBadge(badge: BadgeStyle): this; + Draw(): void; + private isVariableFunction; +} +export {}; diff --git a/client/includes/nativeui/types/items/UIMenuItem.d.ts b/client/includes/nativeui/types/items/UIMenuItem.d.ts new file mode 100644 index 0000000..b1025fb --- /dev/null +++ b/client/includes/nativeui/types/items/UIMenuItem.d.ts @@ -0,0 +1,51 @@ +import BadgeStyle from "../enums/BadgeStyle"; +import NativeUI from "../NativeUi"; +import ResRectangle from "../modules/ResRectangle"; +import ResText from "../modules/ResText"; +import Sprite from "../modules/Sprite"; +import Color from "../utils/Color"; +import Point from "../utils/Point"; +export default class UIMenuItem { + readonly Id: string; + static readonly DefaultBackColor: Color; + static readonly DefaultHighlightedBackColor: Color; + static readonly DefaultForeColor: Color; + static readonly DefaultHighlightedForeColor: Color; + private _event; + protected _rectangle: ResRectangle; + protected _text: ResText; + protected _description: string; + protected _selectedSprite: Sprite; + protected _badgeLeft: Sprite; + protected _badgeRight: Sprite; + protected _labelText: ResText; + BackColor: Color; + HighlightedBackColor: Color; + ForeColor: Color; + HighlightedForeColor: Color; + Enabled: boolean; + Selected: boolean; + Hovered: boolean; + Data: any; + Offset: Point; + Parent: NativeUI; + get Text(): string; + set Text(text: string); + get Description(): string; + set Description(text: string); + RightLabel: string; + LeftBadge: BadgeStyle; + RightBadge: BadgeStyle; + constructor(text: string, description?: string, data?: any); + SetVerticalPosition(y: number): void; + addEvent(event: string, ...args: any[]): void; + fireEvent(): void; + Draw(): void; + SetLeftBadge(badge: BadgeStyle): void; + SetRightBadge(badge: BadgeStyle): void; + SetRightLabel(text: string): void; + BadgeToSpriteLib(badge: BadgeStyle): "commonmenu" | "mpshopsale" | "mpleaderboard"; + BadgeToSpriteName(badge: BadgeStyle, selected: boolean): "" | "mp_medal_bronze" | "mp_medal_gold" | "medal_silver" | "mp_alerttriangle" | "mp_hostcrown" | "shop_ammo_icon_b" | "shop_ammo_icon_a" | "shop_armour_icon_b" | "shop_armour_icon_a" | "shop_barber_icon_b" | "shop_barber_icon_a" | "shop_clothing_icon_b" | "shop_clothing_icon_a" | "shop_franklin_icon_b" | "shop_franklin_icon_a" | "shop_garage_bike_icon_b" | "shop_garage_bike_icon_a" | "shop_garage_icon_b" | "shop_garage_icon_a" | "shop_gunclub_icon_b" | "shop_gunclub_icon_a" | "shop_health_icon_b" | "shop_health_icon_a" | "shop_lock" | "shop_makeup_icon_b" | "shop_makeup_icon_a" | "shop_mask_icon_b" | "shop_mask_icon_a" | "shop_michael_icon_b" | "shop_michael_icon_a" | "shop_new_star" | "shop_tattoos_icon_b" | "shop_tattoos_icon_a" | "shop_tick_icon" | "shop_trevor_icon_b" | "shop_trevor_icon_a" | "saleicon" | "arrowleft" | "arrowright" | "leaderboard_audio_1" | "leaderboard_audio_2" | "leaderboard_audio_3" | "leaderboard_audio_inactive" | "leaderboard_audio_mute"; + IsBagdeWhiteSprite(badge: BadgeStyle): boolean; + BadgeToColor(badge: BadgeStyle, selected: boolean): Color; +} diff --git a/client/includes/nativeui/types/items/UIMenuListItem.d.ts b/client/includes/nativeui/types/items/UIMenuListItem.d.ts new file mode 100644 index 0000000..511f39f --- /dev/null +++ b/client/includes/nativeui/types/items/UIMenuListItem.d.ts @@ -0,0 +1,30 @@ +import BadgeStyle from "../enums/BadgeStyle"; +import ItemsCollection from "../modules/ItemsCollection"; +import ListItem from "../modules/ListItem"; +import ResText from "../modules/ResText"; +import Sprite from "../modules/Sprite"; +import UIMenuItem from "./UIMenuItem"; +export default class UIMenuListItem extends UIMenuItem { + ScrollingEnabled: boolean; + HoldTimeBeforeScroll: number; + protected _itemText: ResText; + protected _arrowLeft: Sprite; + protected _arrowRight: Sprite; + private _currentOffset; + private _itemsCollection; + get Collection(): ListItem[]; + set Collection(v: ListItem[]); + set SelectedItem(v: ListItem); + get SelectedItem(): ListItem; + get SelectedValue(): any; + protected _index: number; + get Index(): number; + set Index(value: number); + constructor(text: string, description?: string, collection?: ItemsCollection, startIndex?: number, data?: any); + setCollection(collection: ItemsCollection): void; + setCollectionItem(index: number, item: ListItem | string, resetSelection?: boolean): void; + SetVerticalPosition(y: number): void; + SetRightLabel(text: string): this; + SetRightBadge(badge: BadgeStyle): this; + Draw(): void; +} diff --git a/client/includes/nativeui/types/items/UIMenuSliderItem.d.ts b/client/includes/nativeui/types/items/UIMenuSliderItem.d.ts new file mode 100644 index 0000000..5c00d33 --- /dev/null +++ b/client/includes/nativeui/types/items/UIMenuSliderItem.d.ts @@ -0,0 +1,19 @@ +import BadgeStyle from "../enums/BadgeStyle"; +import UIMenuItem from "./UIMenuItem"; +export default class UIMenuSliderItem extends UIMenuItem { + private _arrowLeft; + private _arrowRight; + private _rectangleBackground; + private _rectangleSlider; + private _rectangleDivider; + private _items; + private _index; + get Index(): number; + set Index(value: number); + constructor(text: string, items: any[], index: number, description?: string, divider?: boolean, data?: any); + SetVerticalPosition(y: number): void; + IndexToItem(index: number): any; + Draw(): void; + SetRightBadge(badge: BadgeStyle): void; + SetRightLabel(text: string): void; +} diff --git a/client/includes/nativeui/types/modules/BigMessage.d.ts b/client/includes/nativeui/types/modules/BigMessage.d.ts new file mode 100644 index 0000000..45542d9 --- /dev/null +++ b/client/includes/nativeui/types/modules/BigMessage.d.ts @@ -0,0 +1,14 @@ +import HudColor from '../enums/HudColor'; +import Message from './Message'; +export default class BigMessage extends Message { + static Initialize(scaleForm: string, transitionOutAnimName: string): void; + static ShowMissionPassedMessage(msg: string, subtitle?: string, time?: number): void; + static ShowColoredShard(msg: string, desc: string, textColor: HudColor, bgColor: HudColor, time?: number): void; + static ShowOldMessage(msg: string, time?: number): void; + static ShowSimpleShard(title: string, subtitle?: string, time?: number): void; + static ShowRankupMessage(msg: string, subtitle: string, rank: number, time?: number): void; + static ShowPlaneMessage(title: string, planeName: string, planeHash: number, time?: number): void; + static ShowWeaponPurchasedMessage(bigMessage: string, weaponName: string, weaponHash: number, time?: number): void; + static ShowWastedMessage(title: string, message: string, color: HudColor, darkenBackground: boolean, time?: number): void; + static ShowMpMessageLarge(msg: string, subtitle?: string, time?: number): void; +} diff --git a/client/includes/nativeui/types/modules/Container.d.ts b/client/includes/nativeui/types/modules/Container.d.ts new file mode 100644 index 0000000..0c7e78b --- /dev/null +++ b/client/includes/nativeui/types/modules/Container.d.ts @@ -0,0 +1,10 @@ +import Size from "../utils/Size"; +import Rectangle from "./Rectangle"; +import Point from '../utils/Point'; +import Color from '../utils/Color'; +export default class Container extends Rectangle { + Items: any[]; + constructor(pos: Point, size: Size, color: Color); + addItem(item: any): void; + Draw(offset?: Size): void; +} diff --git a/client/includes/nativeui/types/modules/IElement.d.ts b/client/includes/nativeui/types/modules/IElement.d.ts new file mode 100644 index 0000000..a40679d --- /dev/null +++ b/client/includes/nativeui/types/modules/IElement.d.ts @@ -0,0 +1,4 @@ +export default class IElement { + Enabled: boolean; + constructor(); +} diff --git a/client/includes/nativeui/types/modules/InstructionalButton.d.ts b/client/includes/nativeui/types/modules/InstructionalButton.d.ts new file mode 100644 index 0000000..db8d4f8 --- /dev/null +++ b/client/includes/nativeui/types/modules/InstructionalButton.d.ts @@ -0,0 +1,13 @@ +import UIMenuItem from "../items/UIMenuItem"; +import Control from '../enums/Control'; +export default class InstructionalButton { + Text: string; + get ItemBind(): UIMenuItem; + private _itemBind; + private readonly _buttonString; + private readonly _buttonControl; + private readonly _usingControls; + constructor(text: string, control: Control, buttonString?: string); + BindToItem(item: UIMenuItem): void; + GetButtonId(): string; +} diff --git a/client/includes/nativeui/types/modules/ItemsCollection.d.ts b/client/includes/nativeui/types/modules/ItemsCollection.d.ts new file mode 100644 index 0000000..0e4e1ba --- /dev/null +++ b/client/includes/nativeui/types/modules/ItemsCollection.d.ts @@ -0,0 +1,7 @@ +import ListItem from "../modules/ListItem"; +export default class ItemsCollection { + private items; + constructor(items: ListItem[] | string[] | number[]); + length(): number; + getListItems(): any[]; +} diff --git a/client/includes/nativeui/types/modules/ListItem.d.ts b/client/includes/nativeui/types/modules/ListItem.d.ts new file mode 100644 index 0000000..f761c37 --- /dev/null +++ b/client/includes/nativeui/types/modules/ListItem.d.ts @@ -0,0 +1,6 @@ +export default class ListItem { + readonly Id: string; + DisplayText: string; + Data: any; + constructor(text?: string, data?: any); +} diff --git a/client/includes/nativeui/types/modules/Message.d.ts b/client/includes/nativeui/types/modules/Message.d.ts new file mode 100644 index 0000000..ab56d38 --- /dev/null +++ b/client/includes/nativeui/types/modules/Message.d.ts @@ -0,0 +1,23 @@ +import Scaleform from '../utils/Scaleform'; +export default class Message { + private static _messageVisible; + private static _transitionOutTimeout; + private static _transitionOutFinishedTimeout; + private static _delayedTransitionInTimeout; + private static _scaleform; + private static _transitionOutTimeMs; + private static _transitionOutAnimName; + protected static Initialize(scaleForm: string, transitionOutAnimName: string): void; + static get IsVisible(): boolean; + protected static get Scaleform(): Scaleform; + private static Load; + private static SetDelayedTransition; + static ShowCustomShard(funcName: string, time?: number, ...funcArgs: any[]): void; + static ShowComplexCustomShard(messageHandler: { + (): void; + }, time?: number): void; + protected static TransitionOut(): void; + private static TransitionIn; + private static SetTransitionOutTimer; + protected static Render(): void; +} diff --git a/client/includes/nativeui/types/modules/MidsizedMessage.d.ts b/client/includes/nativeui/types/modules/MidsizedMessage.d.ts new file mode 100644 index 0000000..aea4440 --- /dev/null +++ b/client/includes/nativeui/types/modules/MidsizedMessage.d.ts @@ -0,0 +1,9 @@ +import HudColor from '../enums/HudColor'; +import Message from './Message'; +export default class MidsizedMessage extends Message { + static Initialize(scaleForm: string, transitionOutAnimName: string): void; + static ShowMidsizedMessage(title: string, message?: string, time?: number): void; + static ShowBridgesKnivesProgress(title: string, totalToDo: number, message: string, info: string, completed: number, time?: number): void; + static ShowCondensedShardMessage(title: string, message: string, bgColor: HudColor, useDarkerShard: boolean, time?: number): void; + static ShowMidsizedShardMessage(title: string, message: string, bgColor: HudColor, useDarkerShard: boolean, useCondensedShard: boolean, time?: number): void; +} diff --git a/client/includes/nativeui/types/modules/Rectangle.d.ts b/client/includes/nativeui/types/modules/Rectangle.d.ts new file mode 100644 index 0000000..a23c3b9 --- /dev/null +++ b/client/includes/nativeui/types/modules/Rectangle.d.ts @@ -0,0 +1,11 @@ +import Color from "../utils/Color"; +import Point from "../utils/Point"; +import Size from "../utils/Size"; +import IElement from "./IElement"; +export default class Rectangle extends IElement { + Pos: Point; + Size: Size; + Color: Color; + constructor(pos: Point, size: Size, color: Color); + Draw(pos: Point | Size, size: Size, color: Color): void; +} diff --git a/client/includes/nativeui/types/modules/ResRectangle.d.ts b/client/includes/nativeui/types/modules/ResRectangle.d.ts new file mode 100644 index 0000000..5f0f010 --- /dev/null +++ b/client/includes/nativeui/types/modules/ResRectangle.d.ts @@ -0,0 +1,10 @@ +import Point from "../utils/Point"; +import Size from "../utils/Size"; +import Rectangle from "./Rectangle"; +import Color from '../utils/Color'; +export default class ResRectangle extends Rectangle { + constructor(pos: Point, size: Size, color: Color); + Draw(): void; + Draw(offset: any): void; + Draw(pos: Point | Size, size: Size, color: Color): void; +} diff --git a/client/includes/nativeui/types/modules/ResText.d.ts b/client/includes/nativeui/types/modules/ResText.d.ts new file mode 100644 index 0000000..0db6a6a --- /dev/null +++ b/client/includes/nativeui/types/modules/ResText.d.ts @@ -0,0 +1,17 @@ +import Alignment from "../enums/Alignment"; +import Color from "../utils/Color"; +import Point from "../utils/Point"; +import Size from "../utils/Size"; +import Text from "./Text"; +export default class ResText extends Text { + TextAlignment: Alignment; + DropShadow: boolean; + Outline: boolean; + Wrap: number; + get WordWrap(): Size; + set WordWrap(value: Size); + constructor(caption: string, pos: Point, scale: number, color?: Color, font?: number, centered?: Alignment); + Draw(): void; + Draw(offset: Size): void; + Draw(caption: Size, pos: Point, scale: number, color: Color, font: string | number, arg2: any): void; +} diff --git a/client/includes/nativeui/types/modules/Sprite.d.ts b/client/includes/nativeui/types/modules/Sprite.d.ts new file mode 100644 index 0000000..af07987 --- /dev/null +++ b/client/includes/nativeui/types/modules/Sprite.d.ts @@ -0,0 +1,19 @@ +import Color from "../utils/Color"; +import Point from "../utils/Point"; +import Size from "../utils/Size"; +export default class Sprite { + TextureName: string; + Pos: Point; + Size: Size; + Heading: number; + Color: Color; + Visible: boolean; + private _textureDict; + constructor(textureDict: string, textureName: string, pos: Point, size: Size, heading?: number, color?: Color); + LoadTextureDictionary(): void; + private requestTextureDictPromise; + set TextureDict(v: string); + get TextureDict(): string; + get IsTextureDictionaryLoaded(): boolean; + Draw(textureDictionary?: string, textureName?: string, pos?: Point, size?: Size, heading?: number, color?: Color, loadTexture?: boolean): void; +} diff --git a/client/includes/nativeui/types/modules/Text.d.ts b/client/includes/nativeui/types/modules/Text.d.ts new file mode 100644 index 0000000..7d6c732 --- /dev/null +++ b/client/includes/nativeui/types/modules/Text.d.ts @@ -0,0 +1,16 @@ +import Color from "../utils/Color"; +import Point from "../utils/Point"; +import IElement from "./IElement"; +import Size from '../utils/Size'; +export default class Text extends IElement { + Caption: string; + Pos: Point; + Scale: number; + Color: Color; + Font: number; + Centered: boolean; + constructor(caption: string, pos: Point, scale: number, color: Color, font: number, centered: boolean); + Draw(caption: Size, pos: Point, scale: number, color: Color, font: string | number, centered: boolean): void; + static AddLongString(text: string): void; +} +export { Text }; diff --git a/client/includes/nativeui/types/utils/Color.d.ts b/client/includes/nativeui/types/utils/Color.d.ts new file mode 100644 index 0000000..5cc4fe9 --- /dev/null +++ b/client/includes/nativeui/types/utils/Color.d.ts @@ -0,0 +1,12 @@ +export default class Color { + static Empty: Color; + static Transparent: Color; + static Black: Color; + static White: Color; + static WhiteSmoke: Color; + R: number; + G: number; + B: number; + A: number; + constructor(r: number, g: number, b: number, a?: number); +} diff --git a/client/includes/nativeui/types/utils/Common.d.ts b/client/includes/nativeui/types/utils/Common.d.ts new file mode 100644 index 0000000..2eb723d --- /dev/null +++ b/client/includes/nativeui/types/utils/Common.d.ts @@ -0,0 +1,3 @@ +export default class Common { + static PlaySound(audioName: string, audioRef: string): void; +} diff --git a/client/includes/nativeui/types/utils/LiteEvent.d.ts b/client/includes/nativeui/types/utils/LiteEvent.d.ts new file mode 100644 index 0000000..6c74152 --- /dev/null +++ b/client/includes/nativeui/types/utils/LiteEvent.d.ts @@ -0,0 +1,21 @@ +interface ILiteEvent { + on(handler: { + (...args: any[]): void; + }): void; + off(handler: { + (...args: any[]): void; + }): void; +} +export default class LiteEvent implements ILiteEvent { + private handlers; + on(handler: { + (...args: any[]): void; + }): void; + off(handler: { + (...args: any[]): void; + }): void; + emit(...args: any[]): void; + expose(): ILiteEvent; + count(): number; +} +export {}; diff --git a/client/includes/nativeui/types/utils/Number.d.ts b/client/includes/nativeui/types/utils/Number.d.ts new file mode 100644 index 0000000..881fbb8 --- /dev/null +++ b/client/includes/nativeui/types/utils/Number.d.ts @@ -0,0 +1 @@ +export declare const fixFloat: (n: number) => number; diff --git a/client/includes/nativeui/types/utils/Point.d.ts b/client/includes/nativeui/types/utils/Point.d.ts new file mode 100644 index 0000000..95db2c8 --- /dev/null +++ b/client/includes/nativeui/types/utils/Point.d.ts @@ -0,0 +1,10 @@ +export default class Point { + X: number; + Y: number; + constructor(x: number, y: number); + static Parse(point: number[]): Point; + static Parse(point: { + X: number; + Y: number; + }): Point; +} diff --git a/client/includes/nativeui/types/utils/Scaleform.d.ts b/client/includes/nativeui/types/utils/Scaleform.d.ts new file mode 100644 index 0000000..4237f70 --- /dev/null +++ b/client/includes/nativeui/types/utils/Scaleform.d.ts @@ -0,0 +1,14 @@ +export default class Scaleform { + private _handle; + private scaleForm; + constructor(scaleForm: string); + get handle(): number; + get isValid(): boolean; + get isLoaded(): boolean; + private callFunctionHead; + callFunction(funcName: string, ...args: any[]): void; + callFunctionReturn(funcName: string, ...args: any[]): number; + render2D(): void; + recreate(): void; + destroy(): void; +} diff --git a/client/includes/nativeui/types/utils/Screen.d.ts b/client/includes/nativeui/types/utils/Screen.d.ts new file mode 100644 index 0000000..9ce953e --- /dev/null +++ b/client/includes/nativeui/types/utils/Screen.d.ts @@ -0,0 +1,15 @@ +import Font from "../enums/Font"; +import Point from "./Point"; +import Size from "./Size"; +export default class Screen { + static Width: number; + static Height: number; + static get ResolutionMaintainRatio(): Size; + static MousePosition(relative?: boolean): { + X: number; + Y: number; + }; + static IsMouseInBounds(topLeft: Point, boxSize: Size): boolean; + static GetTextWidth(text: string, font: Font, scale: number): number; + static GetLineCount(text: string, position: Point, font: Font, scale: number, wrap: number): number; +} diff --git a/client/includes/nativeui/types/utils/Size.d.ts b/client/includes/nativeui/types/utils/Size.d.ts new file mode 100644 index 0000000..8a184dc --- /dev/null +++ b/client/includes/nativeui/types/utils/Size.d.ts @@ -0,0 +1,5 @@ +export default class Size { + Width: number; + Height: number; + constructor(w?: number, h?: number); +} diff --git a/client/includes/nativeui/types/utils/UUIDV4.d.ts b/client/includes/nativeui/types/utils/UUIDV4.d.ts new file mode 100644 index 0000000..26e292f --- /dev/null +++ b/client/includes/nativeui/types/utils/UUIDV4.d.ts @@ -0,0 +1 @@ +export default function UUIDV4(): string; diff --git a/client/index.mjs b/client/index.mjs index 9cff50f..fc193e8 100644 --- a/client/index.mjs +++ b/client/index.mjs @@ -1,5 +1,29 @@ import * as alt from 'alt' import * as native from 'natives' +import * as NativeUI from './includes/nativeui/nativeui.min.js' + +import './ui.mjs' + +alt.setMsPerGameMinute(30000) + +alt.onServer('player:death', () => { + native.animpostfxPlay('DeathFailNeutralIn', 5000, false) + NativeUI.BigMessage.ShowWastedMessage('Мертв', 'Вы умерли', NativeUI.HudColor.HUD_COLOUR_RED, 5000) +}) + +alt.onServer('player:notify', message => { + native.beginTextCommandThefeedPost('STRING') + native.addTextComponentSubstringPlayerName(message) + native.endTextCommandThefeedPostTicker(false, false) +}) + +alt.onServer('player:setInvincible', () => { + native.setEntityInvincible(alt.Player.local.scriptID, true) +}) + +alt.onServer('player:delInvincible', () => { + native.setEntityInvincible(alt.Player.local.scriptID, false) +}) alt.onServer('vehicle:setInto', (newVehicle) => { const localPlayer = alt.Player.local.scriptID @@ -12,3 +36,7 @@ alt.onServer('vehicle:setInto', (newVehicle) => { alt.onServer('admin:setStat', () => { alt.setStat('shooting_ability', 99999) }) + +alt.onServer('admin:setInvincible', toggle => { + native.setEntityInvincible(alt.Player.local.scriptID, toggle) +}) \ No newline at end of file diff --git a/client/ui.mjs b/client/ui.mjs new file mode 100644 index 0000000..2bad650 --- /dev/null +++ b/client/ui.mjs @@ -0,0 +1,116 @@ +import alt from 'alt-client' +import * as native from 'natives' +import * as NativeUI from "./includes/nativeui/nativeui.min.js" + +// NativeUI.MidsizedMessage.ShowMidsizedShardMessage("Menu opened", "Awesome", NativeUI.HudColor.HUD_COLOUR_BLACK, true, true) +// NativeUI.MidsizedMessage.ShowMidsizedMessage('~r~Вы саспект!', 'Уйдите от полиции', 1000) + +const Menu = NativeUI.Menu +const UIMenuItem = NativeUI.UIMenuItem +const UIMenuListItem = NativeUI.UIMenuListItem +const ItemsCollection = NativeUI.ItemsCollection +const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem +const Point = NativeUI.Point + +const menuPos = new Point(1450, 150) +const locations = ['airport', 'spawn', 'fibroof', 'epsilon', 'policestation', 'yankton'] + +let subMenuActive = false + +const adminMenu = new Menu("Админ Панель", "Выполняйте админ-функции", menuPos) +const kickPlayerMenu = new Menu("Кикнуть игрока", "Сервер кикнет любого игрока", menuPos) +const banPlayerMenu = new Menu('Забанить игрока', "Сервер забанит игрока", menuPos) +const killPlayerMenu = new Menu('Убить игрока', "Сервер моментально убьет игрока", menuPos) +const carSpawnMenu = new Menu("Заспавнить машину", "Сервер заспавнит машину", menuPos) +const teleportToLocationMenu = new Menu("Телепорт к локации", "Телепортируйтесь на выбранную локацию", menuPos) +const myPersonMenu = new Menu("Мой персонаж", "Выберите что-то", menuPos) +const weaponsMenu = new Menu("Оружие", "Выберите оружие", menuPos) +const teleportToPlayerMenu = new Menu("Телепорт к игроку", "Вы телепортируетесь к игроку", menuPos) +const teleportToMeMenu = new Menu("Телепорт к себе", "Вы телепортируете игрока к себе", menuPos) + +const kickItem = new UIMenuItem('Кикнуть игрока',`Сервер кикнет игрока`) +const banItem = new UIMenuItem('Забанить игрока',`Сервер заблокирует игрока`) +const killItem = new UIMenuItem('Убить игрока',`Убейте моментально любого игрока`) +const spawnCarItem = new UIMenuItem('Заспавнить машину',`Сервер заспавнит машину перед вами`) +const teleportToLocationItem = new UIMenuItem('Телепорт к локации',`Телепортируйтесь к выбранной локации`) +const myPersonItem = new UIMenuItem('Мой персонаж', `Выдайте себе здоровье или станьте неуязвимым`) +const weaponsItem = new UIMenuItem('Выдать себе оружие',`Выдайте любое оружие себе`) +const teleportToPlayerItem = new UIMenuItem('Телепорт к игроку',`Телепортируйтесь к игроку`) +const teleportToMeItem = new UIMenuItem('Телепорт игрока к себе', `Телепортируйте игрока к себе`) + +const playersListItem = new UIMenuListItem( + "Игроки", + "Выберите игрока", + new ItemsCollection(alt.Player.all.map(_player => _player.name)) +) + +myPersonMenu.AddItem(new UIMenuCheckboxItem( + "Неуязвимость", + false, + "Делает вашего персонажа неуязвимым" +)) +myPersonMenu.AddItem(new UIMenuItem('Восстановить здоровье', `Восстанавливает 100hp`)) + +kickPlayerMenu.AddItem(playersListItem) +alt.setInterval(() => playersListItem.Collection = new ItemsCollection(alt.Player.all.map(_player => `[${_player.id}]:${_player.name}`)).getListItems(), 300) + +adminMenu.BindMenuToItem(myPersonMenu, myPersonItem) +adminMenu.BindMenuToItem(kickPlayerMenu, kickItem) +adminMenu.BindMenuToItem(banPlayerMenu, banItem) +adminMenu.BindMenuToItem(killPlayerMenu, killItem) +adminMenu.BindMenuToItem(carSpawnMenu, spawnCarItem) +adminMenu.BindMenuToItem(teleportToLocationMenu, teleportToLocationItem) +adminMenu.BindMenuToItem(weaponsMenu, weaponsItem) +adminMenu.BindMenuToItem(teleportToPlayerMenu, teleportToPlayerItem) +adminMenu.BindMenuToItem(teleportToMeMenu, teleportToMeItem) + + +adminMenu.ItemSelect.on(item => { + if (item instanceof UIMenuItem) subMenuActive = true +}) + +myPersonMenu.ItemSelect.on(item => { + if (item.Text.toLowerCase() === 'восстановить здоровье') alt.emitServer('getHealth') +}) + +myPersonMenu.CheckboxChange.on(item => { + if (item.Text.toLowerCase() === 'неуязвимость') alt.emitServer('godMode', item.Checked) +}) + +kickPlayerMenu.ItemSelect.on(item => { + alt.emitServer("kickPlayer", item.SelectedItem.DisplayText); +}) + + +alt.on('keyup', key => { + if (key === 113) { // F2 + alt.emitServer('showAdminPanel') + } +}) + +alt.onServer('ui:showAdminPanel', () => { + if ( + kickPlayerMenu.Visible + || banPlayerMenu.Visible + || killPlayerMenu.Visible + || carSpawnMenu.Visible + || teleportToLocationMenu.Visible + || myPersonMenu.Visible + || weaponsMenu.Visible + || teleportToPlayerMenu.Visible + || teleportToMeMenu.Visible + ) + { + kickPlayerMenu.Close() + banPlayerMenu.Close() + killPlayerMenu.Close() + carSpawnMenu.Close() + teleportToLocationMenu.Close() + myPersonMenu.Close() + weaponsMenu.Close() + teleportToPlayerMenu.Close() + teleportToMeMenu.Close() + } + + adminMenu.Visible ? adminMenu.Close() : adminMenu.Open() +}) diff --git a/resource.cfg b/resource.cfg index 8fd600a..9d3c698 100644 --- a/resource.cfg +++ b/resource.cfg @@ -6,6 +6,7 @@ client-files: [ client/* ] deps: [ - chat - altv-os-global-textlabels + chat, + altv-os-global-textlabels, + altv-os-nametags ] diff --git a/server/index.mjs b/server/index.mjs index 7d94fb6..6abc13a 100644 --- a/server/index.mjs +++ b/server/index.mjs @@ -2,6 +2,12 @@ Events */ +// Admin ui +import './modules/events/ui/showAdminPanel.mjs' +import './modules/events/ui/getHealth.mjs' +import './modules/events/ui/godMode.mjs' +import './modules/events/ui/kickPlayer.mjs' + import './modules/events/playerConnect.mjs' import './modules/events/playerDisconnect.mjs' import './modules/events/playerDeath.mjs' diff --git a/server/modules/commands/admin/kick.mjs b/server/modules/commands/admin/kick.mjs index 74291ed..f3465cb 100644 --- a/server/modules/commands/admin/kick.mjs +++ b/server/modules/commands/admin/kick.mjs @@ -1,5 +1,5 @@ import alt from 'alt-server' -import { registerCmd, send } from 'chat' +import { registerCmd, broadcast, send } from 'chat' import { isPlayerAdmin } from '../../helpers/helpers.mjs' registerCmd('kick', (player, args) => { @@ -15,5 +15,8 @@ registerCmd('kick', (player, args) => { return send(player, `{EE9A00}[SERVER]: {FFF}Игрок с ID: "${args[0]}" не найден`); } - target.kick() + alt.emitClient(target, 'player:notify', `Вы были кикнуты с этого сервера`) + + alt.setTimeout(() => target.kick(), 300) + broadcast(`{EE9A00}[SERVER]: {FFF}Игрок {1CD8FD}${target.name} {FFF}был кикнут с сервера`) }) \ No newline at end of file diff --git a/server/modules/events/playerConnect.mjs b/server/modules/events/playerConnect.mjs index b76206c..0b59d09 100644 --- a/server/modules/events/playerConnect.mjs +++ b/server/modules/events/playerConnect.mjs @@ -6,8 +6,15 @@ import skins from '../../skins.json' alt.on('playerConnect', (player) => { broadcast(`{EE9A00}[SERVER]: {1CD8FD}👋 ${player.name} {FFF}присоеденился к серверу`) + const date = new Date() + player.setSyncedMeta('NAME', `[${player.id}]: ${player.name}`); + player.setDateTime(date.getDay(), date.getMonth(), date.getFullYear(), date.getHours(), date.getMinutes(), date.getSeconds()) player.model = skins[Math.floor(Math.random() * (skins.length - 1 - 0) + 0)] player.spawn(config.spawn.x, config.spawn.y,config.spawn.z) player.dimension = 0 -}) \ No newline at end of file + + + alt.emitClient(player, 'player:setInvincible') + alt.emitClient(player, 'player:notify', '~g~Добро пожаловать на сервер!') +}) diff --git a/server/modules/events/playerDeath.mjs b/server/modules/events/playerDeath.mjs index 46d51eb..dd7190c 100644 --- a/server/modules/events/playerDeath.mjs +++ b/server/modules/events/playerDeath.mjs @@ -4,8 +4,9 @@ import config from '../../config.mjs' alt.on('playerDeath', (player) => { alt.emitClient(player, 'player:death') + alt.Player.all.forEach(_player => alt.emitClient(_player, 'player:notify', `Игрок ${player.name} погиб`)) alt.setTimeout(() => { player.spawn(config.spawn.x, config.spawn.y,config.spawn.z) player.removeAllWeapons() - }, 3000) + }, 5000) }) \ No newline at end of file diff --git a/server/modules/events/ui/getHealth.mjs b/server/modules/events/ui/getHealth.mjs new file mode 100644 index 0000000..c06de86 --- /dev/null +++ b/server/modules/events/ui/getHealth.mjs @@ -0,0 +1,9 @@ +import alt from 'alt-server' +import { isPlayerAdmin } from '../../helpers/helpers.mjs' + +alt.onClient('getHealth', player => { + if (!isPlayerAdmin(player)) return false + + player.health = 200 + alt.emitClient(player, 'player:notify', 'Ваше здоровье было восстановлено') +}) \ No newline at end of file diff --git a/server/modules/events/ui/godMode.mjs b/server/modules/events/ui/godMode.mjs new file mode 100644 index 0000000..44cdc73 --- /dev/null +++ b/server/modules/events/ui/godMode.mjs @@ -0,0 +1,14 @@ +import alt from 'alt-server' +import { isPlayerAdmin } from '../../helpers/helpers.mjs' + +alt.onClient('godMode', (player, checked) => { + if (!isPlayerAdmin(player)) return false + + if (checked) { + alt.emitClient(player, 'admin:setInvincible', checked) + alt.emitClient(player, 'player:notify', 'Неуязвимость: вкл') + } else { + alt.emitClient(player, 'admin:setInvincible', checked) + alt.emitClient(player, 'player:notify', 'Неуязвимость: выкл') + } +}) \ No newline at end of file diff --git a/server/modules/events/ui/kickPlayer.mjs b/server/modules/events/ui/kickPlayer.mjs new file mode 100644 index 0000000..e53e170 --- /dev/null +++ b/server/modules/events/ui/kickPlayer.mjs @@ -0,0 +1,12 @@ +import alt from 'alt-server' +import { broadcast } from 'chat' +import { isPlayerAdmin } from '../../helpers/helpers.mjs' + +alt.onClient('kickPlayer', (player, targetId) => { + if (!isPlayerAdmin(player)) return false + const target = alt.Player.getByID(+/\d+/.exec(targetId.split(':')[0])) + alt.emitClient(target, 'player:notify', `Вы были кикнуты с этого сервера`) + + alt.setTimeout(() => target.kick(), 300) + broadcast(`{EE9A00}[SERVER]: {FFF}Игрок {1CD8FD}${target.name} {FFF}был кикнут с сервера`) +}) \ No newline at end of file diff --git a/server/modules/events/ui/showAdminPanel.mjs b/server/modules/events/ui/showAdminPanel.mjs new file mode 100644 index 0000000..3508a6b --- /dev/null +++ b/server/modules/events/ui/showAdminPanel.mjs @@ -0,0 +1,8 @@ +import alt from 'alt-server' +import { isPlayerAdmin } from '../../helpers/helpers.mjs' + +alt.onClient('showAdminPanel', player => { + if (!isPlayerAdmin(player)) return false + + alt.emitClient(player, 'ui:showAdminPanel') +}) \ No newline at end of file