Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as shitfuck from 'alt-client';
- import * as gecilada from 'natives';
- const lokalisJatekos = shitfuck.Player.local;
- const WeaponModelMod = {
- CombatPdw: 0x0A3D4D34,
- HeavySniperMk2: 0x0A914799,
- HeavySniper: 0x0C472FE2,
- SniperRifle: 0x05FC3C11,
- FireExtinguisher: 0x060EC506,
- CompactLauncher: 0x0781FE4A,
- Snowball: 0x0787F0BB,
- VintagePistol: 0x083839C4,
- Pistol: 0x1B06D571,
- PumpShotgun: 0x1D073A89,
- CeramicPistol: 0x2B5EF5EC,
- Smg: 0x2BE6766B,
- StickyBomb: 0x2C3731D9,
- HeavyShotgun: 0x3AABBBAA,
- GrenadeLauncherSmoke: 0x4DD2DC56,
- Hammer: 0x4E875F73,
- CombatPistol: 0x5EF9FEC4,
- MarksmanRifleMk2: 0x6A6C02E0,
- Railgun: 0x6D544C99,
- BullpupRifle: 0x7F229F94,
- Firework: 0x7F7497E5,
- CombatMg: 0x7FD62962,
- Flashlight: 0x8BB05FD7,
- Mg: 0x9D07F764,
- BullpupShotgun: 0x9D61E50F,
- AutoShotgun: 0x12E82D3D,
- APPistol: 0x22D8FE39,
- Ball: 0x23C9F95C,
- Molotov: 0x24B17070,
- PetrolCan: 0x34A67B97,
- Minigun: 0x42BF8A85,
- HomingLauncher: 0x63AB0442,
- SmgMk2: 0x78A97CD0,
- CarbineRifle: 0x83BF0278,
- Crowbar: 0x84BD7BFD,
- BullpupRifleMk2: 0x84D6FAFD,
- Dagger: 0x92A27487,
- Grenade: 0x93E220BD,
- DoubleAction: 0x97EA20B8,
- Pistol50: 0x99AEEB3B,
- Knife: 0x99B507EA,
- AssaultRifleMk2: 0x394F415C,
- GolfClub: 0x440E4788,
- Raycarbine: 0x476BF155,
- Flare: 0x497FACC3,
- PumpShotgunMk2: 0x555AF99A,
- CompactRifle: 0x624FE830,
- Nightstick: 0x678B81B1,
- NavyRevolver: 0x917F6C8C,
- Bat: 0x958A4A8F,
- SpecialCarbineMk2: 0x969C3D67,
- StunGun: 0x3656C8C1,
- StoneHatchet: 0x3813FC08,
- SawnOffShotgun: 0x7846A318,
- Wrench: 0x19044EE0,
- MicroSmg: 0x13532244,
- FlareGun: 0x47757124,
- Gusenberg: 0x61012683,
- SNSPistolMk2: 0x88374054,
- PoolCue: 0x94117305,
- BzGas: 0xA0973D5E,
- Musket: 0xA89CB99E,
- GrenadeLauncher: 0xA284510B,
- Unarmed: 0xA2719263,
- ProxMine: 0xAB564B93,
- AdvancedRifle: 0xAF113F99,
- Raypistol: 0xAF3696A1,
- Rpg: 0xB1CA77B1,
- Rayminigun: 0xB62D1F67,
- PipeBomb: 0xBA45E8B8,
- HazardCan: 0xBA536372,
- MiniSmg: 0xBD248B55,
- SNSPistol: 0xBFD21232,
- PistolMk2: 0xBFE256D4,
- AssaultRifle: 0xBFEFFF6D,
- SpecialCarbine: 0xC0A3098D,
- Revolver: 0xC1B3C3D1,
- MarksmanRifle: 0xC734385A,
- RevolverMk2: 0xCB96392F,
- BattleAxe: 0xCD274149,
- Knuckle: 0xD8DF3C3C,
- HeavyPistol: 0xD205520E,
- MachinePistol: 0xDB1AA450,
- CombatMgMk2: 0xDBBD7280,
- MarksmanPistol: 0xDC4DB296,
- Machete: 0xDD5DF8D9,
- Switchblade: 0xDFE37640,
- AssaultShotgun: 0xE284C527,
- DbShotgun: 0xEF951FBB,
- AssaultSmg: 0xEFE7E2DF,
- Hatchet: 0xF9DCBF2D,
- Bottle: 0xF9E6AA4B,
- CarbineRifleMk2: 0xFAD1F1C9,
- Parachute: 0xFBAB5776,
- SmokeGrenade: 0xFDBC8A50
- };
- 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 ColorMod {
- constructor(r, g, b, a = 255) {
- this.R = r;
- this.G = g;
- this.B = b;
- this.A = a;
- }
- }
- ColorMod.Empty = new ColorMod(0, 0, 0, 0);
- ColorMod.Transparent = new ColorMod(0, 0, 0, 0);
- ColorMod.Black = new ColorMod(0, 0, 0, 255);
- ColorMod.White = new ColorMod(255, 255, 255, 255);
- ColorMod.WhiteSmoke = new ColorMod(245, 245, 245, 255);
- class SizeMod {
- constructor(w = 0, h = 0) {
- this.Width = w;
- this.Height = h;
- }
- }
- class PointMod {
- 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 PointMod(arg[0], arg[1]);
- } else if (arg.X && arg.Y) {
- return new PointMod(arg.X, arg.Y);
- }
- } else if (typeof arg === 'string') {
- if (arg.indexOf(',') !== -1) {
- const arr = arg.split(',');
- return new PointMod(parseFloat(arr[0]), parseFloat(arr[1]));
- }
- }
- return new PointMod(0, 0);
- }
- }
- class IElementMod {
- constructor() {
- this.Enabled = true;
- }
- }
- class TextMod extends IElementMod {
- constructor(caption, pos, scale, color, font, centered) {
- super();
- this.Caption = caption;
- this.Pos = pos;
- this.Scale = scale;
- this.ColorMod = color || new ColorMod(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 PointMod(this.Pos.X + caption.Width, this.Pos.Y + caption.Height);
- scale = this.Scale;
- color = this.ColorMod;
- font = this.Font;
- centered = this.Centered;
- }
- const x = pos.X / 1280.0;
- const y = pos.Y / 720.0;
- gecilada.setTextFont(parseInt(font));
- gecilada.setTextScale(scale, scale);
- gecilada.setTextColour(color.R, color.G, color.B, color.A);
- gecilada.setTextCentre(centered);
- gecilada.beginTextCommandDisplayText('STRING');
- TextMod.AddLongString(caption);
- gecilada.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);
- }
- gecilada.addTextComponentSubstringPlayerName(text.substr(currentIndex, position));
- }
- }
- }
- const gameScreen = gecilada.getActiveScreenResolution(0, 0);
- class ScreenMod {
- static get ResolutionMaintainRatio() {
- const ratio = ScreenMod.Width / ScreenMod.Height;
- const width = 1080.0 * ratio;
- return new SizeMod(width, 1080.0);
- }
- static MousePosition(relative = false) {
- const res = ScreenMod.ResolutionMaintainRatio;
- const cursor = shitfuck.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 = ScreenMod.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) {
- gecilada.beginTextCommandGetWidth('CELL_EMAIL_BCON');
- TextMod.AddLongString(text);
- gecilada.setTextFont(font);
- gecilada.setTextScale(1.0, scale);
- const width = gecilada.endTextCommandGetWidth(true);
- const res = ScreenMod.ResolutionMaintainRatio;
- return res.Width * width;
- }
- static GetLineCount(text, position, font, scale, wrap) {
- gecilada.beginTextCommandLineCount('CELL_EMAIL_BCON');
- TextMod.AddLongString(text);
- const res = ScreenMod.ResolutionMaintainRatio;
- const x = position.X / res.Width;
- const y = position.Y / res.Height;
- gecilada.setTextFont(font);
- gecilada.setTextScale(1.0, scale);
- if (wrap > 0) {
- const start = position.X / res.Width;
- const end = start + wrap / res.Width;
- gecilada.setTextWrap(x, end);
- }
- let lineCount = gecilada.endTextCommandLineCount(x, y);
- return lineCount;
- }
- }
- ScreenMod.Width = gameScreen[1];
- ScreenMod.Height = gameScreen[2];
- class SpriteMod {
- constructor(textureDict, textureName, pos, size, heading = 0, color = new ColorMod(255, 255, 255)) {
- this.TextureDict = textureDict;
- this.TextureName = textureName;
- this.Pos = pos;
- this.SizeMod = size;
- this.Heading = heading;
- this.ColorMod = color;
- this.Visible = true;
- }
- LoadTextureDictionary() {
- this.requestTextureDictPromise(this._textureDict).then((succ) => {});
- }
- requestTextureDictPromise(textureDict) {
- return new Promise((resolve, reject) => {
- gecilada.requestStreamedTextureDict(textureDict, true);
- let inter = shitfuck.setInterval(() => {
- if (gecilada.hasStreamedTextureDictLoaded(textureDict)) {
- shitfuck.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 gecilada.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.SizeMod;
- heading = heading || this.Heading;
- color = color || this.ColorMod;
- loadTexture = loadTexture || true;
- if (loadTexture) {
- if (!gecilada.hasStreamedTextureDictLoaded(textureDictionary)) gecilada.requestStreamedTextureDict(textureDictionary, true);
- }
- const screenw = ScreenMod.Width;
- const screenh = ScreenMod.Height;
- const height = 1080.0;
- const ratio = screenw / screenh;
- const width = height * ratio;
- const w = this.SizeMod.Width / width;
- const h = this.SizeMod.Height / height;
- const x = this.Pos.X / width + w * 0.5;
- const y = this.Pos.Y / height + h * 0.5;
- gecilada.drawSprite(textureDictionary, textureName, x, y, w, h, heading, color.R, color.G, color.B, color.A, true);
- }
- }
- class RectangleMod extends IElementMod {
- constructor(pos, size, color) {
- super();
- this.Enabled = true;
- this.Pos = pos;
- this.SizeMod = size;
- this.ColorMod = color;
- }
- Draw(pos, size, color) {
- if (!pos) pos = new SizeMod(0, 0);
- if (!size && !color) {
- pos = new PointMod(this.Pos.X + pos.Width, this.Pos.Y + pos.Height);
- size = this.SizeMod;
- color = this.ColorMod;
- }
- 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;
- gecilada.drawRect(x, y, w, h, color.R, color.G, color.B, color.A, false);
- }
- }
- class ResRectangleMod extends RectangleMod {
- constructor(pos, size, color) {
- super(pos, size, color);
- }
- Draw(pos, size, color) {
- if (!pos) pos = new SizeMod();
- if (pos && !size && !color) {
- pos = new PointMod(this.Pos.X + pos.Width, this.Pos.Y + pos.Height);
- size = this.SizeMod;
- color = this.ColorMod;
- }
- const screenw = ScreenMod.Width;
- const screenh = ScreenMod.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;
- gecilada.drawRect(x, y, w, h, color.R, color.G, color.B, color.A, false);
- }
- }
- class ResTextMod extends TextMod {
- constructor(caption, pos, scale, color, font, centered) {
- super(caption, pos, scale, color || new ColorMod(255, 255, 255), font || 0, false);
- this.TextAlignment = Alignment$1.Left;
- this.Wrap = 0;
- if (centered) this.TextAlignment = centered;
- }
- get WordWrap() {
- return new SizeMod(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 SizeMod(0, 0);
- if (arg1 && !pos) {
- textAlignment = this.TextAlignment;
- caption = this.Caption;
- pos = new PointMod(this.Pos.X + arg1.Width, this.Pos.Y + arg1.Height);
- scale = this.Scale;
- color = this.ColorMod;
- 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 = ScreenMod.Width;
- const screenh = ScreenMod.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;
- gecilada.setTextFont(parseInt(font));
- gecilada.setTextScale(1.0, scale);
- gecilada.setTextColour(color.R, color.G, color.B, color.A);
- if (centered !== undefined) {
- gecilada.setTextCentre(centered);
- } else {
- if (dropShadow) gecilada.setTextDropshadow(2, 0, 0, 0, 0);
- if (outline) shitfuck.logWarning('[NativeUIMod] ResTextMod outline not working!');
- switch (textAlignment) {
- case Alignment$1.Centered:
- gecilada.setTextCentre(true);
- break;
- case Alignment$1.Right:
- gecilada.setTextRightJustify(true);
- gecilada.setTextWrap(0.0, x);
- break;
- }
- if (this.Wrap) {
- const xsize = (this.Pos.X + this.Wrap) / width;
- gecilada.setTextWrap(x, xsize);
- }
- }
- gecilada.beginTextCommandDisplayText('CELL_EMAIL_BCON');
- TextMod.AddLongString(caption);
- gecilada.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 UIMenuItemMod {
- constructor(text, description = '', data = null) {
- this.Id = UUIDV4();
- this.BackColor = UIMenuItemMod.DefaultBackColor;
- this.HighlightedBackColor = UIMenuItemMod.DefaultHighlightedBackColor;
- this.ForeColor = UIMenuItemMod.DefaultForeColor;
- this.HighlightedForeColor = UIMenuItemMod.DefaultHighlightedForeColor;
- this.RightLabel = '';
- this.LeftBadge = BadgeStyle$1.None;
- this.RightBadge = BadgeStyle$1.None;
- this.Enabled = true;
- this.Data = data;
- this._rectangle = new ResRectangleMod(new PointMod(0, 0), new SizeMod(431, 38), new ColorMod(150, 0, 0, 0));
- this._text = new ResTextMod(text, new PointMod(8, 0), 0.33, ColorMod.WhiteSmoke, Font$1.ChaletLondon, Alignment$1.Left);
- this.Description = description;
- this._selectedSprite = new SpriteMod('commonmenu', 'gradient_nav', new PointMod(0, 0), new SizeMod(431, 38));
- this._badgeLeft = new SpriteMod('commonmenu', '', new PointMod(0, 0), new SizeMod(40, 40));
- this._badgeRight = new SpriteMod('commonmenu', '', new PointMod(0, 0), new SizeMod(40, 40));
- this._labelText = new ResTextMod('', new PointMod(0, 0), 0.35, ColorMod.White, 0, Alignment$1.Right);
- }
- get TextMod() {
- return this._text.Caption;
- }
- set TextMod(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 PointMod(this.Offset.X, y + 144 + this.Offset.Y);
- this._selectedSprite.Pos = new PointMod(0 + this.Offset.X, y + 144 + this.Offset.Y);
- this._text.Pos = new PointMod(8 + this.Offset.X, y + 147 + this.Offset.Y);
- this._badgeLeft.Pos = new PointMod(0 + this.Offset.X, y + 142 + this.Offset.Y);
- this._badgeRight.Pos = new PointMod(385 + this.Offset.X, y + 142 + this.Offset.Y);
- this._labelText.Pos = new PointMod(420 + this.Offset.X, y + 148 + this.Offset.Y);
- }
- addEvent(event, ...args) {
- this._event = { event: event, args: args };
- }
- fireEvent() {
- if (this._event) {
- shitfuck.emit(this._event.event, ...this._event.args);
- }
- }
- Draw() {
- this._rectangle.SizeMod = new SizeMod(431 + this.Parent.WidthOffset, 38);
- this._selectedSprite.SizeMod = new SizeMod(431 + this.Parent.WidthOffset, 38);
- if (this.Hovered && !this.Selected) {
- this._rectangle.ColorMod = new ColorMod(255, 255, 255, 20);
- this._rectangle.Draw();
- }
- this._selectedSprite.ColorMod = this.Selected ? this.HighlightedBackColor : this.BackColor;
- this._selectedSprite.Draw();
- this._text.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- if (this.LeftBadge != BadgeStyle$1.None) {
- this._text.Pos = new PointMod(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.ColorMod = this.IsBagdeWhiteSprite(this.LeftBadge)
- ? this.Enabled
- ? this.Selected
- ? this.HighlightedForeColor
- : this.ForeColor
- : new ColorMod(163, 159, 148)
- : ColorMod.White;
- this._badgeLeft.Draw();
- } else {
- this._text.Pos = new PointMod(8 + this.Offset.X, this._text.Pos.Y);
- }
- if (this.RightBadge != BadgeStyle$1.None) {
- this._badgeRight.Pos = new PointMod(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.ColorMod = this.IsBagdeWhiteSprite(this.RightBadge)
- ? this.Enabled
- ? this.Selected
- ? this.HighlightedForeColor
- : this.ForeColor
- : new ColorMod(163, 159, 148)
- : ColorMod.White;
- this._badgeRight.Draw();
- }
- if (this.RightLabel && this.RightLabel !== '') {
- this._labelText.Pos = new PointMod(420 + this.Offset.X + this.Parent.WidthOffset, this._labelText.Pos.Y);
- this._labelText.Caption = this.RightLabel;
- this._labelText.ColorMod = this._text.ColorMod = this.Enabled
- ? this.Selected
- ? this.HighlightedForeColor
- : this.ForeColor
- : new ColorMod(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 ColorMod(255, 0, 0, 0) : new ColorMod(255, 255, 255, 255);
- default:
- return new ColorMod(255, 255, 255, 255);
- }
- }
- }
- UIMenuItemMod.DefaultBackColor = ColorMod.Empty;
- UIMenuItemMod.DefaultHighlightedBackColor = ColorMod.White;
- UIMenuItemMod.DefaultForeColor = ColorMod.WhiteSmoke;
- UIMenuItemMod.DefaultHighlightedForeColor = ColorMod.Black;
- class UIMenuCheckboxItemMod extends UIMenuItemMod {
- constructor(text, check = false, description = '') {
- super(text, description);
- this.Checked = false;
- const y = 0;
- this._checkedSprite = new SpriteMod('commonmenu', 'shop_box_blank', new PointMod(410, y + 95), new SizeMod(50, 50));
- this.Checked = check;
- }
- SetVerticalPosition(y) {
- super.SetVerticalPosition(y);
- this._checkedSprite.Pos = new PointMod(380 + this.Offset.X + this.Parent.WidthOffset, y + 138 + this.Offset.Y);
- }
- Draw() {
- super.Draw();
- this._checkedSprite.Pos = this._checkedSprite.Pos = new PointMod(380 + this.Offset.X + this.Parent.WidthOffset, this._checkedSprite.Pos.Y);
- const isDefaultHightlitedForeColor = this.HighlightedForeColor == UIMenuItemMod.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.ColorMod = this.Enabled
- ? this.Selected && !isDefaultHightlitedForeColor
- ? this.HighlightedForeColor
- : this.ForeColor
- : new ColorMod(163, 159, 148);
- this._checkedSprite.Draw();
- }
- SetRightBadge(badge) {
- return this;
- }
- SetRightLabel(text) {
- return this;
- }
- }
- class ListItemMod {
- constructor(text = '', data = null) {
- this.Id = UUIDV4();
- this.DisplayText = text;
- this.Data = data;
- }
- }
- class ItemsCollectionMod {
- constructor(items) {
- if (items.length === 0) throw new Error('ItemsCollectionMod cannot be empty');
- this.items = items;
- }
- length() {
- return this.items.length;
- }
- getListItems() {
- const items = [];
- for (const item of this.items) {
- if (item instanceof ListItemMod) {
- items.push(item);
- } else if (typeof item == 'string') {
- items.push(new ListItemMod(item));
- } else if (typeof item == 'number') {
- items.push(new ListItemMod(item.toString()));
- }
- }
- return items;
- }
- }
- class UIMenuListItemMod extends UIMenuItemMod {
- constructor(text, description = '', collection = new ItemsCollectionMod([]), 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 SpriteMod('commonmenu', 'arrowleft', new PointMod(110, 105 + y), new SizeMod(30, 30));
- this._arrowRight = new SpriteMod('commonmenu', 'arrowright', new PointMod(280, 105 + y), new SizeMod(30, 30));
- this._itemText = new ResTextMod('', new PointMod(290, y + 104), 0.35, ColorMod.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 = ScreenMod.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 ListItemMod(item);
- this.Collection.splice(index, 1, item);
- if (resetSelection) this.Index = 0;
- }
- SetVerticalPosition(y) {
- this._arrowLeft.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y);
- this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y);
- this._itemText.Pos = new PointMod(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.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._itemText.Caption = caption;
- this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._arrowLeft.Pos = new PointMod(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 PointMod(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y);
- } else {
- this._itemText.Pos = new PointMod(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 UIMenuAutoListItemMod extends UIMenuItemMod {
- 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 SpriteMod('commonmenu', 'arrowleft', new PointMod(110, 105 + y), new SizeMod(30, 30));
- this._arrowRight = new SpriteMod('commonmenu', 'arrowright', new PointMod(280, 105 + y), new SizeMod(30, 30));
- this._itemText = new ResTextMod('', new PointMod(290, y + 104), 0.35, ColorMod.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 = ScreenMod.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 = ScreenMod.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 = ScreenMod.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 PointMod(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y);
- this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y);
- this._itemText.Pos = new PointMod(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.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._itemText.Caption = this.PreCaptionText + this._selectedValue + this.PostCaptionText;
- this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._arrowLeft.Pos = new PointMod(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 PointMod(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y);
- } else {
- this._itemText.Pos = new PointMod(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y);
- }
- this._itemText.Draw();
- }
- }
- class UIMenuSliderItemMod extends UIMenuItemMod {
- constructor(text, items, index, description = '', divider = false, data = null) {
- super(text, description, data);
- const y = 0;
- this._items = items;
- this._arrowLeft = new SpriteMod('commonmenutu', 'arrowleft', new PointMod(0, 105 + y), new SizeMod(15, 15));
- this._arrowRight = new SpriteMod('commonmenutu', 'arrowright', new PointMod(0, 105 + y), new SizeMod(15, 15));
- this._rectangleBackground = new ResRectangleMod(new PointMod(0, 0), new SizeMod(150, 9), new ColorMod(4, 32, 57, 255));
- this._rectangleSlider = new ResRectangleMod(new PointMod(0, 0), new SizeMod(75, 9), new ColorMod(57, 116, 200, 255));
- if (divider) {
- this._rectangleDivider = new ResRectangleMod(new PointMod(0, 0), new SizeMod(2.5, 20), ColorMod.WhiteSmoke);
- } else {
- this._rectangleDivider = new ResRectangleMod(new PointMod(0, 0), new SizeMod(2.5, 20), ColorMod.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 PointMod(250 + this.Offset.X + this.Parent.WidthOffset, y + 158.5 + this.Offset.Y);
- this._rectangleSlider.Pos = new PointMod(250 + this.Offset.X + this.Parent.WidthOffset, y + 158.5 + this.Offset.Y);
- this._rectangleDivider.Pos = new PointMod(323.5 + this.Offset.X + this.Parent.WidthOffset, y + 153 + this.Offset.Y);
- this._arrowLeft.Pos = new PointMod(235 + this.Offset.X + this.Parent.WidthOffset, 155.5 + y + this.Offset.Y);
- this._arrowRight.Pos = new PointMod(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.ColorMod = this.Enabled ? (this.Selected ? ColorMod.Black : ColorMod.WhiteSmoke) : new ColorMod(163, 159, 148);
- this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? ColorMod.Black : ColorMod.WhiteSmoke) : new ColorMod(163, 159, 148);
- let offset = ((this._rectangleBackground.SizeMod.Width - this._rectangleSlider.SizeMod.Width) / (this._items.length - 1)) * this.Index;
- this._rectangleSlider.Pos = new PointMod(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 ContainerMod extends RectangleMod {
- 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 SizeMod();
- const screenw = ScreenMod.Width;
- const screenh = ScreenMod.Height;
- const height = 1080.0;
- const ratio = screenw / screenh;
- const width = height * ratio;
- const w = this.SizeMod.Width / width;
- const h = this.SizeMod.Height / height;
- const x = (this.Pos.X + offset.Width) / width + w * 0.5;
- const y = (this.Pos.Y + offset.Height) / height + h * 0.5;
- gecilada.drawRect(x, y, w, h, this.ColorMod.R, this.ColorMod.G, this.ColorMod.B, this.ColorMod.A, false);
- for (var item of this.Items) item.Draw(new SizeMod(this.Pos.X + offset.Width, this.Pos.Y + offset.Height));
- }
- }
- class CommonMod {
- static PlaySound(audioName, audioRef) {
- gecilada.playSound(-1, audioName, audioRef, false, 0, true);
- }
- }
- class LiteEventMod {
- 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 InstructionalButtonMod {
- constructor(text, control, buttonString = null) {
- this._itemBind = null;
- this.TextMod = 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 ? gecilada.getControlInstructionalButton(2, this._buttonControl, false) : 't_' + this._buttonString;
- }
- }
- class ScaleformMod {
- constructor(scaleForm) {
- this._handle = 0;
- this.scaleForm = scaleForm;
- this._handle = gecilada.requestScaleformMovie(this.scaleForm);
- }
- get handle() {
- return this._handle;
- }
- get isValid() {
- return this._handle != 0;
- }
- get isLoaded() {
- return gecilada.hasScaleformMovieLoaded(this._handle);
- }
- callFunctionHead(funcName, ...args) {
- if (!this.isValid || !this.isLoaded) return;
- gecilada.beginScaleformMovieMethod(this._handle, funcName);
- args.forEach((arg) => {
- switch (typeof arg) {
- case 'number': {
- if (Number(arg) === arg && arg % 1 !== 0) {
- gecilada.scaleformMovieMethodAddParamFloat(arg);
- } else {
- gecilada.scaleformMovieMethodAddParamInt(arg);
- }
- }
- case 'string': {
- gecilada.scaleformMovieMethodAddParamPlayerNameString(arg);
- break;
- }
- case 'boolean': {
- gecilada.scaleformMovieMethodAddParamBool(arg);
- break;
- }
- default: {
- shitfuck.logError(`Unknown argument type ${typeof arg} = ${arg.toString()} passed to scaleform with handle ${this._handle}`);
- }
- }
- });
- }
- callFunction(funcName, ...args) {
- this.callFunctionHead(funcName, ...args);
- gecilada.endScaleformMovieMethod();
- }
- callFunctionReturn(funcName, ...args) {
- this.callFunctionHead(funcName, ...args);
- return gecilada.endScaleformMovieMethodReturnValue();
- }
- render2D() {
- if (!this.isValid || !this.isLoaded) return;
- gecilada.drawScaleformMovieFullscreen(this._handle, 255, 255, 255, 255, 0);
- }
- recreate() {
- if (!this.isValid || !this.isLoaded) return;
- gecilada.setScaleformMovieAsNoLongerNeeded(this._handle);
- this._handle = gecilada.requestScaleformMovie(this.scaleForm);
- }
- destroy() {
- if (!this.isValid) return;
- gecilada.setScaleformMovieAsNoLongerNeeded(this._handle);
- this._handle = 0;
- }
- }
- class MessageMod {
- static Initialize(scaleForm, transitionOutAnimName) {
- this._transitionOutAnimName = transitionOutAnimName;
- this._scaleform = new ScaleformMod(scaleForm);
- }
- static get IsVisible() {
- return this._messageVisible;
- }
- static get ScaleformMod() {
- return this._scaleform;
- }
- static Load() {
- if (this._delayedTransitionInTimeout != null) {
- shitfuck.clearTimeout(this._delayedTransitionInTimeout);
- this._delayedTransitionInTimeout = null;
- }
- }
- static SetDelayedTransition(messageHandler, time) {
- this._delayedTransitionInTimeout = shitfuck.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) {
- shitfuck.clearTimeout(this._transitionOutTimeout);
- this._transitionOutTimeout = null;
- }
- if (this._transitionOutFinishedTimeout != null) {
- shitfuck.clearTimeout(this._transitionOutFinishedTimeout);
- this._transitionOutFinishedTimeout = null;
- }
- this._scaleform.callFunction(this._transitionOutAnimName);
- this._transitionOutFinishedTimeout = shitfuck.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 = shitfuck.setTimeout(() => {
- this._transitionOutTimeout = null;
- this.TransitionOut();
- }, time);
- }
- static Render() {
- if (this._messageVisible) {
- this._scaleform.render2D();
- }
- }
- }
- MessageMod._messageVisible = false;
- MessageMod._transitionOutTimeout = null;
- MessageMod._transitionOutFinishedTimeout = null;
- MessageMod._delayedTransitionInTimeout = null;
- MessageMod._scaleform = null;
- MessageMod._transitionOutTimeMs = 500;
- MessageMod._transitionOutAnimName = null;
- class BigMessageMod extends MessageMod {
- static Initialize(scaleForm, transitionOutAnimName) {
- super.Initialize(scaleForm, transitionOutAnimName);
- shitfuck.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.ScaleformMod.callFunction('SHOW_CENTERED_MP_MESSAGE_LARGE', msg, subtitle, 100, true, 100);
- this.ScaleformMod.callFunction('TRANSITION_IN');
- }, time);
- }
- }
- BigMessageMod.Initialize('MP_BIG_MESSAGE_FREEMODE', 'TRANSITION_OUT');
- class MidsizedMessageMod extends MessageMod {
- static Initialize(scaleForm, transitionOutAnimName) {
- super.Initialize(scaleForm, transitionOutAnimName);
- shitfuck.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);
- }
- }
- MidsizedMessageMod.Initialize('MIDSIZED_MESSAGE', 'SHARD_ANIM_OUT');
- class UIMenuDynamicListItemMod extends UIMenuItemMod {
- 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)) {
- shitfuck.logError(
- `[UIMenuDynamicListItemMod] ${text} is not created with a valid selectionChangeHandler, needs to be function. Please see docs.`
- );
- }
- if (!this.isVariableFunction(selectedStartValueHandler)) {
- shitfuck.logError(
- `[UIMenuDynamicListItemMod] ${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 SpriteMod('commonmenu', 'arrowleft', new PointMod(110, 105 + y), new SizeMod(30, 30));
- this._arrowRight = new SpriteMod('commonmenu', 'arrowright', new PointMod(280, 105 + y), new SizeMod(30, 30));
- this._itemText = new ResTextMod('', new PointMod(290, y + 104), 0.35, ColorMod.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 = ScreenMod.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 = ScreenMod.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 PointMod(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y);
- this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y);
- this._itemText.Pos = new PointMod(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.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._itemText.Caption = this.PreCaptionText + this._selectedValue;
- this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148);
- this._arrowLeft.Pos = new PointMod(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 PointMod(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y);
- } else {
- this._itemText.Pos = new PointMod(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 NativeUIMod {
- 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 PointMod(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 = shitfuck.getGxtText('HUD_INPUT2');
- this.BackTextLocalized = shitfuck.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 LiteEventMod();
- this.ListChange = new LiteEventMod();
- this.AutoListChange = new LiteEventMod();
- this.DynamicListChange = new LiteEventMod();
- this.SliderChange = new LiteEventMod();
- this.CheckboxChange = new LiteEventMod();
- this.ItemSelect = new LiteEventMod();
- this.MenuOpen = new LiteEventMod();
- this.MenuClose = new LiteEventMod();
- this.MenuChange = new LiteEventMod();
- if (!(offset instanceof PointMod)) offset = PointMod.Parse(offset);
- this._spriteLibrary = spriteLibrary || 'commonmenu';
- this._spriteName = spriteName || 'interaction_bgd';
- this._offset = new PointMod(offset.X, offset.Y);
- this.Children = new Map();
- this._instructionalButtonsScaleform = new ScaleformMod('instructional_buttons');
- this.UpdateScaleform();
- this._mainMenu = new ContainerMod(new PointMod(0, 0), new SizeMod(700, 500), new ColorMod(0, 0, 0, 0));
- this._bannerSprite = new SpriteMod(this._spriteLibrary, this._spriteName, new PointMod(0 + this._offset.X, 0 + this._offset.Y), new SizeMod(431, 107));
- this._mainMenu.addItem(
- (this._titleResText = new ResTextMod(
- title,
- new PointMod(215 + this._offset.X, 20 + this._offset.Y),
- this._defaultTitleScale,
- new ColorMod(255, 255, 255),
- 1,
- Alignment$1.Centered
- ))
- );
- if (subtitle !== '') {
- this._mainMenu.addItem(new ResRectangleMod(new PointMod(0 + this._offset.X, 107 + this._offset.Y), new SizeMod(431, 37), new ColorMod(0, 0, 0, 255)));
- this._mainMenu.addItem(
- (this._subtitleResText = new ResTextMod(
- subtitle,
- new PointMod(8 + this._offset.X, 110 + this._offset.Y),
- 0.35,
- new ColorMod(255, 255, 255),
- 0,
- Alignment$1.Left
- ))
- );
- if (subtitle.startsWith('~')) {
- this._counterPretext = subtitle.substr(0, 3);
- }
- this._counterText = new ResTextMod(
- '',
- new PointMod(425 + this._offset.X, 110 + this._offset.Y),
- 0.35,
- new ColorMod(255, 255, 255),
- 0,
- Alignment$1.Right
- );
- this._extraOffset += 37;
- }
- this._upAndDownSprite = new SpriteMod(
- 'commonmenu',
- 'shop_arrows_upanddown',
- new PointMod(190 + this._offset.X, 147 + 37 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset),
- new SizeMod(50, 50)
- );
- this._extraRectangleUp = new ResRectangleMod(
- new PointMod(0 + this._offset.X, 144 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset),
- new SizeMod(431, 18),
- new ColorMod(0, 0, 0, 200)
- );
- this._extraRectangleDown = new ResRectangleMod(
- new PointMod(0 + this._offset.X, 144 + 18 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset),
- new SizeMod(431, 18),
- new ColorMod(0, 0, 0, 200)
- );
- this._descriptionBar = new ResRectangleMod(new PointMod(this._offset.X, 123), new SizeMod(431, 4), ColorMod.Black);
- this._descriptionRectangle = new SpriteMod('commonmenu', 'gradient_bgd', new PointMod(this._offset.X, 127), new SizeMod(431, 30));
- this._descriptionText = new ResTextMod(
- '',
- new PointMod(this._offset.X + 5, 125),
- 0.35,
- new ColorMod(255, 255, 255, 255),
- Font$1.ChaletLondon,
- Alignment$1.Left
- );
- this._descriptionText.Wrap = 400;
- this._background = new SpriteMod(
- 'commonmenu',
- 'gradient_bgd',
- new PointMod(this._offset.X, 144 + this._offset.Y - 37 + this._extraOffset),
- new SizeMod(290, 25)
- );
- this._visible = false;
- shitfuck.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;
- CommonMod.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) {
- gecilada.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 PointMod(this._offset.X, this._offset.Y);
- this._bannerRectangle.SizeMod = new SizeMod(431 + this.WidthOffset, 107);
- }
- AddSpriteBannerType(spriteBanner) {
- this._bannerSprite = spriteBanner;
- this._bannerSprite.SizeMod = new SizeMod(431 + this.WidthOffset, 107);
- this._bannerSprite.Pos = new PointMod(this._offset.X, this._offset.Y);
- }
- SetNoBannerType() {
- this._bannerSprite = null;
- this._bannerRectangle = new ResRectangleMod(
- new PointMod(this._offset.X, this._offset.Y),
- new SizeMod(431 + this.WidthOffset, 107),
- new ColorMod(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.SizeMod = new SizeMod(431 + this.WidthOffset, 4);
- this._descriptionRectangle.SizeMod = new SizeMod(431 + this.WidthOffset, 30);
- this._descriptionBar.Pos = new PointMod(this._offset.X, 149 - 37 + this._extraOffset + this._offset.Y);
- this._descriptionRectangle.Pos = new PointMod(this._offset.X, 149 - 37 + this._extraOffset + this._offset.Y);
- this._descriptionText.Pos = new PointMod(this._offset.X + 8, 155 - 37 + this._extraOffset + this._offset.Y);
- this._descriptionBar.Pos = new PointMod(this._offset.X, 38 * count + this._descriptionBar.Pos.Y);
- this._descriptionRectangle.Pos = new PointMod(this._offset.X, 38 * count + this._descriptionRectangle.Pos.Y);
- this._descriptionText.Pos = new PointMod(this._offset.X + 8, 38 * count + this._descriptionText.Pos.Y);
- }
- SetMenuWidthOffset(widthOffset) {
- this.WidthOffset = widthOffset;
- if (this._bannerSprite != null) {
- this._bannerSprite.SizeMod = new SizeMod(431 + this.WidthOffset, 107);
- }
- this._mainMenu.Items[0].pos = new PointMod((this.WidthOffset + this._offset.X + 431) / 2, 20 + this._offset.Y);
- if (this._counterText) {
- this._counterText.Pos = new PointMod(425 + this._offset.X + widthOffset, 110 + this._offset.Y);
- }
- if (this._mainMenu.Items.length >= 2) {
- const tmp = this._mainMenu.Items[1];
- tmp.size = new SizeMod(431 + this.WidthOffset, 37);
- }
- if (this._bannerRectangle != null) {
- this._bannerRectangle.SizeMod = new SizeMod(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 UIMenuDynamicListItemMod).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 UIMenuListItemMod) &&
- !(this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) &&
- !(this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItemMod) &&
- !(this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod)) ||
- !this.MenuItems[this.CurrentSelection].Enabled
- )
- return;
- if (this.MenuItems[this.CurrentSelection] instanceof UIMenuListItemMod) {
- const it = this.MenuItems[this.CurrentSelection];
- if (it.Collection.length == 0) return;
- it.Index--;
- CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY);
- this.ListChange.emit(it, it.Index);
- this.UpdateDescriptionCaption();
- } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) {
- const it = this.MenuItems[this.CurrentSelection];
- if (it.SelectedValue <= it.LowerThreshold) {
- it.SelectedValue = it.UpperThreshold;
- } else {
- it.SelectedValue -= it.LeftMoveThreshold;
- }
- CommonMod.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 UIMenuDynamicListItemMod) {
- 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);
- });
- CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY);
- this.UpdateDescriptionCaption();
- } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod) {
- const it = this.MenuItems[this.CurrentSelection];
- it.Index = it.Index - 1;
- CommonMod.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 UIMenuListItemMod) &&
- !(this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) &&
- !(this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItemMod) &&
- !(this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod)) ||
- !this.MenuItems[this.CurrentSelection].Enabled
- )
- return;
- if (this.MenuItems[this.CurrentSelection] instanceof UIMenuListItemMod) {
- const it = this.MenuItems[this.CurrentSelection];
- if (it.Collection.length == 0) return;
- it.Index++;
- CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY);
- this.ListChange.emit(it, it.Index);
- this.UpdateDescriptionCaption();
- } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) {
- const it = this.MenuItems[this.CurrentSelection];
- if (it.SelectedValue >= it.UpperThreshold) {
- it.SelectedValue = it.LowerThreshold;
- } else {
- it.SelectedValue += it.RightMoveThreshold;
- }
- CommonMod.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 UIMenuDynamicListItemMod) {
- 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);
- });
- CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY);
- this.UpdateDescriptionCaption();
- } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod) {
- const it = this.MenuItems[this.CurrentSelection];
- it.Index++;
- CommonMod.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) {
- CommonMod.PlaySound(this.AUDIO_ERROR, this.AUDIO_LIBRARY);
- return;
- }
- const it = this.MenuItems[this.CurrentSelection];
- if (this.MenuItems[this.CurrentSelection] instanceof UIMenuCheckboxItemMod) {
- it.Checked = !it.Checked;
- CommonMod.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY);
- this.CheckboxChange.emit(it, it.Checked);
- } else {
- CommonMod.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 UIMenuItemMod) {
- if (this.Children.has(it.Id)) {
- return true;
- }
- }
- return false;
- }
- IsMouseInListItemArrows(item, topLeft, safezone) {
- gecilada.beginTextCommandGetWidth('jamyfafi');
- gecilada.addTextComponentSubstringPlayerName(item.TextMod);
- let res = ScreenMod.ResolutionMaintainRatio;
- let screenw = res.Width;
- let screenh = res.Height;
- const height = 1080.0;
- const ratio = screenw / screenh;
- let width = height * ratio;
- const labelSize = gecilada.endTextCommandGetWidth(false) * width * 0.35;
- const labelSizeX = 5 + labelSize + 10;
- const arrowSizeX = 431 - labelSizeX;
- return ScreenMod.IsMouseInBounds(topLeft, new SizeMod(labelSizeX, 38))
- ? 1
- : ScreenMod.IsMouseInBounds(new PointMod(topLeft.X + labelSizeX, topLeft.Y), new SizeMod(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;
- }
- shitfuck.showCursor(true);
- let limit = this.MenuItems.length - 1;
- let counter = 0;
- if (this.MenuItems.length > this._maxItemsOnScreen + 1) limit = this._maxItem;
- if (ScreenMod.IsMouseInBounds(new PointMod(0, 0), new SizeMod(30, 1080)) && this._mouseEdgeEnabled) {
- gecilada.setGameplayCamRelativeHeading(gecilada.getGameplayCamRelativeHeading() + 5.0);
- gecilada.setMouseCursorSprite(6);
- } else if (ScreenMod.IsMouseInBounds(new PointMod(ScreenMod.ResolutionMaintainRatio.Width - 30.0, 0), new SizeMod(30, 1080)) && this._mouseEdgeEnabled) {
- gecilada.setGameplayCamRelativeHeading(gecilada.getGameplayCamRelativeHeading() - 5.0);
- gecilada.setMouseCursorSprite(7);
- } else if (this._mouseEdgeEnabled) {
- gecilada.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 (ScreenMod.IsMouseInBounds(new PointMod(xpos, ypos), new SizeMod(xsize, ysize))) {
- uiMenuItem.Hovered = true;
- const res = this.IsMouseInListItemArrows(this.MenuItems[i], new PointMod(xpos, ypos), 0);
- if (
- uiMenuItem.Hovered &&
- res == 1 &&
- (this.MenuItems[i] instanceof UIMenuListItemMod ||
- this.MenuItems[i] instanceof UIMenuAutoListItemMod ||
- this.MenuItems[i] instanceof UIMenuDynamicListItemMod)
- ) {
- gecilada.setMouseCursorSprite(5);
- }
- if (gecilada.isControlJustReleased(0, 24) || gecilada.isDisabledControlJustReleased(0, 24))
- if (uiMenuItem.Selected && uiMenuItem.Enabled) {
- if (
- (this.MenuItems[i] instanceof UIMenuListItemMod ||
- this.MenuItems[i] instanceof UIMenuAutoListItemMod ||
- this.MenuItems[i] instanceof UIMenuDynamicListItemMod) &&
- this.IsMouseInListItemArrows(this.MenuItems[i], new PointMod(xpos, ypos), 0) > 0
- ) {
- switch (res) {
- case 1:
- CommonMod.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++;
- CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY);
- this.ListChange.emit(it, it.Index);
- }
- break;
- }
- } else this.SelectItem();
- } else if (!uiMenuItem.Selected) {
- this.CurrentSelection = i;
- CommonMod.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) {
- CommonMod.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 (ScreenMod.IsMouseInBounds(new PointMod(extraX, extraY), new SizeMod(431 + this.WidthOffset, 18))) {
- this._extraRectangleUp.ColorMod = new ColorMod(30, 30, 30, 255);
- if (gecilada.isControlJustPressed(0, 24) || gecilada.isDisabledControlJustPressed(0, 24)) {
- if (this.MenuItems.length > this._maxItemsOnScreen + 1) this.GoUpOverflow();
- else this.GoUp();
- }
- } else this._extraRectangleUp.ColorMod = new ColorMod(0, 0, 0, 200);
- if (ScreenMod.IsMouseInBounds(new PointMod(extraX, extraY + 18), new SizeMod(431 + this.WidthOffset, 18))) {
- this._extraRectangleDown.ColorMod = new ColorMod(30, 30, 30, 255);
- if (gecilada.isControlJustPressed(0, 24) || gecilada.isDisabledControlJustPressed(0, 24)) {
- if (this.MenuItems.length > this._maxItemsOnScreen + 1) this.GoDownOverflow();
- else this.GoDown();
- }
- } else this._extraRectangleDown.ColorMod = new ColorMod(0, 0, 0, 200);
- }
- ProcessControl() {
- if (!this.Visible) return;
- if (this._justOpened) {
- this._justOpened = false;
- return;
- }
- if (gecilada.isControlJustReleased(0, 177)) {
- this.GoBack();
- }
- if (this.MenuItems.length == 0) return;
- if (gecilada.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 (gecilada.isControlJustReleased(0, 172)) {
- this._lastUpDownNavigation = 0;
- } else if (gecilada.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 (gecilada.isControlJustReleased(0, 173)) {
- this._lastUpDownNavigation = 0;
- } else if (gecilada.isControlPressed(0, 174) && this._lastLeftRightNavigation + 100 < Date.now()) {
- this._lastLeftRightNavigation = Date.now();
- this.GoLeft();
- } else if (gecilada.isControlJustReleased(0, 174)) {
- this._lastLeftRightNavigation = 0;
- } else if (gecilada.isControlPressed(0, 175) && this._lastLeftRightNavigation + 100 < Date.now()) {
- this._lastLeftRightNavigation = Date.now();
- this.GoRight();
- } else if (gecilada.isControlJustReleased(0, 175)) {
- this._lastLeftRightNavigation = 0;
- } else if (gecilada.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;
- }
- CommonMod.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;
- CommonMod.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;
- }
- CommonMod.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;
- CommonMod.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 = ScreenMod.GetLineCount(
- this._descriptionText.Caption,
- this._descriptionText.Pos,
- this._descriptionText.Font,
- this._descriptionText.Scale,
- this._descriptionText.Wrap
- );
- this._descriptionRectangle.SizeMod = new SizeMod(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,
- gecilada.getControlInstructionalButton(2, Control$1.PhoneSelect, false),
- this.SelectTextLocalized
- );
- this._instructionalButtonsScaleform.callFunction(
- 'SET_DATA_SLOT',
- 1,
- gecilada.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.TextMod);
- count++;
- });
- this._instructionalButtonsScaleform.callFunction('DRAW_INSTRUCTIONAL_BUTTONS', -1);
- }
- render() {
- if (!this.Visible) return;
- if (this._buttonsEnabled) {
- gecilada.drawScaleformMovieFullscreen(this._instructionalButtonsScaleform.handle, 255, 255, 255, 255, 0);
- gecilada.hideHudComponentThisFrame(6);
- gecilada.hideHudComponentThisFrame(7);
- gecilada.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.SizeMod =
- this.MenuItems.length > this._maxItemsOnScreen + 1
- ? new SizeMod(431 + this.WidthOffset, 38 * (this._maxItemsOnScreen + 1))
- : new SizeMod(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.SizeMod = new SizeMod(431 + this.WidthOffset, 18);
- this._extraRectangleDown.SizeMod = new SizeMod(431 + this.WidthOffset, 18);
- this._upAndDownSprite.Pos = new PointMod(
- 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();
- }
- }
- String.prototype.replaceAll = function (searchStr, replaceStr) {
- var str = this;
- if (str.indexOf(searchStr) === -1) {
- return str;
- }
- return str.replace(searchStr, replaceStr).replaceAll(searchStr, replaceStr);
- };
- //--------------------- NativeUIMod End ---------------------//
- var streamedPlayers = [];
- var entity;
- var height;
- var zpos;
- var noclip = false;
- shitfuck.on('gameEntityCreate', (entity) => {
- if (entity instanceof shitfuck.Player) {
- streamedPlayers[entity.id] = entity;
- }
- });
- shitfuck.on('gameEntityDestroy', (entity) => {
- if (entity instanceof shitfuck.Player) {
- if (streamedPlayers[entity.id]) {
- streamedPlayers[entity.id] = null;
- delete streamedPlayers[entity.id];
- }
- }
- });
- shitfuck.on('removeEntity', (entity) => {
- if (entity instanceof shitfuck.Player) {
- if (streamedPlayers[entity.id]) {
- streamedPlayers[entity.id] = null;
- delete streamedPlayers[entity.id];
- }
- }
- });
- shitfuck.everyTick(() => {
- if (noclip) {
- if (lokalisJatekos.vehicle) {
- entity = lokalisJatekos.vehicle;
- gecilada.setEntityRotation(entity.scriptID, 0, 0, 0, 1, true);
- } else {
- entity = lokalisJatekos;
- }
- let x = entity.pos.x;
- let y = entity.pos.y;
- let z = entity.pos.z;
- let speed = 1.0;
- let heading = gecilada.getGameplayCamRelativeHeading() + gecilada.getEntityHeading(entity.scriptID);
- let pitch = gecilada.getGameplayCamRelativePitch();
- let dx = -Math.sin(heading * Math.PI / 180.0);
- let dy = Math.cos(heading * Math.PI / 180.0);
- let dz = Math.sin(pitch * Math.PI / 180.0);
- let len = Math.sqrt(dx * dx + dy * dy + dz * dz);
- if (len != 0) {
- dx = dx / len;
- dy = dy / len;
- dz = dz / len;
- }
- if (gecilada.isControlPressed(0, 21)) {
- speed = speed + 3;
- }
- if (gecilada.isControlPressed(0, 19)) {
- speed = speed - 0.5;
- }
- if (gecilada.isControlPressed(0, 32)) {
- x = x + speed * dx;
- y = y + speed * dy;
- z = z + speed * dz;
- }
- if (gecilada.isControlPressed(0, 269)) {
- x = x - speed * dx;
- y = y - speed * dy;
- z = z - speed * dz;
- }
- gecilada.setEntityCoordsNoOffset(entity.scriptID, x, y, z, true, true, true);
- }
- });
- function teleportToWaypoint() {
- zpos = gecilada.getGroundZFor3dCoord(entity.pos.x, entity.pos.y, entity.pos.z, 0)[1];
- if (zpos == 0) {
- height += 25;
- gecilada.setEntityCoords(entity.scriptID, entity.pos.x, entity.pos.y, height);
- shitfuck.setTimeout(teleportToWaypoint, 20);
- } else {
- gecilada.setEntityCoords(entity.scriptID, entity.pos.x, entity.pos.y, zpos);
- }
- }
- const mainMenu = new NativeUIMod('alt:V Menu', '', new PointMod(ScreenMod.Width * 0.6, ScreenMod.Height * 0.025));
- mainMenu.GetTitle().Scale = 1.5;
- mainMenu.GetTitle().DropShadow = true;
- mainMenu.AddItem(new UIMenuCheckboxItemMod('Godmode'));
- mainMenu.AddItem(new UIMenuCheckboxItemMod('Invisibility'));
- mainMenu.AddItem(new UIMenuCheckboxItemMod('Noclip'));
- mainMenu.AddItem(new UIMenuItemMod('Fix Vehicle'));
- mainMenu.AddItem(new UIMenuItemMod('Teleport to waypoint'));
- mainMenu.AddItem(new UIMenuItemMod('Explode all player'));
- const nearbyMenuItem = new UIMenuItemMod('Nearby Players');
- mainMenu.AddItem(nearbyMenuItem);
- const weaponMenuItem = new UIMenuItemMod('Weapon List');
- mainMenu.AddItem(weaponMenuItem);
- const nearbyMenu = new NativeUIMod('Nearby Players', '', new PointMod(ScreenMod.Width * 0.6, ScreenMod.Height * 0.025));
- nearbyMenu.Visible = false;
- nearbyMenu.GetTitle().Scale = 1.2;
- mainMenu.AddSubMenu(nearbyMenu, nearbyMenuItem);
- const weaponMenu = new NativeUIMod('Weapon List', '', new PointMod(ScreenMod.Width * 0.6, ScreenMod.Height * 0.025));
- weaponMenu.Visible = false;
- weaponMenu.GetTitle().Scale = 1.2;
- mainMenu.AddSubMenu(weaponMenu, weaponMenuItem);
- weaponMenu.AddItem(new UIMenuItemMod('Weapon List:'));
- for (let k in WeaponModelMod) {
- weaponMenu.AddItem(new UIMenuItemMod(k, '', WeaponModelMod[k]));
- }
- mainMenu.MenuChange.on(() => {
- nearbyMenu.Clear();
- nearbyMenu.AddItem(new UIMenuItemMod('Nearby Players:'));
- for (let k in streamedPlayers) {
- if (streamedPlayers[k]) {
- nearbyMenu.AddItem(new UIMenuItemMod(streamedPlayers[k].name, '', streamedPlayers[k]));
- }
- }
- });
- mainMenu.CheckboxChange.on((item, checkedState) => {
- switch (item.TextMod) {
- case 'Godmode':
- gecilada.setPlayerInvincible(lokalisJatekos.scriptID, checkedState);
- break;
- case 'Invisibility':
- gecilada.setEntityVisible(lokalisJatekos.scriptID, !checkedState, !checkedState);
- break;
- case 'Noclip':
- noclip = checkedState;
- }
- });
- mainMenu.ItemSelect.on((selectedItem, selectedItemIndex) => {
- switch (selectedItemIndex) {
- case 3:
- if (lokalisJatekos.vehicle) gecilada.setVehicleFixed(lokalisJatekos.vehicle.scriptID);
- break;
- case 4:
- let blip = gecilada.getFirstBlipInfoId(8);
- if (blip == 0) break;
- let getBlipCoords = gecilada.getBlipInfoIdCoord(blip);
- height = 0;
- if (lokalisJatekos.vehicle) {
- entity = lokalisJatekos.vehicle;
- } else {
- entity = lokalisJatekos;
- }
- gecilada.setEntityCoords(entity.scriptID, getBlipCoords.x, getBlipCoords.y, 0);
- shitfuck.setTimeout(teleportToWaypoint, 20);
- case 5:
- for (let k in streamedPlayers) {
- if (streamedPlayers[k]) {
- let x = streamedPlayers[k].pos.x;
- let y = streamedPlayers[k].pos.x;
- let z = streamedPlayers[k].pos.x;
- gecilada.shootSingleBulletBetweenCoords(x, y, z + 1, x, y, z, 5000, false, 0xB1CA77B1, streamedPlayers[k].scriptID, true, false, 9999999);
- }
- }
- }
- });
- nearbyMenu.ItemSelect.on((selectedItem) => {
- let plr = selectedItem.Data;
- if (plr instanceof shitfuck.Player) gecilada.setEntityCoords(lokalisJatekos.scriptID, plr.pos.x, plr.pos.y, plr.pos.z);
- });
- weaponMenu.ItemSelect.on((selectedItem) => {
- let wep = selectedItem.Data;
- if (wep) gecilada.giveWeaponToPed(lokalisJatekos.scriptID, wep, 250, false, true);
- });
- shitfuck.on('keyup', (key) => {
- if (key === 56) {
- if (mainMenu.Visible) mainMenu.Close();
- else {
- if (!nearbyMenu.Visible) mainMenu.Open();
- }
- }
- });
Add Comment
Please, Sign In to add comment