SHOW:
|
|
- or go back to the newest paste.
1 | import * as shitfuck from 'alt-client'; | |
2 | import * as gecilada from 'natives'; | |
3 | ||
4 | const lokalisJatekos = shitfuck.Player.local; | |
5 | ||
6 | const WeaponModelMod = { | |
7 | CombatPdw: 0x0A3D4D34, | |
8 | HeavySniperMk2: 0x0A914799, | |
9 | HeavySniper: 0x0C472FE2, | |
10 | SniperRifle: 0x05FC3C11, | |
11 | FireExtinguisher: 0x060EC506, | |
12 | CompactLauncher: 0x0781FE4A, | |
13 | Snowball: 0x0787F0BB, | |
14 | VintagePistol: 0x083839C4, | |
15 | Pistol: 0x1B06D571, | |
16 | PumpShotgun: 0x1D073A89, | |
17 | CeramicPistol: 0x2B5EF5EC, | |
18 | Smg: 0x2BE6766B, | |
19 | StickyBomb: 0x2C3731D9, | |
20 | HeavyShotgun: 0x3AABBBAA, | |
21 | GrenadeLauncherSmoke: 0x4DD2DC56, | |
22 | Hammer: 0x4E875F73, | |
23 | CombatPistol: 0x5EF9FEC4, | |
24 | MarksmanRifleMk2: 0x6A6C02E0, | |
25 | Railgun: 0x6D544C99, | |
26 | BullpupRifle: 0x7F229F94, | |
27 | Firework: 0x7F7497E5, | |
28 | CombatMg: 0x7FD62962, | |
29 | Flashlight: 0x8BB05FD7, | |
30 | Mg: 0x9D07F764, | |
31 | BullpupShotgun: 0x9D61E50F, | |
32 | AutoShotgun: 0x12E82D3D, | |
33 | APPistol: 0x22D8FE39, | |
34 | Ball: 0x23C9F95C, | |
35 | Molotov: 0x24B17070, | |
36 | PetrolCan: 0x34A67B97, | |
37 | Minigun: 0x42BF8A85, | |
38 | HomingLauncher: 0x63AB0442, | |
39 | SmgMk2: 0x78A97CD0, | |
40 | CarbineRifle: 0x83BF0278, | |
41 | Crowbar: 0x84BD7BFD, | |
42 | BullpupRifleMk2: 0x84D6FAFD, | |
43 | Dagger: 0x92A27487, | |
44 | Grenade: 0x93E220BD, | |
45 | DoubleAction: 0x97EA20B8, | |
46 | Pistol50: 0x99AEEB3B, | |
47 | Knife: 0x99B507EA, | |
48 | AssaultRifleMk2: 0x394F415C, | |
49 | GolfClub: 0x440E4788, | |
50 | Raycarbine: 0x476BF155, | |
51 | Flare: 0x497FACC3, | |
52 | PumpShotgunMk2: 0x555AF99A, | |
53 | CompactRifle: 0x624FE830, | |
54 | Nightstick: 0x678B81B1, | |
55 | NavyRevolver: 0x917F6C8C, | |
56 | Bat: 0x958A4A8F, | |
57 | SpecialCarbineMk2: 0x969C3D67, | |
58 | StunGun: 0x3656C8C1, | |
59 | StoneHatchet: 0x3813FC08, | |
60 | SawnOffShotgun: 0x7846A318, | |
61 | Wrench: 0x19044EE0, | |
62 | MicroSmg: 0x13532244, | |
63 | FlareGun: 0x47757124, | |
64 | Gusenberg: 0x61012683, | |
65 | SNSPistolMk2: 0x88374054, | |
66 | PoolCue: 0x94117305, | |
67 | BzGas: 0xA0973D5E, | |
68 | Musket: 0xA89CB99E, | |
69 | GrenadeLauncher: 0xA284510B, | |
70 | Unarmed: 0xA2719263, | |
71 | ProxMine: 0xAB564B93, | |
72 | AdvancedRifle: 0xAF113F99, | |
73 | Raypistol: 0xAF3696A1, | |
74 | Rpg: 0xB1CA77B1, | |
75 | Rayminigun: 0xB62D1F67, | |
76 | PipeBomb: 0xBA45E8B8, | |
77 | HazardCan: 0xBA536372, | |
78 | MiniSmg: 0xBD248B55, | |
79 | SNSPistol: 0xBFD21232, | |
80 | PistolMk2: 0xBFE256D4, | |
81 | AssaultRifle: 0xBFEFFF6D, | |
82 | SpecialCarbine: 0xC0A3098D, | |
83 | Revolver: 0xC1B3C3D1, | |
84 | MarksmanRifle: 0xC734385A, | |
85 | RevolverMk2: 0xCB96392F, | |
86 | BattleAxe: 0xCD274149, | |
87 | Knuckle: 0xD8DF3C3C, | |
88 | HeavyPistol: 0xD205520E, | |
89 | MachinePistol: 0xDB1AA450, | |
90 | CombatMgMk2: 0xDBBD7280, | |
91 | MarksmanPistol: 0xDC4DB296, | |
92 | Machete: 0xDD5DF8D9, | |
93 | Switchblade: 0xDFE37640, | |
94 | AssaultShotgun: 0xE284C527, | |
95 | DbShotgun: 0xEF951FBB, | |
96 | AssaultSmg: 0xEFE7E2DF, | |
97 | Hatchet: 0xF9DCBF2D, | |
98 | Bottle: 0xF9E6AA4B, | |
99 | CarbineRifleMk2: 0xFAD1F1C9, | |
100 | Parachute: 0xFBAB5776, | |
101 | SmokeGrenade: 0xFDBC8A50 | |
102 | }; | |
103 | ||
104 | var BadgeStyle; | |
105 | (function (BadgeStyle) { | |
106 | BadgeStyle[(BadgeStyle['None'] = 0)] = 'None'; | |
107 | BadgeStyle[(BadgeStyle['BronzeMedal'] = 1)] = 'BronzeMedal'; | |
108 | BadgeStyle[(BadgeStyle['GoldMedal'] = 2)] = 'GoldMedal'; | |
109 | BadgeStyle[(BadgeStyle['SilverMedal'] = 3)] = 'SilverMedal'; | |
110 | BadgeStyle[(BadgeStyle['Alert'] = 4)] = 'Alert'; | |
111 | BadgeStyle[(BadgeStyle['Crown'] = 5)] = 'Crown'; | |
112 | BadgeStyle[(BadgeStyle['Ammo'] = 6)] = 'Ammo'; | |
113 | BadgeStyle[(BadgeStyle['Armour'] = 7)] = 'Armour'; | |
114 | BadgeStyle[(BadgeStyle['Barber'] = 8)] = 'Barber'; | |
115 | BadgeStyle[(BadgeStyle['Clothes'] = 9)] = 'Clothes'; | |
116 | BadgeStyle[(BadgeStyle['Franklin'] = 10)] = 'Franklin'; | |
117 | BadgeStyle[(BadgeStyle['Bike'] = 11)] = 'Bike'; | |
118 | BadgeStyle[(BadgeStyle['Car'] = 12)] = 'Car'; | |
119 | BadgeStyle[(BadgeStyle['Gun'] = 13)] = 'Gun'; | |
120 | BadgeStyle[(BadgeStyle['Heart'] = 14)] = 'Heart'; | |
121 | BadgeStyle[(BadgeStyle['Makeup'] = 15)] = 'Makeup'; | |
122 | BadgeStyle[(BadgeStyle['Mask'] = 16)] = 'Mask'; | |
123 | BadgeStyle[(BadgeStyle['Michael'] = 17)] = 'Michael'; | |
124 | BadgeStyle[(BadgeStyle['Star'] = 18)] = 'Star'; | |
125 | BadgeStyle[(BadgeStyle['Tattoo'] = 19)] = 'Tattoo'; | |
126 | BadgeStyle[(BadgeStyle['Trevor'] = 20)] = 'Trevor'; | |
127 | BadgeStyle[(BadgeStyle['Lock'] = 21)] = 'Lock'; | |
128 | BadgeStyle[(BadgeStyle['Tick'] = 22)] = 'Tick'; | |
129 | BadgeStyle[(BadgeStyle['Sale'] = 23)] = 'Sale'; | |
130 | BadgeStyle[(BadgeStyle['ArrowLeft'] = 24)] = 'ArrowLeft'; | |
131 | BadgeStyle[(BadgeStyle['ArrowRight'] = 25)] = 'ArrowRight'; | |
132 | BadgeStyle[(BadgeStyle['Audio1'] = 26)] = 'Audio1'; | |
133 | BadgeStyle[(BadgeStyle['Audio2'] = 27)] = 'Audio2'; | |
134 | BadgeStyle[(BadgeStyle['Audio3'] = 28)] = 'Audio3'; | |
135 | BadgeStyle[(BadgeStyle['AudioInactive'] = 29)] = 'AudioInactive'; | |
136 | BadgeStyle[(BadgeStyle['AudioMute'] = 30)] = 'AudioMute'; | |
137 | })(BadgeStyle || (BadgeStyle = {})); | |
138 | var BadgeStyle$1 = BadgeStyle; | |
139 | ||
140 | var Font; | |
141 | (function (Font) { | |
142 | Font[(Font['ChaletLondon'] = 0)] = 'ChaletLondon'; | |
143 | Font[(Font['HouseScript'] = 1)] = 'HouseScript'; | |
144 | Font[(Font['Monospace'] = 2)] = 'Monospace'; | |
145 | Font[(Font['CharletComprimeColonge'] = 4)] = 'CharletComprimeColonge'; | |
146 | Font[(Font['Pricedown'] = 7)] = 'Pricedown'; | |
147 | })(Font || (Font = {})); | |
148 | var Font$1 = Font; | |
149 | ||
150 | var Alignment; | |
151 | (function (Alignment) { | |
152 | Alignment[(Alignment['Left'] = 0)] = 'Left'; | |
153 | Alignment[(Alignment['Centered'] = 1)] = 'Centered'; | |
154 | Alignment[(Alignment['Right'] = 2)] = 'Right'; | |
155 | })(Alignment || (Alignment = {})); | |
156 | var Alignment$1 = Alignment; | |
157 | ||
158 | var Control; | |
159 | (function (Control) { | |
160 | Control[(Control['NextCamera'] = 0)] = 'NextCamera'; | |
161 | Control[(Control['LookLeftRight'] = 1)] = 'LookLeftRight'; | |
162 | Control[(Control['LookUpDown'] = 2)] = 'LookUpDown'; | |
163 | Control[(Control['LookUpOnly'] = 3)] = 'LookUpOnly'; | |
164 | Control[(Control['LookDownOnly'] = 4)] = 'LookDownOnly'; | |
165 | Control[(Control['LookLeftOnly'] = 5)] = 'LookLeftOnly'; | |
166 | Control[(Control['LookRightOnly'] = 6)] = 'LookRightOnly'; | |
167 | Control[(Control['CinematicSlowMo'] = 7)] = 'CinematicSlowMo'; | |
168 | Control[(Control['FlyUpDown'] = 8)] = 'FlyUpDown'; | |
169 | Control[(Control['FlyLeftRight'] = 9)] = 'FlyLeftRight'; | |
170 | Control[(Control['ScriptedFlyZUp'] = 10)] = 'ScriptedFlyZUp'; | |
171 | Control[(Control['ScriptedFlyZDown'] = 11)] = 'ScriptedFlyZDown'; | |
172 | Control[(Control['WeaponWheelUpDown'] = 12)] = 'WeaponWheelUpDown'; | |
173 | Control[(Control['WeaponWheelLeftRight'] = 13)] = 'WeaponWheelLeftRight'; | |
174 | Control[(Control['WeaponWheelNext'] = 14)] = 'WeaponWheelNext'; | |
175 | Control[(Control['WeaponWheelPrev'] = 15)] = 'WeaponWheelPrev'; | |
176 | Control[(Control['SelectNextWeapon'] = 16)] = 'SelectNextWeapon'; | |
177 | Control[(Control['SelectPrevWeapon'] = 17)] = 'SelectPrevWeapon'; | |
178 | Control[(Control['SkipCutscene'] = 18)] = 'SkipCutscene'; | |
179 | Control[(Control['CharacterWheel'] = 19)] = 'CharacterWheel'; | |
180 | Control[(Control['MultiplayerInfo'] = 20)] = 'MultiplayerInfo'; | |
181 | Control[(Control['Sprint'] = 21)] = 'Sprint'; | |
182 | Control[(Control['Jump'] = 22)] = 'Jump'; | |
183 | Control[(Control['Enter'] = 23)] = 'Enter'; | |
184 | Control[(Control['Attack'] = 24)] = 'Attack'; | |
185 | Control[(Control['Aim'] = 25)] = 'Aim'; | |
186 | Control[(Control['LookBehind'] = 26)] = 'LookBehind'; | |
187 | Control[(Control['Phone'] = 27)] = 'Phone'; | |
188 | Control[(Control['SpecialAbility'] = 28)] = 'SpecialAbility'; | |
189 | Control[(Control['SpecialAbilitySecondary'] = 29)] = 'SpecialAbilitySecondary'; | |
190 | Control[(Control['MoveLeftRight'] = 30)] = 'MoveLeftRight'; | |
191 | Control[(Control['MoveUpDown'] = 31)] = 'MoveUpDown'; | |
192 | Control[(Control['MoveUpOnly'] = 32)] = 'MoveUpOnly'; | |
193 | Control[(Control['MoveDownOnly'] = 33)] = 'MoveDownOnly'; | |
194 | Control[(Control['MoveLeftOnly'] = 34)] = 'MoveLeftOnly'; | |
195 | Control[(Control['MoveRightOnly'] = 35)] = 'MoveRightOnly'; | |
196 | Control[(Control['Duck'] = 36)] = 'Duck'; | |
197 | Control[(Control['SelectWeapon'] = 37)] = 'SelectWeapon'; | |
198 | Control[(Control['Pickup'] = 38)] = 'Pickup'; | |
199 | Control[(Control['SniperZoom'] = 39)] = 'SniperZoom'; | |
200 | Control[(Control['SniperZoomInOnly'] = 40)] = 'SniperZoomInOnly'; | |
201 | Control[(Control['SniperZoomOutOnly'] = 41)] = 'SniperZoomOutOnly'; | |
202 | Control[(Control['SniperZoomInSecondary'] = 42)] = 'SniperZoomInSecondary'; | |
203 | Control[(Control['SniperZoomOutSecondary'] = 43)] = 'SniperZoomOutSecondary'; | |
204 | Control[(Control['Cover'] = 44)] = 'Cover'; | |
205 | Control[(Control['Reload'] = 45)] = 'Reload'; | |
206 | Control[(Control['Talk'] = 46)] = 'Talk'; | |
207 | Control[(Control['Detonate'] = 47)] = 'Detonate'; | |
208 | Control[(Control['HUDSpecial'] = 48)] = 'HUDSpecial'; | |
209 | Control[(Control['Arrest'] = 49)] = 'Arrest'; | |
210 | Control[(Control['AccurateAim'] = 50)] = 'AccurateAim'; | |
211 | Control[(Control['Context'] = 51)] = 'Context'; | |
212 | Control[(Control['ContextSecondary'] = 52)] = 'ContextSecondary'; | |
213 | Control[(Control['WeaponSpecial'] = 53)] = 'WeaponSpecial'; | |
214 | Control[(Control['WeaponSpecial2'] = 54)] = 'WeaponSpecial2'; | |
215 | Control[(Control['Dive'] = 55)] = 'Dive'; | |
216 | Control[(Control['DropWeapon'] = 56)] = 'DropWeapon'; | |
217 | Control[(Control['DropAmmo'] = 57)] = 'DropAmmo'; | |
218 | Control[(Control['ThrowGrenade'] = 58)] = 'ThrowGrenade'; | |
219 | Control[(Control['VehicleMoveLeftRight'] = 59)] = 'VehicleMoveLeftRight'; | |
220 | Control[(Control['VehicleMoveUpDown'] = 60)] = 'VehicleMoveUpDown'; | |
221 | Control[(Control['VehicleMoveUpOnly'] = 61)] = 'VehicleMoveUpOnly'; | |
222 | Control[(Control['VehicleMoveDownOnly'] = 62)] = 'VehicleMoveDownOnly'; | |
223 | Control[(Control['VehicleMoveLeftOnly'] = 63)] = 'VehicleMoveLeftOnly'; | |
224 | Control[(Control['VehicleMoveRightOnly'] = 64)] = 'VehicleMoveRightOnly'; | |
225 | Control[(Control['VehicleSpecial'] = 65)] = 'VehicleSpecial'; | |
226 | Control[(Control['VehicleGunLeftRight'] = 66)] = 'VehicleGunLeftRight'; | |
227 | Control[(Control['VehicleGunUpDown'] = 67)] = 'VehicleGunUpDown'; | |
228 | Control[(Control['VehicleAim'] = 68)] = 'VehicleAim'; | |
229 | Control[(Control['VehicleAttack'] = 69)] = 'VehicleAttack'; | |
230 | Control[(Control['VehicleAttack2'] = 70)] = 'VehicleAttack2'; | |
231 | Control[(Control['VehicleAccelerate'] = 71)] = 'VehicleAccelerate'; | |
232 | Control[(Control['VehicleBrake'] = 72)] = 'VehicleBrake'; | |
233 | Control[(Control['VehicleDuck'] = 73)] = 'VehicleDuck'; | |
234 | Control[(Control['VehicleHeadlight'] = 74)] = 'VehicleHeadlight'; | |
235 | Control[(Control['VehicleExit'] = 75)] = 'VehicleExit'; | |
236 | Control[(Control['VehicleHandbrake'] = 76)] = 'VehicleHandbrake'; | |
237 | Control[(Control['VehicleHotwireLeft'] = 77)] = 'VehicleHotwireLeft'; | |
238 | Control[(Control['VehicleHotwireRight'] = 78)] = 'VehicleHotwireRight'; | |
239 | Control[(Control['VehicleLookBehind'] = 79)] = 'VehicleLookBehind'; | |
240 | Control[(Control['VehicleCinCam'] = 80)] = 'VehicleCinCam'; | |
241 | Control[(Control['VehicleNextRadio'] = 81)] = 'VehicleNextRadio'; | |
242 | Control[(Control['VehiclePrevRadio'] = 82)] = 'VehiclePrevRadio'; | |
243 | Control[(Control['VehicleNextRadioTrack'] = 83)] = 'VehicleNextRadioTrack'; | |
244 | Control[(Control['VehiclePrevRadioTrack'] = 84)] = 'VehiclePrevRadioTrack'; | |
245 | Control[(Control['VehicleRadioWheel'] = 85)] = 'VehicleRadioWheel'; | |
246 | Control[(Control['VehicleHorn'] = 86)] = 'VehicleHorn'; | |
247 | Control[(Control['VehicleFlyThrottleUp'] = 87)] = 'VehicleFlyThrottleUp'; | |
248 | Control[(Control['VehicleFlyThrottleDown'] = 88)] = 'VehicleFlyThrottleDown'; | |
249 | Control[(Control['VehicleFlyYawLeft'] = 89)] = 'VehicleFlyYawLeft'; | |
250 | Control[(Control['VehicleFlyYawRight'] = 90)] = 'VehicleFlyYawRight'; | |
251 | Control[(Control['VehiclePassengerAim'] = 91)] = 'VehiclePassengerAim'; | |
252 | Control[(Control['VehiclePassengerAttack'] = 92)] = 'VehiclePassengerAttack'; | |
253 | Control[(Control['VehicleSpecialAbilityFranklin'] = 93)] = 'VehicleSpecialAbilityFranklin'; | |
254 | Control[(Control['VehicleStuntUpDown'] = 94)] = 'VehicleStuntUpDown'; | |
255 | Control[(Control['VehicleCinematicUpDown'] = 95)] = 'VehicleCinematicUpDown'; | |
256 | Control[(Control['VehicleCinematicUpOnly'] = 96)] = 'VehicleCinematicUpOnly'; | |
257 | Control[(Control['VehicleCinematicDownOnly'] = 97)] = 'VehicleCinematicDownOnly'; | |
258 | Control[(Control['VehicleCinematicLeftRight'] = 98)] = 'VehicleCinematicLeftRight'; | |
259 | Control[(Control['VehicleSelectNextWeapon'] = 99)] = 'VehicleSelectNextWeapon'; | |
260 | Control[(Control['VehicleSelectPrevWeapon'] = 100)] = 'VehicleSelectPrevWeapon'; | |
261 | Control[(Control['VehicleRoof'] = 101)] = 'VehicleRoof'; | |
262 | Control[(Control['VehicleJump'] = 102)] = 'VehicleJump'; | |
263 | Control[(Control['VehicleGrapplingHook'] = 103)] = 'VehicleGrapplingHook'; | |
264 | Control[(Control['VehicleShuffle'] = 104)] = 'VehicleShuffle'; | |
265 | Control[(Control['VehicleDropProjectile'] = 105)] = 'VehicleDropProjectile'; | |
266 | Control[(Control['VehicleMouseControlOverride'] = 106)] = 'VehicleMouseControlOverride'; | |
267 | Control[(Control['VehicleFlyRollLeftRight'] = 107)] = 'VehicleFlyRollLeftRight'; | |
268 | Control[(Control['VehicleFlyRollLeftOnly'] = 108)] = 'VehicleFlyRollLeftOnly'; | |
269 | Control[(Control['VehicleFlyRollRightOnly'] = 109)] = 'VehicleFlyRollRightOnly'; | |
270 | Control[(Control['VehicleFlyPitchUpDown'] = 110)] = 'VehicleFlyPitchUpDown'; | |
271 | Control[(Control['VehicleFlyPitchUpOnly'] = 111)] = 'VehicleFlyPitchUpOnly'; | |
272 | Control[(Control['VehicleFlyPitchDownOnly'] = 112)] = 'VehicleFlyPitchDownOnly'; | |
273 | Control[(Control['VehicleFlyUnderCarriage'] = 113)] = 'VehicleFlyUnderCarriage'; | |
274 | Control[(Control['VehicleFlyAttack'] = 114)] = 'VehicleFlyAttack'; | |
275 | Control[(Control['VehicleFlySelectNextWeapon'] = 115)] = 'VehicleFlySelectNextWeapon'; | |
276 | Control[(Control['VehicleFlySelectPrevWeapon'] = 116)] = 'VehicleFlySelectPrevWeapon'; | |
277 | Control[(Control['VehicleFlySelectTargetLeft'] = 117)] = 'VehicleFlySelectTargetLeft'; | |
278 | Control[(Control['VehicleFlySelectTargetRight'] = 118)] = 'VehicleFlySelectTargetRight'; | |
279 | Control[(Control['VehicleFlyVerticalFlightMode'] = 119)] = 'VehicleFlyVerticalFlightMode'; | |
280 | Control[(Control['VehicleFlyDuck'] = 120)] = 'VehicleFlyDuck'; | |
281 | Control[(Control['VehicleFlyAttackCamera'] = 121)] = 'VehicleFlyAttackCamera'; | |
282 | Control[(Control['VehicleFlyMouseControlOverride'] = 122)] = 'VehicleFlyMouseControlOverride'; | |
283 | Control[(Control['VehicleSubTurnLeftRight'] = 123)] = 'VehicleSubTurnLeftRight'; | |
284 | Control[(Control['VehicleSubTurnLeftOnly'] = 124)] = 'VehicleSubTurnLeftOnly'; | |
285 | Control[(Control['VehicleSubTurnRightOnly'] = 125)] = 'VehicleSubTurnRightOnly'; | |
286 | Control[(Control['VehicleSubPitchUpDown'] = 126)] = 'VehicleSubPitchUpDown'; | |
287 | Control[(Control['VehicleSubPitchUpOnly'] = 127)] = 'VehicleSubPitchUpOnly'; | |
288 | Control[(Control['VehicleSubPitchDownOnly'] = 128)] = 'VehicleSubPitchDownOnly'; | |
289 | Control[(Control['VehicleSubThrottleUp'] = 129)] = 'VehicleSubThrottleUp'; | |
290 | Control[(Control['VehicleSubThrottleDown'] = 130)] = 'VehicleSubThrottleDown'; | |
291 | Control[(Control['VehicleSubAscend'] = 131)] = 'VehicleSubAscend'; | |
292 | Control[(Control['VehicleSubDescend'] = 132)] = 'VehicleSubDescend'; | |
293 | Control[(Control['VehicleSubTurnHardLeft'] = 133)] = 'VehicleSubTurnHardLeft'; | |
294 | Control[(Control['VehicleSubTurnHardRight'] = 134)] = 'VehicleSubTurnHardRight'; | |
295 | Control[(Control['VehicleSubMouseControlOverride'] = 135)] = 'VehicleSubMouseControlOverride'; | |
296 | Control[(Control['VehiclePushbikePedal'] = 136)] = 'VehiclePushbikePedal'; | |
297 | Control[(Control['VehiclePushbikeSprint'] = 137)] = 'VehiclePushbikeSprint'; | |
298 | Control[(Control['VehiclePushbikeFrontBrake'] = 138)] = 'VehiclePushbikeFrontBrake'; | |
299 | Control[(Control['VehiclePushbikeRearBrake'] = 139)] = 'VehiclePushbikeRearBrake'; | |
300 | Control[(Control['MeleeAttackLight'] = 140)] = 'MeleeAttackLight'; | |
301 | Control[(Control['MeleeAttackHeavy'] = 141)] = 'MeleeAttackHeavy'; | |
302 | Control[(Control['MeleeAttackAlternate'] = 142)] = 'MeleeAttackAlternate'; | |
303 | Control[(Control['MeleeBlock'] = 143)] = 'MeleeBlock'; | |
304 | Control[(Control['ParachuteDeploy'] = 144)] = 'ParachuteDeploy'; | |
305 | Control[(Control['ParachuteDetach'] = 145)] = 'ParachuteDetach'; | |
306 | Control[(Control['ParachuteTurnLeftRight'] = 146)] = 'ParachuteTurnLeftRight'; | |
307 | Control[(Control['ParachuteTurnLeftOnly'] = 147)] = 'ParachuteTurnLeftOnly'; | |
308 | Control[(Control['ParachuteTurnRightOnly'] = 148)] = 'ParachuteTurnRightOnly'; | |
309 | Control[(Control['ParachutePitchUpDown'] = 149)] = 'ParachutePitchUpDown'; | |
310 | Control[(Control['ParachutePitchUpOnly'] = 150)] = 'ParachutePitchUpOnly'; | |
311 | Control[(Control['ParachutePitchDownOnly'] = 151)] = 'ParachutePitchDownOnly'; | |
312 | Control[(Control['ParachuteBrakeLeft'] = 152)] = 'ParachuteBrakeLeft'; | |
313 | Control[(Control['ParachuteBrakeRight'] = 153)] = 'ParachuteBrakeRight'; | |
314 | Control[(Control['ParachuteSmoke'] = 154)] = 'ParachuteSmoke'; | |
315 | Control[(Control['ParachutePrecisionLanding'] = 155)] = 'ParachutePrecisionLanding'; | |
316 | Control[(Control['Map'] = 156)] = 'Map'; | |
317 | Control[(Control['SelectWeaponUnarmed'] = 157)] = 'SelectWeaponUnarmed'; | |
318 | Control[(Control['SelectWeaponMelee'] = 158)] = 'SelectWeaponMelee'; | |
319 | Control[(Control['SelectWeaponHandgun'] = 159)] = 'SelectWeaponHandgun'; | |
320 | Control[(Control['SelectWeaponShotgun'] = 160)] = 'SelectWeaponShotgun'; | |
321 | Control[(Control['SelectWeaponSmg'] = 161)] = 'SelectWeaponSmg'; | |
322 | Control[(Control['SelectWeaponAutoRifle'] = 162)] = 'SelectWeaponAutoRifle'; | |
323 | Control[(Control['SelectWeaponSniper'] = 163)] = 'SelectWeaponSniper'; | |
324 | Control[(Control['SelectWeaponHeavy'] = 164)] = 'SelectWeaponHeavy'; | |
325 | Control[(Control['SelectWeaponSpecial'] = 165)] = 'SelectWeaponSpecial'; | |
326 | Control[(Control['SelectCharacterMichael'] = 166)] = 'SelectCharacterMichael'; | |
327 | Control[(Control['SelectCharacterFranklin'] = 167)] = 'SelectCharacterFranklin'; | |
328 | Control[(Control['SelectCharacterTrevor'] = 168)] = 'SelectCharacterTrevor'; | |
329 | Control[(Control['SelectCharacterMultiplayer'] = 169)] = 'SelectCharacterMultiplayer'; | |
330 | Control[(Control['SaveReplayClip'] = 170)] = 'SaveReplayClip'; | |
331 | Control[(Control['SpecialAbilityPC'] = 171)] = 'SpecialAbilityPC'; | |
332 | Control[(Control['PhoneUp'] = 172)] = 'PhoneUp'; | |
333 | Control[(Control['PhoneDown'] = 173)] = 'PhoneDown'; | |
334 | Control[(Control['PhoneLeft'] = 174)] = 'PhoneLeft'; | |
335 | Control[(Control['PhoneRight'] = 175)] = 'PhoneRight'; | |
336 | Control[(Control['PhoneSelect'] = 176)] = 'PhoneSelect'; | |
337 | Control[(Control['PhoneCancel'] = 177)] = 'PhoneCancel'; | |
338 | Control[(Control['PhoneOption'] = 178)] = 'PhoneOption'; | |
339 | Control[(Control['PhoneExtraOption'] = 179)] = 'PhoneExtraOption'; | |
340 | Control[(Control['PhoneScrollForward'] = 180)] = 'PhoneScrollForward'; | |
341 | Control[(Control['PhoneScrollBackward'] = 181)] = 'PhoneScrollBackward'; | |
342 | Control[(Control['PhoneCameraFocusLock'] = 182)] = 'PhoneCameraFocusLock'; | |
343 | Control[(Control['PhoneCameraGrid'] = 183)] = 'PhoneCameraGrid'; | |
344 | Control[(Control['PhoneCameraSelfie'] = 184)] = 'PhoneCameraSelfie'; | |
345 | Control[(Control['PhoneCameraDOF'] = 185)] = 'PhoneCameraDOF'; | |
346 | Control[(Control['PhoneCameraExpression'] = 186)] = 'PhoneCameraExpression'; | |
347 | Control[(Control['FrontendDown'] = 187)] = 'FrontendDown'; | |
348 | Control[(Control['FrontendUp'] = 188)] = 'FrontendUp'; | |
349 | Control[(Control['FrontendLeft'] = 189)] = 'FrontendLeft'; | |
350 | Control[(Control['FrontendRight'] = 190)] = 'FrontendRight'; | |
351 | Control[(Control['FrontendRdown'] = 191)] = 'FrontendRdown'; | |
352 | Control[(Control['FrontendRup'] = 192)] = 'FrontendRup'; | |
353 | Control[(Control['FrontendRleft'] = 193)] = 'FrontendRleft'; | |
354 | Control[(Control['FrontendRright'] = 194)] = 'FrontendRright'; | |
355 | Control[(Control['FrontendAxisX'] = 195)] = 'FrontendAxisX'; | |
356 | Control[(Control['FrontendAxisY'] = 196)] = 'FrontendAxisY'; | |
357 | Control[(Control['FrontendRightAxisX'] = 197)] = 'FrontendRightAxisX'; | |
358 | Control[(Control['FrontendRightAxisY'] = 198)] = 'FrontendRightAxisY'; | |
359 | Control[(Control['FrontendPause'] = 199)] = 'FrontendPause'; | |
360 | Control[(Control['FrontendPauseAlternate'] = 200)] = 'FrontendPauseAlternate'; | |
361 | Control[(Control['FrontendAccept'] = 201)] = 'FrontendAccept'; | |
362 | Control[(Control['FrontendCancel'] = 202)] = 'FrontendCancel'; | |
363 | Control[(Control['FrontendX'] = 203)] = 'FrontendX'; | |
364 | Control[(Control['FrontendY'] = 204)] = 'FrontendY'; | |
365 | Control[(Control['FrontendLb'] = 205)] = 'FrontendLb'; | |
366 | Control[(Control['FrontendRb'] = 206)] = 'FrontendRb'; | |
367 | Control[(Control['FrontendLt'] = 207)] = 'FrontendLt'; | |
368 | Control[(Control['FrontendRt'] = 208)] = 'FrontendRt'; | |
369 | Control[(Control['FrontendLs'] = 209)] = 'FrontendLs'; | |
370 | Control[(Control['FrontendRs'] = 210)] = 'FrontendRs'; | |
371 | Control[(Control['FrontendLeaderboard'] = 211)] = 'FrontendLeaderboard'; | |
372 | Control[(Control['FrontendSocialClub'] = 212)] = 'FrontendSocialClub'; | |
373 | Control[(Control['FrontendSocialClubSecondary'] = 213)] = 'FrontendSocialClubSecondary'; | |
374 | Control[(Control['FrontendDelete'] = 214)] = 'FrontendDelete'; | |
375 | Control[(Control['FrontendEndscreenAccept'] = 215)] = 'FrontendEndscreenAccept'; | |
376 | Control[(Control['FrontendEndscreenExpand'] = 216)] = 'FrontendEndscreenExpand'; | |
377 | Control[(Control['FrontendSelect'] = 217)] = 'FrontendSelect'; | |
378 | Control[(Control['ScriptLeftAxisX'] = 218)] = 'ScriptLeftAxisX'; | |
379 | Control[(Control['ScriptLeftAxisY'] = 219)] = 'ScriptLeftAxisY'; | |
380 | Control[(Control['ScriptRightAxisX'] = 220)] = 'ScriptRightAxisX'; | |
381 | Control[(Control['ScriptRightAxisY'] = 221)] = 'ScriptRightAxisY'; | |
382 | Control[(Control['ScriptRUp'] = 222)] = 'ScriptRUp'; | |
383 | Control[(Control['ScriptRDown'] = 223)] = 'ScriptRDown'; | |
384 | Control[(Control['ScriptRLeft'] = 224)] = 'ScriptRLeft'; | |
385 | Control[(Control['ScriptRRight'] = 225)] = 'ScriptRRight'; | |
386 | Control[(Control['ScriptLB'] = 226)] = 'ScriptLB'; | |
387 | Control[(Control['ScriptRB'] = 227)] = 'ScriptRB'; | |
388 | Control[(Control['ScriptLT'] = 228)] = 'ScriptLT'; | |
389 | Control[(Control['ScriptRT'] = 229)] = 'ScriptRT'; | |
390 | Control[(Control['ScriptLS'] = 230)] = 'ScriptLS'; | |
391 | Control[(Control['ScriptRS'] = 231)] = 'ScriptRS'; | |
392 | Control[(Control['ScriptPadUp'] = 232)] = 'ScriptPadUp'; | |
393 | Control[(Control['ScriptPadDown'] = 233)] = 'ScriptPadDown'; | |
394 | Control[(Control['ScriptPadLeft'] = 234)] = 'ScriptPadLeft'; | |
395 | Control[(Control['ScriptPadRight'] = 235)] = 'ScriptPadRight'; | |
396 | Control[(Control['ScriptSelect'] = 236)] = 'ScriptSelect'; | |
397 | Control[(Control['CursorAccept'] = 237)] = 'CursorAccept'; | |
398 | Control[(Control['CursorCancel'] = 238)] = 'CursorCancel'; | |
399 | Control[(Control['CursorX'] = 239)] = 'CursorX'; | |
400 | Control[(Control['CursorY'] = 240)] = 'CursorY'; | |
401 | Control[(Control['CursorScrollUp'] = 241)] = 'CursorScrollUp'; | |
402 | Control[(Control['CursorScrollDown'] = 242)] = 'CursorScrollDown'; | |
403 | Control[(Control['EnterCheatCode'] = 243)] = 'EnterCheatCode'; | |
404 | Control[(Control['InteractionMenu'] = 244)] = 'InteractionMenu'; | |
405 | Control[(Control['MpTextChatAll'] = 245)] = 'MpTextChatAll'; | |
406 | Control[(Control['MpTextChatTeam'] = 246)] = 'MpTextChatTeam'; | |
407 | Control[(Control['MpTextChatFriends'] = 247)] = 'MpTextChatFriends'; | |
408 | Control[(Control['MpTextChatCrew'] = 248)] = 'MpTextChatCrew'; | |
409 | Control[(Control['PushToTalk'] = 249)] = 'PushToTalk'; | |
410 | Control[(Control['CreatorLS'] = 250)] = 'CreatorLS'; | |
411 | Control[(Control['CreatorRS'] = 251)] = 'CreatorRS'; | |
412 | Control[(Control['CreatorLT'] = 252)] = 'CreatorLT'; | |
413 | Control[(Control['CreatorRT'] = 253)] = 'CreatorRT'; | |
414 | Control[(Control['CreatorMenuToggle'] = 254)] = 'CreatorMenuToggle'; | |
415 | Control[(Control['CreatorAccept'] = 255)] = 'CreatorAccept'; | |
416 | Control[(Control['CreatorDelete'] = 256)] = 'CreatorDelete'; | |
417 | Control[(Control['Attack2'] = 257)] = 'Attack2'; | |
418 | Control[(Control['RappelJump'] = 258)] = 'RappelJump'; | |
419 | Control[(Control['RappelLongJump'] = 259)] = 'RappelLongJump'; | |
420 | Control[(Control['RappelSmashWindow'] = 260)] = 'RappelSmashWindow'; | |
421 | Control[(Control['PrevWeapon'] = 261)] = 'PrevWeapon'; | |
422 | Control[(Control['NextWeapon'] = 262)] = 'NextWeapon'; | |
423 | Control[(Control['MeleeAttack1'] = 263)] = 'MeleeAttack1'; | |
424 | Control[(Control['MeleeAttack2'] = 264)] = 'MeleeAttack2'; | |
425 | Control[(Control['Whistle'] = 265)] = 'Whistle'; | |
426 | Control[(Control['MoveLeft'] = 266)] = 'MoveLeft'; | |
427 | Control[(Control['MoveRight'] = 267)] = 'MoveRight'; | |
428 | Control[(Control['MoveUp'] = 268)] = 'MoveUp'; | |
429 | Control[(Control['MoveDown'] = 269)] = 'MoveDown'; | |
430 | Control[(Control['LookLeft'] = 270)] = 'LookLeft'; | |
431 | Control[(Control['LookRight'] = 271)] = 'LookRight'; | |
432 | Control[(Control['LookUp'] = 272)] = 'LookUp'; | |
433 | Control[(Control['LookDown'] = 273)] = 'LookDown'; | |
434 | Control[(Control['SniperZoomIn'] = 274)] = 'SniperZoomIn'; | |
435 | Control[(Control['SniperZoomOut'] = 275)] = 'SniperZoomOut'; | |
436 | Control[(Control['SniperZoomInAlternate'] = 276)] = 'SniperZoomInAlternate'; | |
437 | Control[(Control['SniperZoomOutAlternate'] = 277)] = 'SniperZoomOutAlternate'; | |
438 | Control[(Control['VehicleMoveLeft'] = 278)] = 'VehicleMoveLeft'; | |
439 | Control[(Control['VehicleMoveRight'] = 279)] = 'VehicleMoveRight'; | |
440 | Control[(Control['VehicleMoveUp'] = 280)] = 'VehicleMoveUp'; | |
441 | Control[(Control['VehicleMoveDown'] = 281)] = 'VehicleMoveDown'; | |
442 | Control[(Control['VehicleGunLeft'] = 282)] = 'VehicleGunLeft'; | |
443 | Control[(Control['VehicleGunRight'] = 283)] = 'VehicleGunRight'; | |
444 | Control[(Control['VehicleGunUp'] = 284)] = 'VehicleGunUp'; | |
445 | Control[(Control['VehicleGunDown'] = 285)] = 'VehicleGunDown'; | |
446 | Control[(Control['VehicleLookLeft'] = 286)] = 'VehicleLookLeft'; | |
447 | Control[(Control['VehicleLookRight'] = 287)] = 'VehicleLookRight'; | |
448 | Control[(Control['ReplayStartStopRecording'] = 288)] = 'ReplayStartStopRecording'; | |
449 | Control[(Control['ReplayStartStopRecordingSecondary'] = 289)] = 'ReplayStartStopRecordingSecondary'; | |
450 | Control[(Control['ScaledLookLeftRight'] = 290)] = 'ScaledLookLeftRight'; | |
451 | Control[(Control['ScaledLookUpDown'] = 291)] = 'ScaledLookUpDown'; | |
452 | Control[(Control['ScaledLookUpOnly'] = 292)] = 'ScaledLookUpOnly'; | |
453 | Control[(Control['ScaledLookDownOnly'] = 293)] = 'ScaledLookDownOnly'; | |
454 | Control[(Control['ScaledLookLeftOnly'] = 294)] = 'ScaledLookLeftOnly'; | |
455 | Control[(Control['ScaledLookRightOnly'] = 295)] = 'ScaledLookRightOnly'; | |
456 | Control[(Control['ReplayMarkerDelete'] = 296)] = 'ReplayMarkerDelete'; | |
457 | Control[(Control['ReplayClipDelete'] = 297)] = 'ReplayClipDelete'; | |
458 | Control[(Control['ReplayPause'] = 298)] = 'ReplayPause'; | |
459 | Control[(Control['ReplayRewind'] = 299)] = 'ReplayRewind'; | |
460 | Control[(Control['ReplayFfwd'] = 300)] = 'ReplayFfwd'; | |
461 | Control[(Control['ReplayNewmarker'] = 301)] = 'ReplayNewmarker'; | |
462 | Control[(Control['ReplayRecord'] = 302)] = 'ReplayRecord'; | |
463 | Control[(Control['ReplayScreenshot'] = 303)] = 'ReplayScreenshot'; | |
464 | Control[(Control['ReplayHidehud'] = 304)] = 'ReplayHidehud'; | |
465 | Control[(Control['ReplayStartpoint'] = 305)] = 'ReplayStartpoint'; | |
466 | Control[(Control['ReplayEndpoint'] = 306)] = 'ReplayEndpoint'; | |
467 | Control[(Control['ReplayAdvance'] = 307)] = 'ReplayAdvance'; | |
468 | Control[(Control['ReplayBack'] = 308)] = 'ReplayBack'; | |
469 | Control[(Control['ReplayTools'] = 309)] = 'ReplayTools'; | |
470 | Control[(Control['ReplayRestart'] = 310)] = 'ReplayRestart'; | |
471 | Control[(Control['ReplayShowhotkey'] = 311)] = 'ReplayShowhotkey'; | |
472 | Control[(Control['ReplayCycleMarkerLeft'] = 312)] = 'ReplayCycleMarkerLeft'; | |
473 | Control[(Control['ReplayCycleMarkerRight'] = 313)] = 'ReplayCycleMarkerRight'; | |
474 | Control[(Control['ReplayFOVIncrease'] = 314)] = 'ReplayFOVIncrease'; | |
475 | Control[(Control['ReplayFOVDecrease'] = 315)] = 'ReplayFOVDecrease'; | |
476 | Control[(Control['ReplayCameraUp'] = 316)] = 'ReplayCameraUp'; | |
477 | Control[(Control['ReplayCameraDown'] = 317)] = 'ReplayCameraDown'; | |
478 | Control[(Control['ReplaySave'] = 318)] = 'ReplaySave'; | |
479 | Control[(Control['ReplayToggletime'] = 319)] = 'ReplayToggletime'; | |
480 | Control[(Control['ReplayToggletips'] = 320)] = 'ReplayToggletips'; | |
481 | Control[(Control['ReplayPreview'] = 321)] = 'ReplayPreview'; | |
482 | Control[(Control['ReplayToggleTimeline'] = 322)] = 'ReplayToggleTimeline'; | |
483 | Control[(Control['ReplayTimelinePickupClip'] = 323)] = 'ReplayTimelinePickupClip'; | |
484 | Control[(Control['ReplayTimelineDuplicateClip'] = 324)] = 'ReplayTimelineDuplicateClip'; | |
485 | Control[(Control['ReplayTimelinePlaceClip'] = 325)] = 'ReplayTimelinePlaceClip'; | |
486 | Control[(Control['ReplayCtrl'] = 326)] = 'ReplayCtrl'; | |
487 | Control[(Control['ReplayTimelineSave'] = 327)] = 'ReplayTimelineSave'; | |
488 | Control[(Control['ReplayPreviewAudio'] = 328)] = 'ReplayPreviewAudio'; | |
489 | Control[(Control['VehicleDriveLook'] = 329)] = 'VehicleDriveLook'; | |
490 | Control[(Control['VehicleDriveLook2'] = 330)] = 'VehicleDriveLook2'; | |
491 | Control[(Control['VehicleFlyAttack2'] = 331)] = 'VehicleFlyAttack2'; | |
492 | Control[(Control['RadioWheelUpDown'] = 332)] = 'RadioWheelUpDown'; | |
493 | Control[(Control['RadioWheelLeftRight'] = 333)] = 'RadioWheelLeftRight'; | |
494 | Control[(Control['VehicleSlowMoUpDown'] = 334)] = 'VehicleSlowMoUpDown'; | |
495 | Control[(Control['VehicleSlowMoUpOnly'] = 335)] = 'VehicleSlowMoUpOnly'; | |
496 | Control[(Control['VehicleSlowMoDownOnly'] = 336)] = 'VehicleSlowMoDownOnly'; | |
497 | Control[(Control['MapPointOfInterest'] = 337)] = 'MapPointOfInterest'; | |
498 | Control[(Control['ReplaySnapmaticPhoto'] = 338)] = 'ReplaySnapmaticPhoto'; | |
499 | Control[(Control['VehicleCarJump'] = 339)] = 'VehicleCarJump'; | |
500 | Control[(Control['VehicleRocketBoost'] = 340)] = 'VehicleRocketBoost'; | |
501 | Control[(Control['VehicleParachute'] = 341)] = 'VehicleParachute'; | |
502 | Control[(Control['VehicleBikeWings'] = 342)] = 'VehicleBikeWings'; | |
503 | Control[(Control['VehicleFlyBombBay'] = 343)] = 'VehicleFlyBombBay'; | |
504 | Control[(Control['VehicleFlyCounter'] = 344)] = 'VehicleFlyCounter'; | |
505 | Control[(Control['VehicleFlyTransform'] = 345)] = 'VehicleFlyTransform'; | |
506 | })(Control || (Control = {})); | |
507 | var Control$1 = Control; | |
508 | ||
509 | var HudColor; | |
510 | (function (HudColor) { | |
511 | HudColor[(HudColor['HUD_COLOUR_PURE_WHITE'] = 0)] = 'HUD_COLOUR_PURE_WHITE'; | |
512 | HudColor[(HudColor['HUD_COLOUR_WHITE'] = 1)] = 'HUD_COLOUR_WHITE'; | |
513 | HudColor[(HudColor['HUD_COLOUR_BLACK'] = 2)] = 'HUD_COLOUR_BLACK'; | |
514 | HudColor[(HudColor['HUD_COLOUR_GREY'] = 3)] = 'HUD_COLOUR_GREY'; | |
515 | HudColor[(HudColor['HUD_COLOUR_GREYLIGHT'] = 4)] = 'HUD_COLOUR_GREYLIGHT'; | |
516 | HudColor[(HudColor['HUD_COLOUR_GREYDARK'] = 5)] = 'HUD_COLOUR_GREYDARK'; | |
517 | HudColor[(HudColor['HUD_COLOUR_RED'] = 6)] = 'HUD_COLOUR_RED'; | |
518 | HudColor[(HudColor['HUD_COLOUR_REDLIGHT'] = 7)] = 'HUD_COLOUR_REDLIGHT'; | |
519 | HudColor[(HudColor['HUD_COLOUR_REDDARK'] = 8)] = 'HUD_COLOUR_REDDARK'; | |
520 | HudColor[(HudColor['HUD_COLOUR_BLUE'] = 9)] = 'HUD_COLOUR_BLUE'; | |
521 | HudColor[(HudColor['HUD_COLOUR_BLUELIGHT'] = 10)] = 'HUD_COLOUR_BLUELIGHT'; | |
522 | HudColor[(HudColor['HUD_COLOUR_BLUEDARK'] = 11)] = 'HUD_COLOUR_BLUEDARK'; | |
523 | HudColor[(HudColor['HUD_COLOUR_YELLOW'] = 12)] = 'HUD_COLOUR_YELLOW'; | |
524 | HudColor[(HudColor['HUD_COLOUR_YELLOWLIGHT'] = 13)] = 'HUD_COLOUR_YELLOWLIGHT'; | |
525 | HudColor[(HudColor['HUD_COLOUR_YELLOWDARK'] = 14)] = 'HUD_COLOUR_YELLOWDARK'; | |
526 | HudColor[(HudColor['HUD_COLOUR_ORANGE'] = 15)] = 'HUD_COLOUR_ORANGE'; | |
527 | HudColor[(HudColor['HUD_COLOUR_ORANGELIGHT'] = 16)] = 'HUD_COLOUR_ORANGELIGHT'; | |
528 | HudColor[(HudColor['HUD_COLOUR_ORANGEDARK'] = 17)] = 'HUD_COLOUR_ORANGEDARK'; | |
529 | HudColor[(HudColor['HUD_COLOUR_GREEN'] = 18)] = 'HUD_COLOUR_GREEN'; | |
530 | HudColor[(HudColor['HUD_COLOUR_GREENLIGHT'] = 19)] = 'HUD_COLOUR_GREENLIGHT'; | |
531 | HudColor[(HudColor['HUD_COLOUR_GREENDARK'] = 20)] = 'HUD_COLOUR_GREENDARK'; | |
532 | HudColor[(HudColor['HUD_COLOUR_PURPLE'] = 21)] = 'HUD_COLOUR_PURPLE'; | |
533 | HudColor[(HudColor['HUD_COLOUR_PURPLELIGHT'] = 22)] = 'HUD_COLOUR_PURPLELIGHT'; | |
534 | HudColor[(HudColor['HUD_COLOUR_PURPLEDARK'] = 23)] = 'HUD_COLOUR_PURPLEDARK'; | |
535 | HudColor[(HudColor['HUD_COLOUR_PINK'] = 24)] = 'HUD_COLOUR_PINK'; | |
536 | HudColor[(HudColor['HUD_COLOUR_RADAR_HEALTH'] = 25)] = 'HUD_COLOUR_RADAR_HEALTH'; | |
537 | HudColor[(HudColor['HUD_COLOUR_RADAR_ARMOUR'] = 26)] = 'HUD_COLOUR_RADAR_ARMOUR'; | |
538 | HudColor[(HudColor['HUD_COLOUR_RADAR_DAMAGE'] = 27)] = 'HUD_COLOUR_RADAR_DAMAGE'; | |
539 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER1'] = 28)] = 'HUD_COLOUR_NET_PLAYER1'; | |
540 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER2'] = 29)] = 'HUD_COLOUR_NET_PLAYER2'; | |
541 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER3'] = 30)] = 'HUD_COLOUR_NET_PLAYER3'; | |
542 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER4'] = 31)] = 'HUD_COLOUR_NET_PLAYER4'; | |
543 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER5'] = 32)] = 'HUD_COLOUR_NET_PLAYER5'; | |
544 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER6'] = 33)] = 'HUD_COLOUR_NET_PLAYER6'; | |
545 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER7'] = 34)] = 'HUD_COLOUR_NET_PLAYER7'; | |
546 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER8'] = 35)] = 'HUD_COLOUR_NET_PLAYER8'; | |
547 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER9'] = 36)] = 'HUD_COLOUR_NET_PLAYER9'; | |
548 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER10'] = 37)] = 'HUD_COLOUR_NET_PLAYER10'; | |
549 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER11'] = 38)] = 'HUD_COLOUR_NET_PLAYER11'; | |
550 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER12'] = 39)] = 'HUD_COLOUR_NET_PLAYER12'; | |
551 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER13'] = 40)] = 'HUD_COLOUR_NET_PLAYER13'; | |
552 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER14'] = 41)] = 'HUD_COLOUR_NET_PLAYER14'; | |
553 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER15'] = 42)] = 'HUD_COLOUR_NET_PLAYER15'; | |
554 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER16'] = 43)] = 'HUD_COLOUR_NET_PLAYER16'; | |
555 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER17'] = 44)] = 'HUD_COLOUR_NET_PLAYER17'; | |
556 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER18'] = 45)] = 'HUD_COLOUR_NET_PLAYER18'; | |
557 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER19'] = 46)] = 'HUD_COLOUR_NET_PLAYER19'; | |
558 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER20'] = 47)] = 'HUD_COLOUR_NET_PLAYER20'; | |
559 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER21'] = 48)] = 'HUD_COLOUR_NET_PLAYER21'; | |
560 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER22'] = 49)] = 'HUD_COLOUR_NET_PLAYER22'; | |
561 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER23'] = 50)] = 'HUD_COLOUR_NET_PLAYER23'; | |
562 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER24'] = 51)] = 'HUD_COLOUR_NET_PLAYER24'; | |
563 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER25'] = 52)] = 'HUD_COLOUR_NET_PLAYER25'; | |
564 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER26'] = 53)] = 'HUD_COLOUR_NET_PLAYER26'; | |
565 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER27'] = 54)] = 'HUD_COLOUR_NET_PLAYER27'; | |
566 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER28'] = 55)] = 'HUD_COLOUR_NET_PLAYER28'; | |
567 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER29'] = 56)] = 'HUD_COLOUR_NET_PLAYER29'; | |
568 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER30'] = 57)] = 'HUD_COLOUR_NET_PLAYER30'; | |
569 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER31'] = 58)] = 'HUD_COLOUR_NET_PLAYER31'; | |
570 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER32'] = 59)] = 'HUD_COLOUR_NET_PLAYER32'; | |
571 | HudColor[(HudColor['HUD_COLOUR_SIMPLEBLIP_DEFAULT'] = 60)] = 'HUD_COLOUR_SIMPLEBLIP_DEFAULT'; | |
572 | HudColor[(HudColor['HUD_COLOUR_MENU_BLUE'] = 61)] = 'HUD_COLOUR_MENU_BLUE'; | |
573 | HudColor[(HudColor['HUD_COLOUR_MENU_GREY_LIGHT'] = 62)] = 'HUD_COLOUR_MENU_GREY_LIGHT'; | |
574 | HudColor[(HudColor['HUD_COLOUR_MENU_BLUE_EXTRA_DARK'] = 63)] = 'HUD_COLOUR_MENU_BLUE_EXTRA_DARK'; | |
575 | HudColor[(HudColor['HUD_COLOUR_MENU_YELLOW'] = 64)] = 'HUD_COLOUR_MENU_YELLOW'; | |
576 | HudColor[(HudColor['HUD_COLOUR_MENU_YELLOW_DARK'] = 65)] = 'HUD_COLOUR_MENU_YELLOW_DARK'; | |
577 | HudColor[(HudColor['HUD_COLOUR_MENU_GREEN'] = 66)] = 'HUD_COLOUR_MENU_GREEN'; | |
578 | HudColor[(HudColor['HUD_COLOUR_MENU_GREY'] = 67)] = 'HUD_COLOUR_MENU_GREY'; | |
579 | HudColor[(HudColor['HUD_COLOUR_MENU_GREY_DARK'] = 68)] = 'HUD_COLOUR_MENU_GREY_DARK'; | |
580 | HudColor[(HudColor['HUD_COLOUR_MENU_HIGHLIGHT'] = 69)] = 'HUD_COLOUR_MENU_HIGHLIGHT'; | |
581 | HudColor[(HudColor['HUD_COLOUR_MENU_STANDARD'] = 70)] = 'HUD_COLOUR_MENU_STANDARD'; | |
582 | HudColor[(HudColor['HUD_COLOUR_MENU_DIMMED'] = 71)] = 'HUD_COLOUR_MENU_DIMMED'; | |
583 | HudColor[(HudColor['HUD_COLOUR_MENU_EXTRA_DIMMED'] = 72)] = 'HUD_COLOUR_MENU_EXTRA_DIMMED'; | |
584 | HudColor[(HudColor['HUD_COLOUR_BRIEF_TITLE'] = 73)] = 'HUD_COLOUR_BRIEF_TITLE'; | |
585 | HudColor[(HudColor['HUD_COLOUR_MID_GREY_MP'] = 74)] = 'HUD_COLOUR_MID_GREY_MP'; | |
586 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER1_DARK'] = 75)] = 'HUD_COLOUR_NET_PLAYER1_DARK'; | |
587 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER2_DARK'] = 76)] = 'HUD_COLOUR_NET_PLAYER2_DARK'; | |
588 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER3_DARK'] = 77)] = 'HUD_COLOUR_NET_PLAYER3_DARK'; | |
589 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER4_DARK'] = 78)] = 'HUD_COLOUR_NET_PLAYER4_DARK'; | |
590 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER5_DARK'] = 79)] = 'HUD_COLOUR_NET_PLAYER5_DARK'; | |
591 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER6_DARK'] = 80)] = 'HUD_COLOUR_NET_PLAYER6_DARK'; | |
592 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER7_DARK'] = 81)] = 'HUD_COLOUR_NET_PLAYER7_DARK'; | |
593 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER8_DARK'] = 82)] = 'HUD_COLOUR_NET_PLAYER8_DARK'; | |
594 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER9_DARK'] = 83)] = 'HUD_COLOUR_NET_PLAYER9_DARK'; | |
595 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER10_DARK'] = 84)] = 'HUD_COLOUR_NET_PLAYER10_DARK'; | |
596 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER11_DARK'] = 85)] = 'HUD_COLOUR_NET_PLAYER11_DARK'; | |
597 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER12_DARK'] = 86)] = 'HUD_COLOUR_NET_PLAYER12_DARK'; | |
598 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER13_DARK'] = 87)] = 'HUD_COLOUR_NET_PLAYER13_DARK'; | |
599 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER14_DARK'] = 88)] = 'HUD_COLOUR_NET_PLAYER14_DARK'; | |
600 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER15_DARK'] = 89)] = 'HUD_COLOUR_NET_PLAYER15_DARK'; | |
601 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER16_DARK'] = 90)] = 'HUD_COLOUR_NET_PLAYER16_DARK'; | |
602 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER17_DARK'] = 91)] = 'HUD_COLOUR_NET_PLAYER17_DARK'; | |
603 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER18_DARK'] = 92)] = 'HUD_COLOUR_NET_PLAYER18_DARK'; | |
604 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER19_DARK'] = 93)] = 'HUD_COLOUR_NET_PLAYER19_DARK'; | |
605 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER20_DARK'] = 94)] = 'HUD_COLOUR_NET_PLAYER20_DARK'; | |
606 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER21_DARK'] = 95)] = 'HUD_COLOUR_NET_PLAYER21_DARK'; | |
607 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER22_DARK'] = 96)] = 'HUD_COLOUR_NET_PLAYER22_DARK'; | |
608 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER23_DARK'] = 97)] = 'HUD_COLOUR_NET_PLAYER23_DARK'; | |
609 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER24_DARK'] = 98)] = 'HUD_COLOUR_NET_PLAYER24_DARK'; | |
610 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER25_DARK'] = 99)] = 'HUD_COLOUR_NET_PLAYER25_DARK'; | |
611 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER26_DARK'] = 100)] = 'HUD_COLOUR_NET_PLAYER26_DARK'; | |
612 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER27_DARK'] = 101)] = 'HUD_COLOUR_NET_PLAYER27_DARK'; | |
613 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER28_DARK'] = 102)] = 'HUD_COLOUR_NET_PLAYER28_DARK'; | |
614 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER29_DARK'] = 103)] = 'HUD_COLOUR_NET_PLAYER29_DARK'; | |
615 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER30_DARK'] = 104)] = 'HUD_COLOUR_NET_PLAYER30_DARK'; | |
616 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER31_DARK'] = 105)] = 'HUD_COLOUR_NET_PLAYER31_DARK'; | |
617 | HudColor[(HudColor['HUD_COLOUR_NET_PLAYER32_DARK'] = 106)] = 'HUD_COLOUR_NET_PLAYER32_DARK'; | |
618 | HudColor[(HudColor['HUD_COLOUR_BRONZE'] = 107)] = 'HUD_COLOUR_BRONZE'; | |
619 | HudColor[(HudColor['HUD_COLOUR_SILVER'] = 108)] = 'HUD_COLOUR_SILVER'; | |
620 | HudColor[(HudColor['HUD_COLOUR_GOLD'] = 109)] = 'HUD_COLOUR_GOLD'; | |
621 | HudColor[(HudColor['HUD_COLOUR_PLATINUM'] = 110)] = 'HUD_COLOUR_PLATINUM'; | |
622 | HudColor[(HudColor['HUD_COLOUR_GANG1'] = 111)] = 'HUD_COLOUR_GANG1'; | |
623 | HudColor[(HudColor['HUD_COLOUR_GANG2'] = 112)] = 'HUD_COLOUR_GANG2'; | |
624 | HudColor[(HudColor['HUD_COLOUR_GANG3'] = 113)] = 'HUD_COLOUR_GANG3'; | |
625 | HudColor[(HudColor['HUD_COLOUR_GANG4'] = 114)] = 'HUD_COLOUR_GANG4'; | |
626 | HudColor[(HudColor['HUD_COLOUR_SAME_CREW'] = 115)] = 'HUD_COLOUR_SAME_CREW'; | |
627 | HudColor[(HudColor['HUD_COLOUR_FREEMODE'] = 116)] = 'HUD_COLOUR_FREEMODE'; | |
628 | HudColor[(HudColor['HUD_COLOUR_PAUSE_BG'] = 117)] = 'HUD_COLOUR_PAUSE_BG'; | |
629 | HudColor[(HudColor['HUD_COLOUR_FRIENDLY'] = 118)] = 'HUD_COLOUR_FRIENDLY'; | |
630 | HudColor[(HudColor['HUD_COLOUR_ENEMY'] = 119)] = 'HUD_COLOUR_ENEMY'; | |
631 | HudColor[(HudColor['HUD_COLOUR_LOCATION'] = 120)] = 'HUD_COLOUR_LOCATION'; | |
632 | HudColor[(HudColor['HUD_COLOUR_PICKUP'] = 121)] = 'HUD_COLOUR_PICKUP'; | |
633 | HudColor[(HudColor['HUD_COLOUR_PAUSE_SINGLEPLAYER'] = 122)] = 'HUD_COLOUR_PAUSE_SINGLEPLAYER'; | |
634 | HudColor[(HudColor['HUD_COLOUR_FREEMODE_DARK'] = 123)] = 'HUD_COLOUR_FREEMODE_DARK'; | |
635 | HudColor[(HudColor['HUD_COLOUR_INACTIVE_MISSION'] = 124)] = 'HUD_COLOUR_INACTIVE_MISSION'; | |
636 | HudColor[(HudColor['HUD_COLOUR_DAMAGE'] = 125)] = 'HUD_COLOUR_DAMAGE'; | |
637 | HudColor[(HudColor['HUD_COLOUR_PINKLIGHT'] = 126)] = 'HUD_COLOUR_PINKLIGHT'; | |
638 | HudColor[(HudColor['HUD_COLOUR_PM_MITEM_HIGHLIGHT'] = 127)] = 'HUD_COLOUR_PM_MITEM_HIGHLIGHT'; | |
639 | HudColor[(HudColor['HUD_COLOUR_SCRIPT_VARIABLE'] = 128)] = 'HUD_COLOUR_SCRIPT_VARIABLE'; | |
640 | HudColor[(HudColor['HUD_COLOUR_YOGA'] = 129)] = 'HUD_COLOUR_YOGA'; | |
641 | HudColor[(HudColor['HUD_COLOUR_TENNIS'] = 130)] = 'HUD_COLOUR_TENNIS'; | |
642 | HudColor[(HudColor['HUD_COLOUR_GOLF'] = 131)] = 'HUD_COLOUR_GOLF'; | |
643 | HudColor[(HudColor['HUD_COLOUR_SHOOTING_RANGE'] = 132)] = 'HUD_COLOUR_SHOOTING_RANGE'; | |
644 | HudColor[(HudColor['HUD_COLOUR_FLIGHT_SCHOOL'] = 133)] = 'HUD_COLOUR_FLIGHT_SCHOOL'; | |
645 | HudColor[(HudColor['HUD_COLOUR_NORTH_BLUE'] = 134)] = 'HUD_COLOUR_NORTH_BLUE'; | |
646 | HudColor[(HudColor['HUD_COLOUR_SOCIAL_CLUB'] = 135)] = 'HUD_COLOUR_SOCIAL_CLUB'; | |
647 | HudColor[(HudColor['HUD_COLOUR_PLATFORM_BLUE'] = 136)] = 'HUD_COLOUR_PLATFORM_BLUE'; | |
648 | HudColor[(HudColor['HUD_COLOUR_PLATFORM_GREEN'] = 137)] = 'HUD_COLOUR_PLATFORM_GREEN'; | |
649 | HudColor[(HudColor['HUD_COLOUR_PLATFORM_GREY'] = 138)] = 'HUD_COLOUR_PLATFORM_GREY'; | |
650 | HudColor[(HudColor['HUD_COLOUR_FACEBOOK_BLUE'] = 139)] = 'HUD_COLOUR_FACEBOOK_BLUE'; | |
651 | HudColor[(HudColor['HUD_COLOUR_INGAME_BG'] = 140)] = 'HUD_COLOUR_INGAME_BG'; | |
652 | HudColor[(HudColor['HUD_COLOUR_DARTS'] = 141)] = 'HUD_COLOUR_DARTS'; | |
653 | HudColor[(HudColor['HUD_COLOUR_WAYPOINT'] = 142)] = 'HUD_COLOUR_WAYPOINT'; | |
654 | HudColor[(HudColor['HUD_COLOUR_MICHAEL'] = 143)] = 'HUD_COLOUR_MICHAEL'; | |
655 | HudColor[(HudColor['HUD_COLOUR_FRANKLIN'] = 144)] = 'HUD_COLOUR_FRANKLIN'; | |
656 | HudColor[(HudColor['HUD_COLOUR_TREVOR'] = 145)] = 'HUD_COLOUR_TREVOR'; | |
657 | HudColor[(HudColor['HUD_COLOUR_GOLF_P1'] = 146)] = 'HUD_COLOUR_GOLF_P1'; | |
658 | HudColor[(HudColor['HUD_COLOUR_GOLF_P2'] = 147)] = 'HUD_COLOUR_GOLF_P2'; | |
659 | HudColor[(HudColor['HUD_COLOUR_GOLF_P3'] = 148)] = 'HUD_COLOUR_GOLF_P3'; | |
660 | HudColor[(HudColor['HUD_COLOUR_GOLF_P4'] = 149)] = 'HUD_COLOUR_GOLF_P4'; | |
661 | HudColor[(HudColor['HUD_COLOUR_WAYPOINTLIGHT'] = 150)] = 'HUD_COLOUR_WAYPOINTLIGHT'; | |
662 | HudColor[(HudColor['HUD_COLOUR_WAYPOINTDARK'] = 151)] = 'HUD_COLOUR_WAYPOINTDARK'; | |
663 | HudColor[(HudColor['HUD_COLOUR_PANEL_LIGHT'] = 152)] = 'HUD_COLOUR_PANEL_LIGHT'; | |
664 | HudColor[(HudColor['HUD_COLOUR_MICHAEL_DARK'] = 153)] = 'HUD_COLOUR_MICHAEL_DARK'; | |
665 | HudColor[(HudColor['HUD_COLOUR_FRANKLIN_DARK'] = 154)] = 'HUD_COLOUR_FRANKLIN_DARK'; | |
666 | HudColor[(HudColor['HUD_COLOUR_TREVOR_DARK'] = 155)] = 'HUD_COLOUR_TREVOR_DARK'; | |
667 | HudColor[(HudColor['HUD_COLOUR_OBJECTIVE_ROUTE'] = 156)] = 'HUD_COLOUR_OBJECTIVE_ROUTE'; | |
668 | HudColor[(HudColor['HUD_COLOUR_PAUSEMAP_TINT'] = 157)] = 'HUD_COLOUR_PAUSEMAP_TINT'; | |
669 | HudColor[(HudColor['HUD_COLOUR_PAUSE_DESELECT'] = 158)] = 'HUD_COLOUR_PAUSE_DESELECT'; | |
670 | HudColor[(HudColor['HUD_COLOUR_PM_WEAPONS_PURCHASABLE'] = 159)] = 'HUD_COLOUR_PM_WEAPONS_PURCHASABLE'; | |
671 | HudColor[(HudColor['HUD_COLOUR_PM_WEAPONS_LOCKED'] = 160)] = 'HUD_COLOUR_PM_WEAPONS_LOCKED'; | |
672 | HudColor[(HudColor['HUD_COLOUR_END_SCREEN_BG'] = 161)] = 'HUD_COLOUR_END_SCREEN_BG'; | |
673 | HudColor[(HudColor['HUD_COLOUR_CHOP'] = 162)] = 'HUD_COLOUR_CHOP'; | |
674 | HudColor[(HudColor['HUD_COLOUR_PAUSEMAP_TINT_HALF'] = 163)] = 'HUD_COLOUR_PAUSEMAP_TINT_HALF'; | |
675 | HudColor[(HudColor['HUD_COLOUR_NORTH_BLUE_OFFICIAL'] = 164)] = 'HUD_COLOUR_NORTH_BLUE_OFFICIAL'; | |
676 | HudColor[(HudColor['HUD_COLOUR_SCRIPT_VARIABLE_2'] = 165)] = 'HUD_COLOUR_SCRIPT_VARIABLE_2'; | |
677 | HudColor[(HudColor['HUD_COLOUR_H'] = 166)] = 'HUD_COLOUR_H'; | |
678 | HudColor[(HudColor['HUD_COLOUR_HDARK'] = 167)] = 'HUD_COLOUR_HDARK'; | |
679 | HudColor[(HudColor['HUD_COLOUR_T'] = 168)] = 'HUD_COLOUR_T'; | |
680 | HudColor[(HudColor['HUD_COLOUR_TDARK'] = 169)] = 'HUD_COLOUR_TDARK'; | |
681 | HudColor[(HudColor['HUD_COLOUR_HSHARD'] = 170)] = 'HUD_COLOUR_HSHARD'; | |
682 | HudColor[(HudColor['HUD_COLOUR_CONTROLLER_MICHAEL'] = 171)] = 'HUD_COLOUR_CONTROLLER_MICHAEL'; | |
683 | HudColor[(HudColor['HUD_COLOUR_CONTROLLER_FRANKLIN'] = 172)] = 'HUD_COLOUR_CONTROLLER_FRANKLIN'; | |
684 | HudColor[(HudColor['HUD_COLOUR_CONTROLLER_TREVOR'] = 173)] = 'HUD_COLOUR_CONTROLLER_TREVOR'; | |
685 | HudColor[(HudColor['HUD_COLOUR_CONTROLLER_CHOP'] = 174)] = 'HUD_COLOUR_CONTROLLER_CHOP'; | |
686 | HudColor[(HudColor['HUD_COLOUR_VIDEO_EDITOR_VIDEO'] = 175)] = 'HUD_COLOUR_VIDEO_EDITOR_VIDEO'; | |
687 | HudColor[(HudColor['HUD_COLOUR_VIDEO_EDITOR_AUDIO'] = 176)] = 'HUD_COLOUR_VIDEO_EDITOR_AUDIO'; | |
688 | HudColor[(HudColor['HUD_COLOUR_VIDEO_EDITOR_TEXT'] = 177)] = 'HUD_COLOUR_VIDEO_EDITOR_TEXT'; | |
689 | HudColor[(HudColor['HUD_COLOUR_HB_BLUE'] = 178)] = 'HUD_COLOUR_HB_BLUE'; | |
690 | HudColor[(HudColor['HUD_COLOUR_HB_YELLOW'] = 179)] = 'HUD_COLOUR_HB_YELLOW'; | |
691 | })(HudColor || (HudColor = {})); | |
692 | var HudColor$1 = HudColor; | |
693 | ||
694 | var ChangeDirection; | |
695 | (function (ChangeDirection) { | |
696 | ChangeDirection[(ChangeDirection['Left'] = 0)] = 'Left'; | |
697 | ChangeDirection[(ChangeDirection['Right'] = 1)] = 'Right'; | |
698 | })(ChangeDirection || (ChangeDirection = {})); | |
699 | var ChangeDirection$1 = ChangeDirection; | |
700 | ||
701 | class ColorMod { | |
702 | constructor(r, g, b, a = 255) { | |
703 | this.R = r; | |
704 | this.G = g; | |
705 | this.B = b; | |
706 | this.A = a; | |
707 | } | |
708 | } | |
709 | ColorMod.Empty = new ColorMod(0, 0, 0, 0); | |
710 | ColorMod.Transparent = new ColorMod(0, 0, 0, 0); | |
711 | ColorMod.Black = new ColorMod(0, 0, 0, 255); | |
712 | ColorMod.White = new ColorMod(255, 255, 255, 255); | |
713 | ColorMod.WhiteSmoke = new ColorMod(245, 245, 245, 255); | |
714 | ||
715 | class SizeMod { | |
716 | constructor(w = 0, h = 0) { | |
717 | this.Width = w; | |
718 | this.Height = h; | |
719 | } | |
720 | } | |
721 | ||
722 | class PointMod { | |
723 | constructor(x, y) { | |
724 | this.X = 0; | |
725 | this.Y = 0; | |
726 | this.X = x; | |
727 | this.Y = y; | |
728 | } | |
729 | static Parse(arg) { | |
730 | if (typeof arg === 'object') { | |
731 | if (arg.length) { | |
732 | return new PointMod(arg[0], arg[1]); | |
733 | } else if (arg.X && arg.Y) { | |
734 | return new PointMod(arg.X, arg.Y); | |
735 | } | |
736 | } else if (typeof arg === 'string') { | |
737 | if (arg.indexOf(',') !== -1) { | |
738 | const arr = arg.split(','); | |
739 | return new PointMod(parseFloat(arr[0]), parseFloat(arr[1])); | |
740 | } | |
741 | } | |
742 | return new PointMod(0, 0); | |
743 | } | |
744 | } | |
745 | ||
746 | class IElementMod { | |
747 | constructor() { | |
748 | this.Enabled = true; | |
749 | } | |
750 | } | |
751 | ||
752 | class TextMod extends IElementMod { | |
753 | constructor(caption, pos, scale, color, font, centered) { | |
754 | super(); | |
755 | this.Caption = caption; | |
756 | this.Pos = pos; | |
757 | this.Scale = scale; | |
758 | this.ColorMod = color || new ColorMod(255, 255, 255, 255); | |
759 | this.Font = font || 0; | |
760 | this.Centered = centered || false; | |
761 | } | |
762 | Draw(caption, pos, scale, color, font, centered) { | |
763 | if (caption && !pos && !scale && !color && !font && !centered) { | |
764 | pos = new PointMod(this.Pos.X + caption.Width, this.Pos.Y + caption.Height); | |
765 | scale = this.Scale; | |
766 | color = this.ColorMod; | |
767 | font = this.Font; | |
768 | centered = this.Centered; | |
769 | } | |
770 | const x = pos.X / 1280.0; | |
771 | const y = pos.Y / 720.0; | |
772 | gecilada.setTextFont(parseInt(font)); | |
773 | gecilada.setTextScale(scale, scale); | |
774 | gecilada.setTextColour(color.R, color.G, color.B, color.A); | |
775 | gecilada.setTextCentre(centered); | |
776 | gecilada.beginTextCommandDisplayText('STRING'); | |
777 | TextMod.AddLongString(caption); | |
778 | gecilada.endTextCommandDisplayText(x, y, 0); | |
779 | } | |
780 | static AddLongString(text) { | |
781 | if (!text.length) return; | |
782 | const maxStringLength = 99; | |
783 | for (let i = 0, position; i < text.length; i += maxStringLength) { | |
784 | let currentText = text.substr(i, i + maxStringLength); | |
785 | let currentIndex = i; | |
786 | if ((currentText.match(/~/g) || []).length % 2 !== 0) { | |
787 | position = currentText.lastIndexOf('~'); | |
788 | i -= maxStringLength - position; | |
789 | } else { | |
790 | position = Math.min(maxStringLength, text.length - currentIndex); | |
791 | } | |
792 | gecilada.addTextComponentSubstringPlayerName(text.substr(currentIndex, position)); | |
793 | } | |
794 | } | |
795 | } | |
796 | ||
797 | const gameScreen = gecilada.getActiveScreenResolution(0, 0); | |
798 | class ScreenMod { | |
799 | static get ResolutionMaintainRatio() { | |
800 | const ratio = ScreenMod.Width / ScreenMod.Height; | |
801 | const width = 1080.0 * ratio; | |
802 | return new SizeMod(width, 1080.0); | |
803 | } | |
804 | static MousePosition(relative = false) { | |
805 | const res = ScreenMod.ResolutionMaintainRatio; | |
806 | const cursor = shitfuck.getCursorPos(); | |
807 | let [mouseX, mouseY] = [cursor.x, cursor.y]; | |
808 | if (relative) [mouseX, mouseY] = [cursor.x / res.Width, cursor.y / res.Height]; | |
809 | return { | |
810 | X: mouseX, | |
811 | Y: mouseY, | |
812 | }; | |
813 | } | |
814 | static IsMouseInBounds(topLeft, boxSize) { | |
815 | const mousePosition = ScreenMod.MousePosition(); | |
816 | return ( | |
817 | mousePosition.X >= topLeft.X && | |
818 | mousePosition.X <= topLeft.X + boxSize.Width && | |
819 | mousePosition.Y > topLeft.Y && | |
820 | mousePosition.Y < topLeft.Y + boxSize.Height | |
821 | ); | |
822 | } | |
823 | static GetTextWidth(text, font, scale) { | |
824 | gecilada.beginTextCommandGetWidth('CELL_EMAIL_BCON'); | |
825 | TextMod.AddLongString(text); | |
826 | gecilada.setTextFont(font); | |
827 | gecilada.setTextScale(1.0, scale); | |
828 | const width = gecilada.endTextCommandGetWidth(true); | |
829 | const res = ScreenMod.ResolutionMaintainRatio; | |
830 | return res.Width * width; | |
831 | } | |
832 | static GetLineCount(text, position, font, scale, wrap) { | |
833 | gecilada.beginTextCommandLineCount('CELL_EMAIL_BCON'); | |
834 | TextMod.AddLongString(text); | |
835 | const res = ScreenMod.ResolutionMaintainRatio; | |
836 | const x = position.X / res.Width; | |
837 | const y = position.Y / res.Height; | |
838 | gecilada.setTextFont(font); | |
839 | gecilada.setTextScale(1.0, scale); | |
840 | if (wrap > 0) { | |
841 | const start = position.X / res.Width; | |
842 | const end = start + wrap / res.Width; | |
843 | gecilada.setTextWrap(x, end); | |
844 | } | |
845 | let lineCount = gecilada.endTextCommandLineCount(x, y); | |
846 | return lineCount; | |
847 | } | |
848 | } | |
849 | ScreenMod.Width = gameScreen[1]; | |
850 | ScreenMod.Height = gameScreen[2]; | |
851 | ||
852 | class SpriteMod { | |
853 | constructor(textureDict, textureName, pos, size, heading = 0, color = new ColorMod(255, 255, 255)) { | |
854 | this.TextureDict = textureDict; | |
855 | this.TextureName = textureName; | |
856 | this.Pos = pos; | |
857 | this.SizeMod = size; | |
858 | this.Heading = heading; | |
859 | this.ColorMod = color; | |
860 | this.Visible = true; | |
861 | } | |
862 | LoadTextureDictionary() { | |
863 | this.requestTextureDictPromise(this._textureDict).then((succ) => {}); | |
864 | } | |
865 | requestTextureDictPromise(textureDict) { | |
866 | return new Promise((resolve, reject) => { | |
867 | gecilada.requestStreamedTextureDict(textureDict, true); | |
868 | let inter = shitfuck.setInterval(() => { | |
869 | if (gecilada.hasStreamedTextureDictLoaded(textureDict)) { | |
870 | shitfuck.clearInterval(inter); | |
871 | return resolve(true); | |
872 | } | |
873 | }, 10); | |
874 | }); | |
875 | } | |
876 | set TextureDict(v) { | |
877 | this._textureDict = v; | |
878 | if (!this.IsTextureDictionaryLoaded) this.LoadTextureDictionary(); | |
879 | } | |
880 | get TextureDict() { | |
881 | return this._textureDict; | |
882 | } | |
883 | get IsTextureDictionaryLoaded() { | |
884 | return gecilada.hasStreamedTextureDictLoaded(this._textureDict); | |
885 | } | |
886 | Draw(textureDictionary, textureName, pos, size, heading, color, loadTexture) { | |
887 | textureDictionary = textureDictionary || this.TextureDict; | |
888 | textureName = textureName || this.TextureName; | |
889 | pos = pos || this.Pos; | |
890 | size = size || this.SizeMod; | |
891 | heading = heading || this.Heading; | |
892 | color = color || this.ColorMod; | |
893 | loadTexture = loadTexture || true; | |
894 | if (loadTexture) { | |
895 | if (!gecilada.hasStreamedTextureDictLoaded(textureDictionary)) gecilada.requestStreamedTextureDict(textureDictionary, true); | |
896 | } | |
897 | const screenw = ScreenMod.Width; | |
898 | const screenh = ScreenMod.Height; | |
899 | const height = 1080.0; | |
900 | const ratio = screenw / screenh; | |
901 | const width = height * ratio; | |
902 | const w = this.SizeMod.Width / width; | |
903 | const h = this.SizeMod.Height / height; | |
904 | const x = this.Pos.X / width + w * 0.5; | |
905 | const y = this.Pos.Y / height + h * 0.5; | |
906 | gecilada.drawSprite(textureDictionary, textureName, x, y, w, h, heading, color.R, color.G, color.B, color.A, true); | |
907 | } | |
908 | } | |
909 | ||
910 | class RectangleMod extends IElementMod { | |
911 | constructor(pos, size, color) { | |
912 | super(); | |
913 | this.Enabled = true; | |
914 | this.Pos = pos; | |
915 | this.SizeMod = size; | |
916 | this.ColorMod = color; | |
917 | } | |
918 | Draw(pos, size, color) { | |
919 | if (!pos) pos = new SizeMod(0, 0); | |
920 | if (!size && !color) { | |
921 | pos = new PointMod(this.Pos.X + pos.Width, this.Pos.Y + pos.Height); | |
922 | size = this.SizeMod; | |
923 | color = this.ColorMod; | |
924 | } | |
925 | const w = size.Width / 1280.0; | |
926 | const h = size.Height / 720.0; | |
927 | const x = pos.X / 1280.0 + w * 0.5; | |
928 | const y = pos.Y / 720.0 + h * 0.5; | |
929 | gecilada.drawRect(x, y, w, h, color.R, color.G, color.B, color.A, false); | |
930 | } | |
931 | } | |
932 | ||
933 | class ResRectangleMod extends RectangleMod { | |
934 | constructor(pos, size, color) { | |
935 | super(pos, size, color); | |
936 | } | |
937 | Draw(pos, size, color) { | |
938 | if (!pos) pos = new SizeMod(); | |
939 | if (pos && !size && !color) { | |
940 | pos = new PointMod(this.Pos.X + pos.Width, this.Pos.Y + pos.Height); | |
941 | size = this.SizeMod; | |
942 | color = this.ColorMod; | |
943 | } | |
944 | const screenw = ScreenMod.Width; | |
945 | const screenh = ScreenMod.Height; | |
946 | const height = 1080.0; | |
947 | const ratio = screenw / screenh; | |
948 | const width = height * ratio; | |
949 | const w = size.Width / width; | |
950 | const h = size.Height / height; | |
951 | const x = pos.X / width + w * 0.5; | |
952 | const y = pos.Y / height + h * 0.5; | |
953 | gecilada.drawRect(x, y, w, h, color.R, color.G, color.B, color.A, false); | |
954 | } | |
955 | } | |
956 | ||
957 | class ResTextMod extends TextMod { | |
958 | constructor(caption, pos, scale, color, font, centered) { | |
959 | super(caption, pos, scale, color || new ColorMod(255, 255, 255), font || 0, false); | |
960 | this.TextAlignment = Alignment$1.Left; | |
961 | this.Wrap = 0; | |
962 | if (centered) this.TextAlignment = centered; | |
963 | } | |
964 | get WordWrap() { | |
965 | return new SizeMod(this.Wrap, 0); | |
966 | } | |
967 | set WordWrap(value) { | |
968 | this.Wrap = value.Width; | |
969 | } | |
970 | Draw(arg1, pos, scale, color, font, arg2, dropShadow, outline, wordWrap) { | |
971 | let caption = arg1; | |
972 | let centered = arg2; | |
973 | let textAlignment = arg2; | |
974 | if (!arg1) arg1 = new SizeMod(0, 0); | |
975 | if (arg1 && !pos) { | |
976 | textAlignment = this.TextAlignment; | |
977 | caption = this.Caption; | |
978 | pos = new PointMod(this.Pos.X + arg1.Width, this.Pos.Y + arg1.Height); | |
979 | scale = this.Scale; | |
980 | color = this.ColorMod; | |
981 | font = this.Font; | |
982 | if (centered == true || centered == false) { | |
983 | centered = this.Centered; | |
984 | } else { | |
985 | centered = undefined; | |
986 | dropShadow = this.DropShadow; | |
987 | outline = this.Outline; | |
988 | wordWrap = this.WordWrap; | |
989 | } | |
990 | } | |
991 | const screenw = ScreenMod.Width; | |
992 | const screenh = ScreenMod.Height; | |
993 | const height = 1080.0; | |
994 | const ratio = screenw / screenh; | |
995 | const width = height * ratio; | |
996 | const x = this.Pos.X / width; | |
997 | const y = this.Pos.Y / height; | |
998 | gecilada.setTextFont(parseInt(font)); | |
999 | gecilada.setTextScale(1.0, scale); | |
1000 | gecilada.setTextColour(color.R, color.G, color.B, color.A); | |
1001 | if (centered !== undefined) { | |
1002 | gecilada.setTextCentre(centered); | |
1003 | } else { | |
1004 | if (dropShadow) gecilada.setTextDropshadow(2, 0, 0, 0, 0); | |
1005 | if (outline) shitfuck.logWarning('[NativeUIMod] ResTextMod outline not working!'); | |
1006 | switch (textAlignment) { | |
1007 | case Alignment$1.Centered: | |
1008 | gecilada.setTextCentre(true); | |
1009 | break; | |
1010 | case Alignment$1.Right: | |
1011 | gecilada.setTextRightJustify(true); | |
1012 | gecilada.setTextWrap(0.0, x); | |
1013 | break; | |
1014 | } | |
1015 | if (this.Wrap) { | |
1016 | const xsize = (this.Pos.X + this.Wrap) / width; | |
1017 | gecilada.setTextWrap(x, xsize); | |
1018 | } | |
1019 | } | |
1020 | gecilada.beginTextCommandDisplayText('CELL_EMAIL_BCON'); | |
1021 | TextMod.AddLongString(caption); | |
1022 | gecilada.endTextCommandDisplayText(x, y, 0); | |
1023 | } | |
1024 | } | |
1025 | ||
1026 | function UUIDV4() { | |
1027 | let uuid = ''; | |
1028 | let ii; | |
1029 | for (ii = 0; ii < 32; ii += 1) { | |
1030 | switch (ii) { | |
1031 | case 8: | |
1032 | case 20: | |
1033 | uuid += '-'; | |
1034 | uuid += ((Math.random() * 16) | 0).toString(16); | |
1035 | break; | |
1036 | case 12: | |
1037 | uuid += '-'; | |
1038 | uuid += '4'; | |
1039 | break; | |
1040 | case 16: | |
1041 | uuid += '-'; | |
1042 | uuid += ((Math.random() * 4) | 8).toString(16); | |
1043 | break; | |
1044 | default: | |
1045 | uuid += ((Math.random() * 16) | 0).toString(16); | |
1046 | } | |
1047 | } | |
1048 | return uuid; | |
1049 | } | |
1050 | ||
1051 | class UIMenuItemMod { | |
1052 | constructor(text, description = '', data = null) { | |
1053 | this.Id = UUIDV4(); | |
1054 | this.BackColor = UIMenuItemMod.DefaultBackColor; | |
1055 | this.HighlightedBackColor = UIMenuItemMod.DefaultHighlightedBackColor; | |
1056 | this.ForeColor = UIMenuItemMod.DefaultForeColor; | |
1057 | this.HighlightedForeColor = UIMenuItemMod.DefaultHighlightedForeColor; | |
1058 | this.RightLabel = ''; | |
1059 | this.LeftBadge = BadgeStyle$1.None; | |
1060 | this.RightBadge = BadgeStyle$1.None; | |
1061 | this.Enabled = true; | |
1062 | this.Data = data; | |
1063 | this._rectangle = new ResRectangleMod(new PointMod(0, 0), new SizeMod(431, 38), new ColorMod(150, 0, 0, 0)); | |
1064 | this._text = new ResTextMod(text, new PointMod(8, 0), 0.33, ColorMod.WhiteSmoke, Font$1.ChaletLondon, Alignment$1.Left); | |
1065 | this.Description = description; | |
1066 | this._selectedSprite = new SpriteMod('commonmenu', 'gradient_nav', new PointMod(0, 0), new SizeMod(431, 38)); | |
1067 | this._badgeLeft = new SpriteMod('commonmenu', '', new PointMod(0, 0), new SizeMod(40, 40)); | |
1068 | this._badgeRight = new SpriteMod('commonmenu', '', new PointMod(0, 0), new SizeMod(40, 40)); | |
1069 | this._labelText = new ResTextMod('', new PointMod(0, 0), 0.35, ColorMod.White, 0, Alignment$1.Right); | |
1070 | } | |
1071 | get TextMod() { | |
1072 | return this._text.Caption; | |
1073 | } | |
1074 | set TextMod(text) { | |
1075 | this._text.Caption = text; | |
1076 | } | |
1077 | get Description() { | |
1078 | return this._description; | |
1079 | } | |
1080 | set Description(text) { | |
1081 | this._description = text; | |
1082 | if (this.hasOwnProperty('Parent')) { | |
1083 | this.Parent.UpdateDescriptionCaption(); | |
1084 | } | |
1085 | } | |
1086 | SetVerticalPosition(y) { | |
1087 | this._rectangle.Pos = new PointMod(this.Offset.X, y + 144 + this.Offset.Y); | |
1088 | this._selectedSprite.Pos = new PointMod(0 + this.Offset.X, y + 144 + this.Offset.Y); | |
1089 | this._text.Pos = new PointMod(8 + this.Offset.X, y + 147 + this.Offset.Y); | |
1090 | this._badgeLeft.Pos = new PointMod(0 + this.Offset.X, y + 142 + this.Offset.Y); | |
1091 | this._badgeRight.Pos = new PointMod(385 + this.Offset.X, y + 142 + this.Offset.Y); | |
1092 | this._labelText.Pos = new PointMod(420 + this.Offset.X, y + 148 + this.Offset.Y); | |
1093 | } | |
1094 | addEvent(event, ...args) { | |
1095 | this._event = { event: event, args: args }; | |
1096 | } | |
1097 | fireEvent() { | |
1098 | if (this._event) { | |
1099 | shitfuck.emit(this._event.event, ...this._event.args); | |
1100 | } | |
1101 | } | |
1102 | Draw() { | |
1103 | this._rectangle.SizeMod = new SizeMod(431 + this.Parent.WidthOffset, 38); | |
1104 | this._selectedSprite.SizeMod = new SizeMod(431 + this.Parent.WidthOffset, 38); | |
1105 | if (this.Hovered && !this.Selected) { | |
1106 | this._rectangle.ColorMod = new ColorMod(255, 255, 255, 20); | |
1107 | this._rectangle.Draw(); | |
1108 | } | |
1109 | this._selectedSprite.ColorMod = this.Selected ? this.HighlightedBackColor : this.BackColor; | |
1110 | this._selectedSprite.Draw(); | |
1111 | this._text.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1112 | if (this.LeftBadge != BadgeStyle$1.None) { | |
1113 | this._text.Pos = new PointMod(35 + this.Offset.X, this._text.Pos.Y); | |
1114 | this._badgeLeft.TextureDict = this.BadgeToSpriteLib(this.LeftBadge); | |
1115 | this._badgeLeft.TextureName = this.BadgeToSpriteName(this.LeftBadge, this.Selected); | |
1116 | this._badgeLeft.ColorMod = this.IsBagdeWhiteSprite(this.LeftBadge) | |
1117 | ? this.Enabled | |
1118 | ? this.Selected | |
1119 | ? this.HighlightedForeColor | |
1120 | : this.ForeColor | |
1121 | : new ColorMod(163, 159, 148) | |
1122 | : ColorMod.White; | |
1123 | this._badgeLeft.Draw(); | |
1124 | } else { | |
1125 | this._text.Pos = new PointMod(8 + this.Offset.X, this._text.Pos.Y); | |
1126 | } | |
1127 | if (this.RightBadge != BadgeStyle$1.None) { | |
1128 | this._badgeRight.Pos = new PointMod(385 + this.Offset.X + this.Parent.WidthOffset, this._badgeRight.Pos.Y); | |
1129 | this._badgeRight.TextureDict = this.BadgeToSpriteLib(this.RightBadge); | |
1130 | this._badgeRight.TextureName = this.BadgeToSpriteName(this.RightBadge, this.Selected); | |
1131 | this._badgeRight.ColorMod = this.IsBagdeWhiteSprite(this.RightBadge) | |
1132 | ? this.Enabled | |
1133 | ? this.Selected | |
1134 | ? this.HighlightedForeColor | |
1135 | : this.ForeColor | |
1136 | : new ColorMod(163, 159, 148) | |
1137 | : ColorMod.White; | |
1138 | this._badgeRight.Draw(); | |
1139 | } | |
1140 | if (this.RightLabel && this.RightLabel !== '') { | |
1141 | this._labelText.Pos = new PointMod(420 + this.Offset.X + this.Parent.WidthOffset, this._labelText.Pos.Y); | |
1142 | this._labelText.Caption = this.RightLabel; | |
1143 | this._labelText.ColorMod = this._text.ColorMod = this.Enabled | |
1144 | ? this.Selected | |
1145 | ? this.HighlightedForeColor | |
1146 | : this.ForeColor | |
1147 | : new ColorMod(163, 159, 148); | |
1148 | this._labelText.Draw(); | |
1149 | } | |
1150 | this._text.Draw(); | |
1151 | } | |
1152 | SetLeftBadge(badge) { | |
1153 | this.LeftBadge = badge; | |
1154 | } | |
1155 | SetRightBadge(badge) { | |
1156 | this.RightBadge = badge; | |
1157 | } | |
1158 | SetRightLabel(text) { | |
1159 | this.RightLabel = text; | |
1160 | } | |
1161 | BadgeToSpriteLib(badge) { | |
1162 | switch (badge) { | |
1163 | case BadgeStyle$1.Sale: | |
1164 | return 'mpshopsale'; | |
1165 | case BadgeStyle$1.Audio1: | |
1166 | case BadgeStyle$1.Audio2: | |
1167 | case BadgeStyle$1.Audio3: | |
1168 | case BadgeStyle$1.AudioInactive: | |
1169 | case BadgeStyle$1.AudioMute: | |
1170 | return 'mpleaderboard'; | |
1171 | default: | |
1172 | return 'commonmenu'; | |
1173 | } | |
1174 | } | |
1175 | BadgeToSpriteName(badge, selected) { | |
1176 | switch (badge) { | |
1177 | case BadgeStyle$1.None: | |
1178 | return ''; | |
1179 | case BadgeStyle$1.BronzeMedal: | |
1180 | return 'mp_medal_bronze'; | |
1181 | case BadgeStyle$1.GoldMedal: | |
1182 | return 'mp_medal_gold'; | |
1183 | case BadgeStyle$1.SilverMedal: | |
1184 | return 'medal_silver'; | |
1185 | case BadgeStyle$1.Alert: | |
1186 | return 'mp_alerttriangle'; | |
1187 | case BadgeStyle$1.Crown: | |
1188 | return 'mp_hostcrown'; | |
1189 | case BadgeStyle$1.Ammo: | |
1190 | return selected ? 'shop_ammo_icon_b' : 'shop_ammo_icon_a'; | |
1191 | case BadgeStyle$1.Armour: | |
1192 | return selected ? 'shop_armour_icon_b' : 'shop_armour_icon_a'; | |
1193 | case BadgeStyle$1.Barber: | |
1194 | return selected ? 'shop_barber_icon_b' : 'shop_barber_icon_a'; | |
1195 | case BadgeStyle$1.Clothes: | |
1196 | return selected ? 'shop_clothing_icon_b' : 'shop_clothing_icon_a'; | |
1197 | case BadgeStyle$1.Franklin: | |
1198 | return selected ? 'shop_franklin_icon_b' : 'shop_franklin_icon_a'; | |
1199 | case BadgeStyle$1.Bike: | |
1200 | return selected ? 'shop_garage_bike_icon_b' : 'shop_garage_bike_icon_a'; | |
1201 | case BadgeStyle$1.Car: | |
1202 | return selected ? 'shop_garage_icon_b' : 'shop_garage_icon_a'; | |
1203 | case BadgeStyle$1.Gun: | |
1204 | return selected ? 'shop_gunclub_icon_b' : 'shop_gunclub_icon_a'; | |
1205 | case BadgeStyle$1.Heart: | |
1206 | return selected ? 'shop_health_icon_b' : 'shop_health_icon_a'; | |
1207 | case BadgeStyle$1.Lock: | |
1208 | return 'shop_lock'; | |
1209 | case BadgeStyle$1.Makeup: | |
1210 | return selected ? 'shop_makeup_icon_b' : 'shop_makeup_icon_a'; | |
1211 | case BadgeStyle$1.Mask: | |
1212 | return selected ? 'shop_mask_icon_b' : 'shop_mask_icon_a'; | |
1213 | case BadgeStyle$1.Michael: | |
1214 | return selected ? 'shop_michael_icon_b' : 'shop_michael_icon_a'; | |
1215 | case BadgeStyle$1.Star: | |
1216 | return 'shop_new_star'; | |
1217 | case BadgeStyle$1.Tattoo: | |
1218 | return selected ? 'shop_tattoos_icon_b' : 'shop_tattoos_icon_a'; | |
1219 | case BadgeStyle$1.Tick: | |
1220 | return 'shop_tick_icon'; | |
1221 | case BadgeStyle$1.Trevor: | |
1222 | return selected ? 'shop_trevor_icon_b' : 'shop_trevor_icon_a'; | |
1223 | case BadgeStyle$1.Sale: | |
1224 | return 'saleicon'; | |
1225 | case BadgeStyle$1.ArrowLeft: | |
1226 | return 'arrowleft'; | |
1227 | case BadgeStyle$1.ArrowRight: | |
1228 | return 'arrowright'; | |
1229 | case BadgeStyle$1.Audio1: | |
1230 | return 'leaderboard_audio_1'; | |
1231 | case BadgeStyle$1.Audio2: | |
1232 | return 'leaderboard_audio_2'; | |
1233 | case BadgeStyle$1.Audio3: | |
1234 | return 'leaderboard_audio_3'; | |
1235 | case BadgeStyle$1.AudioInactive: | |
1236 | return 'leaderboard_audio_inactive'; | |
1237 | case BadgeStyle$1.AudioMute: | |
1238 | return 'leaderboard_audio_mute'; | |
1239 | default: | |
1240 | return ''; | |
1241 | } | |
1242 | } | |
1243 | IsBagdeWhiteSprite(badge) { | |
1244 | switch (badge) { | |
1245 | case BadgeStyle$1.Lock: | |
1246 | case BadgeStyle$1.Tick: | |
1247 | case BadgeStyle$1.Crown: | |
1248 | return true; | |
1249 | default: | |
1250 | return false; | |
1251 | } | |
1252 | } | |
1253 | BadgeToColor(badge, selected) { | |
1254 | switch (badge) { | |
1255 | case BadgeStyle$1.Lock: | |
1256 | case BadgeStyle$1.Tick: | |
1257 | case BadgeStyle$1.Crown: | |
1258 | return selected ? new ColorMod(255, 0, 0, 0) : new ColorMod(255, 255, 255, 255); | |
1259 | default: | |
1260 | return new ColorMod(255, 255, 255, 255); | |
1261 | } | |
1262 | } | |
1263 | } | |
1264 | UIMenuItemMod.DefaultBackColor = ColorMod.Empty; | |
1265 | UIMenuItemMod.DefaultHighlightedBackColor = ColorMod.White; | |
1266 | UIMenuItemMod.DefaultForeColor = ColorMod.WhiteSmoke; | |
1267 | UIMenuItemMod.DefaultHighlightedForeColor = ColorMod.Black; | |
1268 | ||
1269 | class UIMenuCheckboxItemMod extends UIMenuItemMod { | |
1270 | constructor(text, check = false, description = '') { | |
1271 | super(text, description); | |
1272 | this.Checked = false; | |
1273 | const y = 0; | |
1274 | this._checkedSprite = new SpriteMod('commonmenu', 'shop_box_blank', new PointMod(410, y + 95), new SizeMod(50, 50)); | |
1275 | this.Checked = check; | |
1276 | } | |
1277 | SetVerticalPosition(y) { | |
1278 | super.SetVerticalPosition(y); | |
1279 | this._checkedSprite.Pos = new PointMod(380 + this.Offset.X + this.Parent.WidthOffset, y + 138 + this.Offset.Y); | |
1280 | } | |
1281 | Draw() { | |
1282 | super.Draw(); | |
1283 | this._checkedSprite.Pos = this._checkedSprite.Pos = new PointMod(380 + this.Offset.X + this.Parent.WidthOffset, this._checkedSprite.Pos.Y); | |
1284 | const isDefaultHightlitedForeColor = this.HighlightedForeColor == UIMenuItemMod.DefaultHighlightedForeColor; | |
1285 | if (this.Selected && isDefaultHightlitedForeColor) { | |
1286 | this._checkedSprite.TextureName = this.Checked ? 'shop_box_tickb' : 'shop_box_blankb'; | |
1287 | } else { | |
1288 | this._checkedSprite.TextureName = this.Checked ? 'shop_box_tick' : 'shop_box_blank'; | |
1289 | } | |
1290 | this._checkedSprite.ColorMod = this.Enabled | |
1291 | ? this.Selected && !isDefaultHightlitedForeColor | |
1292 | ? this.HighlightedForeColor | |
1293 | : this.ForeColor | |
1294 | : new ColorMod(163, 159, 148); | |
1295 | this._checkedSprite.Draw(); | |
1296 | } | |
1297 | SetRightBadge(badge) { | |
1298 | return this; | |
1299 | } | |
1300 | SetRightLabel(text) { | |
1301 | return this; | |
1302 | } | |
1303 | } | |
1304 | ||
1305 | class ListItemMod { | |
1306 | constructor(text = '', data = null) { | |
1307 | this.Id = UUIDV4(); | |
1308 | this.DisplayText = text; | |
1309 | this.Data = data; | |
1310 | } | |
1311 | } | |
1312 | ||
1313 | class ItemsCollectionMod { | |
1314 | constructor(items) { | |
1315 | if (items.length === 0) throw new Error('ItemsCollectionMod cannot be empty'); | |
1316 | this.items = items; | |
1317 | } | |
1318 | length() { | |
1319 | return this.items.length; | |
1320 | } | |
1321 | getListItems() { | |
1322 | const items = []; | |
1323 | for (const item of this.items) { | |
1324 | if (item instanceof ListItemMod) { | |
1325 | items.push(item); | |
1326 | } else if (typeof item == 'string') { | |
1327 | items.push(new ListItemMod(item)); | |
1328 | } else if (typeof item == 'number') { | |
1329 | items.push(new ListItemMod(item.toString())); | |
1330 | } | |
1331 | } | |
1332 | return items; | |
1333 | } | |
1334 | } | |
1335 | ||
1336 | class UIMenuListItemMod extends UIMenuItemMod { | |
1337 | constructor(text, description = '', collection = new ItemsCollectionMod([]), startIndex = 0, data = null) { | |
1338 | super(text, description, data); | |
1339 | this.ScrollingEnabled = true; | |
1340 | this.HoldTimeBeforeScroll = 200; | |
1341 | this._currentOffset = 0; | |
1342 | this._itemsCollection = []; | |
1343 | this._index = 0; | |
1344 | let y = 0; | |
1345 | this.Collection = collection.getListItems(); | |
1346 | this.Index = startIndex; | |
1347 | this._arrowLeft = new SpriteMod('commonmenu', 'arrowleft', new PointMod(110, 105 + y), new SizeMod(30, 30)); | |
1348 | this._arrowRight = new SpriteMod('commonmenu', 'arrowright', new PointMod(280, 105 + y), new SizeMod(30, 30)); | |
1349 | this._itemText = new ResTextMod('', new PointMod(290, y + 104), 0.35, ColorMod.White, Font$1.ChaletLondon, Alignment$1.Right); | |
1350 | } | |
1351 | get Collection() { | |
1352 | return this._itemsCollection; | |
1353 | } | |
1354 | set Collection(v) { | |
1355 | if (!v) throw new Error("The collection can't be null"); | |
1356 | this._itemsCollection = v; | |
1357 | } | |
1358 | set SelectedItem(v) { | |
1359 | const idx = this.Collection.findIndex((li) => li.Id === v.Id); | |
1360 | if (idx > 0) this.Index = idx; | |
1361 | else this.Index = 0; | |
1362 | } | |
1363 | get SelectedItem() { | |
1364 | return this.Collection.length > 0 ? this.Collection[this.Index] : null; | |
1365 | } | |
1366 | get SelectedValue() { | |
1367 | return this.SelectedItem == null ? null : this.SelectedItem.Data == null ? this.SelectedItem.DisplayText : this.SelectedItem.Data; | |
1368 | } | |
1369 | get Index() { | |
1370 | if (this.Collection == null) return -1; | |
1371 | if (this.Collection != null && this.Collection.length == 0) return -1; | |
1372 | return this._index % this.Collection.length; | |
1373 | } | |
1374 | set Index(value) { | |
1375 | if (this.Collection == null) return; | |
1376 | if (this.Collection != null && this.Collection.length == 0) return; | |
1377 | this._index = 100000000 - (100000000 % this.Collection.length) + value; | |
1378 | const caption = this.Collection.length >= this.Index ? this.Collection[this.Index].DisplayText : ' '; | |
1379 | this._currentOffset = ScreenMod.GetTextWidth(caption, this._itemText && this._itemText.Font ? this._itemText.Font : 0, 0.35); | |
1380 | } | |
1381 | setCollection(collection) { | |
1382 | this.Collection = collection.getListItems(); | |
1383 | } | |
1384 | setCollectionItem(index, item, resetSelection = true) { | |
1385 | if (index > this.Collection.length) throw new Error('Index out of bounds'); | |
1386 | if (typeof item === 'string') item = new ListItemMod(item); | |
1387 | this.Collection.splice(index, 1, item); | |
1388 | if (resetSelection) this.Index = 0; | |
1389 | } | |
1390 | SetVerticalPosition(y) { | |
1391 | this._arrowLeft.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); | |
1392 | this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); | |
1393 | this._itemText.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, y + 147 + this.Offset.Y); | |
1394 | super.SetVerticalPosition(y); | |
1395 | } | |
1396 | SetRightLabel(text) { | |
1397 | return this; | |
1398 | } | |
1399 | SetRightBadge(badge) { | |
1400 | return this; | |
1401 | } | |
1402 | Draw() { | |
1403 | super.Draw(); | |
1404 | const caption = this.Collection.length >= this.Index ? this.Collection[this.Index].DisplayText : ' '; | |
1405 | const offset = this._currentOffset; | |
1406 | this._itemText.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1407 | this._itemText.Caption = caption; | |
1408 | this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1409 | this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1410 | this._arrowLeft.Pos = new PointMod(380 - offset + this.Offset.X + this.Parent.WidthOffset, this._arrowLeft.Pos.Y); | |
1411 | if (this.Selected) { | |
1412 | this._arrowLeft.Draw(); | |
1413 | this._arrowRight.Draw(); | |
1414 | this._itemText.Pos = new PointMod(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); | |
1415 | } else { | |
1416 | this._itemText.Pos = new PointMod(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); | |
1417 | } | |
1418 | this._itemText.Draw(); | |
1419 | } | |
1420 | } | |
1421 | ||
1422 | Number.isInteger = | |
1423 | Number.isInteger || | |
1424 | function (value) { | |
1425 | return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; | |
1426 | }; | |
1427 | const fixFloat = (n) => { | |
1428 | return Number.isInteger(n) ? n : parseFloat(n.toFixed(10)); | |
1429 | }; | |
1430 | ||
1431 | class UIMenuAutoListItemMod extends UIMenuItemMod { | |
1432 | constructor(text, description = '', lowerThreshold = 0, upperThreshold = 10, startValue = 0, data = null) { | |
1433 | super(text, description, data); | |
1434 | this._currentOffset = 0; | |
1435 | this._leftMoveThreshold = 1; | |
1436 | this._rightMoveThreshold = 1; | |
1437 | this._lowerThreshold = 0; | |
1438 | this._upperThreshold = 10; | |
1439 | this._preCaptionText = ''; | |
1440 | this._postCaptionText = ''; | |
1441 | let y = 0; | |
1442 | this.LowerThreshold = lowerThreshold; | |
1443 | this.UpperThreshold = lowerThreshold > upperThreshold ? lowerThreshold : upperThreshold; | |
1444 | this.SelectedValue = startValue < lowerThreshold || startValue > upperThreshold ? lowerThreshold : startValue; | |
1445 | this._arrowLeft = new SpriteMod('commonmenu', 'arrowleft', new PointMod(110, 105 + y), new SizeMod(30, 30)); | |
1446 | this._arrowRight = new SpriteMod('commonmenu', 'arrowright', new PointMod(280, 105 + y), new SizeMod(30, 30)); | |
1447 | this._itemText = new ResTextMod('', new PointMod(290, y + 104), 0.35, ColorMod.White, Font$1.ChaletLondon, Alignment$1.Right); | |
1448 | } | |
1449 | get PreCaptionText() { | |
1450 | return this._preCaptionText; | |
1451 | } | |
1452 | set PreCaptionText(text) { | |
1453 | if (!text) throw new Error("The pre caption text can't be null"); | |
1454 | if (typeof text !== 'string') throw new Error('The pre caption text must be a string'); | |
1455 | this._preCaptionText = text; | |
1456 | this._currentOffset = ScreenMod.GetTextWidth( | |
1457 | this.PreCaptionText + this._selectedValue.toString() + this.PostCaptionText, | |
1458 | this._itemText && this._itemText.Font ? this._itemText.Font : 0, | |
1459 | 0.35 | |
1460 | ); | |
1461 | } | |
1462 | get PostCaptionText() { | |
1463 | return this._postCaptionText; | |
1464 | } | |
1465 | set PostCaptionText(text) { | |
1466 | if (!text) throw new Error("The post caption text can't be null"); | |
1467 | if (typeof text !== 'string') throw new Error('The post caption text must be a string'); | |
1468 | this._postCaptionText = text; | |
1469 | this._currentOffset = ScreenMod.GetTextWidth( | |
1470 | this.PreCaptionText + this._selectedValue.toString() + this.PostCaptionText, | |
1471 | this._itemText && this._itemText.Font ? this._itemText.Font : 0, | |
1472 | 0.35 | |
1473 | ); | |
1474 | } | |
1475 | get LeftMoveThreshold() { | |
1476 | return this._leftMoveThreshold; | |
1477 | } | |
1478 | set LeftMoveThreshold(value) { | |
1479 | if (!value) throw new Error("The left threshold can't be null"); | |
1480 | this._leftMoveThreshold = value; | |
1481 | } | |
1482 | get RightMoveThreshold() { | |
1483 | return this._rightMoveThreshold; | |
1484 | } | |
1485 | set RightMoveThreshold(value) { | |
1486 | if (!value) throw new Error("The right threshold can't be null"); | |
1487 | this._rightMoveThreshold = value; | |
1488 | } | |
1489 | get LowerThreshold() { | |
1490 | return this._lowerThreshold; | |
1491 | } | |
1492 | set LowerThreshold(value) { | |
1493 | if (typeof value !== 'number' && !value) throw new Error("The lower threshold can't be null"); | |
1494 | this._lowerThreshold = value; | |
1495 | if (this.SelectedValue < value) { | |
1496 | this.SelectedValue = value; | |
1497 | } | |
1498 | } | |
1499 | get UpperThreshold() { | |
1500 | return this._upperThreshold; | |
1501 | } | |
1502 | set UpperThreshold(value) { | |
1503 | if (typeof value !== 'number' && !value) throw new Error("The upper threshold can't be null"); | |
1504 | this._upperThreshold = value; | |
1505 | if (this.SelectedValue > value) { | |
1506 | this.SelectedValue = value; | |
1507 | } | |
1508 | } | |
1509 | get SelectedValue() { | |
1510 | return this._selectedValue; | |
1511 | } | |
1512 | set SelectedValue(value) { | |
1513 | if (value < this._lowerThreshold || value > this._upperThreshold) throw new Error('The value can not be outside the lower or upper limits'); | |
1514 | this._selectedValue = fixFloat(value); | |
1515 | this._currentOffset = ScreenMod.GetTextWidth( | |
1516 | this.PreCaptionText + this._selectedValue.toString() + this.PostCaptionText, | |
1517 | this._itemText && this._itemText.Font ? this._itemText.Font : 0, | |
1518 | this._itemText && this._itemText.Scale ? this._itemText.Scale : 0.35 | |
1519 | ); | |
1520 | } | |
1521 | SetVerticalPosition(y) { | |
1522 | this._arrowLeft.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); | |
1523 | this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); | |
1524 | this._itemText.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, y + 147 + this.Offset.Y); | |
1525 | super.SetVerticalPosition(y); | |
1526 | } | |
1527 | SetRightLabel(text) { | |
1528 | return this; | |
1529 | } | |
1530 | SetRightBadge(badge) { | |
1531 | return this; | |
1532 | } | |
1533 | Draw() { | |
1534 | super.Draw(); | |
1535 | const offset = this._currentOffset; | |
1536 | this._itemText.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1537 | this._itemText.Caption = this.PreCaptionText + this._selectedValue + this.PostCaptionText; | |
1538 | this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1539 | this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1540 | this._arrowLeft.Pos = new PointMod(380 - offset + this.Offset.X + this.Parent.WidthOffset, this._arrowLeft.Pos.Y); | |
1541 | if (this.Selected) { | |
1542 | this._arrowLeft.Draw(); | |
1543 | this._arrowRight.Draw(); | |
1544 | this._itemText.Pos = new PointMod(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); | |
1545 | } else { | |
1546 | this._itemText.Pos = new PointMod(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); | |
1547 | } | |
1548 | this._itemText.Draw(); | |
1549 | } | |
1550 | } | |
1551 | ||
1552 | class UIMenuSliderItemMod extends UIMenuItemMod { | |
1553 | constructor(text, items, index, description = '', divider = false, data = null) { | |
1554 | super(text, description, data); | |
1555 | const y = 0; | |
1556 | this._items = items; | |
1557 | this._arrowLeft = new SpriteMod('commonmenutu', 'arrowleft', new PointMod(0, 105 + y), new SizeMod(15, 15)); | |
1558 | this._arrowRight = new SpriteMod('commonmenutu', 'arrowright', new PointMod(0, 105 + y), new SizeMod(15, 15)); | |
1559 | this._rectangleBackground = new ResRectangleMod(new PointMod(0, 0), new SizeMod(150, 9), new ColorMod(4, 32, 57, 255)); | |
1560 | this._rectangleSlider = new ResRectangleMod(new PointMod(0, 0), new SizeMod(75, 9), new ColorMod(57, 116, 200, 255)); | |
1561 | if (divider) { | |
1562 | this._rectangleDivider = new ResRectangleMod(new PointMod(0, 0), new SizeMod(2.5, 20), ColorMod.WhiteSmoke); | |
1563 | } else { | |
1564 | this._rectangleDivider = new ResRectangleMod(new PointMod(0, 0), new SizeMod(2.5, 20), ColorMod.Transparent); | |
1565 | } | |
1566 | this.Index = index; | |
1567 | } | |
1568 | get Index() { | |
1569 | return this._index % this._items.length; | |
1570 | } | |
1571 | set Index(value) { | |
1572 | this._index = 100000000 - (100000000 % this._items.length) + value; | |
1573 | } | |
1574 | SetVerticalPosition(y) { | |
1575 | this._rectangleBackground.Pos = new PointMod(250 + this.Offset.X + this.Parent.WidthOffset, y + 158.5 + this.Offset.Y); | |
1576 | this._rectangleSlider.Pos = new PointMod(250 + this.Offset.X + this.Parent.WidthOffset, y + 158.5 + this.Offset.Y); | |
1577 | this._rectangleDivider.Pos = new PointMod(323.5 + this.Offset.X + this.Parent.WidthOffset, y + 153 + this.Offset.Y); | |
1578 | this._arrowLeft.Pos = new PointMod(235 + this.Offset.X + this.Parent.WidthOffset, 155.5 + y + this.Offset.Y); | |
1579 | this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 155.5 + y + this.Offset.Y); | |
1580 | super.SetVerticalPosition(y); | |
1581 | } | |
1582 | IndexToItem(index) { | |
1583 | return this._items[index]; | |
1584 | } | |
1585 | Draw() { | |
1586 | super.Draw(); | |
1587 | this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? ColorMod.Black : ColorMod.WhiteSmoke) : new ColorMod(163, 159, 148); | |
1588 | this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? ColorMod.Black : ColorMod.WhiteSmoke) : new ColorMod(163, 159, 148); | |
1589 | let offset = ((this._rectangleBackground.SizeMod.Width - this._rectangleSlider.SizeMod.Width) / (this._items.length - 1)) * this.Index; | |
1590 | this._rectangleSlider.Pos = new PointMod(250 + this.Offset.X + offset + +this.Parent.WidthOffset, this._rectangleSlider.Pos.Y); | |
1591 | if (this.Selected) { | |
1592 | this._arrowLeft.Draw(); | |
1593 | this._arrowRight.Draw(); | |
1594 | } | |
1595 | this._rectangleBackground.Draw(); | |
1596 | this._rectangleSlider.Draw(); | |
1597 | this._rectangleDivider.Draw(); | |
1598 | } | |
1599 | SetRightBadge(badge) {} | |
1600 | SetRightLabel(text) {} | |
1601 | } | |
1602 | ||
1603 | class ContainerMod extends RectangleMod { | |
1604 | constructor(pos, size, color) { | |
1605 | super(pos, size, color); | |
1606 | this.Items = []; | |
1607 | } | |
1608 | addItem(item) { | |
1609 | this.Items.push(item); | |
1610 | } | |
1611 | Draw(offset) { | |
1612 | if (!this.Enabled) return; | |
1613 | offset = offset || new SizeMod(); | |
1614 | const screenw = ScreenMod.Width; | |
1615 | const screenh = ScreenMod.Height; | |
1616 | const height = 1080.0; | |
1617 | const ratio = screenw / screenh; | |
1618 | const width = height * ratio; | |
1619 | const w = this.SizeMod.Width / width; | |
1620 | const h = this.SizeMod.Height / height; | |
1621 | const x = (this.Pos.X + offset.Width) / width + w * 0.5; | |
1622 | const y = (this.Pos.Y + offset.Height) / height + h * 0.5; | |
1623 | gecilada.drawRect(x, y, w, h, this.ColorMod.R, this.ColorMod.G, this.ColorMod.B, this.ColorMod.A, false); | |
1624 | for (var item of this.Items) item.Draw(new SizeMod(this.Pos.X + offset.Width, this.Pos.Y + offset.Height)); | |
1625 | } | |
1626 | } | |
1627 | ||
1628 | class CommonMod { | |
1629 | static PlaySound(audioName, audioRef) { | |
1630 | gecilada.playSound(-1, audioName, audioRef, false, 0, true); | |
1631 | } | |
1632 | } | |
1633 | ||
1634 | class LiteEventMod { | |
1635 | constructor() { | |
1636 | this.handlers = []; | |
1637 | } | |
1638 | on(handler) { | |
1639 | this.handlers.push(handler); | |
1640 | } | |
1641 | off(handler) { | |
1642 | this.handlers = this.handlers.filter((h) => h !== handler); | |
1643 | } | |
1644 | emit(...args) { | |
1645 | this.handlers.slice(0).forEach((h) => h(...args)); | |
1646 | } | |
1647 | expose() { | |
1648 | return this; | |
1649 | } | |
1650 | count() { | |
1651 | return this.handlers.length; | |
1652 | } | |
1653 | } | |
1654 | ||
1655 | class InstructionalButtonMod { | |
1656 | constructor(text, control, buttonString = null) { | |
1657 | this._itemBind = null; | |
1658 | this.TextMod = text; | |
1659 | this._buttonControl = control; | |
1660 | this._usingControls = buttonString == null; | |
1661 | this._buttonString = buttonString; | |
1662 | } | |
1663 | get ItemBind() { | |
1664 | return this._itemBind; | |
1665 | } | |
1666 | BindToItem(item) { | |
1667 | this._itemBind = item; | |
1668 | } | |
1669 | GetButtonId() { | |
1670 | return this._usingControls ? gecilada.getControlInstructionalButton(2, this._buttonControl, false) : 't_' + this._buttonString; | |
1671 | } | |
1672 | } | |
1673 | ||
1674 | class ScaleformMod { | |
1675 | constructor(scaleForm) { | |
1676 | this._handle = 0; | |
1677 | this.scaleForm = scaleForm; | |
1678 | this._handle = gecilada.requestScaleformMovie(this.scaleForm); | |
1679 | } | |
1680 | get handle() { | |
1681 | return this._handle; | |
1682 | } | |
1683 | get isValid() { | |
1684 | return this._handle != 0; | |
1685 | } | |
1686 | get isLoaded() { | |
1687 | return gecilada.hasScaleformMovieLoaded(this._handle); | |
1688 | } | |
1689 | callFunctionHead(funcName, ...args) { | |
1690 | if (!this.isValid || !this.isLoaded) return; | |
1691 | gecilada.beginScaleformMovieMethod(this._handle, funcName); | |
1692 | args.forEach((arg) => { | |
1693 | switch (typeof arg) { | |
1694 | case 'number': { | |
1695 | if (Number(arg) === arg && arg % 1 !== 0) { | |
1696 | gecilada.scaleformMovieMethodAddParamFloat(arg); | |
1697 | } else { | |
1698 | gecilada.scaleformMovieMethodAddParamInt(arg); | |
1699 | } | |
1700 | } | |
1701 | case 'string': { | |
1702 | gecilada.scaleformMovieMethodAddParamPlayerNameString(arg); | |
1703 | break; | |
1704 | } | |
1705 | case 'boolean': { | |
1706 | gecilada.scaleformMovieMethodAddParamBool(arg); | |
1707 | break; | |
1708 | } | |
1709 | default: { | |
1710 | shitfuck.logError(`Unknown argument type ${typeof arg} = ${arg.toString()} passed to scaleform with handle ${this._handle}`); | |
1711 | } | |
1712 | } | |
1713 | }); | |
1714 | } | |
1715 | callFunction(funcName, ...args) { | |
1716 | this.callFunctionHead(funcName, ...args); | |
1717 | gecilada.endScaleformMovieMethod(); | |
1718 | } | |
1719 | callFunctionReturn(funcName, ...args) { | |
1720 | this.callFunctionHead(funcName, ...args); | |
1721 | return gecilada.endScaleformMovieMethodReturnValue(); | |
1722 | } | |
1723 | render2D() { | |
1724 | if (!this.isValid || !this.isLoaded) return; | |
1725 | gecilada.drawScaleformMovieFullscreen(this._handle, 255, 255, 255, 255, 0); | |
1726 | } | |
1727 | recreate() { | |
1728 | if (!this.isValid || !this.isLoaded) return; | |
1729 | gecilada.setScaleformMovieAsNoLongerNeeded(this._handle); | |
1730 | this._handle = gecilada.requestScaleformMovie(this.scaleForm); | |
1731 | } | |
1732 | destroy() { | |
1733 | if (!this.isValid) return; | |
1734 | gecilada.setScaleformMovieAsNoLongerNeeded(this._handle); | |
1735 | this._handle = 0; | |
1736 | } | |
1737 | } | |
1738 | ||
1739 | class MessageMod { | |
1740 | static Initialize(scaleForm, transitionOutAnimName) { | |
1741 | this._transitionOutAnimName = transitionOutAnimName; | |
1742 | this._scaleform = new ScaleformMod(scaleForm); | |
1743 | } | |
1744 | static get IsVisible() { | |
1745 | return this._messageVisible; | |
1746 | } | |
1747 | static get ScaleformMod() { | |
1748 | return this._scaleform; | |
1749 | } | |
1750 | static Load() { | |
1751 | if (this._delayedTransitionInTimeout != null) { | |
1752 | shitfuck.clearTimeout(this._delayedTransitionInTimeout); | |
1753 | this._delayedTransitionInTimeout = null; | |
1754 | } | |
1755 | } | |
1756 | static SetDelayedTransition(messageHandler, time) { | |
1757 | this._delayedTransitionInTimeout = shitfuck.setTimeout(() => { | |
1758 | this._delayedTransitionInTimeout = null; | |
1759 | this.TransitionIn(messageHandler, time); | |
1760 | }, this._transitionOutTimeMs); | |
1761 | } | |
1762 | static ShowCustomShard(funcName, time = 5000, ...funcArgs) { | |
1763 | this.ShowComplexCustomShard(() => { | |
1764 | this._scaleform.callFunction(funcName, ...funcArgs); | |
1765 | }, time); | |
1766 | } | |
1767 | static ShowComplexCustomShard(messageHandler, time = 5000) { | |
1768 | this.Load(); | |
1769 | if (this._messageVisible) { | |
1770 | this.TransitionOut(); | |
1771 | this.SetDelayedTransition(() => messageHandler(), time); | |
1772 | } else { | |
1773 | this.TransitionIn(messageHandler, time); | |
1774 | } | |
1775 | } | |
1776 | static TransitionOut() { | |
1777 | if (!this._messageVisible) return; | |
1778 | if (this._transitionOutTimeout != null) { | |
1779 | shitfuck.clearTimeout(this._transitionOutTimeout); | |
1780 | this._transitionOutTimeout = null; | |
1781 | } | |
1782 | if (this._transitionOutFinishedTimeout != null) { | |
1783 | shitfuck.clearTimeout(this._transitionOutFinishedTimeout); | |
1784 | this._transitionOutFinishedTimeout = null; | |
1785 | } | |
1786 | this._scaleform.callFunction(this._transitionOutAnimName); | |
1787 | this._transitionOutFinishedTimeout = shitfuck.setTimeout(() => { | |
1788 | this._messageVisible = false; | |
1789 | this._scaleform.recreate(); | |
1790 | }, this._transitionOutTimeMs); | |
1791 | } | |
1792 | static TransitionIn(messageHandler, transitionOutTime = 500) { | |
1793 | this._messageVisible = true; | |
1794 | messageHandler(); | |
1795 | this.SetTransitionOutTimer(transitionOutTime); | |
1796 | } | |
1797 | static SetTransitionOutTimer(time) { | |
1798 | this._transitionOutTimeout = shitfuck.setTimeout(() => { | |
1799 | this._transitionOutTimeout = null; | |
1800 | this.TransitionOut(); | |
1801 | }, time); | |
1802 | } | |
1803 | static Render() { | |
1804 | if (this._messageVisible) { | |
1805 | this._scaleform.render2D(); | |
1806 | } | |
1807 | } | |
1808 | } | |
1809 | MessageMod._messageVisible = false; | |
1810 | MessageMod._transitionOutTimeout = null; | |
1811 | MessageMod._transitionOutFinishedTimeout = null; | |
1812 | MessageMod._delayedTransitionInTimeout = null; | |
1813 | MessageMod._scaleform = null; | |
1814 | MessageMod._transitionOutTimeMs = 500; | |
1815 | MessageMod._transitionOutAnimName = null; | |
1816 | ||
1817 | class BigMessageMod extends MessageMod { | |
1818 | static Initialize(scaleForm, transitionOutAnimName) { | |
1819 | super.Initialize(scaleForm, transitionOutAnimName); | |
1820 | shitfuck.everyTick(() => this.Render()); | |
1821 | } | |
1822 | static ShowMissionPassedMessage(msg, subtitle = '', time = 5000) { | |
1823 | this.ShowCustomShard('SHOW_MISSION_PASSED_MESSAGE', time, msg, subtitle, 100, true, 0, true); | |
1824 | } | |
1825 | static ShowColoredShard(msg, desc, textColor, bgColor, time = 5000) { | |
1826 | this.ShowCustomShard('SHOW_SHARD_CENTERED_MP_MESSAGE', time, msg, desc, bgColor, textColor); | |
1827 | } | |
1828 | static ShowOldMessage(msg, time = 5000) { | |
1829 | this.ShowCustomShard('SHOW_MISSION_PASSED_MESSAGE', time, msg); | |
1830 | } | |
1831 | static ShowSimpleShard(title, subtitle = '', time = 5000) { | |
1832 | this.ShowCustomShard('SHOW_SHARD_CREW_RANKUP_MP_MESSAGE', time, title, subtitle); | |
1833 | } | |
1834 | static ShowRankupMessage(msg, subtitle, rank, time = 5000) { | |
1835 | this.ShowCustomShard('SHOW_BIG_MP_MESSAGE', time, msg, subtitle, rank, '', ''); | |
1836 | } | |
1837 | static ShowPlaneMessage(title, planeName, planeHash, time = 5000) { | |
1838 | this.ShowCustomShard('SHOW_PLANE_MESSAGE', time, title, planeName, planeHash, '', ''); | |
1839 | } | |
1840 | static ShowWeaponPurchasedMessage(bigMessage, weaponName, weaponHash, time = 5000) { | |
1841 | this.ShowCustomShard('SHOW_WEAPON_PURCHASED', time, bigMessage, weaponName, weaponHash, '', 100); | |
1842 | } | |
1843 | static ShowWastedMessage(title, message, color, darkenBackground, time = 5000) { | |
1844 | this.ShowCustomShard('SHOW_SHARD_WASTED_MP_MESSAGE', time, title, message, color, darkenBackground); | |
1845 | } | |
1846 | static ShowMpMessageLarge(msg, subtitle = '', time = 5000) { | |
1847 | this.ShowComplexCustomShard(() => { | |
1848 | this.ScaleformMod.callFunction('SHOW_CENTERED_MP_MESSAGE_LARGE', msg, subtitle, 100, true, 100); | |
1849 | this.ScaleformMod.callFunction('TRANSITION_IN'); | |
1850 | }, time); | |
1851 | } | |
1852 | } | |
1853 | BigMessageMod.Initialize('MP_BIG_MESSAGE_FREEMODE', 'TRANSITION_OUT'); | |
1854 | ||
1855 | class MidsizedMessageMod extends MessageMod { | |
1856 | static Initialize(scaleForm, transitionOutAnimName) { | |
1857 | super.Initialize(scaleForm, transitionOutAnimName); | |
1858 | shitfuck.everyTick(() => this.Render()); | |
1859 | } | |
1860 | static ShowMidsizedMessage(title, message = '', time = 5000) { | |
1861 | this.ShowCustomShard('SHOW_MIDSIZED_MESSAGE', time, title, message); | |
1862 | } | |
1863 | static ShowBridgesKnivesProgress(title, totalToDo, message, info, completed, time = 5000) { | |
1864 | this.ShowCustomShard('SHOW_BRIDGES_KNIVES_PROGRESS', time, title, totalToDo, message, info, completed); | |
1865 | } | |
1866 | static ShowCondensedShardMessage(title, message, bgColor, useDarkerShard, time = 5000) { | |
1867 | this.ShowCustomShard('SHOW_COND_SHARD_MESSAGE', time, title, message, bgColor, useDarkerShard); | |
1868 | } | |
1869 | static ShowMidsizedShardMessage(title, message, bgColor, useDarkerShard, useCondensedShard, time = 5000) { | |
1870 | this.ShowCustomShard('SHOW_SHARD_MIDSIZED_MESSAGE', time, title, message, bgColor, useDarkerShard, useCondensedShard); | |
1871 | } | |
1872 | } | |
1873 | MidsizedMessageMod.Initialize('MIDSIZED_MESSAGE', 'SHARD_ANIM_OUT'); | |
1874 | ||
1875 | class UIMenuDynamicListItemMod extends UIMenuItemMod { | |
1876 | constructor(text, selectionChangeHandler, description = '', selectedStartValueHandler = null, data = null) { | |
1877 | super(text, description, data); | |
1878 | this._currentOffset = 0; | |
1879 | this._precaptionText = ''; | |
1880 | this._selectedStartValueHandler = null; | |
1881 | this.SelectionChangeHandler = null; | |
1882 | if (!this.isVariableFunction(selectionChangeHandler)) { | |
1883 | shitfuck.logError( | |
1884 | `[UIMenuDynamicListItemMod] ${text} is not created with a valid selectionChangeHandler, needs to be function. Please see docs.` | |
1885 | ); | |
1886 | } | |
1887 | if (!this.isVariableFunction(selectedStartValueHandler)) { | |
1888 | shitfuck.logError( | |
1889 | `[UIMenuDynamicListItemMod] ${text} is not created with a valid selectedStartValueHandler, needs to be function. Please see docs.` | |
1890 | ); | |
1891 | } | |
1892 | this.SelectionChangeHandler = selectionChangeHandler; | |
1893 | this._selectedStartValueHandler = selectedStartValueHandler; | |
1894 | let y = 0; | |
1895 | this._arrowLeft = new SpriteMod('commonmenu', 'arrowleft', new PointMod(110, 105 + y), new SizeMod(30, 30)); | |
1896 | this._arrowRight = new SpriteMod('commonmenu', 'arrowright', new PointMod(280, 105 + y), new SizeMod(30, 30)); | |
1897 | this._itemText = new ResTextMod('', new PointMod(290, y + 104), 0.35, ColorMod.White, Font$1.ChaletLondon, Alignment$1.Right); | |
1898 | } | |
1899 | SelectionChangeHandlerPromise(item, selectedValue, changeDirection) { | |
1900 | return new Promise((resolve, reject) => { | |
1901 | let newSelectedValue = this.SelectionChangeHandler(item, selectedValue, changeDirection); | |
1902 | resolve(newSelectedValue); | |
1903 | }); | |
1904 | } | |
1905 | get PreCaptionText() { | |
1906 | return this._precaptionText; | |
1907 | } | |
1908 | set PreCaptionText(text) { | |
1909 | if (!text) throw new Error("The pre caption text can't be null"); | |
1910 | if (typeof text !== 'string') throw new Error('The pre caption text must be a string'); | |
1911 | this._precaptionText = text; | |
1912 | this._currentOffset = ScreenMod.GetTextWidth( | |
1913 | this.PreCaptionText + this._selectedValue, | |
1914 | this._itemText && this._itemText.Font ? this._itemText.Font : 0, | |
1915 | 0.35 | |
1916 | ); | |
1917 | } | |
1918 | get SelectedValue() { | |
1919 | return this._selectedValue; | |
1920 | } | |
1921 | set SelectedValue(value) { | |
1922 | this._selectedValue = value; | |
1923 | if (value == undefined) return; | |
1924 | this._currentOffset = ScreenMod.GetTextWidth( | |
1925 | this.PreCaptionText + this._selectedValue, | |
1926 | this._itemText && this._itemText.Font ? this._itemText.Font : 0, | |
1927 | this._itemText && this._itemText.Scale ? this._itemText.Scale : 0.35 | |
1928 | ); | |
1929 | } | |
1930 | SetVerticalPosition(y) { | |
1931 | this._arrowLeft.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); | |
1932 | this._arrowRight.Pos = new PointMod(400 + this.Offset.X + this.Parent.WidthOffset, 147 + y + this.Offset.Y); | |
1933 | this._itemText.Pos = new PointMod(300 + this.Offset.X + this.Parent.WidthOffset, y + 147 + this.Offset.Y); | |
1934 | super.SetVerticalPosition(y); | |
1935 | } | |
1936 | SetRightLabel(text) { | |
1937 | return this; | |
1938 | } | |
1939 | SetRightBadge(badge) { | |
1940 | return this; | |
1941 | } | |
1942 | Draw() { | |
1943 | super.Draw(); | |
1944 | if (this._selectedValue == undefined) { | |
1945 | if (this._selectedStartValueHandler != null) { | |
1946 | this.SelectedValue = this._selectedStartValueHandler(); | |
1947 | } else { | |
1948 | this._selectedValue = ''; | |
1949 | } | |
1950 | } | |
1951 | const offset = this._currentOffset; | |
1952 | this._itemText.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1953 | this._itemText.Caption = this.PreCaptionText + this._selectedValue; | |
1954 | this._arrowLeft.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1955 | this._arrowRight.ColorMod = this.Enabled ? (this.Selected ? this.HighlightedForeColor : this.ForeColor) : new ColorMod(163, 159, 148); | |
1956 | this._arrowLeft.Pos = new PointMod(380 - offset + this.Offset.X + this.Parent.WidthOffset, this._arrowLeft.Pos.Y); | |
1957 | if (this.Selected) { | |
1958 | this._arrowLeft.Draw(); | |
1959 | this._arrowRight.Draw(); | |
1960 | this._itemText.Pos = new PointMod(405 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); | |
1961 | } else { | |
1962 | this._itemText.Pos = new PointMod(420 + this.Offset.X + this.Parent.WidthOffset, this._itemText.Pos.Y); | |
1963 | } | |
1964 | this._itemText.Draw(); | |
1965 | } | |
1966 | isVariableFunction(functionToCheck) { | |
1967 | return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]'; | |
1968 | } | |
1969 | } | |
1970 | ||
1971 | let menuPool = []; | |
1972 | class NativeUIMod { | |
1973 | constructor(title, subtitle, offset, spriteLibrary, spriteName) { | |
1974 | this._visible = true; | |
1975 | this._counterPretext = ''; | |
1976 | this._counterOverride = undefined; | |
1977 | this._lastUpDownNavigation = 0; | |
1978 | this._lastLeftRightNavigation = 0; | |
1979 | this._extraOffset = 0; | |
1980 | this._buttonsEnabled = true; | |
1981 | this._justOpened = true; | |
1982 | this._justOpenedFromPool = false; | |
1983 | this._justClosedFromPool = false; | |
1984 | this._poolOpening = null; | |
1985 | this._safezoneOffset = new PointMod(0, 0); | |
1986 | this._activeItem = 1000; | |
1987 | this._maxItemsOnScreen = 9; | |
1988 | this._maxItem = this._maxItemsOnScreen; | |
1989 | this._mouseEdgeEnabled = true; | |
1990 | this._bannerSprite = null; | |
1991 | this._bannerRectangle = null; | |
1992 | this._recalculateDescriptionNextFrame = 1; | |
1993 | this._instructionalButtons = []; | |
1994 | this._defaultTitleScale = 1.15; | |
1995 | this._maxMenuItems = 1000; | |
1996 | this.Id = UUIDV4(); | |
1997 | this.SelectTextLocalized = shitfuck.getGxtText('HUD_INPUT2'); | |
1998 | this.BackTextLocalized = shitfuck.getGxtText('HUD_INPUT3'); | |
1999 | this.WidthOffset = 0; | |
2000 | this.ParentMenu = null; | |
2001 | this.ParentItem = null; | |
2002 | this.MouseControlsEnabled = false; | |
2003 | this.CloseableByUser = true; | |
2004 | this.AUDIO_LIBRARY = 'HUD_FRONTEND_DEFAULT_SOUNDSET'; | |
2005 | this.AUDIO_UPDOWN = 'NAV_UP_DOWN'; | |
2006 | this.AUDIO_LEFTRIGHT = 'NAV_LEFT_RIGHT'; | |
2007 | this.AUDIO_SELECT = 'SELECT'; | |
2008 | this.AUDIO_BACK = 'BACK'; | |
2009 | this.AUDIO_ERROR = 'ERROR'; | |
2010 | this.MenuItems = []; | |
2011 | this.IndexChange = new LiteEventMod(); | |
2012 | this.ListChange = new LiteEventMod(); | |
2013 | this.AutoListChange = new LiteEventMod(); | |
2014 | this.DynamicListChange = new LiteEventMod(); | |
2015 | this.SliderChange = new LiteEventMod(); | |
2016 | this.CheckboxChange = new LiteEventMod(); | |
2017 | this.ItemSelect = new LiteEventMod(); | |
2018 | this.MenuOpen = new LiteEventMod(); | |
2019 | this.MenuClose = new LiteEventMod(); | |
2020 | this.MenuChange = new LiteEventMod(); | |
2021 | if (!(offset instanceof PointMod)) offset = PointMod.Parse(offset); | |
2022 | this._spriteLibrary = spriteLibrary || 'commonmenu'; | |
2023 | this._spriteName = spriteName || 'interaction_bgd'; | |
2024 | this._offset = new PointMod(offset.X, offset.Y); | |
2025 | this.Children = new Map(); | |
2026 | this._instructionalButtonsScaleform = new ScaleformMod('instructional_buttons'); | |
2027 | this.UpdateScaleform(); | |
2028 | this._mainMenu = new ContainerMod(new PointMod(0, 0), new SizeMod(700, 500), new ColorMod(0, 0, 0, 0)); | |
2029 | this._bannerSprite = new SpriteMod(this._spriteLibrary, this._spriteName, new PointMod(0 + this._offset.X, 0 + this._offset.Y), new SizeMod(431, 107)); | |
2030 | this._mainMenu.addItem( | |
2031 | (this._titleResText = new ResTextMod( | |
2032 | title, | |
2033 | new PointMod(215 + this._offset.X, 20 + this._offset.Y), | |
2034 | this._defaultTitleScale, | |
2035 | new ColorMod(255, 255, 255), | |
2036 | 1, | |
2037 | Alignment$1.Centered | |
2038 | )) | |
2039 | ); | |
2040 | if (subtitle !== '') { | |
2041 | 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))); | |
2042 | this._mainMenu.addItem( | |
2043 | (this._subtitleResText = new ResTextMod( | |
2044 | subtitle, | |
2045 | new PointMod(8 + this._offset.X, 110 + this._offset.Y), | |
2046 | 0.35, | |
2047 | new ColorMod(255, 255, 255), | |
2048 | 0, | |
2049 | Alignment$1.Left | |
2050 | )) | |
2051 | ); | |
2052 | if (subtitle.startsWith('~')) { | |
2053 | this._counterPretext = subtitle.substr(0, 3); | |
2054 | } | |
2055 | this._counterText = new ResTextMod( | |
2056 | '', | |
2057 | new PointMod(425 + this._offset.X, 110 + this._offset.Y), | |
2058 | 0.35, | |
2059 | new ColorMod(255, 255, 255), | |
2060 | 0, | |
2061 | Alignment$1.Right | |
2062 | ); | |
2063 | this._extraOffset += 37; | |
2064 | } | |
2065 | this._upAndDownSprite = new SpriteMod( | |
2066 | 'commonmenu', | |
2067 | 'shop_arrows_upanddown', | |
2068 | new PointMod(190 + this._offset.X, 147 + 37 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset), | |
2069 | new SizeMod(50, 50) | |
2070 | ); | |
2071 | this._extraRectangleUp = new ResRectangleMod( | |
2072 | new PointMod(0 + this._offset.X, 144 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset), | |
2073 | new SizeMod(431, 18), | |
2074 | new ColorMod(0, 0, 0, 200) | |
2075 | ); | |
2076 | this._extraRectangleDown = new ResRectangleMod( | |
2077 | new PointMod(0 + this._offset.X, 144 + 18 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset), | |
2078 | new SizeMod(431, 18), | |
2079 | new ColorMod(0, 0, 0, 200) | |
2080 | ); | |
2081 | this._descriptionBar = new ResRectangleMod(new PointMod(this._offset.X, 123), new SizeMod(431, 4), ColorMod.Black); | |
2082 | this._descriptionRectangle = new SpriteMod('commonmenu', 'gradient_bgd', new PointMod(this._offset.X, 127), new SizeMod(431, 30)); | |
2083 | this._descriptionText = new ResTextMod( | |
2084 | '', | |
2085 | new PointMod(this._offset.X + 5, 125), | |
2086 | 0.35, | |
2087 | new ColorMod(255, 255, 255, 255), | |
2088 | Font$1.ChaletLondon, | |
2089 | Alignment$1.Left | |
2090 | ); | |
2091 | this._descriptionText.Wrap = 400; | |
2092 | this._background = new SpriteMod( | |
2093 | 'commonmenu', | |
2094 | 'gradient_bgd', | |
2095 | new PointMod(this._offset.X, 144 + this._offset.Y - 37 + this._extraOffset), | |
2096 | new SizeMod(290, 25) | |
2097 | ); | |
2098 | this._visible = false; | |
2099 | shitfuck.everyTick(this.render.bind(this)); | |
2100 | } | |
2101 | GetSpriteBanner() { | |
2102 | return this._bannerSprite; | |
2103 | } | |
2104 | GetRectangleBanner() { | |
2105 | return this._bannerRectangle; | |
2106 | } | |
2107 | GetTitle() { | |
2108 | return this._titleResText; | |
2109 | } | |
2110 | get MaxItemsVisible() { | |
2111 | return this._maxItemsOnScreen; | |
2112 | } | |
2113 | set MaxItemsVisible(value) { | |
2114 | this._maxItemsOnScreen = value; | |
2115 | this._maxItem = value; | |
2116 | } | |
2117 | get Title() { | |
2118 | return this._titleResText.Caption; | |
2119 | } | |
2120 | set Title(text) { | |
2121 | this._titleResText.Caption = text; | |
2122 | } | |
2123 | get GetSubTitle() { | |
2124 | return this._titleResText; | |
2125 | } | |
2126 | get SubTitle() { | |
2127 | return this._titleResText.Caption; | |
2128 | } | |
2129 | set SubTitle(text) { | |
2130 | this._subtitleResText.Caption = text; | |
2131 | } | |
2132 | get Visible() { | |
2133 | return this._visible; | |
2134 | } | |
2135 | set Visible(toggle) { | |
2136 | this._visible = toggle; | |
2137 | CommonMod.PlaySound(this.AUDIO_BACK, this.AUDIO_LIBRARY); | |
2138 | this.UpdateScaleform(); | |
2139 | if (toggle) { | |
2140 | this.UpdateDescriptionCaption(); | |
2141 | } | |
2142 | if (this._justOpenedFromPool === true) { | |
2143 | this._justOpenedFromPool = false; | |
2144 | return; | |
2145 | } | |
2146 | if (toggle) { | |
2147 | this._justOpened = true; | |
2148 | this.MenuOpen.emit(); | |
2149 | if (this.ParentMenu === null) { | |
2150 | if (!menuPool.includes(this) && this !== this._poolOpening) { | |
2151 | const previousMenu = menuPool.length ? menuPool[menuPool.length - 1] : null; | |
2152 | menuPool.push(this); | |
2153 | if (previousMenu !== this._poolOpening && previousMenu !== null) { | |
2154 | previousMenu._justClosedFromPool = true; | |
2155 | previousMenu.Visible = false; | |
2156 | } | |
2157 | } | |
2158 | } | |
2159 | } else { | |
2160 | if (this._justClosedFromPool === true) { | |
2161 | this._justClosedFromPool = false; | |
2162 | return; | |
2163 | } | |
2164 | if (this.ParentMenu === null && menuPool.includes(this) && menuPool.length) { | |
2165 | if (menuPool[menuPool.length - 1] === this) { | |
2166 | menuPool.pop(); | |
2167 | this._justOpenedFromPool = true; | |
2168 | if (!menuPool.length) { | |
2169 | this._poolOpening = null; | |
2170 | } | |
2171 | } | |
2172 | if (menuPool.length) { | |
2173 | this._poolOpening = menuPool[menuPool.length - 1]; | |
2174 | menuPool[menuPool.length - 1].Visible = true; | |
2175 | } | |
2176 | } | |
2177 | if (menuPool.length === 0) { | |
2178 | gecilada.setMouseCursorSprite(1); | |
2179 | } | |
2180 | } | |
2181 | } | |
2182 | get CurrentSelection() { | |
2183 | return this._activeItem % this.MenuItems.length; | |
2184 | } | |
2185 | set CurrentSelection(v) { | |
2186 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2187 | this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length) + v; | |
2188 | if (this.CurrentSelection > this._maxItem) { | |
2189 | this._maxItem = this.CurrentSelection; | |
2190 | this._minItem = this.CurrentSelection - this._maxItemsOnScreen; | |
2191 | } else if (this.CurrentSelection < this._minItem) { | |
2192 | this._maxItem = this._maxItemsOnScreen + this.CurrentSelection; | |
2193 | this._minItem = this.CurrentSelection; | |
2194 | } | |
2195 | this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); | |
2196 | this.UpdateDescriptionCaption(); | |
2197 | } | |
2198 | DisableInstructionalButtons(disable) { | |
2199 | this._buttonsEnabled = !disable; | |
2200 | } | |
2201 | AddInstructionalButton(button) { | |
2202 | this._instructionalButtons.push(button); | |
2203 | } | |
2204 | SetSpriteBannerType(spriteBanner) { | |
2205 | this._bannerRectangle = null; | |
2206 | this.AddSpriteBannerType(spriteBanner); | |
2207 | } | |
2208 | SetRectangleBannerType(rectangle) { | |
2209 | this._bannerSprite = null; | |
2210 | this._bannerRectangle = rectangle; | |
2211 | this._bannerRectangle.Pos = new PointMod(this._offset.X, this._offset.Y); | |
2212 | this._bannerRectangle.SizeMod = new SizeMod(431 + this.WidthOffset, 107); | |
2213 | } | |
2214 | AddSpriteBannerType(spriteBanner) { | |
2215 | this._bannerSprite = spriteBanner; | |
2216 | this._bannerSprite.SizeMod = new SizeMod(431 + this.WidthOffset, 107); | |
2217 | this._bannerSprite.Pos = new PointMod(this._offset.X, this._offset.Y); | |
2218 | } | |
2219 | SetNoBannerType() { | |
2220 | this._bannerSprite = null; | |
2221 | this._bannerRectangle = new ResRectangleMod( | |
2222 | new PointMod(this._offset.X, this._offset.Y), | |
2223 | new SizeMod(431 + this.WidthOffset, 107), | |
2224 | new ColorMod(0, 0, 0, 0) | |
2225 | ); | |
2226 | } | |
2227 | RemoveInstructionalButton(button) { | |
2228 | for (let i = 0; i < this._instructionalButtons.length; i++) { | |
2229 | if (this._instructionalButtons[i] === button) { | |
2230 | this._instructionalButtons.splice(i, 1); | |
2231 | } | |
2232 | } | |
2233 | } | |
2234 | RecalculateDescriptionPosition() { | |
2235 | const count = this.MenuItems.length > this._maxItemsOnScreen + 1 ? this._maxItemsOnScreen + 2 : this.MenuItems.length; | |
2236 | this._descriptionBar.SizeMod = new SizeMod(431 + this.WidthOffset, 4); | |
2237 | this._descriptionRectangle.SizeMod = new SizeMod(431 + this.WidthOffset, 30); | |
2238 | this._descriptionBar.Pos = new PointMod(this._offset.X, 149 - 37 + this._extraOffset + this._offset.Y); | |
2239 | this._descriptionRectangle.Pos = new PointMod(this._offset.X, 149 - 37 + this._extraOffset + this._offset.Y); | |
2240 | this._descriptionText.Pos = new PointMod(this._offset.X + 8, 155 - 37 + this._extraOffset + this._offset.Y); | |
2241 | this._descriptionBar.Pos = new PointMod(this._offset.X, 38 * count + this._descriptionBar.Pos.Y); | |
2242 | this._descriptionRectangle.Pos = new PointMod(this._offset.X, 38 * count + this._descriptionRectangle.Pos.Y); | |
2243 | this._descriptionText.Pos = new PointMod(this._offset.X + 8, 38 * count + this._descriptionText.Pos.Y); | |
2244 | } | |
2245 | SetMenuWidthOffset(widthOffset) { | |
2246 | this.WidthOffset = widthOffset; | |
2247 | if (this._bannerSprite != null) { | |
2248 | this._bannerSprite.SizeMod = new SizeMod(431 + this.WidthOffset, 107); | |
2249 | } | |
2250 | this._mainMenu.Items[0].pos = new PointMod((this.WidthOffset + this._offset.X + 431) / 2, 20 + this._offset.Y); | |
2251 | if (this._counterText) { | |
2252 | this._counterText.Pos = new PointMod(425 + this._offset.X + widthOffset, 110 + this._offset.Y); | |
2253 | } | |
2254 | if (this._mainMenu.Items.length >= 2) { | |
2255 | const tmp = this._mainMenu.Items[1]; | |
2256 | tmp.size = new SizeMod(431 + this.WidthOffset, 37); | |
2257 | } | |
2258 | if (this._bannerRectangle != null) { | |
2259 | this._bannerRectangle.SizeMod = new SizeMod(431 + this.WidthOffset, 107); | |
2260 | } | |
2261 | } | |
2262 | AddItem(item) { | |
2263 | if (this._justOpened) this._justOpened = false; | |
2264 | item.Offset = this._offset; | |
2265 | item.Parent = this; | |
2266 | item.SetVerticalPosition(this.MenuItems.length * 25 - 37 + this._extraOffset); | |
2267 | this.MenuItems.push(item); | |
2268 | this.RefreshIndex(); | |
2269 | } | |
2270 | RemoveItem(item) { | |
2271 | for (let i = 0; i < this.MenuItems.length; i++) { | |
2272 | if (this.MenuItems[i] === item) { | |
2273 | this.MenuItems.splice(i, 1); | |
2274 | break; | |
2275 | } | |
2276 | } | |
2277 | this.RefreshIndex(); | |
2278 | } | |
2279 | RefreshIndex() { | |
2280 | if (this.MenuItems.length == 0) { | |
2281 | this._activeItem = this._maxMenuItems; | |
2282 | this._maxItem = this._maxItemsOnScreen; | |
2283 | this._minItem = 0; | |
2284 | return; | |
2285 | } | |
2286 | for (let i = 0; i < this.MenuItems.length; i++) this.MenuItems[i].Selected = false; | |
2287 | this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length); | |
2288 | this._maxItem = this._maxItemsOnScreen; | |
2289 | this._minItem = 0; | |
2290 | if (this._visible) { | |
2291 | this.UpdateDescriptionCaption(); | |
2292 | } | |
2293 | } | |
2294 | Clear() { | |
2295 | this.MenuItems = []; | |
2296 | this.RecalculateDescriptionPosition(); | |
2297 | } | |
2298 | Open() { | |
2299 | this.Visible = true; | |
2300 | } | |
2301 | CleanUp(closeChildren = false) { | |
2302 | if (closeChildren) { | |
2303 | this.Children.forEach((m) => { | |
2304 | m.Close(true); | |
2305 | }); | |
2306 | } | |
2307 | this.MenuItems.filter((menuItem) => menuItem instanceof UIMenuDynamicListItemMod).forEach((menuItem) => { | |
2308 | menuItem.SelectedValue = undefined; | |
2309 | }); | |
2310 | this.RefreshIndex(); | |
2311 | } | |
2312 | Close(closeChildren = false) { | |
2313 | this.Visible = false; | |
2314 | this.CleanUp(closeChildren); | |
2315 | this.MenuClose.emit(true); | |
2316 | } | |
2317 | GoLeft() { | |
2318 | if ( | |
2319 | (!(this.MenuItems[this.CurrentSelection] instanceof UIMenuListItemMod) && | |
2320 | !(this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) && | |
2321 | !(this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItemMod) && | |
2322 | !(this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod)) || | |
2323 | !this.MenuItems[this.CurrentSelection].Enabled | |
2324 | ) | |
2325 | return; | |
2326 | if (this.MenuItems[this.CurrentSelection] instanceof UIMenuListItemMod) { | |
2327 | const it = this.MenuItems[this.CurrentSelection]; | |
2328 | if (it.Collection.length == 0) return; | |
2329 | it.Index--; | |
2330 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2331 | this.ListChange.emit(it, it.Index); | |
2332 | this.UpdateDescriptionCaption(); | |
2333 | } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) { | |
2334 | const it = this.MenuItems[this.CurrentSelection]; | |
2335 | if (it.SelectedValue <= it.LowerThreshold) { | |
2336 | it.SelectedValue = it.UpperThreshold; | |
2337 | } else { | |
2338 | it.SelectedValue -= it.LeftMoveThreshold; | |
2339 | } | |
2340 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2341 | this.AutoListChange.emit(it, it.SelectedValue, ChangeDirection$1.Left); | |
2342 | this.UpdateDescriptionCaption(); | |
2343 | } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItemMod) { | |
2344 | const it = this.MenuItems[this.CurrentSelection]; | |
2345 | it.SelectionChangeHandlerPromise(it, it.SelectedValue, ChangeDirection$1.Left).then((newSelectedValue) => { | |
2346 | it.SelectedValue = newSelectedValue; | |
2347 | this.DynamicListChange.emit(it, it.SelectedValue, ChangeDirection$1.Left); | |
2348 | }); | |
2349 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2350 | this.UpdateDescriptionCaption(); | |
2351 | } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod) { | |
2352 | const it = this.MenuItems[this.CurrentSelection]; | |
2353 | it.Index = it.Index - 1; | |
2354 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2355 | this.SliderChange.emit(it, it.Index, it.IndexToItem(it.Index)); | |
2356 | this.UpdateDescriptionCaption(); | |
2357 | } | |
2358 | } | |
2359 | GoRight() { | |
2360 | if ( | |
2361 | (!(this.MenuItems[this.CurrentSelection] instanceof UIMenuListItemMod) && | |
2362 | !(this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) && | |
2363 | !(this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItemMod) && | |
2364 | !(this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod)) || | |
2365 | !this.MenuItems[this.CurrentSelection].Enabled | |
2366 | ) | |
2367 | return; | |
2368 | if (this.MenuItems[this.CurrentSelection] instanceof UIMenuListItemMod) { | |
2369 | const it = this.MenuItems[this.CurrentSelection]; | |
2370 | if (it.Collection.length == 0) return; | |
2371 | it.Index++; | |
2372 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2373 | this.ListChange.emit(it, it.Index); | |
2374 | this.UpdateDescriptionCaption(); | |
2375 | } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuAutoListItemMod) { | |
2376 | const it = this.MenuItems[this.CurrentSelection]; | |
2377 | if (it.SelectedValue >= it.UpperThreshold) { | |
2378 | it.SelectedValue = it.LowerThreshold; | |
2379 | } else { | |
2380 | it.SelectedValue += it.RightMoveThreshold; | |
2381 | } | |
2382 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2383 | this.AutoListChange.emit(it, it.SelectedValue, ChangeDirection$1.Right); | |
2384 | this.UpdateDescriptionCaption(); | |
2385 | } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuDynamicListItemMod) { | |
2386 | const it = this.MenuItems[this.CurrentSelection]; | |
2387 | it.SelectionChangeHandlerPromise(it, it.SelectedValue, ChangeDirection$1.Right).then((newSelectedValue) => { | |
2388 | it.SelectedValue = newSelectedValue; | |
2389 | this.DynamicListChange.emit(it, it.SelectedValue, ChangeDirection$1.Right); | |
2390 | }); | |
2391 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2392 | this.UpdateDescriptionCaption(); | |
2393 | } else if (this.MenuItems[this.CurrentSelection] instanceof UIMenuSliderItemMod) { | |
2394 | const it = this.MenuItems[this.CurrentSelection]; | |
2395 | it.Index++; | |
2396 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2397 | this.SliderChange.emit(it, it.Index, it.IndexToItem(it.Index)); | |
2398 | this.UpdateDescriptionCaption(); | |
2399 | } | |
2400 | } | |
2401 | SelectItem() { | |
2402 | if (!this.MenuItems[this.CurrentSelection].Enabled) { | |
2403 | CommonMod.PlaySound(this.AUDIO_ERROR, this.AUDIO_LIBRARY); | |
2404 | return; | |
2405 | } | |
2406 | const it = this.MenuItems[this.CurrentSelection]; | |
2407 | if (this.MenuItems[this.CurrentSelection] instanceof UIMenuCheckboxItemMod) { | |
2408 | it.Checked = !it.Checked; | |
2409 | CommonMod.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY); | |
2410 | this.CheckboxChange.emit(it, it.Checked); | |
2411 | } else { | |
2412 | CommonMod.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY); | |
2413 | this.ItemSelect.emit(it, this.CurrentSelection); | |
2414 | if (this.Children.has(it.Id)) { | |
2415 | const subMenu = this.Children.get(it.Id); | |
2416 | this.Visible = false; | |
2417 | subMenu.Visible = true; | |
2418 | this.MenuChange.emit(subMenu, true); | |
2419 | } | |
2420 | } | |
2421 | it.fireEvent(); | |
2422 | } | |
2423 | HasCurrentSelectionChildren() { | |
2424 | const it = this.MenuItems[this.CurrentSelection]; | |
2425 | if (this.MenuItems[this.CurrentSelection] instanceof UIMenuItemMod) { | |
2426 | if (this.Children.has(it.Id)) { | |
2427 | return true; | |
2428 | } | |
2429 | } | |
2430 | return false; | |
2431 | } | |
2432 | IsMouseInListItemArrows(item, topLeft, safezone) { | |
2433 | gecilada.beginTextCommandGetWidth('jamyfafi'); | |
2434 | gecilada.addTextComponentSubstringPlayerName(item.TextMod); | |
2435 | let res = ScreenMod.ResolutionMaintainRatio; | |
2436 | let screenw = res.Width; | |
2437 | let screenh = res.Height; | |
2438 | const height = 1080.0; | |
2439 | const ratio = screenw / screenh; | |
2440 | let width = height * ratio; | |
2441 | const labelSize = gecilada.endTextCommandGetWidth(false) * width * 0.35; | |
2442 | const labelSizeX = 5 + labelSize + 10; | |
2443 | const arrowSizeX = 431 - labelSizeX; | |
2444 | return ScreenMod.IsMouseInBounds(topLeft, new SizeMod(labelSizeX, 38)) | |
2445 | ? 1 | |
2446 | : ScreenMod.IsMouseInBounds(new PointMod(topLeft.X + labelSizeX, topLeft.Y), new SizeMod(arrowSizeX, 38)) | |
2447 | ? 2 | |
2448 | : 0; | |
2449 | } | |
2450 | ProcessMouse() { | |
2451 | if (!this.Visible || this._justOpened || this.MenuItems.length == 0 || !this.MouseControlsEnabled) { | |
2452 | this.MenuItems.filter((i) => i.Hovered).forEach((i) => (i.Hovered = false)); | |
2453 | return; | |
2454 | } | |
2455 | shitfuck.showCursor(true); | |
2456 | let limit = this.MenuItems.length - 1; | |
2457 | let counter = 0; | |
2458 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) limit = this._maxItem; | |
2459 | if (ScreenMod.IsMouseInBounds(new PointMod(0, 0), new SizeMod(30, 1080)) && this._mouseEdgeEnabled) { | |
2460 | gecilada.setGameplayCamRelativeHeading(gecilada.getGameplayCamRelativeHeading() + 5.0); | |
2461 | gecilada.setMouseCursorSprite(6); | |
2462 | } else if (ScreenMod.IsMouseInBounds(new PointMod(ScreenMod.ResolutionMaintainRatio.Width - 30.0, 0), new SizeMod(30, 1080)) && this._mouseEdgeEnabled) { | |
2463 | gecilada.setGameplayCamRelativeHeading(gecilada.getGameplayCamRelativeHeading() - 5.0); | |
2464 | gecilada.setMouseCursorSprite(7); | |
2465 | } else if (this._mouseEdgeEnabled) { | |
2466 | gecilada.setMouseCursorSprite(1); | |
2467 | } | |
2468 | for (let i = this._minItem; i <= limit; i++) { | |
2469 | let xpos = this._offset.X; | |
2470 | let ypos = this._offset.Y + 144 - 37 + this._extraOffset + counter * 38; | |
2471 | let xsize = 431 + this.WidthOffset; | |
2472 | const ysize = 38; | |
2473 | const uiMenuItem = this.MenuItems[i]; | |
2474 | if (ScreenMod.IsMouseInBounds(new PointMod(xpos, ypos), new SizeMod(xsize, ysize))) { | |
2475 | uiMenuItem.Hovered = true; | |
2476 | const res = this.IsMouseInListItemArrows(this.MenuItems[i], new PointMod(xpos, ypos), 0); | |
2477 | if ( | |
2478 | uiMenuItem.Hovered && | |
2479 | res == 1 && | |
2480 | (this.MenuItems[i] instanceof UIMenuListItemMod || | |
2481 | this.MenuItems[i] instanceof UIMenuAutoListItemMod || | |
2482 | this.MenuItems[i] instanceof UIMenuDynamicListItemMod) | |
2483 | ) { | |
2484 | gecilada.setMouseCursorSprite(5); | |
2485 | } | |
2486 | if (gecilada.isControlJustReleased(0, 24) || gecilada.isDisabledControlJustReleased(0, 24)) | |
2487 | if (uiMenuItem.Selected && uiMenuItem.Enabled) { | |
2488 | if ( | |
2489 | (this.MenuItems[i] instanceof UIMenuListItemMod || | |
2490 | this.MenuItems[i] instanceof UIMenuAutoListItemMod || | |
2491 | this.MenuItems[i] instanceof UIMenuDynamicListItemMod) && | |
2492 | this.IsMouseInListItemArrows(this.MenuItems[i], new PointMod(xpos, ypos), 0) > 0 | |
2493 | ) { | |
2494 | switch (res) { | |
2495 | case 1: | |
2496 | CommonMod.PlaySound(this.AUDIO_SELECT, this.AUDIO_LIBRARY); | |
2497 | this.MenuItems[i].fireEvent(); | |
2498 | this.ItemSelect.emit(this.MenuItems[i], i); | |
2499 | break; | |
2500 | case 2: | |
2501 | let it = this.MenuItems[i]; | |
2502 | if ((it.Collection == null ? it.Items.Count : it.Collection.Count) > 0) { | |
2503 | it.Index++; | |
2504 | CommonMod.PlaySound(this.AUDIO_LEFTRIGHT, this.AUDIO_LIBRARY); | |
2505 | this.ListChange.emit(it, it.Index); | |
2506 | } | |
2507 | break; | |
2508 | } | |
2509 | } else this.SelectItem(); | |
2510 | } else if (!uiMenuItem.Selected) { | |
2511 | this.CurrentSelection = i; | |
2512 | CommonMod.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); | |
2513 | this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); | |
2514 | this.SelectItem(); | |
2515 | this.UpdateDescriptionCaption(); | |
2516 | this.UpdateScaleform(); | |
2517 | } else if (!uiMenuItem.Enabled && uiMenuItem.Selected) { | |
2518 | CommonMod.PlaySound(this.AUDIO_ERROR, this.AUDIO_LIBRARY); | |
2519 | } | |
2520 | } else uiMenuItem.Hovered = false; | |
2521 | counter++; | |
2522 | } | |
2523 | const extraY = 144 + 38 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset + this._safezoneOffset.Y; | |
2524 | const extraX = this._safezoneOffset.X + this._offset.X; | |
2525 | if (this.MenuItems.length <= this._maxItemsOnScreen + 1) return; | |
2526 | if (ScreenMod.IsMouseInBounds(new PointMod(extraX, extraY), new SizeMod(431 + this.WidthOffset, 18))) { | |
2527 | this._extraRectangleUp.ColorMod = new ColorMod(30, 30, 30, 255); | |
2528 | if (gecilada.isControlJustPressed(0, 24) || gecilada.isDisabledControlJustPressed(0, 24)) { | |
2529 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) this.GoUpOverflow(); | |
2530 | else this.GoUp(); | |
2531 | } | |
2532 | } else this._extraRectangleUp.ColorMod = new ColorMod(0, 0, 0, 200); | |
2533 | if (ScreenMod.IsMouseInBounds(new PointMod(extraX, extraY + 18), new SizeMod(431 + this.WidthOffset, 18))) { | |
2534 | this._extraRectangleDown.ColorMod = new ColorMod(30, 30, 30, 255); | |
2535 | if (gecilada.isControlJustPressed(0, 24) || gecilada.isDisabledControlJustPressed(0, 24)) { | |
2536 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) this.GoDownOverflow(); | |
2537 | else this.GoDown(); | |
2538 | } | |
2539 | } else this._extraRectangleDown.ColorMod = new ColorMod(0, 0, 0, 200); | |
2540 | } | |
2541 | ProcessControl() { | |
2542 | if (!this.Visible) return; | |
2543 | if (this._justOpened) { | |
2544 | this._justOpened = false; | |
2545 | return; | |
2546 | } | |
2547 | if (gecilada.isControlJustReleased(0, 177)) { | |
2548 | this.GoBack(); | |
2549 | } | |
2550 | if (this.MenuItems.length == 0) return; | |
2551 | if (gecilada.isControlPressed(0, 172) && this._lastUpDownNavigation + 120 < Date.now()) { | |
2552 | this._lastUpDownNavigation = Date.now(); | |
2553 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) this.GoUpOverflow(); | |
2554 | else this.GoUp(); | |
2555 | this.UpdateScaleform(); | |
2556 | } else if (gecilada.isControlJustReleased(0, 172)) { | |
2557 | this._lastUpDownNavigation = 0; | |
2558 | } else if (gecilada.isControlPressed(0, 173) && this._lastUpDownNavigation + 120 < Date.now()) { | |
2559 | this._lastUpDownNavigation = Date.now(); | |
2560 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) this.GoDownOverflow(); | |
2561 | else this.GoDown(); | |
2562 | this.UpdateScaleform(); | |
2563 | } else if (gecilada.isControlJustReleased(0, 173)) { | |
2564 | this._lastUpDownNavigation = 0; | |
2565 | } else if (gecilada.isControlPressed(0, 174) && this._lastLeftRightNavigation + 100 < Date.now()) { | |
2566 | this._lastLeftRightNavigation = Date.now(); | |
2567 | this.GoLeft(); | |
2568 | } else if (gecilada.isControlJustReleased(0, 174)) { | |
2569 | this._lastLeftRightNavigation = 0; | |
2570 | } else if (gecilada.isControlPressed(0, 175) && this._lastLeftRightNavigation + 100 < Date.now()) { | |
2571 | this._lastLeftRightNavigation = Date.now(); | |
2572 | this.GoRight(); | |
2573 | } else if (gecilada.isControlJustReleased(0, 175)) { | |
2574 | this._lastLeftRightNavigation = 0; | |
2575 | } else if (gecilada.isControlJustReleased(0, 201)) { | |
2576 | this.SelectItem(); | |
2577 | } | |
2578 | } | |
2579 | GoUpOverflow() { | |
2580 | if (this.MenuItems.length <= this._maxItemsOnScreen + 1) return; | |
2581 | if (this._activeItem % this.MenuItems.length <= this._minItem) { | |
2582 | if (this._activeItem % this.MenuItems.length == 0) { | |
2583 | this._minItem = this.MenuItems.length - this._maxItemsOnScreen - 1; | |
2584 | this._maxItem = this.MenuItems.length - 1; | |
2585 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2586 | this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length); | |
2587 | this._activeItem += this.MenuItems.length - 1; | |
2588 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2589 | } else { | |
2590 | this._minItem--; | |
2591 | this._maxItem--; | |
2592 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2593 | this._activeItem--; | |
2594 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2595 | } | |
2596 | } else { | |
2597 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2598 | this._activeItem--; | |
2599 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2600 | } | |
2601 | CommonMod.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); | |
2602 | this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); | |
2603 | this.UpdateDescriptionCaption(); | |
2604 | } | |
2605 | GoUp() { | |
2606 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) return; | |
2607 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2608 | this._activeItem--; | |
2609 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2610 | CommonMod.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); | |
2611 | this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); | |
2612 | this.UpdateDescriptionCaption(); | |
2613 | } | |
2614 | GoDownOverflow() { | |
2615 | if (this.MenuItems.length <= this._maxItemsOnScreen + 1) return; | |
2616 | if (this._activeItem % this.MenuItems.length >= this._maxItem) { | |
2617 | if (this._activeItem % this.MenuItems.length == this.MenuItems.length - 1) { | |
2618 | this._minItem = 0; | |
2619 | this._maxItem = this._maxItemsOnScreen; | |
2620 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2621 | this._activeItem = this._maxMenuItems - (this._maxMenuItems % this.MenuItems.length); | |
2622 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2623 | } else { | |
2624 | this._minItem++; | |
2625 | this._maxItem++; | |
2626 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2627 | this._activeItem++; | |
2628 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2629 | } | |
2630 | } else { | |
2631 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2632 | this._activeItem++; | |
2633 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2634 | } | |
2635 | CommonMod.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); | |
2636 | this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); | |
2637 | this.UpdateDescriptionCaption(); | |
2638 | } | |
2639 | GoDown() { | |
2640 | if (this.MenuItems.length > this._maxItemsOnScreen + 1) return; | |
2641 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = false; | |
2642 | this._activeItem++; | |
2643 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2644 | CommonMod.PlaySound(this.AUDIO_UPDOWN, this.AUDIO_LIBRARY); | |
2645 | this.IndexChange.emit(this.CurrentSelection, this.MenuItems[this._activeItem % this.MenuItems.length]); | |
2646 | this.UpdateDescriptionCaption(); | |
2647 | } | |
2648 | GoBack() { | |
2649 | if (this.ParentMenu != null) { | |
2650 | this.Visible = false; | |
2651 | this.ParentMenu.Visible = true; | |
2652 | this.MenuChange.emit(this.ParentMenu, false); | |
2653 | this.MenuClose.emit(false); | |
2654 | } else if (this.CloseableByUser) { | |
2655 | this.Visible = false; | |
2656 | this.CleanUp(true); | |
2657 | this.MenuClose.emit(false); | |
2658 | } | |
2659 | } | |
2660 | BindMenuToItem(menuToBind, itemToBindTo) { | |
2661 | if (!this.MenuItems.includes(itemToBindTo)) { | |
2662 | this.AddItem(itemToBindTo); | |
2663 | } | |
2664 | menuToBind.ParentMenu = this; | |
2665 | menuToBind.ParentItem = itemToBindTo; | |
2666 | this.Children.set(itemToBindTo.Id, menuToBind); | |
2667 | } | |
2668 | AddSubMenu(subMenu, itemToBindTo) { | |
2669 | this.BindMenuToItem(subMenu, itemToBindTo); | |
2670 | } | |
2671 | ReleaseMenuFromItem(releaseFrom) { | |
2672 | if (!this.Children.has(releaseFrom.Id)) return false; | |
2673 | const menu = this.Children.get(releaseFrom.Id); | |
2674 | menu.ParentItem = null; | |
2675 | menu.ParentMenu = null; | |
2676 | this.Children.delete(releaseFrom.Id); | |
2677 | return true; | |
2678 | } | |
2679 | UpdateDescriptionCaption() { | |
2680 | if (this.MenuItems.length) { | |
2681 | this._descriptionText.Caption = this.MenuItems[this._activeItem % this.MenuItems.length].Description; | |
2682 | this._descriptionText.Wrap = 400; | |
2683 | this._recalculateDescriptionNextFrame++; | |
2684 | } | |
2685 | } | |
2686 | CalculateDescription() { | |
2687 | if (this.MenuItems.length <= 0) return; | |
2688 | if (this._recalculateDescriptionNextFrame > 0) { | |
2689 | this._recalculateDescriptionNextFrame--; | |
2690 | } | |
2691 | this.RecalculateDescriptionPosition(); | |
2692 | if ( | |
2693 | this.MenuItems.length > 0 && | |
2694 | this._descriptionText.Caption && | |
2695 | this.MenuItems[this._activeItem % this.MenuItems.length].Description.trim() !== '' | |
2696 | ) { | |
2697 | const numLines = ScreenMod.GetLineCount( | |
2698 | this._descriptionText.Caption, | |
2699 | this._descriptionText.Pos, | |
2700 | this._descriptionText.Font, | |
2701 | this._descriptionText.Scale, | |
2702 | this._descriptionText.Wrap | |
2703 | ); | |
2704 | this._descriptionRectangle.SizeMod = new SizeMod(431 + this.WidthOffset, numLines * 25 + 15); | |
2705 | if (numLines === 0) { | |
2706 | this._recalculateDescriptionNextFrame++; | |
2707 | } | |
2708 | } | |
2709 | } | |
2710 | UpdateScaleform() { | |
2711 | if (!this.Visible || !this._buttonsEnabled) return; | |
2712 | this._instructionalButtonsScaleform.callFunction('CLEAR_ALL'); | |
2713 | this._instructionalButtonsScaleform.callFunction('TOGGLE_MOUSE_BUTTONS', 0); | |
2714 | this._instructionalButtonsScaleform.callFunction('CREATE_CONTAINER'); | |
2715 | this._instructionalButtonsScaleform.callFunction( | |
2716 | 'SET_DATA_SLOT', | |
2717 | 0, | |
2718 | gecilada.getControlInstructionalButton(2, Control$1.PhoneSelect, false), | |
2719 | this.SelectTextLocalized | |
2720 | ); | |
2721 | this._instructionalButtonsScaleform.callFunction( | |
2722 | 'SET_DATA_SLOT', | |
2723 | 1, | |
2724 | gecilada.getControlInstructionalButton(2, Control$1.PhoneCancel, false), | |
2725 | this.BackTextLocalized | |
2726 | ); | |
2727 | let count = 2; | |
2728 | this._instructionalButtons | |
2729 | .filter((b) => b.ItemBind == null || this.MenuItems[this.CurrentSelection] == b.ItemBind) | |
2730 | .forEach((button) => { | |
2731 | this._instructionalButtonsScaleform.callFunction('SET_DATA_SLOT', count, button.GetButtonId(), button.TextMod); | |
2732 | count++; | |
2733 | }); | |
2734 | this._instructionalButtonsScaleform.callFunction('DRAW_INSTRUCTIONAL_BUTTONS', -1); | |
2735 | } | |
2736 | render() { | |
2737 | if (!this.Visible) return; | |
2738 | if (this._buttonsEnabled) { | |
2739 | gecilada.drawScaleformMovieFullscreen(this._instructionalButtonsScaleform.handle, 255, 255, 255, 255, 0); | |
2740 | gecilada.hideHudComponentThisFrame(6); | |
2741 | gecilada.hideHudComponentThisFrame(7); | |
2742 | gecilada.hideHudComponentThisFrame(9); | |
2743 | } | |
2744 | if (this._justOpened) { | |
2745 | if (this._bannerSprite != null && !this._bannerSprite.IsTextureDictionaryLoaded) this._bannerSprite.LoadTextureDictionary(); | |
2746 | if (!this._background.IsTextureDictionaryLoaded) this._background.LoadTextureDictionary(); | |
2747 | if (!this._descriptionRectangle.IsTextureDictionaryLoaded) this._descriptionRectangle.LoadTextureDictionary(); | |
2748 | if (!this._upAndDownSprite.IsTextureDictionaryLoaded) this._upAndDownSprite.LoadTextureDictionary(); | |
2749 | if (!this._recalculateDescriptionNextFrame) this._recalculateDescriptionNextFrame++; | |
2750 | } | |
2751 | this._mainMenu.Draw(); | |
2752 | this.ProcessMouse(); | |
2753 | this.ProcessControl(); | |
2754 | this._background.SizeMod = | |
2755 | this.MenuItems.length > this._maxItemsOnScreen + 1 | |
2756 | ? new SizeMod(431 + this.WidthOffset, 38 * (this._maxItemsOnScreen + 1)) | |
2757 | : new SizeMod(431 + this.WidthOffset, 38 * this.MenuItems.length); | |
2758 | this._background.Draw(); | |
2759 | if (this._recalculateDescriptionNextFrame) { | |
2760 | this.CalculateDescription(); | |
2761 | } | |
2762 | if (this.MenuItems.length > 0) { | |
2763 | this.MenuItems[this._activeItem % this.MenuItems.length].Selected = true; | |
2764 | if (this.MenuItems[this._activeItem % this.MenuItems.length].Description.trim() !== '') { | |
2765 | this._descriptionBar.Draw(); | |
2766 | this._descriptionRectangle.Draw(); | |
2767 | this._descriptionText.Draw(); | |
2768 | } | |
2769 | } | |
2770 | let count = 0; | |
2771 | if (this.MenuItems.length <= this._maxItemsOnScreen + 1) { | |
2772 | for (const item of this.MenuItems) { | |
2773 | item.SetVerticalPosition(count * 38 - 37 + this._extraOffset); | |
2774 | item.Draw(); | |
2775 | count++; | |
2776 | } | |
2777 | if (this._counterText && this._counterOverride) { | |
2778 | this._counterText.Caption = this._counterPretext + this._counterOverride; | |
2779 | this._counterText.Draw(); | |
2780 | } | |
2781 | } else { | |
2782 | for (let index = this._minItem; index <= this._maxItem; index++) { | |
2783 | let item = this.MenuItems[index]; | |
2784 | item.SetVerticalPosition(count * 38 - 37 + this._extraOffset); | |
2785 | item.Draw(); | |
2786 | count++; | |
2787 | } | |
2788 | this._extraRectangleUp.SizeMod = new SizeMod(431 + this.WidthOffset, 18); | |
2789 | this._extraRectangleDown.SizeMod = new SizeMod(431 + this.WidthOffset, 18); | |
2790 | this._upAndDownSprite.Pos = new PointMod( | |
2791 | 190 + this._offset.X + this.WidthOffset / 2, | |
2792 | 147 + 37 * (this._maxItemsOnScreen + 1) + this._offset.Y - 37 + this._extraOffset | |
2793 | ); | |
2794 | this._extraRectangleUp.Draw(); | |
2795 | this._extraRectangleDown.Draw(); | |
2796 | this._upAndDownSprite.Draw(); | |
2797 | if (this._counterText) { | |
2798 | if (!this._counterOverride) { | |
2799 | const cap = this.CurrentSelection + 1 + ' / ' + this.MenuItems.length; | |
2800 | this._counterText.Caption = this._counterPretext + cap; | |
2801 | } else { | |
2802 | this._counterText.Caption = this._counterPretext + this._counterOverride; | |
2803 | } | |
2804 | this._counterText.Draw(); | |
2805 | } | |
2806 | } | |
2807 | if (this._bannerRectangle != null) this._bannerRectangle.Draw(); | |
2808 | if (this._bannerSprite != null) this._bannerSprite.Draw(); | |
2809 | } | |
2810 | } | |
2811 | ||
2812 | String.prototype.replaceAll = function (searchStr, replaceStr) { | |
2813 | var str = this; | |
2814 | ||
2815 | if (str.indexOf(searchStr) === -1) { | |
2816 | return str; | |
2817 | } | |
2818 | ||
2819 | return str.replace(searchStr, replaceStr).replaceAll(searchStr, replaceStr); | |
2820 | }; | |
2821 | ||
2822 | //--------------------- NativeUIMod End ---------------------// | |
2823 | ||
2824 | var streamedPlayers = []; | |
2825 | var entity; | |
2826 | var height; | |
2827 | var zpos; | |
2828 | var noclip = false; | |
2829 | ||
2830 | shitfuck.on('gameEntityCreate', (entity) => { | |
2831 | if (entity instanceof shitfuck.Player) { | |
2832 | streamedPlayers[entity.id] = entity; | |
2833 | } | |
2834 | }); | |
2835 | ||
2836 | shitfuck.on('gameEntityDestroy', (entity) => { | |
2837 | if (entity instanceof shitfuck.Player) { | |
2838 | if (streamedPlayers[entity.id]) { | |
2839 | streamedPlayers[entity.id] = null; | |
2840 | delete streamedPlayers[entity.id]; | |
2841 | } | |
2842 | } | |
2843 | }); | |
2844 | ||
2845 | shitfuck.on('removeEntity', (entity) => { | |
2846 | if (entity instanceof shitfuck.Player) { | |
2847 | if (streamedPlayers[entity.id]) { | |
2848 | streamedPlayers[entity.id] = null; | |
2849 | delete streamedPlayers[entity.id]; | |
2850 | } | |
2851 | } | |
2852 | }); | |
2853 | ||
2854 | shitfuck.everyTick(() => { | |
2855 | if (noclip) { | |
2856 | if (lokalisJatekos.vehicle) { | |
2857 | entity = lokalisJatekos.vehicle; | |
2858 | gecilada.setEntityRotation(entity.scriptID, 0, 0, 0, 1, true); | |
2859 | } else { | |
2860 | entity = lokalisJatekos; | |
2861 | } | |
2862 | ||
2863 | let x = entity.pos.x; | |
2864 | let y = entity.pos.y; | |
2865 | let z = entity.pos.z; | |
2866 | let speed = 1.0; | |
2867 | ||
2868 | let heading = gecilada.getGameplayCamRelativeHeading() + gecilada.getEntityHeading(entity.scriptID); | |
2869 | let pitch = gecilada.getGameplayCamRelativePitch(); | |
2870 | ||
2871 | let dx = -Math.sin(heading * Math.PI / 180.0); | |
2872 | let dy = Math.cos(heading * Math.PI / 180.0); | |
2873 | let dz = Math.sin(pitch * Math.PI / 180.0); | |
2874 | ||
2875 | let len = Math.sqrt(dx * dx + dy * dy + dz * dz); | |
2876 | if (len != 0) { | |
2877 | dx = dx / len; | |
2878 | dy = dy / len; | |
2879 | dz = dz / len; | |
2880 | } | |
2881 | ||
2882 | if (gecilada.isControlPressed(0, 21)) { | |
2883 | speed = speed + 3; | |
2884 | } | |
2885 | ||
2886 | if (gecilada.isControlPressed(0, 19)) { | |
2887 | speed = speed - 0.5; | |
2888 | } | |
2889 | ||
2890 | if (gecilada.isControlPressed(0, 32)) { | |
2891 | x = x + speed * dx; | |
2892 | y = y + speed * dy; | |
2893 | z = z + speed * dz; | |
2894 | } | |
2895 | ||
2896 | if (gecilada.isControlPressed(0, 269)) { | |
2897 | x = x - speed * dx; | |
2898 | y = y - speed * dy; | |
2899 | z = z - speed * dz; | |
2900 | } | |
2901 | ||
2902 | gecilada.setEntityCoordsNoOffset(entity.scriptID, x, y, z, true, true, true); | |
2903 | } | |
2904 | }); | |
2905 | ||
2906 | function teleportToWaypoint() { | |
2907 | zpos = gecilada.getGroundZFor3dCoord(entity.pos.x, entity.pos.y, entity.pos.z, 0)[1]; | |
2908 | if (zpos == 0) { | |
2909 | height += 25; | |
2910 | gecilada.setEntityCoords(entity.scriptID, entity.pos.x, entity.pos.y, height); | |
2911 | shitfuck.setTimeout(teleportToWaypoint, 20); | |
2912 | } else { | |
2913 | gecilada.setEntityCoords(entity.scriptID, entity.pos.x, entity.pos.y, zpos); | |
2914 | } | |
2915 | } | |
2916 | ||
2917 | const mainMenu = new NativeUIMod('alt:V Menu', '', new PointMod(ScreenMod.Width * 0.6, ScreenMod.Height * 0.025)); | |
2918 | mainMenu.GetTitle().Scale = 1.5; | |
2919 | mainMenu.GetTitle().DropShadow = true; | |
2920 | ||
2921 | mainMenu.AddItem(new UIMenuCheckboxItemMod('Godmode')); | |
2922 | mainMenu.AddItem(new UIMenuCheckboxItemMod('Invisibility')); | |
2923 | mainMenu.AddItem(new UIMenuCheckboxItemMod('Noclip')); | |
2924 | mainMenu.AddItem(new UIMenuItemMod('Fix Vehicle')); | |
2925 | mainMenu.AddItem(new UIMenuItemMod('Teleport to waypoint')); | |
2926 | mainMenu.AddItem(new UIMenuItemMod('Explode all player')); | |
2927 | ||
2928 | const nearbyMenuItem = new UIMenuItemMod('Nearby Players'); | |
2929 | mainMenu.AddItem(nearbyMenuItem); | |
2930 | ||
2931 | const weaponMenuItem = new UIMenuItemMod('Weapon List'); | |
2932 | mainMenu.AddItem(weaponMenuItem); | |
2933 | ||
2934 | const nearbyMenu = new NativeUIMod('Nearby Players', '', new PointMod(ScreenMod.Width * 0.6, ScreenMod.Height * 0.025)); | |
2935 | nearbyMenu.Visible = false; | |
2936 | nearbyMenu.GetTitle().Scale = 1.2; | |
2937 | mainMenu.AddSubMenu(nearbyMenu, nearbyMenuItem); | |
2938 | ||
2939 | const weaponMenu = new NativeUIMod('Weapon List', '', new PointMod(ScreenMod.Width * 0.6, ScreenMod.Height * 0.025)); | |
2940 | weaponMenu.Visible = false; | |
2941 | weaponMenu.GetTitle().Scale = 1.2; | |
2942 | mainMenu.AddSubMenu(weaponMenu, weaponMenuItem); | |
2943 | ||
2944 | weaponMenu.AddItem(new UIMenuItemMod('Weapon List:')); | |
2945 | for (let k in WeaponModelMod) { | |
2946 | weaponMenu.AddItem(new UIMenuItemMod(k, '', WeaponModelMod[k])); | |
2947 | } | |
2948 | ||
2949 | mainMenu.MenuChange.on(() => { | |
2950 | nearbyMenu.Clear(); | |
2951 | nearbyMenu.AddItem(new UIMenuItemMod('Nearby Players:')); | |
2952 | ||
2953 | for (let k in streamedPlayers) { | |
2954 | if (streamedPlayers[k]) { | |
2955 | nearbyMenu.AddItem(new UIMenuItemMod(streamedPlayers[k].name, '', streamedPlayers[k])); | |
2956 | } | |
2957 | } | |
2958 | }); | |
2959 | ||
2960 | mainMenu.CheckboxChange.on((item, checkedState) => { | |
2961 | switch (item.TextMod) { | |
2962 | case 'Godmode': | |
2963 | gecilada.setPlayerInvincible(lokalisJatekos.scriptID, checkedState); | |
2964 | break; | |
2965 | case 'Invisibility': | |
2966 | gecilada.setEntityVisible(lokalisJatekos.scriptID, !checkedState, !checkedState); | |
2967 | break; | |
2968 | case 'Noclip': | |
2969 | noclip = checkedState; | |
2970 | } | |
2971 | }); | |
2972 | ||
2973 | mainMenu.ItemSelect.on((selectedItem, selectedItemIndex) => { | |
2974 | switch (selectedItemIndex) { | |
2975 | case 3: | |
2976 | if (lokalisJatekos.vehicle) gecilada.setVehicleFixed(lokalisJatekos.vehicle.scriptID); | |
2977 | break; | |
2978 | case 4: | |
2979 | let blip = gecilada.getFirstBlipInfoId(8); | |
2980 | if (blip == 0) break; | |
2981 | ||
2982 | let getBlipCoords = gecilada.getBlipInfoIdCoord(blip); | |
2983 | height = 0; | |
2984 | ||
2985 | if (lokalisJatekos.vehicle) { | |
2986 | entity = lokalisJatekos.vehicle; | |
2987 | } else { | |
2988 | entity = lokalisJatekos; | |
2989 | } | |
2990 | ||
2991 | gecilada.setEntityCoords(entity.scriptID, getBlipCoords.x, getBlipCoords.y, 0); | |
2992 | shitfuck.setTimeout(teleportToWaypoint, 20); | |
2993 | case 5: | |
2994 | for (let k in streamedPlayers) { | |
2995 | if (streamedPlayers[k]) { | |
2996 | let x = streamedPlayers[k].pos.x; | |
2997 | let y = streamedPlayers[k].pos.x; | |
2998 | let z = streamedPlayers[k].pos.x; | |
2999 | ||
3000 | gecilada.shootSingleBulletBetweenCoords(x, y, z + 1, x, y, z, 5000, false, 0xB1CA77B1, streamedPlayers[k].scriptID, true, false, 9999999); | |
3001 | } | |
3002 | } | |
3003 | } | |
3004 | }); | |
3005 | ||
3006 | nearbyMenu.ItemSelect.on((selectedItem) => { | |
3007 | let plr = selectedItem.Data; | |
3008 | if (plr instanceof shitfuck.Player) gecilada.setEntityCoords(lokalisJatekos.scriptID, plr.pos.x, plr.pos.y, plr.pos.z); | |
3009 | }); | |
3010 | ||
3011 | weaponMenu.ItemSelect.on((selectedItem) => { | |
3012 | let wep = selectedItem.Data; | |
3013 | if (wep) gecilada.giveWeaponToPed(lokalisJatekos.scriptID, wep, 250, false, true); | |
3014 | }); | |
3015 | ||
3016 | shitfuck.on('keyup', (key) => { | |
3017 | if (key === 56) { | |
3018 | if (mainMenu.Visible) mainMenu.Close(); | |
3019 | else { | |
3020 | if (!nearbyMenu.Visible) mainMenu.Open(); | |
3021 | } | |
3022 | } | |
3023 | }); | |
3024 |