├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── ScriptHookV ├── inc │ ├── enums.h │ ├── main.h │ ├── nativeCaller.h │ ├── natives.h │ └── types.h └── lib │ └── ScriptHookV.lib └── src ├── blankOption.hpp ├── constVariables.hpp ├── dllmain.cpp ├── keyboard.cpp ├── keyboard.hpp ├── menu.cpp ├── menu.hpp ├── option.cpp ├── option.hpp ├── script.cpp ├── script.hpp ├── sliderOption.hpp ├── structs.hpp ├── submenuOption.hpp ├── timer.hpp ├── toggleOption.hpp ├── utils.hpp └── vectorOption.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | /CMakeFiles 2 | /Debug 3 | /Release 4 | /SourceBase.dir 5 | /.vs 6 | 7 | CMakeCache.txt 8 | 9 | *.vcxproj 10 | *.filters 11 | *.user 12 | *.cmake 13 | *.sln -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | project(SourceBase) 4 | set(CMAKE_CXX_STANDARD 20) 5 | include_directories(ScriptHookV/inc) 6 | link_directories(ScriptHookV/lib) 7 | set(CMAKE_SUPPRESS_REGENERATION true) 8 | set(DBUILD_SHARED_LIBS ON) 9 | 10 | file(GLOB SOURCE_HPP "src/*.hpp") 11 | file(GLOB SOURCE_CPP "src/*.cpp") 12 | 13 | set(SRC 14 | ${SOURCE_HPP} 15 | ${SOURCE_CPP} 16 | ) 17 | 18 | list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS asi) 19 | add_library(${PROJECT_NAME} SHARED ${SRC}) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About 2 | Easy to use and efficient trainer menu base for Grand Theft Auto V. 3 | ![image](https://user-images.githubusercontent.com/36642285/103153771-316e2a00-4793-11eb-8450-5c98af361ad6.png) 4 | 5 | # Building a Project 6 | For build project You have to install [CMake Binaries](https://cmake.org/download/) to Your system. 7 | Create a Folder and Open terminal in that, then use this commands: 8 | ``` 9 | git clone https://github.com/Xxsource98/SourceBase.git 10 | cd SourceBase 11 | mkdir build 12 | cd build 13 | cmake .. 14 | ``` 15 | Or You can even use CMake GUI version for easier create project. 16 | 17 | After above steps, you are able to open project with a base. You can build an asi file via cmake by commands: 18 | ``` 19 | cd build 20 | cmake -DCMAKE_BUILD_TYPE=Release . (You can change Release to a Debug) 21 | ``` 22 | 23 | # How to Use 24 | The "main" file is `script.cpp` where you are calling all drawing functions. There are few possible to draw options: 25 | ``` 26 | BlankOption - Empty Option 27 | ToggleOption - Toggling Boolean Variable Option 28 | SliderOption - Slider Option, supporting: float, int 29 | VectorOption - Vector Option for drawing multiple strings on slide, supporting: std::vector 30 | SubmenuOption - Option for change current Submenu 31 | ``` 32 | You have to call `registerSubmenu` function from `Menu` class. It is registering your submenu and you can put all options there for registered submenu. 33 | But that's not all, You have to first make a pointer and draw loop for a base class. The arguments of constructor are: `std::string menuName, MENU_STRUCT menuStruct`, where `menuName` is a displaying menu name and `menuStruct` is a struct, which has menu binds and menu colors.
34 | In the `MainLoop` void function, you have to create a pointer (I recommend to use a smart pointer, I used shared_ptr, because You can create multiple menus in one project). You have to make here a `while` loop and call a `draw` function from the `Menu` class. Don't forget to add a `WAIT(0)` after every while in a project, it's important for a ScriptHookV.

35 | All examples are in `script.cpp` file.
36 | For load .asi mods you have to download a [ScriptHookV](http://www.dev-c.com/gtav/scripthookv/) 37 | 38 | 39 | 40 | # Features 41 | ``` 42 | - Responsive and Modern UI 43 | - Easy to Use 44 | - Smooth Scroller 45 | - Fade in/out Animation 46 | - Efficient code 47 | - Support for Controller 48 | - Support for Create a couple Menus in One Project 49 | ``` 50 | 51 | # License 52 | Project is under GNU General Public License v3.0. You can read more there: [www.gnu.org](https://www.gnu.org/licenses/gpl-3.0.html) 53 | -------------------------------------------------------------------------------- /ScriptHookV/inc/enums.h: -------------------------------------------------------------------------------- 1 | /* 2 | THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK 3 | http://dev-c.com 4 | (C) Alexander Blade 2015-2016 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | enum eAudioFlag 12 | { 13 | AudioFlagActivateSwitchWheelAudio, 14 | AudioFlagAllowCutsceneOverScreenFade, 15 | AudioFlagAllowForceRadioAfterRetune, 16 | AudioFlagAllowPainAndAmbientSpeechToPlayDuringCutscene, 17 | AudioFlagAllowPlayerAIOnMission, 18 | AudioFlagAllowPoliceScannerWhenPlayerHasNoControl, 19 | AudioFlagAllowRadioDuringSwitch, 20 | AudioFlagAllowRadioOverScreenFade, 21 | AudioFlagAllowScoreAndRadio, 22 | AudioFlagAllowScriptedSpeechInSlowMo, 23 | AudioFlagAvoidMissionCompleteDelay, 24 | AudioFlagDisableAbortConversationForDeathAndInjury, 25 | AudioFlagDisableAbortConversationForRagdoll, 26 | AudioFlagDisableBarks, 27 | AudioFlagDisableFlightMusic, 28 | AudioFlagDisableReplayScriptStreamRecording, 29 | AudioFlagEnableHeadsetBeep, 30 | AudioFlagForceConversationInterrupt, 31 | AudioFlagForceSeamlessRadioSwitch, 32 | AudioFlagForceSniperAudio, 33 | AudioFlagFrontendRadioDisabled, 34 | AudioFlagHoldMissionCompleteWhenPrepared, 35 | AudioFlagIsDirectorModeActive, 36 | AudioFlagIsPlayerOnMissionForSpeech, 37 | AudioFlagListenerReverbDisabled, 38 | AudioFlagLoadMPData, 39 | AudioFlagMobileRadioInGame, 40 | AudioFlagOnlyAllowScriptTriggerPoliceScanner, 41 | AudioFlagPlayMenuMusic, 42 | AudioFlagPoliceScannerDisabled, 43 | AudioFlagScriptedConvListenerMaySpeak, 44 | AudioFlagSpeechDucksScore, 45 | AudioFlagSuppressPlayerScubaBreathing, 46 | AudioFlagWantedMusicDisabled, 47 | AudioFlagWantedMusicOnMission 48 | }; 49 | 50 | enum eBlipColor 51 | { 52 | BlipColorWhite = 0, 53 | BlipColorRed = 1, 54 | BlipColorGreen = 2, 55 | BlipColorBlue = 3, 56 | BlipColorYellow = 66, 57 | }; 58 | 59 | enum eBlipSprite 60 | { 61 | BlipSpriteStandard = 1, 62 | BlipSpriteBigBlip = 2, 63 | BlipSpritePoliceOfficer = 3, 64 | BlipSpritePoliceArea = 4, 65 | BlipSpriteSquare = 5, 66 | BlipSpritePlayer = 6, 67 | BlipSpriteNorth = 7, 68 | BlipSpriteWaypoint = 8, 69 | BlipSpriteBigCircle = 9, 70 | BlipSpriteBigCircleOutline = 10, 71 | BlipSpriteArrowUpOutlined = 11, 72 | BlipSpriteArrowDownOutlined = 12, 73 | BlipSpriteArrowUp = 13, 74 | BlipSpriteArrowDown = 14, 75 | BlipSpritePoliceHelicopterAnimated = 15, 76 | BlipSpriteJet = 16, 77 | BlipSpriteNumber1 = 17, 78 | BlipSpriteNumber2 = 18, 79 | BlipSpriteNumber3 = 19, 80 | BlipSpriteNumber4 = 20, 81 | BlipSpriteNumber5 = 21, 82 | BlipSpriteNumber6 = 22, 83 | BlipSpriteNumber7 = 23, 84 | BlipSpriteNumber8 = 24, 85 | BlipSpriteNumber9 = 25, 86 | BlipSpriteNumber10 = 26, 87 | BlipSpriteGTAOCrew = 27, 88 | BlipSpriteGTAOFriendly = 28, 89 | BlipSpriteLift = 36, 90 | BlipSpriteRaceFinish = 38, 91 | BlipSpriteSafehouse = 40, 92 | BlipSpritePoliceOfficer2 = 41, 93 | BlipSpritePoliceCarDot = 42, 94 | BlipSpritePoliceHelicopter = 43, 95 | BlipSpriteChatBubble = 47, 96 | BlipSpriteGarage2 = 50, 97 | BlipSpriteDrugs = 51, 98 | BlipSpriteStore = 52, 99 | BlipSpritePoliceCar = 56, 100 | BlipSpritePolicePlayer = 58, 101 | BlipSpritePoliceStation = 60, 102 | BlipSpriteHospital = 61, 103 | BlipSpriteHelicopter = 64, 104 | BlipSpriteStrangersAndFreaks = 65, 105 | BlipSpriteArmoredTruck = 66, 106 | BlipSpriteTowTruck = 68, 107 | BlipSpriteBarber = 71, 108 | BlipSpriteLosSantosCustoms = 72, 109 | BlipSpriteClothes = 73, 110 | BlipSpriteTattooParlor = 75, 111 | BlipSpriteSimeon = 76, 112 | BlipSpriteLester = 77, 113 | BlipSpriteMichael = 78, 114 | BlipSpriteTrevor = 79, 115 | BlipSpriteRampage = 84, 116 | BlipSpriteVinewoodTours = 85, 117 | BlipSpriteLamar = 86, 118 | BlipSpriteFranklin = 88, 119 | BlipSpriteChinese = 89, 120 | BlipSpriteAirport = 90, 121 | BlipSpriteBar = 93, 122 | BlipSpriteBaseJump = 94, 123 | BlipSpriteCarWash = 100, 124 | BlipSpriteComedyClub = 102, 125 | BlipSpriteDart = 103, 126 | BlipSpriteFIB = 106, 127 | BlipSpriteDollarSign = 108, 128 | BlipSpriteGolf = 109, 129 | BlipSpriteAmmuNation = 110, 130 | BlipSpriteExile = 112, 131 | BlipSpriteShootingRange = 119, 132 | BlipSpriteSolomon = 120, 133 | BlipSpriteStripClub = 121, 134 | BlipSpriteTennis = 122, 135 | BlipSpriteTriathlon = 126, 136 | BlipSpriteOffRoadRaceFinish = 127, 137 | BlipSpriteKey = 134, 138 | BlipSpriteMovieTheater = 135, 139 | BlipSpriteMusic = 136, 140 | BlipSpriteMarijuana = 140, 141 | BlipSpriteHunting = 141, 142 | BlipSpriteArmsTraffickingGround = 147, 143 | BlipSpriteNigel = 149, 144 | BlipSpriteAssaultRifle = 150, 145 | BlipSpriteBat = 151, 146 | BlipSpriteGrenade = 152, 147 | BlipSpriteHealth = 153, 148 | BlipSpriteKnife = 154, 149 | BlipSpriteMolotov = 155, 150 | BlipSpritePistol = 156, 151 | BlipSpriteRPG = 157, 152 | BlipSpriteShotgun = 158, 153 | BlipSpriteSMG = 159, 154 | BlipSpriteSniper = 160, 155 | BlipSpriteSonicWave = 161, 156 | BlipSpritePointOfInterest = 162, 157 | BlipSpriteGTAOPassive = 163, 158 | BlipSpriteGTAOUsingMenu = 164, 159 | BlipSpriteLink = 171, 160 | BlipSpriteMinigun = 173, 161 | BlipSpriteGrenadeLauncher = 174, 162 | BlipSpriteArmor = 175, 163 | BlipSpriteCastle = 176, 164 | BlipSpriteCamera = 184, 165 | BlipSpriteHandcuffs = 188, 166 | BlipSpriteYoga = 197, 167 | BlipSpriteCab = 198, 168 | BlipSpriteNumber11 = 199, 169 | BlipSpriteNumber12 = 200, 170 | BlipSpriteNumber13 = 201, 171 | BlipSpriteNumber14 = 202, 172 | BlipSpriteNumber15 = 203, 173 | BlipSpriteNumber16 = 204, 174 | BlipSpriteShrink = 205, 175 | BlipSpriteEpsilon = 206, 176 | BlipSpritePersonalVehicleCar = 225, 177 | BlipSpritePersonalVehicleBike = 226, 178 | BlipSpriteCustody = 237, 179 | BlipSpriteArmsTraffickingAir = 251, 180 | BlipSpriteFairground = 266, 181 | BlipSpritePropertyManagement = 267, 182 | BlipSpriteAltruist = 269, 183 | BlipSpriteEnemy = 270, 184 | BlipSpriteChop = 273, 185 | BlipSpriteDead = 274, 186 | BlipSpriteHooker = 279, 187 | BlipSpriteFriend = 280, 188 | BlipSpriteBountyHit = 303, 189 | BlipSpriteGTAOMission = 304, 190 | BlipSpriteGTAOSurvival = 305, 191 | BlipSpriteCrateDrop = 306, 192 | BlipSpritePlaneDrop = 307, 193 | BlipSpriteSub = 308, 194 | BlipSpriteRace = 309, 195 | BlipSpriteDeathmatch = 310, 196 | BlipSpriteArmWrestling = 311, 197 | BlipSpriteAmmuNationShootingRange = 313, 198 | BlipSpriteRaceAir = 314, 199 | BlipSpriteRaceCar = 315, 200 | BlipSpriteRaceSea = 316, 201 | BlipSpriteGarbageTruck = 318, 202 | BlipSpriteSafehouseForSale = 350, 203 | BlipSpritePackage = 351, 204 | BlipSpriteMartinMadrazo = 352, 205 | BlipSpriteEnemyHelicopter = 353, 206 | BlipSpriteBoost = 354, 207 | BlipSpriteDevin = 355, 208 | BlipSpriteMarina = 356, 209 | BlipSpriteGarage = 357, 210 | BlipSpriteGolfFlag = 358, 211 | BlipSpriteHangar = 359, 212 | BlipSpriteHelipad = 360, 213 | BlipSpriteJerryCan = 361, 214 | BlipSpriteMasks = 362, 215 | BlipSpriteHeistSetup = 363, 216 | BlipSpriteIncapacitated = 364, 217 | BlipSpritePickupSpawn = 365, 218 | BlipSpriteBoilerSuit = 366, 219 | BlipSpriteCompleted = 367, 220 | BlipSpriteRockets = 368, 221 | BlipSpriteGarageForSale = 369, 222 | BlipSpriteHelipadForSale = 370, 223 | BlipSpriteMarinaForSale = 371, 224 | BlipSpriteHangarForSale = 372, 225 | BlipSpriteBusiness = 374, 226 | BlipSpriteBusinessForSale = 375, 227 | BlipSpriteRaceBike = 376, 228 | BlipSpriteParachute = 377, 229 | BlipSpriteTeamDeathmatch = 378, 230 | BlipSpriteRaceFoot = 379, 231 | BlipSpriteVehicleDeathmatch = 380, 232 | BlipSpriteBarry = 381, 233 | BlipSpriteDom = 382, 234 | BlipSpriteMaryAnn = 383, 235 | BlipSpriteCletus = 384, 236 | BlipSpriteJosh = 385, 237 | BlipSpriteMinute = 386, 238 | BlipSpriteOmega = 387, 239 | BlipSpriteTonya = 388, 240 | BlipSpritePaparazzo = 389, 241 | BlipSpriteCrosshair = 390, 242 | BlipSpriteCreator = 398, 243 | BlipSpriteCreatorDirection = 399, 244 | BlipSpriteAbigail = 400, 245 | BlipSpriteBlimp = 401, 246 | BlipSpriteRepair = 402, 247 | BlipSpriteTestosterone = 403, 248 | BlipSpriteDinghy = 404, 249 | BlipSpriteFanatic = 405, 250 | BlipSpriteInformation = 407, 251 | BlipSpriteCaptureBriefcase = 408, 252 | BlipSpriteLastTeamStanding = 409, 253 | BlipSpriteBoat = 410, 254 | BlipSpriteCaptureHouse = 411, 255 | BlipSpriteJerryCan2 = 415, 256 | BlipSpriteRP = 416, 257 | BlipSpriteGTAOPlayerSafehouse = 417, 258 | BlipSpriteGTAOPlayerSafehouseDead = 418, 259 | BlipSpriteCaptureAmericanFlag = 419, 260 | BlipSpriteCaptureFlag = 420, 261 | BlipSpriteTank = 421, 262 | BlipSpriteHelicopterAnimated = 422, 263 | BlipSpritePlane = 423, 264 | BlipSpritePlayerNoColor = 425, 265 | BlipSpriteGunCar = 426, 266 | BlipSpriteSpeedboat = 427, 267 | BlipSpriteHeist = 428, 268 | BlipSpriteStopwatch = 430, 269 | BlipSpriteDollarSignCircled = 431, 270 | BlipSpriteCrosshair2 = 432, 271 | BlipSpriteDollarSignSquared = 434, 272 | }; 273 | 274 | enum eCameraShake 275 | { 276 | CameraShakeHand = 0, 277 | CameraShakeSmallExplosion, 278 | CameraShakeMediumExplosion, 279 | CameraShakeLargeExplosion, 280 | CameraShakeJolt, 281 | CameraShakeVibrate, 282 | CameraShakeRoadVibration, 283 | CameraShakeDrunk, 284 | CameraShakeSkyDiving, 285 | CameraShakeFamilyDrugTrip, 286 | CameraShakeDeathFail 287 | }; 288 | 289 | enum eControl 290 | { 291 | ControlNextCamera = 0, 292 | ControlLookLeftRight = 1, 293 | ControlLookUpDown = 2, 294 | ControlLookUpOnly = 3, 295 | ControlLookDownOnly = 4, 296 | ControlLookLeftOnly = 5, 297 | ControlLookRightOnly = 6, 298 | ControlCinematicSlowMo = 7, 299 | ControlFlyUpDown = 8, 300 | ControlFlyLeftRight = 9, 301 | ControlScriptedFlyZUp = 10, 302 | ControlScriptedFlyZDown = 11, 303 | ControlWeaponWheelUpDown = 12, 304 | ControlWeaponWheelLeftRight = 13, 305 | ControlWeaponWheelNext = 14, 306 | ControlWeaponWheelPrev = 15, 307 | ControlSelectNextWeapon = 16, 308 | ControlSelectPrevWeapon = 17, 309 | ControlSkipCutscene = 18, 310 | ControlCharacterWheel = 19, 311 | ControlMultiplayerInfo = 20, 312 | ControlSprint = 21, 313 | ControlJump = 22, 314 | ControlEnter = 23, 315 | ControlAttack = 24, 316 | ControlAim = 25, 317 | ControlLookBehind = 26, 318 | ControlPhone = 27, 319 | ControlSpecialAbility = 28, 320 | ControlSpecialAbilitySecondary = 29, 321 | ControlMoveLeftRight = 30, 322 | ControlMoveUpDown = 31, 323 | ControlMoveUpOnly = 32, 324 | ControlMoveDownOnly = 33, 325 | ControlMoveLeftOnly = 34, 326 | ControlMoveRightOnly = 35, 327 | ControlDuck = 36, 328 | ControlSelectWeapon = 37, 329 | ControlPickup = 38, 330 | ControlSniperZoom = 39, 331 | ControlSniperZoomInOnly = 40, 332 | ControlSniperZoomOutOnly = 41, 333 | ControlSniperZoomInSecondary = 42, 334 | ControlSniperZoomOutSecondary = 43, 335 | ControlCover = 44, 336 | ControlReload = 45, 337 | ControlTalk = 46, 338 | ControlDetonate = 47, 339 | ControlHUDSpecial = 48, 340 | ControlArrest = 49, 341 | ControlAccurateAim = 50, 342 | ControlContext = 51, 343 | ControlContextSecondary = 52, 344 | ControlWeaponSpecial = 53, 345 | ControlWeaponSpecial2 = 54, 346 | ControlDive = 55, 347 | ControlDropWeapon = 56, 348 | ControlDropAmmo = 57, 349 | ControlThrowGrenade = 58, 350 | ControlVehicleMoveLeftRight = 59, 351 | ControlVehicleMoveUpDown = 60, 352 | ControlVehicleMoveUpOnly = 61, 353 | ControlVehicleMoveDownOnly = 62, 354 | ControlVehicleMoveLeftOnly = 63, 355 | ControlVehicleMoveRightOnly = 64, 356 | ControlVehicleSpecial = 65, 357 | ControlVehicleGunLeftRight = 66, 358 | ControlVehicleGunUpDown = 67, 359 | ControlVehicleAim = 68, 360 | ControlVehicleAttack = 69, 361 | ControlVehicleAttack2 = 70, 362 | ControlVehicleAccelerate = 71, 363 | ControlVehicleBrake = 72, 364 | ControlVehicleDuck = 73, 365 | ControlVehicleHeadlight = 74, 366 | ControlVehicleExit = 75, 367 | ControlVehicleHandbrake = 76, 368 | ControlVehicleHotwireLeft = 77, 369 | ControlVehicleHotwireRight = 78, 370 | ControlVehicleLookBehind = 79, 371 | ControlVehicleCinCam = 80, 372 | ControlVehicleNextRadio = 81, 373 | ControlVehiclePrevRadio = 82, 374 | ControlVehicleNextRadioTrack = 83, 375 | ControlVehiclePrevRadioTrack = 84, 376 | ControlVehicleRadioWheel = 85, 377 | ControlVehicleHorn = 86, 378 | ControlVehicleFlyThrottleUp = 87, 379 | ControlVehicleFlyThrottleDown = 88, 380 | ControlVehicleFlyYawLeft = 89, 381 | ControlVehicleFlyYawRight = 90, 382 | ControlVehiclePassengerAim = 91, 383 | ControlVehiclePassengerAttack = 92, 384 | ControlVehicleSpecialAbilityFranklin = 93, 385 | ControlVehicleStuntUpDown = 94, 386 | ControlVehicleCinematicUpDown = 95, 387 | ControlVehicleCinematicUpOnly = 96, 388 | ControlVehicleCinematicDownOnly = 97, 389 | ControlVehicleCinematicLeftRight = 98, 390 | ControlVehicleSelectNextWeapon = 99, 391 | ControlVehicleSelectPrevWeapon = 100, 392 | ControlVehicleRoof = 101, 393 | ControlVehicleJump = 102, 394 | ControlVehicleGrapplingHook = 103, 395 | ControlVehicleShuffle = 104, 396 | ControlVehicleDropProjectile = 105, 397 | ControlVehicleMouseControlOverride = 106, 398 | ControlVehicleFlyRollLeftRight = 107, 399 | ControlVehicleFlyRollLeftOnly = 108, 400 | ControlVehicleFlyRollRightOnly = 109, 401 | ControlVehicleFlyPitchUpDown = 110, 402 | ControlVehicleFlyPitchUpOnly = 111, 403 | ControlVehicleFlyPitchDownOnly = 112, 404 | ControlVehicleFlyUnderCarriage = 113, 405 | ControlVehicleFlyAttack = 114, 406 | ControlVehicleFlySelectNextWeapon = 115, 407 | ControlVehicleFlySelectPrevWeapon = 116, 408 | ControlVehicleFlySelectTargetLeft = 117, 409 | ControlVehicleFlySelectTargetRight = 118, 410 | ControlVehicleFlyVerticalFlightMode = 119, 411 | ControlVehicleFlyDuck = 120, 412 | ControlVehicleFlyAttackCamera = 121, 413 | ControlVehicleFlyMouseControlOverride = 122, 414 | ControlVehicleSubTurnLeftRight = 123, 415 | ControlVehicleSubTurnLeftOnly = 124, 416 | ControlVehicleSubTurnRightOnly = 125, 417 | ControlVehicleSubPitchUpDown = 126, 418 | ControlVehicleSubPitchUpOnly = 127, 419 | ControlVehicleSubPitchDownOnly = 128, 420 | ControlVehicleSubThrottleUp = 129, 421 | ControlVehicleSubThrottleDown = 130, 422 | ControlVehicleSubAscend = 131, 423 | ControlVehicleSubDescend = 132, 424 | ControlVehicleSubTurnHardLeft = 133, 425 | ControlVehicleSubTurnHardRight = 134, 426 | ControlVehicleSubMouseControlOverride = 135, 427 | ControlVehiclePushbikePedal = 136, 428 | ControlVehiclePushbikeSprint = 137, 429 | ControlVehiclePushbikeFrontBrake = 138, 430 | ControlVehiclePushbikeRearBrake = 139, 431 | ControlMeleeAttackLight = 140, 432 | ControlMeleeAttackHeavy = 141, 433 | ControlMeleeAttackAlternate = 142, 434 | ControlMeleeBlock = 143, 435 | ControlParachuteDeploy = 144, 436 | ControlParachuteDetach = 145, 437 | ControlParachuteTurnLeftRight = 146, 438 | ControlParachuteTurnLeftOnly = 147, 439 | ControlParachuteTurnRightOnly = 148, 440 | ControlParachutePitchUpDown = 149, 441 | ControlParachutePitchUpOnly = 150, 442 | ControlParachutePitchDownOnly = 151, 443 | ControlParachuteBrakeLeft = 152, 444 | ControlParachuteBrakeRight = 153, 445 | ControlParachuteSmoke = 154, 446 | ControlParachutePrecisionLanding = 155, 447 | ControlMap = 156, 448 | ControlSelectWeaponUnarmed = 157, 449 | ControlSelectWeaponMelee = 158, 450 | ControlSelectWeaponHandgun = 159, 451 | ControlSelectWeaponShotgun = 160, 452 | ControlSelectWeaponSmg = 161, 453 | ControlSelectWeaponAutoRifle = 162, 454 | ControlSelectWeaponSniper = 163, 455 | ControlSelectWeaponHeavy = 164, 456 | ControlSelectWeaponSpecial = 165, 457 | ControlSelectCharacterMichael = 166, 458 | ControlSelectCharacterFranklin = 167, 459 | ControlSelectCharacterTrevor = 168, 460 | ControlSelectCharacterMultiplayer = 169, 461 | ControlSaveReplayClip = 170, 462 | ControlSpecialAbilityPC = 171, 463 | ControlPhoneUp = 172, 464 | ControlPhoneDown = 173, 465 | ControlPhoneLeft = 174, 466 | ControlPhoneRight = 175, 467 | ControlPhoneSelect = 176, 468 | ControlPhoneCancel = 177, 469 | ControlPhoneOption = 178, 470 | ControlPhoneExtraOption = 179, 471 | ControlPhoneScrollForward = 180, 472 | ControlPhoneScrollBackward = 181, 473 | ControlPhoneCameraFocusLock = 182, 474 | ControlPhoneCameraGrid = 183, 475 | ControlPhoneCameraSelfie = 184, 476 | ControlPhoneCameraDOF = 185, 477 | ControlPhoneCameraExpression = 186, 478 | ControlFrontendDown = 187, 479 | ControlFrontendUp = 188, 480 | ControlFrontendLeft = 189, 481 | ControlFrontendRight = 190, 482 | ControlFrontendRdown = 191, 483 | ControlFrontendRup = 192, 484 | ControlFrontendRleft = 193, 485 | ControlFrontendRright = 194, 486 | ControlFrontendAxisX = 195, 487 | ControlFrontendAxisY = 196, 488 | ControlFrontendRightAxisX = 197, 489 | ControlFrontendRightAxisY = 198, 490 | ControlFrontendPause = 199, 491 | ControlFrontendPauseAlternate = 200, 492 | ControlFrontendAccept = 201, 493 | ControlFrontendCancel = 202, 494 | ControlFrontendX = 203, 495 | ControlFrontendY = 204, 496 | ControlFrontendLb = 205, 497 | ControlFrontendRb = 206, 498 | ControlFrontendLt = 207, 499 | ControlFrontendRt = 208, 500 | ControlFrontendLs = 209, 501 | ControlFrontendRs = 210, 502 | ControlFrontendLeaderboard = 211, 503 | ControlFrontendSocialClub = 212, 504 | ControlFrontendSocialClubSecondary = 213, 505 | ControlFrontendDelete = 214, 506 | ControlFrontendEndscreenAccept = 215, 507 | ControlFrontendEndscreenExpand = 216, 508 | ControlFrontendSelect = 217, 509 | ControlScriptLeftAxisX = 218, 510 | ControlScriptLeftAxisY = 219, 511 | ControlScriptRightAxisX = 220, 512 | ControlScriptRightAxisY = 221, 513 | ControlScriptRUp = 222, 514 | ControlScriptRDown = 223, 515 | ControlScriptRLeft = 224, 516 | ControlScriptRRight = 225, 517 | ControlScriptLB = 226, 518 | ControlScriptRB = 227, 519 | ControlScriptLT = 228, 520 | ControlScriptRT = 229, 521 | ControlScriptLS = 230, 522 | ControlScriptRS = 231, 523 | ControlScriptPadUp = 232, 524 | ControlScriptPadDown = 233, 525 | ControlScriptPadLeft = 234, 526 | ControlScriptPadRight = 235, 527 | ControlScriptSelect = 236, 528 | ControlCursorAccept = 237, 529 | ControlCursorCancel = 238, 530 | ControlCursorX = 239, 531 | ControlCursorY = 240, 532 | ControlCursorScrollUp = 241, 533 | ControlCursorScrollDown = 242, 534 | ControlEnterCheatCode = 243, 535 | ControlInteractionMenu = 244, 536 | ControlMpTextChatAll = 245, 537 | ControlMpTextChatTeam = 246, 538 | ControlMpTextChatFriends = 247, 539 | ControlMpTextChatCrew = 248, 540 | ControlPushToTalk = 249, 541 | ControlCreatorLS = 250, 542 | ControlCreatorRS = 251, 543 | ControlCreatorLT = 252, 544 | ControlCreatorRT = 253, 545 | ControlCreatorMenuToggle = 254, 546 | ControlCreatorAccept = 255, 547 | ControlCreatorDelete = 256, 548 | ControlAttack2 = 257, 549 | ControlRappelJump = 258, 550 | ControlRappelLongJump = 259, 551 | ControlRappelSmashWindow = 260, 552 | ControlPrevWeapon = 261, 553 | ControlNextWeapon = 262, 554 | ControlMeleeAttack1 = 263, 555 | ControlMeleeAttack2 = 264, 556 | ControlWhistle = 265, 557 | ControlMoveLeft = 266, 558 | ControlMoveRight = 267, 559 | ControlMoveUp = 268, 560 | ControlMoveDown = 269, 561 | ControlLookLeft = 270, 562 | ControlLookRight = 271, 563 | ControlLookUp = 272, 564 | ControlLookDown = 273, 565 | ControlSniperZoomIn = 274, 566 | ControlSniperZoomOut = 275, 567 | ControlSniperZoomInAlternate = 276, 568 | ControlSniperZoomOutAlternate = 277, 569 | ControlVehicleMoveLeft = 278, 570 | ControlVehicleMoveRight = 279, 571 | ControlVehicleMoveUp = 280, 572 | ControlVehicleMoveDown = 281, 573 | ControlVehicleGunLeft = 282, 574 | ControlVehicleGunRight = 283, 575 | ControlVehicleGunUp = 284, 576 | ControlVehicleGunDown = 285, 577 | ControlVehicleLookLeft = 286, 578 | ControlVehicleLookRight = 287, 579 | ControlReplayStartStopRecording = 288, 580 | ControlReplayStartStopRecordingSecondary = 289, 581 | ControlScaledLookLeftRight = 290, 582 | ControlScaledLookUpDown = 291, 583 | ControlScaledLookUpOnly = 292, 584 | ControlScaledLookDownOnly = 293, 585 | ControlScaledLookLeftOnly = 294, 586 | ControlScaledLookRightOnly = 295, 587 | ControlReplayMarkerDelete = 296, 588 | ControlReplayClipDelete = 297, 589 | ControlReplayPause = 298, 590 | ControlReplayRewind = 299, 591 | ControlReplayFfwd = 300, 592 | ControlReplayNewmarker = 301, 593 | ControlReplayRecord = 302, 594 | ControlReplayScreenshot = 303, 595 | ControlReplayHidehud = 304, 596 | ControlReplayStartpoint = 305, 597 | ControlReplayEndpoint = 306, 598 | ControlReplayAdvance = 307, 599 | ControlReplayBack = 308, 600 | ControlReplayTools = 309, 601 | ControlReplayRestart = 310, 602 | ControlReplayShowhotkey = 311, 603 | ControlReplayCycleMarkerLeft = 312, 604 | ControlReplayCycleMarkerRight = 313, 605 | ControlReplayFOVIncrease = 314, 606 | ControlReplayFOVDecrease = 315, 607 | ControlReplayCameraUp = 316, 608 | ControlReplayCameraDown = 317, 609 | ControlReplaySave = 318, 610 | ControlReplayToggletime = 319, 611 | ControlReplayToggletips = 320, 612 | ControlReplayPreview = 321, 613 | ControlReplayToggleTimeline = 322, 614 | ControlReplayTimelinePickupClip = 323, 615 | ControlReplayTimelineDuplicateClip = 324, 616 | ControlReplayTimelinePlaceClip = 325, 617 | ControlReplayCtrl = 326, 618 | ControlReplayTimelineSave = 327, 619 | ControlReplayPreviewAudio = 328, 620 | ControlVehicleDriveLook = 329, 621 | ControlVehicleDriveLook2 = 330, 622 | ControlVehicleFlyAttack2 = 331, 623 | ControlRadioWheelUpDown = 332, 624 | ControlRadioWheelLeftRight = 333, 625 | ControlVehicleSlowMoUpDown = 334, 626 | ControlVehicleSlowMoUpOnly = 335, 627 | ControlVehicleSlowMoDownOnly = 336, 628 | ControlMapPointOfInterest = 337, 629 | }; 630 | 631 | enum eRadioStation 632 | { 633 | RadioStationLosSantosRockRadio, 634 | RadioStationNonStopPopFM, 635 | RadioStationLosSantos, 636 | RadioStationChannelX, 637 | RadioStationWestCoastTalkRadio, 638 | RadioStationRebelRadio, 639 | RadioStationSoulwaxFM, 640 | RadioStationEastLosFM, 641 | RadioStationWestCoastClassics, 642 | RadioStationTheBlueArk, 643 | RadioStationWorldWideFM, 644 | RadioStationFlyloFM, 645 | RadioStationTheLowdown, 646 | RadioStationTheLab, 647 | RadioStationMirrorPark, 648 | RadioStationSpace, 649 | RadioStationVinewoodBoulevardRadio, 650 | }; 651 | 652 | enum eWindowTitle 653 | { 654 | CELL_EMAIL_BOD, 655 | CELL_EMAIL_BODE, 656 | CELL_EMAIL_BODF, 657 | CELL_EMAIL_SOD, 658 | CELL_EMAIL_SODE, 659 | CELL_EMAIL_SODF, 660 | CELL_EMASH_BOD, 661 | CELL_EMASH_BODE, 662 | CELL_EMASH_BODF, 663 | CELL_EMASH_SOD, 664 | CELL_EMASH_SODE, 665 | CELL_EMASH_SODF, 666 | FMMC_KEY_TIP10, 667 | FMMC_KEY_TIP12, 668 | FMMC_KEY_TIP12F, 669 | FMMC_KEY_TIP12N, 670 | FMMC_KEY_TIP8, 671 | FMMC_KEY_TIP8F, 672 | FMMC_KEY_TIP8FS, 673 | FMMC_KEY_TIP8S, 674 | FMMC_KEY_TIP9, 675 | FMMC_KEY_TIP9F, 676 | FMMC_KEY_TIP9N, 677 | PM_NAME_CHALL, 678 | }; 679 | 680 | enum eGender 681 | { 682 | GenderMale, 683 | GenderFemale 684 | }; 685 | 686 | enum eDrivingStyle 687 | { 688 | DrivingStyleNormal = 0xC00AB, 689 | DrivingStyleIgnoreLights = 0x2C0025, 690 | DrivingStyleSometimesOvertakeTraffic = 5, 691 | DrivingStyleRushed = 0x400C0025, 692 | DrivingStyleAvoidTraffic = 0xC0024, 693 | DrivingStyleAvoidTrafficExtremely = 6 694 | }; 695 | 696 | enum eBone 697 | { 698 | SKEL_ROOT = 0x0, 699 | SKEL_Pelvis = 0x2e28, 700 | SKEL_L_Thigh = 0xe39f, 701 | SKEL_L_Calf = 0xf9bb, 702 | SKEL_L_Foot = 0x3779, 703 | SKEL_L_Toe0 = 0x83c, 704 | IK_L_Foot = 0xfedd, 705 | PH_L_Foot = 0xe175, 706 | MH_L_Knee = 0xb3fe, 707 | SKEL_R_Thigh = 0xca72, 708 | SKEL_R_Calf = 0x9000, 709 | SKEL_R_Foot = 0xcc4d, 710 | SKEL_R_Toe0 = 0x512d, 711 | IK_R_Foot = 0x8aae, 712 | PH_R_Foot = 0x60e6, 713 | MH_R_Knee = 0x3fcf, 714 | RB_L_ThighRoll = 0x5c57, 715 | RB_R_ThighRoll = 0x192a, 716 | SKEL_Spine_Root = 0xe0fd, 717 | SKEL_Spine0 = 0x5c01, 718 | SKEL_Spine1 = 0x60f0, 719 | SKEL_Spine2 = 0x60f1, 720 | SKEL_Spine3 = 0x60f2, 721 | SKEL_L_Clavicle = 0xfcd9, 722 | SKEL_L_UpperArm = 0xb1c5, 723 | SKEL_L_Forearm = 0xeeeb, 724 | SKEL_L_Hand = 0x49d9, 725 | SKEL_L_Finger00 = 0x67f2, 726 | SKEL_L_Finger01 = 0xff9, 727 | SKEL_L_Finger02 = 0xffa, 728 | SKEL_L_Finger10 = 0x67f3, 729 | SKEL_L_Finger11 = 0x1049, 730 | SKEL_L_Finger12 = 0x104a, 731 | SKEL_L_Finger20 = 0x67f4, 732 | SKEL_L_Finger21 = 0x1059, 733 | SKEL_L_Finger22 = 0x105a, 734 | SKEL_L_Finger30 = 0x67f5, 735 | SKEL_L_Finger31 = 0x1029, 736 | SKEL_L_Finger32 = 0x102a, 737 | SKEL_L_Finger40 = 0x67f6, 738 | SKEL_L_Finger41 = 0x1039, 739 | SKEL_L_Finger42 = 0x103a, 740 | PH_L_Hand = 0xeb95, 741 | IK_L_Hand = 0x8cbd, 742 | RB_L_ForeArmRoll = 0xee4f, 743 | RB_L_ArmRoll = 0x1470, 744 | MH_L_Elbow = 0x58b7, 745 | SKEL_R_Clavicle = 0x29d2, 746 | SKEL_R_UpperArm = 0x9d4d, 747 | SKEL_R_Forearm = 0x6e5c, 748 | SKEL_R_Hand = 0xdead, 749 | SKEL_R_Finger00 = 0xe5f2, 750 | SKEL_R_Finger01 = 0xfa10, 751 | SKEL_R_Finger02 = 0xfa11, 752 | SKEL_R_Finger10 = 0xe5f3, 753 | SKEL_R_Finger11 = 0xfa60, 754 | SKEL_R_Finger12 = 0xfa61, 755 | SKEL_R_Finger20 = 0xe5f4, 756 | SKEL_R_Finger21 = 0xfa70, 757 | SKEL_R_Finger22 = 0xfa71, 758 | SKEL_R_Finger30 = 0xe5f5, 759 | SKEL_R_Finger31 = 0xfa40, 760 | SKEL_R_Finger32 = 0xfa41, 761 | SKEL_R_Finger40 = 0xe5f6, 762 | SKEL_R_Finger41 = 0xfa50, 763 | SKEL_R_Finger42 = 0xfa51, 764 | PH_R_Hand = 0x6f06, 765 | IK_R_Hand = 0x188e, 766 | RB_R_ForeArmRoll = 0xab22, 767 | RB_R_ArmRoll = 0x90ff, 768 | MH_R_Elbow = 0xbb0, 769 | SKEL_Neck_1 = 0x9995, 770 | SKEL_Head = 0x796e, 771 | IK_Head = 0x322c, 772 | FACIAL_facialRoot = 0xfe2c, 773 | FB_L_Brow_Out_000 = 0xe3db, 774 | FB_L_Lid_Upper_000 = 0xb2b6, 775 | FB_L_Eye_000 = 0x62ac, 776 | FB_L_CheekBone_000 = 0x542e, 777 | FB_L_Lip_Corner_000 = 0x74ac, 778 | FB_R_Lid_Upper_000 = 0xaa10, 779 | FB_R_Eye_000 = 0x6b52, 780 | FB_R_CheekBone_000 = 0x4b88, 781 | FB_R_Brow_Out_000 = 0x54c, 782 | FB_R_Lip_Corner_000 = 0x2ba6, 783 | FB_Brow_Centre_000 = 0x9149, 784 | FB_UpperLipRoot_000 = 0x4ed2, 785 | FB_UpperLip_000 = 0xf18f, 786 | FB_L_Lip_Top_000 = 0x4f37, 787 | FB_R_Lip_Top_000 = 0x4537, 788 | FB_Jaw_000 = 0xb4a0, 789 | FB_LowerLipRoot_000 = 0x4324, 790 | FB_LowerLip_000 = 0x508f, 791 | FB_L_Lip_Bot_000 = 0xb93b, 792 | FB_R_Lip_Bot_000 = 0xc33b, 793 | FB_Tongue_000 = 0xb987, 794 | RB_Neck_1 = 0x8b93, 795 | IK_Root = 0xdd1c 796 | }; 797 | 798 | enum eFiringPattern : DWORD 799 | { 800 | FiringPatternFullAuto = 0xC6EE6B4C, 801 | FiringPatternBurstFire = 0xD6FF6D61, 802 | FiringPatternBurstInCover = 0x026321F1, 803 | FiringPatternBurstFireDriveby = 0xD31265F2, 804 | FiringPatternFromGround = 0x2264E5D6, 805 | FiringPatternDelayFireByOneSec = 0x7A845691, 806 | FiringPatternSingleShot = 0x5D60E4E0, 807 | FiringPatternBurstFirePistol = 0xA018DB8A, 808 | FiringPatternBurstFireSMG = 0xD10DADEE, 809 | FiringPatternBurstFireRifle = 0x9C74B406, 810 | FiringPatternBurstFireMG = 0xB573C5B4, 811 | FiringPatternBurstFirePumpShotGun = 0x00BAC39B, 812 | FiringPatternBurstFireHeli = 0x914E786F, 813 | FiringPatternBurstFireMicro = 0x42EF03FD, 814 | FiringPatternBurstFireBursts = 0x42EF03FD, 815 | FiringPatternBurstFireTank = 0xE2CA3A71 816 | }; 817 | 818 | enum eFont 819 | { 820 | FontChaletLondon = 0, 821 | FontHouseScript = 1, 822 | FontMonospace = 2, 823 | FontChaletComprimeCologne = 4, 824 | FontPricedown = 7 825 | }; 826 | 827 | enum eVehicleColor 828 | { 829 | VehicleColorMetallicBlack = 0, 830 | VehicleColorMetallicGraphiteBlack = 1, 831 | VehicleColorMetallicBlackSteel = 2, 832 | VehicleColorMetallicDarkSilver = 3, 833 | VehicleColorMetallicSilver = 4, 834 | VehicleColorMetallicBlueSilver = 5, 835 | VehicleColorMetallicSteelGray = 6, 836 | VehicleColorMetallicShadowSilver = 7, 837 | VehicleColorMetallicStoneSilver = 8, 838 | VehicleColorMetallicMidnightSilver = 9, 839 | VehicleColorMetallicGunMetal = 10, 840 | VehicleColorMetallicAnthraciteGray = 11, 841 | VehicleColorMatteBlack = 12, 842 | VehicleColorMatteGray = 13, 843 | VehicleColorMatteLightGray = 14, 844 | VehicleColorUtilBlack = 15, 845 | VehicleColorUtilBlackPoly = 16, 846 | VehicleColorUtilDarksilver = 17, 847 | VehicleColorUtilSilver = 18, 848 | VehicleColorUtilGunMetal = 19, 849 | VehicleColorUtilShadowSilver = 20, 850 | VehicleColorWornBlack = 21, 851 | VehicleColorWornGraphite = 22, 852 | VehicleColorWornSilverGray = 23, 853 | VehicleColorWornSilver = 24, 854 | VehicleColorWornBlueSilver = 25, 855 | VehicleColorWornShadowSilver = 26, 856 | VehicleColorMetallicRed = 27, 857 | VehicleColorMetallicTorinoRed = 28, 858 | VehicleColorMetallicFormulaRed = 29, 859 | VehicleColorMetallicBlazeRed = 30, 860 | VehicleColorMetallicGracefulRed = 31, 861 | VehicleColorMetallicGarnetRed = 32, 862 | VehicleColorMetallicDesertRed = 33, 863 | VehicleColorMetallicCabernetRed = 34, 864 | VehicleColorMetallicCandyRed = 35, 865 | VehicleColorMetallicSunriseOrange = 36, 866 | VehicleColorMetallicClassicGold = 37, 867 | VehicleColorMetallicOrange = 38, 868 | VehicleColorMatteRed = 39, 869 | VehicleColorMatteDarkRed = 40, 870 | VehicleColorMatteOrange = 41, 871 | VehicleColorMatteYellow = 42, 872 | VehicleColorUtilRed = 43, 873 | VehicleColorUtilBrightRed = 44, 874 | VehicleColorUtilGarnetRed = 45, 875 | VehicleColorWornRed = 46, 876 | VehicleColorWornGoldenRed = 47, 877 | VehicleColorWornDarkRed = 48, 878 | VehicleColorMetallicDarkGreen = 49, 879 | VehicleColorMetallicRacingGreen = 50, 880 | VehicleColorMetallicSeaGreen = 51, 881 | VehicleColorMetallicOliveGreen = 52, 882 | VehicleColorMetallicGreen = 53, 883 | VehicleColorMetallicGasolineBlueGreen = 54, 884 | VehicleColorMatteLimeGreen = 55, 885 | VehicleColorUtilDarkGreen = 56, 886 | VehicleColorUtilGreen = 57, 887 | VehicleColorWornDarkGreen = 58, 888 | VehicleColorWornGreen = 59, 889 | VehicleColorWornSeaWash = 60, 890 | VehicleColorMetallicMidnightBlue = 61, 891 | VehicleColorMetallicDarkBlue = 62, 892 | VehicleColorMetallicSaxonyBlue = 63, 893 | VehicleColorMetallicBlue = 64, 894 | VehicleColorMetallicMarinerBlue = 65, 895 | VehicleColorMetallicHarborBlue = 66, 896 | VehicleColorMetallicDiamondBlue = 67, 897 | VehicleColorMetallicSurfBlue = 68, 898 | VehicleColorMetallicNauticalBlue = 69, 899 | VehicleColorMetallicBrightBlue = 70, 900 | VehicleColorMetallicPurpleBlue = 71, 901 | VehicleColorMetallicSpinnakerBlue = 72, 902 | VehicleColorMetallicUltraBlue = 73, 903 | VehicleColorUtilDarkBlue = 75, 904 | VehicleColorUtilMidnightBlue = 76, 905 | VehicleColorUtilBlue = 77, 906 | VehicleColorUtilSeaFoamBlue = 78, 907 | VehicleColorUtilLightningBlue = 79, 908 | VehicleColorUtilMauiBluePoly = 80, 909 | VehicleColorUtilBrightBlue = 81, 910 | VehicleColorMatteDarkBlue = 82, 911 | VehicleColorMatteBlue = 83, 912 | VehicleColorMatteMidnightBlue = 84, 913 | VehicleColorWornDarkBlue = 85, 914 | VehicleColorWornBlue = 86, 915 | VehicleColorWornLightBlue = 87, 916 | VehicleColorMetallicTaxiYellow = 88, 917 | VehicleColorMetallicRaceYellow = 89, 918 | VehicleColorMetallicBronze = 90, 919 | VehicleColorMetallicYellowBird = 91, 920 | VehicleColorMetallicLime = 92, 921 | VehicleColorMetallicChampagne = 93, 922 | VehicleColorMetallicPuebloBeige = 94, 923 | VehicleColorMetallicDarkIvory = 95, 924 | VehicleColorMetallicChocoBrown = 96, 925 | VehicleColorMetallicGoldenBrown = 97, 926 | VehicleColorMetallicLightBrown = 98, 927 | VehicleColorMetallicStrawBeige = 99, 928 | VehicleColorMetallicMossBrown = 100, 929 | VehicleColorMetallicBistonBrown = 101, 930 | VehicleColorMetallicBeechwood = 102, 931 | VehicleColorMetallicDarkBeechwood = 103, 932 | VehicleColorMetallicChocoOrange = 104, 933 | VehicleColorMetallicBeachSand = 105, 934 | VehicleColorMetallicSunBleechedSand = 106, 935 | VehicleColorMetallicCream = 107, 936 | VehicleColorUtilBrown = 108, 937 | VehicleColorUtilMediumBrown = 109, 938 | VehicleColorUtilLightBrown = 110, 939 | VehicleColorMetallicWhite = 111, 940 | VehicleColorMetallicFrostWhite = 112, 941 | VehicleColorWornHoneyBeige = 113, 942 | VehicleColorWornBrown = 114, 943 | VehicleColorWornDarkBrown = 115, 944 | VehicleColorWornStrawBeige = 116, 945 | VehicleColorBrushedSteel = 117, 946 | VehicleColorBrushedBlackSteel = 118, 947 | VehicleColorBrushedAluminium = 119, 948 | VehicleColorChrome = 120, 949 | VehicleColorWornOffWhite = 121, 950 | VehicleColorUtilOffWhite = 122, 951 | VehicleColorWornOrange = 123, 952 | VehicleColorWornLightOrange = 124, 953 | VehicleColorMetallicSecuricorGreen = 125, 954 | VehicleColorWornTaxiYellow = 126, 955 | VehicleColorPoliceCarBlue = 127, 956 | VehicleColorMatteGreen = 128, 957 | VehicleColorMatteBrown = 129, 958 | VehicleColorMatteWhite = 131, 959 | VehicleColorWornWhite = 132, 960 | VehicleColorWornOliveArmyGreen = 133, 961 | VehicleColorPureWhite = 134, 962 | VehicleColorHotPink = 135, 963 | VehicleColorSalmonpink = 136, 964 | VehicleColorMetallicVermillionPink = 137, 965 | VehicleColorOrange = 138, 966 | VehicleColorGreen = 139, 967 | VehicleColorBlue = 140, 968 | VehicleColorMettalicBlackBlue = 141, 969 | VehicleColorMetallicBlackPurple = 142, 970 | VehicleColorMetallicBlackRed = 143, 971 | VehicleColorHunterGreen = 144, 972 | VehicleColorMetallicPurple = 145, 973 | VehicleColorMetaillicVDarkBlue = 146, 974 | VehicleColorModshopBlack1 = 147, 975 | VehicleColorMattePurple = 148, 976 | VehicleColorMatteDarkPurple = 149, 977 | VehicleColorMetallicLavaRed = 150, 978 | VehicleColorMatteForestGreen = 151, 979 | VehicleColorMatteOliveDrab = 152, 980 | VehicleColorMatteDesertBrown = 153, 981 | VehicleColorMatteDesertTan = 154, 982 | VehicleColorMatteFoliageGreen = 155, 983 | VehicleColorDefaultAlloyColor = 156, 984 | VehicleColorEpsilonBlue = 157, 985 | VehicleColorPureGold = 158, 986 | VehicleColorBrushedGold = 159, 987 | }; 988 | 989 | enum eVehicleDoor 990 | { 991 | VehicleDoorFrontLeftDoor = 0, 992 | VehicleDoorFrontRightDoor = 1, 993 | VehicleDoorBackLeftDoor = 2, 994 | VehicleDoorBackRightDoor = 3, 995 | VehicleDoorHood = 4, 996 | VehicleDoorTrunk = 5, 997 | VehicleDoorTrunk2 = 6, 998 | }; 999 | 1000 | enum eVehicleLockStatus 1001 | { 1002 | VehicleLockStatusNone = 0, 1003 | VehicleLockStatusUnlocked = 1, 1004 | VehicleLockStatusLocked = 2, 1005 | VehicleLockStatusLockedForPlayer = 3, 1006 | VehicleLockStatusStickPlayerInside = 4, 1007 | VehicleLockStatusCanBeBrokenInto = 7, 1008 | VehicleLockStatusCanBeBrokenIntoPersist = 8, 1009 | VehicleLockStatusCannotBeTriedToEnter = 10 1010 | }; 1011 | 1012 | enum eVehicleLandingGear 1013 | { 1014 | VehicleLandingGearDeployed = 0, 1015 | VehicleLandingGearClosing = 1, 1016 | VehicleLandingGearOpening = 2, 1017 | VehicleLandingGearRetracted = 3, 1018 | }; 1019 | 1020 | enum eVehicleMod 1021 | { 1022 | VehicleModSpoilers = 0, 1023 | VehicleModFrontBumper = 1, 1024 | VehicleModRearBumper = 2, 1025 | VehicleModSideSkirt = 3, 1026 | VehicleModExhaust = 4, 1027 | VehicleModFrame = 5, 1028 | VehicleModGrille = 6, 1029 | VehicleModHood = 7, 1030 | VehicleModFender = 8, 1031 | VehicleModRightFender = 9, 1032 | VehicleModRoof = 10, 1033 | VehicleModEngine = 11, 1034 | VehicleModBrakes = 12, 1035 | VehicleModTransmission = 13, 1036 | VehicleModHorns = 14, 1037 | VehicleModSuspension = 15, 1038 | VehicleModArmor = 16, 1039 | VehicleModFrontWheels = 23, 1040 | VehicleModBackWheels = 24 // only for motocycles 1041 | }; 1042 | 1043 | enum eVehicleNeonLight 1044 | { 1045 | VehicleNeonLightLeft = 0, 1046 | VehicleNeonLightRight = 1, 1047 | VehicleNeonLightFront = 2, 1048 | VehicleNeonLightBack = 3, 1049 | }; 1050 | 1051 | enum eVehicleRoofState 1052 | { 1053 | VehicleRoofStateClosed, 1054 | VehicleRoofStateOpening, 1055 | VehicleRoofStateOpened, 1056 | VehicleRoofStateClosing, 1057 | }; 1058 | 1059 | enum eVehicleSeat 1060 | { 1061 | VehicleSeatNone = -3, 1062 | VehicleSeatAny = -2, 1063 | VehicleSeatDriver = -1, 1064 | VehicleSeatPassenger = 0, 1065 | VehicleSeatLeftFront = -1, 1066 | VehicleSeatRightFront = 0, 1067 | VehicleSeatLeftRear = 1, 1068 | VehicleSeatRightRear = 2, 1069 | }; 1070 | 1071 | enum eVehicleToggleMod 1072 | { 1073 | VehicleToggleModTurbo = 18, 1074 | VehicleToggleModTireSmoke = 20, 1075 | VehicleToggleModXenonHeadlights = 22 1076 | }; 1077 | 1078 | enum eVehicleWheelType 1079 | { 1080 | VehicleWheelTypeSport = 0, 1081 | VehicleWheelTypeMuscle = 1, 1082 | VehicleWheelTypeLowrider = 2, 1083 | VehicleWheelTypeSUV = 3, 1084 | VehicleWheelTypeOffroad = 4, 1085 | VehicleWheelTypeTuner = 5, 1086 | VehicleWheelTypeBikeWheels = 6, 1087 | VehicleWheelTypeHighEnd = 7 1088 | }; 1089 | 1090 | enum eVehicleWindow 1091 | { 1092 | VehicleWindowFrontRight = 1, 1093 | VehicleWindowFrontLeft = 0, 1094 | VehicleWindowBackRight = 3, 1095 | VehicleWindowBackLeft = 2 1096 | }; 1097 | 1098 | enum eVehicleWindowTint 1099 | { 1100 | VehicleWindowTintNone = 0, 1101 | VehicleWindowTintPureBlack = 1, 1102 | VehicleWindowTintDarkSmoke = 2, 1103 | VehicleWindowTintLightSmoke = 3, 1104 | VehicleWindowTintStock = 4, 1105 | VehicleWindowTintLimo = 5, 1106 | VehicleWindowTintGreen = 6 1107 | }; 1108 | 1109 | enum eNumberPlateMounting 1110 | { 1111 | NumberPlateMountingFrontAndRear = 0, 1112 | NumberPlateMountingFront = 1, 1113 | NumberPlateMountingRear = 2, 1114 | NumberPlateMountingNone = 3, 1115 | }; 1116 | 1117 | enum eNumberPlateType 1118 | { 1119 | NumberPlateTypeBlueOnWhite1 = 0, 1120 | NumberPlateTypeYellowOnBlack = 1, 1121 | NumberPlateTypeYellowOnBlue = 2, 1122 | NumberPlateTypeBlueOnWhite2 = 3, 1123 | NumberPlateTypeBlueOnWhite3 = 4, 1124 | NumberPlateTypeNorthYankton = 5, 1125 | }; 1126 | 1127 | enum eVehicleClass 1128 | { 1129 | VehicleClassCompacts = 0, 1130 | VehicleClassSedans = 1, 1131 | VehicleClassSUVs = 2, 1132 | VehicleClassCoupes = 3, 1133 | VehicleClassMuscle = 4, 1134 | VehicleClassSportsClassics = 5, 1135 | VehicleClassSports = 6, 1136 | VehicleClassSuper = 7, 1137 | VehicleClassMotorcycles = 8, 1138 | VehicleClassOffRoad = 9, 1139 | VehicleClassIndustrial = 10, 1140 | VehicleClassUtility = 11, 1141 | VehicleClassVans = 12, 1142 | VehicleClassCycles = 13, 1143 | VehicleClassBoats = 14, 1144 | VehicleClassHelicopters = 15, 1145 | VehicleClassPlanes = 16, 1146 | VehicleClassService = 17, 1147 | VehicleClassEmergency = 18, 1148 | VehicleClassMilitary = 19, 1149 | VehicleClassCommercial = 20, 1150 | VehicleClassTrains = 21, 1151 | }; 1152 | 1153 | enum eExplosionType 1154 | { 1155 | ExplosionTypeGrenade = 0, 1156 | ExplosionTypeGrenadeL = 1, 1157 | ExplosionTypeStickyBomb = 2, 1158 | ExplosionTypeMolotov = 3, 1159 | ExplosionTypeRocket = 4, 1160 | ExplosionTypeTankShell = 5, 1161 | ExplosionTypeHiOctane = 6, 1162 | ExplosionTypeCar = 7, 1163 | ExplosionTypePlane = 8, 1164 | ExplosionTypePetrolPump = 9, 1165 | ExplosionTypeBike = 10, 1166 | ExplosionTypeSteam = 11, 1167 | ExplosionTypeFlame = 12, 1168 | ExplosionTypeWaterHydrant = 13, 1169 | ExplosionTypeGasCanister = 14, 1170 | ExplosionTypeBoat = 15, 1171 | ExplosionTypeShipDestroy = 16, 1172 | ExplosionTypeTruck = 17, 1173 | ExplosionTypeBullet = 18, 1174 | ExplosionTypeSmokeGL = 19, 1175 | ExplosionTypeSmokeG = 20, 1176 | ExplosionTypeBZGas = 21, 1177 | ExplosionTypeFlare = 22, 1178 | ExplosionTypeGasCanister2 = 23, 1179 | ExplosionTypeExtinguisher = 24, 1180 | ExplosionTypeProgramAR = 25, 1181 | ExplosionTypeTrain = 26, 1182 | ExplosionTypeBarrel = 27, 1183 | ExplosionTypePropane = 28, 1184 | ExplosionTypeBlimp = 29, 1185 | ExplosionTypeFlameExplode = 30, 1186 | ExplosionTypeTanker = 31, 1187 | ExplosionTypePlaneRocket = 32, 1188 | ExplosionTypeVehicleBullet = 33, 1189 | ExplosionTypeGasTank = 34, 1190 | ExplosionTypeFireWork = 35, 1191 | ExplosionTypeSnowBall = 36, 1192 | ExplosionTypeProxMine = 37, 1193 | ExplosionTypeValkyrie = 38 1194 | }; 1195 | 1196 | enum eIntersectFlags 1197 | { 1198 | IntersectFlagsEverything = -1, 1199 | IntersectFlagsMap = 1, 1200 | IntersectFlagsMissionEntities = 2, 1201 | IntersectFlagsPeds1 = 12, // 4 and 8 both seem to be peds 1202 | IntersectFlagsObjects = 16, 1203 | IntersectFlagsUnk1 = 32, 1204 | IntersectFlagsUnk2 = 64, 1205 | IntersectFlagsUnk3 = 128, 1206 | IntersectFlagsVegetation = 256, 1207 | IntersectFlagsUnk4 = 512 1208 | }; 1209 | 1210 | enum eMarkerType 1211 | { 1212 | MarkerTypeUpsideDownCone = 0, 1213 | MarkerTypeVerticalCylinder = 1, 1214 | MarkerTypeThickChevronUp = 2, 1215 | MarkerTypeThinChevronUp = 3, 1216 | MarkerTypeCheckeredFlagRect = 4, 1217 | MarkerTypeCheckeredFlagCircle = 5, 1218 | MarkerTypeVerticleCircle = 6, 1219 | MarkerTypePlaneModel = 7, 1220 | MarkerTypeLostMCDark = 8, 1221 | MarkerTypeLostMCLight = 9, 1222 | MarkerTypeNumber0 = 10, 1223 | MarkerTypeNumber1 = 11, 1224 | MarkerTypeNumber2 = 12, 1225 | MarkerTypeNumber3 = 13, 1226 | MarkerTypeNumber4 = 14, 1227 | MarkerTypeNumber5 = 15, 1228 | MarkerTypeNumber6 = 16, 1229 | MarkerTypeNumber7 = 17, 1230 | MarkerTypeNumber8 = 18, 1231 | MarkerTypeNumber9 = 19, 1232 | MarkerTypeChevronUpx1 = 20, 1233 | MarkerTypeChevronUpx2 = 21, 1234 | MarkerTypeChevronUpx3 = 22, 1235 | MarkerTypeHorizontalCircleFat = 23, 1236 | MarkerTypeReplayIcon = 24, 1237 | MarkerTypeHorizontalCircleSkinny = 25, 1238 | MarkerTypeHorizontalCircleSkinny_Arrow = 26, 1239 | MarkerTypeHorizontalSplitArrowCircle = 27, 1240 | MarkerTypeDebugSphere = 28 1241 | }; 1242 | 1243 | enum eRelationship 1244 | { 1245 | RelationshipHate = 5, 1246 | RelationshipDislike = 4, 1247 | RelationshipNeutral = 3, 1248 | RelationshipLike = 2, 1249 | RelationshipRespect = 1, 1250 | RelationshipCompanion = 0, 1251 | RelationshipPedestrians = 255 // or neutral 1252 | }; 1253 | 1254 | enum eRopeType 1255 | { 1256 | RopeTypeNormal = 4, 1257 | }; 1258 | 1259 | enum eWeapon : DWORD 1260 | { 1261 | WeaponKnife = 0x99B507EA, 1262 | WeaponNightstick = 0x678B81B1, 1263 | WeaponHammer = 0x4E875F73, 1264 | WeaponBat = 0x958A4A8F, 1265 | WeaponGolfClub = 0x440E4788, 1266 | WeaponCrowbar = 0x84BD7BFD, 1267 | WeaponPistol = 0x1B06D571, 1268 | WeaponCombatPistol = 0x5EF9FEC4, 1269 | WeaponAPPistol = 0x22D8FE39, 1270 | WeaponPistol50 = 0x99AEEB3B, 1271 | WeaponMicroSMG = 0x13532244, 1272 | WeaponSMG = 0x2BE6766B, 1273 | WeaponAssaultSMG = 0xEFE7E2DF, 1274 | WeaponCombatPDW = 0x0A3D4D34, 1275 | WeaponAssaultRifle = 0xBFEFFF6D, 1276 | WeaponCarbineRifle = 0x83BF0278, 1277 | WeaponAdvancedRifle = 0xAF113F99, 1278 | WeaponMG = 0x9D07F764, 1279 | WeaponCombatMG = 0x7FD62962, 1280 | WeaponPumpShotgun = 0x1D073A89, 1281 | WeaponSawnOffShotgun = 0x7846A318, 1282 | WeaponAssaultShotgun = 0xE284C527, 1283 | WeaponBullpupShotgun = 0x9D61E50F, 1284 | WeaponStunGun = 0x3656C8C1, 1285 | WeaponSniperRifle = 0x5FC3C11, 1286 | WeaponHeavySniper = 0xC472FE2, 1287 | WeaponGrenadeLauncher = 0xA284510B, 1288 | WeaponGrenadeLauncherSmoke = 0x4DD2DC56, 1289 | WeaponRPG = 0xB1CA77B1, 1290 | WeaponMinigun = 0x42BF8A85, 1291 | WeaponGrenade = 0x93E220BD, 1292 | WeaponStickyBomb = 0x2C3731D9, 1293 | WeaponSmokeGrenade = 0xFDBC8A50, 1294 | WeaponBZGas = 0xA0973D5E, 1295 | WeaponMolotov = 0x24B17070, 1296 | WeaponFireExtinguisher = 0x60EC506, 1297 | WeaponPetrolCan = 0x34A67B97, 1298 | WeaponSNSPistol = 0xBFD21232, 1299 | WeaponSpecialCarbine = 0xC0A3098D, 1300 | WeaponHeavyPistol = 0xD205520E, 1301 | WeaponBullpupRifle = 0x7F229F94, 1302 | WeaponHomingLauncher = 0x63AB0442, 1303 | WeaponProximityMine = 0xAB564B93, 1304 | WeaponSnowball = 0x787F0BB, 1305 | WeaponVintagePistol = 0x83839C4, 1306 | WeaponDagger = 0x92A27487, 1307 | WeaponFirework = 0x7F7497E5, 1308 | WeaponMusket = 0xA89CB99E, 1309 | WeaponMarksmanRifle = 0xC734385A, 1310 | WeaponHeavyShotgun = 0x3AABBBAA, 1311 | WeaponGusenberg = 0x61012683, 1312 | WeaponHatchet = 0xF9DCBF2D, 1313 | WeaponRailgun = 0x6D544C99, 1314 | WeaponUnarmed = 0xA2719263 1315 | }; 1316 | 1317 | enum eWeaponGroup : DWORD 1318 | { 1319 | WeaponGroupUnarmed = 0xA00FC1E4, 1320 | WeaponGroupMelee = 0xD49321D4, 1321 | WeaponGroupPistol = 0x18D5FA97, 1322 | WeaponGroupSMG = 0xC6E9A5C5, 1323 | WeaponGroupAssaultRifle = 0xC7D15052, 1324 | WeaponGroupMG = 0x451B04BC, 1325 | WeaponGroupShotgun = 0x33431399, 1326 | WeaponGroupSniper = 0xB7BBD827, 1327 | WeaponGroupHeavy = 0xA27A4F9F, 1328 | WeaponGroupThrown = 0x5C4C5883, 1329 | WeaponGroupPetrolCan = 0x5F1BE07C 1330 | }; 1331 | 1332 | enum eWeaponTint 1333 | { 1334 | WeaponTintNormal = 0, 1335 | WeaponTintGreen = 1, 1336 | WeaponTintGold = 2, 1337 | WeaponTintPink = 3, 1338 | WeaponTintArmy = 4, 1339 | WeaponTintLSPD = 5, 1340 | WeaponTintOrange = 6, 1341 | WeaponTintPlatinum = 7 1342 | }; 1343 | 1344 | enum ePickupType : DWORD 1345 | { 1346 | PickupTypeCustomScript = 0x2C014CA6, 1347 | PickupTypeVehicleCustomScript = 0xA5B8CAA9, 1348 | PickupTypeParachute = 0x6773257D, 1349 | PickupTypePortablePackage = 0x80AB931C, 1350 | PickupTypePortableCrateUnfixed = 0x6E717A95, 1351 | 1352 | PickupTypeHealth = 0x8F707C18, 1353 | PickupTypeHealthSnack = 0x1CD2CF66, 1354 | PickupTypeArmour = 0x4BFB42D1, 1355 | 1356 | PickupTypeMoneyCase = 0xCE6FDD6B, 1357 | PickupTypeMoneySecurityCase = 0xDE78F17E, 1358 | PickupTypeMoneyVariable = 0xFE18F3AF, 1359 | PickupTypeMoneyMedBag = 0x14568F28, 1360 | PickupTypeMoneyPurse = 0x1E9A99F8, 1361 | PickupTypeMoneyDepBag = 0x20893292, 1362 | PickupTypeMoneyWallet = 0x5DE0AD3E, 1363 | PickupTypeMoneyPaperBag = 0x711D02A4, 1364 | 1365 | PickupTypeWeaponPistol = 0xF9AFB48F, 1366 | PickupTypeWeaponCombatPistol = 0x8967B4F3, 1367 | PickupTypeWeaponAPPistol = 0x3B662889, 1368 | PickupTypeWeaponSNSPistol = 0xC5B72713, 1369 | PickupTypeWeaponHeavyPistol = 0x9CF13918, 1370 | PickupTypeWeaponMicroSMG = 0x1D9588D3, 1371 | PickupTypeWeaponSMG = 0x3A4C2AD2, 1372 | PickupTypeWeaponMG = 0x85CAA9B1, 1373 | PickupTypeWeaponCombatMG = 0xB2930A14, 1374 | PickupTypeWeaponAssaultRifle = 0xF33C83B0, 1375 | PickupTypeWeaponCarbineRifle = 0xDF711959, 1376 | PickupTypeWeaponAdvancedRifle = 0xB2B5325E, 1377 | PickupTypeWeaponSpecialCarbine = 0x968339D, 1378 | PickupTypeWeaponBullpupRifle = 0x815D66E8, 1379 | PickupTypeWeaponPumpShotgun = 0xA9355DCD, 1380 | PickupTypeWeaponSawnoffShotgun = 0x96B412A3, 1381 | PickupTypeWeaponAssaultShotgun = 0x9299C95B, 1382 | PickupTypeWeaponSniperRifle = 0xFE2A352C, 1383 | PickupTypeWeaponHeavySniper = 0x693583AD, 1384 | PickupTypeWeaponGrenadeLauncher = 0x2E764125, 1385 | PickupTypeWeaponRPG = 0x4D36C349, 1386 | PickupTypeWeaponMinigun = 0x2F36B434, 1387 | PickupTypeWeaponGrenade = 0x5E0683A1, 1388 | PickupTypeWeaponStickyBomb = 0x7C119D58, 1389 | PickupTypeWeaponSmokeGrenade = 0x1CD604C7, 1390 | PickupTypeWeaponMolotov = 0x2DD30479, 1391 | PickupTypeWeaponPetrolCan = 0xC69DE3FF, 1392 | PickupTypeWeaponKnife = 0x278D8734, 1393 | PickupTypeWeaponNightstick = 0x5EA16D74, 1394 | PickupTypeWeaponBat = 0x81EE601E, 1395 | PickupTypeWeaponCrowbar = 0x872DC888, 1396 | PickupTypeWeaponGolfclub = 0x88EAACA7, 1397 | PickupTypeWeaponBottle = 0xFA51ABF5, 1398 | 1399 | PickupTypeVehicleWeaponPistol = 0xA54AE7B7, 1400 | PickupTypeVehicleWeaponCombatPistol = 0xD0AACEF7, 1401 | PickupTypeVehicleWeaponAPPistol = 0xCC8B3905, 1402 | PickupTypeVehicleWeaponMicroSMG = 0xB86AEE5B, 1403 | PickupTypeVehicleWeaponSawnoffShotgun = 0x2E071B5A, 1404 | PickupTypeVehicleWeaponGrenade = 0xA717F898, 1405 | PickupTypeVehicleWeaponSmokeGrenade = 0x65A7D8E9, 1406 | PickupTypeVehicleWeaponStickyBomb = 0x2C804FE3, 1407 | PickupTypeVehicleWeaponMolotov = 0x84D676D4, 1408 | PickupTypeVehicleHealth = 0x98D79EF, 1409 | 1410 | PickupTypeAmmoPistol = 0x20796A82, 1411 | PickupTypeAmmoSMG = 0x116FC4E6, 1412 | PickupTypeAmmoMG = 0xDE58E0B3, 1413 | PickupTypeAmmoRifle = 0xE4BD2FC6, 1414 | PickupTypeAmmoShotgun = 0x77F3F2DD, 1415 | PickupTypeAmmoSniper = 0xC02CF125, 1416 | PickupTypeAmmoGrenadeLauncher = 0x881AB0A8, 1417 | PickupTypeAmmoRPG = 0x84837FD7, 1418 | PickupTypeAmmoMinigun = 0xF25A01B9, 1419 | PickupTypeAmmoMissileMP = 0xF99E15D0, 1420 | PickupTypeAmmoBulletMP = 0x550447A9, 1421 | PickupTypeAmmoGrenadeLauncherMP = 0xA421A532 1422 | }; 1423 | 1424 | enum eHudComponent 1425 | { 1426 | HudComponentMain = 0, 1427 | HudComponentWantedStars, 1428 | HudComponentWeaponIcon, 1429 | HudComponentCash, 1430 | HudComponentMpCash, 1431 | HudComponentMpMessage, 1432 | HudComponentVehicleName, 1433 | HudComponentAreaName, 1434 | HudComponentUnused, 1435 | HudComponentStreetName, 1436 | HudComponentHelpText, 1437 | HudComponentFloatingHelpText1, 1438 | HudComponentFloatingHelpText2, 1439 | HudComponentCashChange, 1440 | HudComponentReticle, 1441 | HudComponentSubtitleText, 1442 | HudComponentRadioStationsWheel, 1443 | HudComponentSaving, 1444 | HudComponentGameStreamUnused, 1445 | HudComponentWeaponWheel, 1446 | HudComponentWeaponWheelStats, 1447 | HudComponentDrugsPurse01, 1448 | HudComponentDrugsPurse02, 1449 | HudComponentDrugsPurse03, 1450 | HudComponentDrugsPurse04, 1451 | HudComponentMpTagCashFromBank, 1452 | HudComponentMpTagPackages, 1453 | HudComponentMpTagCuffKeys, 1454 | HudComponentMpTagDownloadData, 1455 | HudComponentMpTagIfPedFollowing, 1456 | HudComponentMpTagKeyCard, 1457 | HudComponentMpTagRandomObject, 1458 | HudComponentMpTagRemoteControl, 1459 | HudComponentMpTagCashFromSafe, 1460 | HudComponentMpTagWeaponsPackage, 1461 | HudComponentMpTagKeys, 1462 | HudComponentMpVehicle, 1463 | HudComponentMpVehicleHeli, 1464 | HudComponentMpVehiclePlane, 1465 | HudComponentPlayerSwitchAlert, 1466 | HudComponentMpRankBar, 1467 | HudComponentDirectorMode, 1468 | HudComponentReplayController, 1469 | HudComponentReplayMouse, 1470 | HudComponentReplayHeader, 1471 | HudComponentReplayOptions, 1472 | HudComponentReplayHelpText, 1473 | HudComponentReplayMiscText, 1474 | HudComponentReplayTopLine, 1475 | HudComponentReplayBottomLine, 1476 | HudComponentReplayLeftBar, 1477 | HudComponentReplayTimer 1478 | }; 1479 | 1480 | -------------------------------------------------------------------------------- /ScriptHookV/inc/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK 3 | http://dev-c.com 4 | (C) Alexander Blade 2015-2016 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | #define IMPORT __declspec(dllimport) 12 | 13 | /* textures */ 14 | 15 | // Create texture 16 | // texFileName - texture file name, it's best to specify full texture path and use PNG textures 17 | // returns internal texture id 18 | // Texture deletion is performed automatically when game reloads scripts 19 | // Can be called only in the same thread as natives 20 | 21 | IMPORT int createTexture(const char *texFileName); 22 | 23 | // Draw texture 24 | // id - texture id recieved from createTexture() 25 | // index - each texture can have up to 64 different instances on screen at one time 26 | // level - draw level, being used in global draw order, texture instance with least level draws first 27 | // time - how much time (ms) texture instance will stay on screen, the amount of time should be enough 28 | // for it to stay on screen until the next corresponding drawTexture() call 29 | // sizeX,Y - size in screen space, should be in the range from 0.0 to 1.0, e.g setting this to 0.2 means that 30 | // texture instance will take 20% of the screen space 31 | // centerX,Y - center position in texture space, e.g. 0.5 means real texture center 32 | // posX,Y - position in screen space, [0.0, 0.0] - top left corner, [1.0, 1.0] - bottom right, 33 | // texture instance is positioned according to it's center 34 | // rotation - should be in the range from 0.0 to 1.0 35 | // screenHeightScaleFactor - screen aspect ratio, used for texture size correction, you can get it using natives 36 | // r,g,b,a - color, should be in the range from 0.0 to 1.0 37 | // 38 | // Texture instance draw parameters are updated each time script performs corresponding call to drawTexture() 39 | // You should always check your textures layout for 16:9, 16:10 and 4:3 screen aspects, for ex. in 1280x720, 40 | // 1440x900 and 1024x768 screen resolutions, use windowed mode for this 41 | // Can be called only in the same thread as natives 42 | 43 | IMPORT void drawTexture(int id, int index, int level, int time, 44 | float sizeX, float sizeY, float centerX, float centerY, 45 | float posX, float posY, float rotation, float screenHeightScaleFactor, 46 | float r, float g, float b, float a); 47 | 48 | // IDXGISwapChain::Present callback 49 | // Called right before the actual Present method call, render test calls don't trigger callbacks 50 | // When the game uses DX10 it actually uses DX11 with DX10 feature level 51 | // Remember that you can't call natives inside 52 | // void OnPresent(IDXGISwapChain *swapChain); 53 | typedef void(*PresentCallback)(void *); 54 | 55 | // Register IDXGISwapChain::Present callback 56 | // must be called on dll attach 57 | IMPORT void presentCallbackRegister(PresentCallback cb); 58 | 59 | // Unregister IDXGISwapChain::Present callback 60 | // must be called on dll detach 61 | IMPORT void presentCallbackUnregister(PresentCallback cb); 62 | 63 | /* keyboard */ 64 | 65 | // DWORD key, WORD repeats, BYTE scanCode, BOOL isExtended, BOOL isWithAlt, BOOL wasDownBefore, BOOL isUpNow 66 | typedef void(*KeyboardHandler)(DWORD, WORD, BYTE, BOOL, BOOL, BOOL, BOOL); 67 | 68 | // Register keyboard handler 69 | // must be called on dll attach 70 | IMPORT void keyboardHandlerRegister(KeyboardHandler handler); 71 | 72 | // Unregister keyboard handler 73 | // must be called on dll detach 74 | IMPORT void keyboardHandlerUnregister(KeyboardHandler handler); 75 | 76 | /* scripts */ 77 | 78 | IMPORT void scriptWait(DWORD time); 79 | IMPORT void scriptRegister(HMODULE module, void(*LP_SCRIPT_MAIN)()); 80 | IMPORT void scriptRegisterAdditionalThread(HMODULE module, void(*LP_SCRIPT_MAIN)()); 81 | IMPORT void scriptUnregister(HMODULE module); 82 | IMPORT void scriptUnregister(void(*LP_SCRIPT_MAIN)()); // deprecated 83 | 84 | IMPORT void nativeInit(UINT64 hash); 85 | IMPORT void nativePush64(UINT64 val); 86 | IMPORT PUINT64 nativeCall(); 87 | 88 | static void WAIT(DWORD time) { scriptWait(time); } 89 | static void TERMINATE() { WAIT(MAXDWORD); } 90 | 91 | // Returns pointer to global variable 92 | // make sure that you check game version before accessing globals because 93 | // ids may differ between patches 94 | IMPORT UINT64 *getGlobalPtr(int globalId); 95 | 96 | /* world */ 97 | 98 | // Get entities from internal pools 99 | // return value represents filled array elements count 100 | // can be called only in the same thread as natives 101 | IMPORT int worldGetAllVehicles(int *arr, int arrSize); 102 | IMPORT int worldGetAllPeds(int *arr, int arrSize); 103 | IMPORT int worldGetAllObjects(int *arr, int arrSize); 104 | IMPORT int worldGetAllPickups(int *arr, int arrSize); 105 | 106 | /* misc */ 107 | 108 | // Returns base object pointer using it's script handle 109 | // make sure that you check game version before accessing object fields because 110 | // offsets may differ between patches 111 | IMPORT BYTE *getScriptHandleBaseAddress(int handle); 112 | 113 | enum eGameVersion : int 114 | { 115 | VER_1_0_335_2_STEAM, 116 | VER_1_0_335_2_NOSTEAM, 117 | 118 | VER_1_0_350_1_STEAM, 119 | VER_1_0_350_2_NOSTEAM, 120 | 121 | VER_1_0_372_2_STEAM, 122 | VER_1_0_372_2_NOSTEAM, 123 | 124 | VER_1_0_393_2_STEAM, 125 | VER_1_0_393_2_NOSTEAM, 126 | 127 | VER_1_0_393_4_STEAM, 128 | VER_1_0_393_4_NOSTEAM, 129 | 130 | VER_1_0_463_1_STEAM, 131 | VER_1_0_463_1_NOSTEAM, 132 | 133 | VER_1_0_505_2_STEAM, 134 | VER_1_0_505_2_NOSTEAM, 135 | 136 | VER_1_0_573_1_STEAM, 137 | VER_1_0_573_1_NOSTEAM, 138 | 139 | VER_1_0_617_1_STEAM, 140 | VER_1_0_617_1_NOSTEAM, 141 | 142 | VER_SIZE, 143 | VER_UNK = -1 144 | }; 145 | 146 | IMPORT eGameVersion getGameVersion(); 147 | -------------------------------------------------------------------------------- /ScriptHookV/inc/nativeCaller.h: -------------------------------------------------------------------------------- 1 | /* 2 | THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK 3 | http://dev-c.com 4 | (C) Alexander Blade 2015 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "main.h" 10 | 11 | template 12 | static inline void nativePush(T val) 13 | { 14 | UINT64 val64 = 0; 15 | if (sizeof(T) > sizeof(UINT64)) 16 | { 17 | throw "error, value size > 64 bit"; 18 | } 19 | *reinterpret_cast(&val64) = val; // &val + sizeof(dw) - sizeof(val) 20 | nativePush64(val64); 21 | } 22 | 23 | template 24 | static inline R invoke(UINT64 hash) 25 | { 26 | nativeInit(hash); 27 | return *reinterpret_cast(nativeCall()); 28 | } 29 | 30 | template 31 | static inline R invoke(UINT64 hash, T1 P1) 32 | { 33 | nativeInit(hash); 34 | 35 | nativePush(P1); 36 | 37 | return *reinterpret_cast(nativeCall()); 38 | } 39 | 40 | template 41 | static inline R invoke(UINT64 hash, T1 P1, T2 P2) 42 | { 43 | nativeInit(hash); 44 | 45 | nativePush(P1); 46 | nativePush(P2); 47 | 48 | return *reinterpret_cast(nativeCall()); 49 | } 50 | 51 | template 52 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3) 53 | { 54 | nativeInit(hash); 55 | 56 | nativePush(P1); 57 | nativePush(P2); 58 | nativePush(P3); 59 | 60 | return *reinterpret_cast(nativeCall()); 61 | } 62 | 63 | template 64 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4) 65 | { 66 | nativeInit(hash); 67 | 68 | nativePush(P1); 69 | nativePush(P2); 70 | nativePush(P3); 71 | nativePush(P4); 72 | 73 | return *reinterpret_cast(nativeCall()); 74 | } 75 | 76 | template 77 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5) 78 | { 79 | nativeInit(hash); 80 | 81 | nativePush(P1); 82 | nativePush(P2); 83 | nativePush(P3); 84 | nativePush(P4); 85 | nativePush(P5); 86 | 87 | return *reinterpret_cast(nativeCall()); 88 | } 89 | 90 | template 91 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6) 92 | { 93 | nativeInit(hash); 94 | 95 | nativePush(P1); 96 | nativePush(P2); 97 | nativePush(P3); 98 | nativePush(P4); 99 | nativePush(P5); 100 | nativePush(P6); 101 | 102 | return *reinterpret_cast(nativeCall()); 103 | } 104 | 105 | template 106 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7) 107 | { 108 | nativeInit(hash); 109 | 110 | nativePush(P1); 111 | nativePush(P2); 112 | nativePush(P3); 113 | nativePush(P4); 114 | nativePush(P5); 115 | nativePush(P6); 116 | nativePush(P7); 117 | 118 | return *reinterpret_cast(nativeCall()); 119 | } 120 | 121 | template 122 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8) 123 | { 124 | nativeInit(hash); 125 | 126 | nativePush(P1); 127 | nativePush(P2); 128 | nativePush(P3); 129 | nativePush(P4); 130 | nativePush(P5); 131 | nativePush(P6); 132 | nativePush(P7); 133 | nativePush(P8); 134 | 135 | return *reinterpret_cast(nativeCall()); 136 | } 137 | 138 | template 139 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9) 140 | { 141 | nativeInit(hash); 142 | 143 | nativePush(P1); 144 | nativePush(P2); 145 | nativePush(P3); 146 | nativePush(P4); 147 | nativePush(P5); 148 | nativePush(P6); 149 | nativePush(P7); 150 | nativePush(P8); 151 | nativePush(P9); 152 | 153 | return *reinterpret_cast(nativeCall()); 154 | } 155 | 156 | template 157 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10) 158 | { 159 | nativeInit(hash); 160 | 161 | nativePush(P1); 162 | nativePush(P2); 163 | nativePush(P3); 164 | nativePush(P4); 165 | nativePush(P5); 166 | nativePush(P6); 167 | nativePush(P7); 168 | nativePush(P8); 169 | nativePush(P9); 170 | nativePush(P10); 171 | 172 | return *reinterpret_cast(nativeCall()); 173 | } 174 | 175 | template 176 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11) 177 | { 178 | nativeInit(hash); 179 | 180 | nativePush(P1); 181 | nativePush(P2); 182 | nativePush(P3); 183 | nativePush(P4); 184 | nativePush(P5); 185 | nativePush(P6); 186 | nativePush(P7); 187 | nativePush(P8); 188 | nativePush(P9); 189 | nativePush(P10); 190 | nativePush(P11); 191 | 192 | return *reinterpret_cast(nativeCall()); 193 | } 194 | 195 | template 196 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12) 197 | { 198 | nativeInit(hash); 199 | 200 | nativePush(P1); 201 | nativePush(P2); 202 | nativePush(P3); 203 | nativePush(P4); 204 | nativePush(P5); 205 | nativePush(P6); 206 | nativePush(P7); 207 | nativePush(P8); 208 | nativePush(P9); 209 | nativePush(P10); 210 | nativePush(P11); 211 | nativePush(P12); 212 | 213 | return *reinterpret_cast(nativeCall()); 214 | } 215 | 216 | template 217 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13) 218 | { 219 | nativeInit(hash); 220 | 221 | nativePush(P1); 222 | nativePush(P2); 223 | nativePush(P3); 224 | nativePush(P4); 225 | nativePush(P5); 226 | nativePush(P6); 227 | nativePush(P7); 228 | nativePush(P8); 229 | nativePush(P9); 230 | nativePush(P10); 231 | nativePush(P11); 232 | nativePush(P12); 233 | nativePush(P13); 234 | 235 | return *reinterpret_cast(nativeCall()); 236 | } 237 | 238 | template 239 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14) 240 | { 241 | nativeInit(hash); 242 | 243 | nativePush(P1); 244 | nativePush(P2); 245 | nativePush(P3); 246 | nativePush(P4); 247 | nativePush(P5); 248 | nativePush(P6); 249 | nativePush(P7); 250 | nativePush(P8); 251 | nativePush(P9); 252 | nativePush(P10); 253 | nativePush(P11); 254 | nativePush(P12); 255 | nativePush(P13); 256 | nativePush(P14); 257 | 258 | return *reinterpret_cast(nativeCall()); 259 | } 260 | 261 | template 262 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15) 263 | { 264 | nativeInit(hash); 265 | 266 | nativePush(P1); 267 | nativePush(P2); 268 | nativePush(P3); 269 | nativePush(P4); 270 | nativePush(P5); 271 | nativePush(P6); 272 | nativePush(P7); 273 | nativePush(P8); 274 | nativePush(P9); 275 | nativePush(P10); 276 | nativePush(P11); 277 | nativePush(P12); 278 | nativePush(P13); 279 | nativePush(P14); 280 | nativePush(P15); 281 | 282 | return *reinterpret_cast(nativeCall()); 283 | } 284 | 285 | template 286 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16) 287 | { 288 | nativeInit(hash); 289 | 290 | nativePush(P1); 291 | nativePush(P2); 292 | nativePush(P3); 293 | nativePush(P4); 294 | nativePush(P5); 295 | nativePush(P6); 296 | nativePush(P7); 297 | nativePush(P8); 298 | nativePush(P9); 299 | nativePush(P10); 300 | nativePush(P11); 301 | nativePush(P12); 302 | nativePush(P13); 303 | nativePush(P14); 304 | nativePush(P15); 305 | nativePush(P16); 306 | 307 | return *reinterpret_cast(nativeCall()); 308 | } 309 | 310 | template 311 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17) 312 | { 313 | nativeInit(hash); 314 | 315 | nativePush(P1); 316 | nativePush(P2); 317 | nativePush(P3); 318 | nativePush(P4); 319 | nativePush(P5); 320 | nativePush(P6); 321 | nativePush(P7); 322 | nativePush(P8); 323 | nativePush(P9); 324 | nativePush(P10); 325 | nativePush(P11); 326 | nativePush(P12); 327 | nativePush(P13); 328 | nativePush(P14); 329 | nativePush(P15); 330 | nativePush(P16); 331 | nativePush(P17); 332 | 333 | return *reinterpret_cast(nativeCall()); 334 | } 335 | 336 | template 337 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18) 338 | { 339 | nativeInit(hash); 340 | 341 | nativePush(P1); 342 | nativePush(P2); 343 | nativePush(P3); 344 | nativePush(P4); 345 | nativePush(P5); 346 | nativePush(P6); 347 | nativePush(P7); 348 | nativePush(P8); 349 | nativePush(P9); 350 | nativePush(P10); 351 | nativePush(P11); 352 | nativePush(P12); 353 | nativePush(P13); 354 | nativePush(P14); 355 | nativePush(P15); 356 | nativePush(P16); 357 | nativePush(P17); 358 | nativePush(P18); 359 | 360 | return *reinterpret_cast(nativeCall()); 361 | } 362 | 363 | template 364 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19) 365 | { 366 | nativeInit(hash); 367 | 368 | nativePush(P1); 369 | nativePush(P2); 370 | nativePush(P3); 371 | nativePush(P4); 372 | nativePush(P5); 373 | nativePush(P6); 374 | nativePush(P7); 375 | nativePush(P8); 376 | nativePush(P9); 377 | nativePush(P10); 378 | nativePush(P11); 379 | nativePush(P12); 380 | nativePush(P13); 381 | nativePush(P14); 382 | nativePush(P15); 383 | nativePush(P16); 384 | nativePush(P17); 385 | nativePush(P18); 386 | nativePush(P19); 387 | 388 | return *reinterpret_cast(nativeCall()); 389 | } 390 | 391 | template 392 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20) 393 | { 394 | nativeInit(hash); 395 | 396 | nativePush(P1); 397 | nativePush(P2); 398 | nativePush(P3); 399 | nativePush(P4); 400 | nativePush(P5); 401 | nativePush(P6); 402 | nativePush(P7); 403 | nativePush(P8); 404 | nativePush(P9); 405 | nativePush(P10); 406 | nativePush(P11); 407 | nativePush(P12); 408 | nativePush(P13); 409 | nativePush(P14); 410 | nativePush(P15); 411 | nativePush(P16); 412 | nativePush(P17); 413 | nativePush(P18); 414 | nativePush(P19); 415 | nativePush(P20); 416 | 417 | return *reinterpret_cast(nativeCall()); 418 | } 419 | 420 | template 421 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21) 422 | { 423 | nativeInit(hash); 424 | 425 | nativePush(P1); 426 | nativePush(P2); 427 | nativePush(P3); 428 | nativePush(P4); 429 | nativePush(P5); 430 | nativePush(P6); 431 | nativePush(P7); 432 | nativePush(P8); 433 | nativePush(P9); 434 | nativePush(P10); 435 | nativePush(P11); 436 | nativePush(P12); 437 | nativePush(P13); 438 | nativePush(P14); 439 | nativePush(P15); 440 | nativePush(P16); 441 | nativePush(P17); 442 | nativePush(P18); 443 | nativePush(P19); 444 | nativePush(P20); 445 | nativePush(P21); 446 | 447 | return *reinterpret_cast(nativeCall()); 448 | } 449 | 450 | template 451 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22) 452 | { 453 | nativeInit(hash); 454 | 455 | nativePush(P1); 456 | nativePush(P2); 457 | nativePush(P3); 458 | nativePush(P4); 459 | nativePush(P5); 460 | nativePush(P6); 461 | nativePush(P7); 462 | nativePush(P8); 463 | nativePush(P9); 464 | nativePush(P10); 465 | nativePush(P11); 466 | nativePush(P12); 467 | nativePush(P13); 468 | nativePush(P14); 469 | nativePush(P15); 470 | nativePush(P16); 471 | nativePush(P17); 472 | nativePush(P18); 473 | nativePush(P19); 474 | nativePush(P20); 475 | nativePush(P21); 476 | nativePush(P22); 477 | 478 | return *reinterpret_cast(nativeCall()); 479 | } 480 | 481 | template 482 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22, T23 P23) 483 | { 484 | nativeInit(hash); 485 | 486 | nativePush(P1); 487 | nativePush(P2); 488 | nativePush(P3); 489 | nativePush(P4); 490 | nativePush(P5); 491 | nativePush(P6); 492 | nativePush(P7); 493 | nativePush(P8); 494 | nativePush(P9); 495 | nativePush(P10); 496 | nativePush(P11); 497 | nativePush(P12); 498 | nativePush(P13); 499 | nativePush(P14); 500 | nativePush(P15); 501 | nativePush(P16); 502 | nativePush(P17); 503 | nativePush(P18); 504 | nativePush(P19); 505 | nativePush(P20); 506 | nativePush(P21); 507 | nativePush(P22); 508 | nativePush(P23); 509 | 510 | return *reinterpret_cast(nativeCall()); 511 | } 512 | 513 | template 514 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22, T23 P23, T24 P24) 515 | { 516 | nativeInit(hash); 517 | 518 | nativePush(P1); 519 | nativePush(P2); 520 | nativePush(P3); 521 | nativePush(P4); 522 | nativePush(P5); 523 | nativePush(P6); 524 | nativePush(P7); 525 | nativePush(P8); 526 | nativePush(P9); 527 | nativePush(P10); 528 | nativePush(P11); 529 | nativePush(P12); 530 | nativePush(P13); 531 | nativePush(P14); 532 | nativePush(P15); 533 | nativePush(P16); 534 | nativePush(P17); 535 | nativePush(P18); 536 | nativePush(P19); 537 | nativePush(P20); 538 | nativePush(P21); 539 | nativePush(P22); 540 | nativePush(P23); 541 | nativePush(P24); 542 | 543 | return *reinterpret_cast(nativeCall()); 544 | } 545 | 546 | template 547 | static inline R invoke(UINT64 hash, T1 P1, T2 P2, T3 P3, T4 P4, T5 P5, T6 P6, T7 P7, T8 P8, T9 P9, T10 P10, T11 P11, T12 P12, T13 P13, T14 P14, T15 P15, T16 P16, T17 P17, T18 P18, T19 P19, T20 P20, T21 P21, T22 P22, T23 P23, T24 P24, T25 P25) 548 | { 549 | nativeInit(hash); 550 | 551 | nativePush(P1); 552 | nativePush(P2); 553 | nativePush(P3); 554 | nativePush(P4); 555 | nativePush(P5); 556 | nativePush(P6); 557 | nativePush(P7); 558 | nativePush(P8); 559 | nativePush(P9); 560 | nativePush(P10); 561 | nativePush(P11); 562 | nativePush(P12); 563 | nativePush(P13); 564 | nativePush(P14); 565 | nativePush(P15); 566 | nativePush(P16); 567 | nativePush(P17); 568 | nativePush(P18); 569 | nativePush(P19); 570 | nativePush(P20); 571 | nativePush(P21); 572 | nativePush(P22); 573 | nativePush(P23); 574 | nativePush(P24); 575 | nativePush(P25); 576 | 577 | return *reinterpret_cast(nativeCall()); 578 | } -------------------------------------------------------------------------------- /ScriptHookV/inc/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK 3 | http://dev-c.com 4 | (C) Alexander Blade 2015 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | typedef DWORD Void; 12 | typedef DWORD Any; 13 | typedef DWORD uint; 14 | typedef DWORD Hash; 15 | typedef int Entity; 16 | typedef int Player; 17 | typedef int FireId; 18 | typedef int Ped; 19 | typedef int Vehicle; 20 | typedef int Cam; 21 | typedef int CarGenerator; 22 | typedef int Group; 23 | typedef int Train; 24 | typedef int Pickup; 25 | typedef int Object; 26 | typedef int Weapon; 27 | typedef int Interior; 28 | typedef int Blip; 29 | typedef int Texture; 30 | typedef int TextureDict; 31 | typedef int CoverPoint; 32 | typedef int Camera; 33 | typedef int TaskSequence; 34 | typedef int ColourIndex; 35 | typedef int Sphere; 36 | typedef int ScrHandle; 37 | 38 | #pragma pack(push, 1) 39 | typedef struct 40 | { 41 | float x; 42 | DWORD _paddingx; 43 | float y; 44 | DWORD _paddingy; 45 | float z; 46 | DWORD _paddingz; 47 | } Vector3; 48 | #pragma pack(pop) -------------------------------------------------------------------------------- /ScriptHookV/lib/ScriptHookV.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xxsource98/SourceBase/8ce38cd1629c3868659c4911073854dcaad66fab/ScriptHookV/lib/ScriptHookV.lib -------------------------------------------------------------------------------- /src/blankOption.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include "option.hpp" 11 | 12 | namespace Source 13 | { 14 | namespace Options 15 | { 16 | class BlankOption : public Option 17 | { 18 | public: 19 | /*I don't know if texts in game has any limitations, but description won't display big strings (I don't really know why)*/ 20 | BlankOption(std::string optionText, std::string optionDescription = "", std::function optionCallback = [] {}) 21 | : Option(std::move(optionText), "", std::move(optionDescription), std::move(optionCallback)) 22 | { 23 | this->setOptionType("Blank"); 24 | } 25 | }; 26 | } 27 | } -------------------------------------------------------------------------------- /src/constVariables.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | 11 | inline constexpr const char* MENU_VERSION = "1.1"; -------------------------------------------------------------------------------- /src/dllmain.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "script.hpp" 14 | #include "keyboard.hpp" 15 | #include "utils.hpp" 16 | 17 | #pragma comment(lib, "ScriptHookV.lib") 18 | 19 | void mainScript() 20 | { 21 | ENABLE_CONSOLE; 22 | srand((unsigned int)time(0)); 23 | Source::MainLoop(); 24 | } 25 | 26 | BOOL WINAPI DllMain( 27 | HINSTANCE hinstDLL, // handle to DLL module 28 | DWORD fdwReason, // reason for calling function 29 | LPVOID lpReserved) // reserved 30 | { 31 | switch (fdwReason) 32 | { 33 | case DLL_PROCESS_ATTACH: 34 | scriptRegister(hinstDLL, mainScript); 35 | keyboardHandlerRegister(OnKeyboardMessage); 36 | break; 37 | 38 | case DLL_PROCESS_DETACH: 39 | FREE_CONSOLE; 40 | scriptUnregister(mainScript); 41 | keyboardHandlerUnregister(OnKeyboardMessage); 42 | break; 43 | 44 | default: 45 | break; 46 | } 47 | 48 | return TRUE; 49 | } -------------------------------------------------------------------------------- /src/keyboard.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK 3 | http://dev-c.com 4 | (C) Alexander Blade 2015 5 | */ 6 | 7 | #include "keyboard.hpp" 8 | #include 9 | 10 | const int KEYS_SIZE = 255; 11 | 12 | struct { 13 | DWORD time; 14 | BOOL isWithAlt; 15 | BOOL wasDownBefore; 16 | BOOL isUpNow; 17 | } keyStates[KEYS_SIZE]; 18 | 19 | void OnKeyboardMessage(DWORD key, WORD repeats, BYTE scanCode, BOOL isExtended, BOOL isWithAlt, BOOL wasDownBefore, BOOL isUpNow) 20 | { 21 | if (key < KEYS_SIZE) 22 | { 23 | keyStates[key].time = (DWORD)GetTickCount64(); 24 | keyStates[key].isWithAlt = isWithAlt; 25 | keyStates[key].wasDownBefore = wasDownBefore; 26 | keyStates[key].isUpNow = isUpNow; 27 | } 28 | } 29 | 30 | const int NOW_PERIOD = 100, MAX_DOWN = 5000; // ms 31 | 32 | bool IsKeyDown(DWORD key) 33 | { 34 | return (key < KEYS_SIZE) ? (((DWORD)GetTickCount64() < keyStates[key].time + (DWORD)MAX_DOWN) && !keyStates[key].isUpNow) : false; 35 | } 36 | 37 | bool IsKeyJustUp(DWORD key, bool exclusive) 38 | { 39 | bool b = (key < KEYS_SIZE) ? ((DWORD)GetTickCount64() < keyStates[key].time + NOW_PERIOD && keyStates[key].isUpNow) : false; 40 | if (b && exclusive) 41 | ResetKeyState(key); 42 | return b; 43 | } 44 | 45 | bool isControllerEnabled() 46 | { 47 | return !CONTROLS::_IS_INPUT_DISABLED(2);; 48 | } 49 | 50 | bool isControllerDown(unsigned int key, bool disabled) 51 | { 52 | return isControllerEnabled() ? (disabled ? CONTROLS::IS_DISABLED_CONTROL_PRESSED(2, key) : CONTROLS::IS_CONTROL_PRESSED(2, key)) : false; 53 | } 54 | 55 | bool isControllerJustDown(unsigned int key, bool disabled) 56 | { 57 | return isControllerEnabled() ? (disabled ? CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, key) : CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(2, key)) : false; 58 | } 59 | 60 | void ResetKeyState(DWORD key) 61 | { 62 | if (key < KEYS_SIZE) 63 | memset(&keyStates[key], 0, sizeof(keyStates[0])); 64 | } -------------------------------------------------------------------------------- /src/keyboard.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | THIS FILE IS A PART OF GTA V SCRIPT HOOK SDK 3 | http://dev-c.com 4 | (C) Alexander Blade 2015 5 | */ 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | // parameters are the same as with aru's ScriptHook for IV 12 | void OnKeyboardMessage(DWORD key, WORD repeats, BYTE scanCode, BOOL isExtended, BOOL isWithAlt, BOOL wasDownBefore, BOOL isUpNow); 13 | 14 | bool IsKeyDown(DWORD key); 15 | bool IsKeyJustUp(DWORD key, bool exclusive = true); 16 | bool isControllerDown(unsigned int key, bool disabled = false); 17 | bool isControllerJustDown(unsigned int key, bool disabled = false); 18 | void ResetKeyState(DWORD key); -------------------------------------------------------------------------------- /src/menu.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #include "Menu.hpp" 10 | 11 | namespace Source 12 | { 13 | Menu::Menu(std::string menuName, MENU_STRUCT menuStruct) 14 | { 15 | this->p_menuName = menuName; 16 | this->p_menuColors = menuStruct.menuColors; 17 | this->p_menuBinds = menuStruct.menuBinds; 18 | this->p_defaultMenuColors = this->p_menuColors; 19 | this->p_menuContrBinds = menuStruct.menuControllerBinds; 20 | this->p_delay = std::make_shared(std::chrono::milliseconds(130)); 21 | this->p_menuSize = Vec2(300.f, 90.f); 22 | this->p_menuPosition = Vec2(260.f, 100.f); 23 | this->p_currentSubmenu = "main"; 24 | this->p_menuOpened = false; 25 | this->p_onMenuClose = false; 26 | this->p_onMenuOpen = false; 27 | this->p_currentOption = 1; 28 | this->p_maxVisibleOptions = 9; 29 | this->p_submenuLevel = 0; 30 | this->p_menuOpacityMultiplier = 0.f; 31 | this->p_currentYOption = 1.f; 32 | this->p_scrollerSpeed = 0.25f; 33 | this->p_menuFadeSpeed = 0.2f; 34 | this->p_controlsToDisable = { 35 | ControlPhone, 36 | ControlWeaponWheelUpDown, 37 | ControlWeaponWheelLeftRight, 38 | ControlWeaponWheelNext, 39 | ControlWeaponWheelPrev, 40 | ControlCharacterWheel, 41 | ControlMultiplayerInfo, 42 | ControlPhone, 43 | ControlMap, 44 | ControlPhoneUp, 45 | ControlPhoneDown, 46 | ControlPhoneLeft, 47 | ControlPhoneRight, 48 | ControlPhoneSelect, 49 | ControlPhoneCancel, 50 | ControlPhoneOption, 51 | ControlFrontendDown, 52 | ControlFrontendUp, 53 | ControlFrontendLeft, 54 | ControlFrontendRight, 55 | ControlFrontendRdown, 56 | ControlFrontendRup, 57 | ControlFrontendRleft, 58 | ControlFrontendRright, 59 | ControlFrontendAccept, 60 | ControlFrontendCancel, 61 | ControlSelectWeapon, 62 | ControlMeleeAttack1, 63 | ControlMeleeAttack2, 64 | ControlMeleeAttackAlternate, 65 | ControlMeleeAttackLight, 66 | ControlMeleeAttackHeavy, 67 | ControlReplayStartStopRecording, 68 | ControlReplayStartStopRecordingSecondary, 69 | ControlVehicleHorn, 70 | ControlNextCamera 71 | }; 72 | } 73 | 74 | Menu::~Menu() 75 | { 76 | for (auto& option : this->p_menuOptions) 77 | { 78 | delete option; 79 | } 80 | } 81 | 82 | void Menu::draw(std::function menuOptions, std::function featuresLoop) 83 | { 84 | this->listenKeyboard(); 85 | 86 | if (this->p_menuOpened) 87 | { 88 | menuOptions(this); 89 | this->disableControls(); 90 | } 91 | else this->enableControls(); 92 | 93 | this->checkBinds(); 94 | this->resetKeyboard(); 95 | this->handleFadeAnimation(); 96 | featuresLoop(); 97 | } 98 | 99 | void Menu::addOption(Option* option) const 100 | { 101 | this->p_menuOptions.push_back(option); 102 | } 103 | 104 | void Menu::registerSubmenu(std::string submenuName, std::string submenuID, std::function submenuElements) const 105 | { 106 | if (!Utils::doesElementExistInVector(this->p_menuSubmenus, submenuID)) 107 | this->p_menuSubmenus.push_back(submenuID); 108 | 109 | if (this->p_menuOpened && (this->p_currentSubmenu == submenuID)) 110 | { 111 | submenuElements(); 112 | this->drawHeader(); 113 | this->drawOptions(); 114 | this->drawNavbar(submenuName); 115 | this->drawFooter(); 116 | } 117 | } 118 | 119 | void Menu::setPosition(Vec2 newPosition) const 120 | { 121 | this->p_menuPosition = newPosition; 122 | } 123 | 124 | void Menu::setColor(Enums::ColorType colorType, RGBA newColor) const 125 | { 126 | switch (colorType) 127 | { 128 | case Enums::ColorType::MAIN_RECT: 129 | this->p_menuColors.mainRect = newColor; 130 | break; 131 | 132 | case Enums::ColorType::NAVBAR_RECT: 133 | this->p_menuColors.navbarRect = newColor; 134 | break; 135 | 136 | case Enums::ColorType::BACKGROUND: 137 | this->p_menuColors.background = newColor; 138 | break; 139 | 140 | case Enums::ColorType::FOOTER_RECT: 141 | this->p_menuColors.footerRect = newColor; 142 | break; 143 | 144 | case Enums::ColorType::DESCRIPTION_RECT: 145 | this->p_menuColors.descriptionRect = newColor; 146 | break; 147 | 148 | default: 149 | break; 150 | } 151 | } 152 | 153 | void Menu::setColor(Enums::ColorType colorType, RGBAF newColor) const 154 | { 155 | switch (colorType) 156 | { 157 | case Enums::ColorType::RECT_TEXT: 158 | this->p_menuColors.mainText = newColor; 159 | break; 160 | 161 | case Enums::ColorType::NAVBAR_TEXT: 162 | this->p_menuColors.navbarText = newColor; 163 | break; 164 | 165 | case Enums::ColorType::OPTION_TEXT: 166 | this->p_menuColors.optionText = newColor; 167 | break; 168 | 169 | case Enums::ColorType::FOOTER_TEXT: 170 | this->p_menuColors.footerText = newColor; 171 | break; 172 | 173 | case Enums::ColorType::DESCRIPTION_TEXT: 174 | this->p_menuColors.descriptionText = newColor; 175 | break; 176 | 177 | default: 178 | break; 179 | } 180 | } 181 | 182 | void Menu::setName(std::string newName) const 183 | { 184 | this->p_menuName = newName; 185 | } 186 | 187 | void Menu::setCurrentSubmenu(std::string newSubmenu) const 188 | { 189 | if (!Utils::doesElementExistInVector(this->p_shownSubmenus, newSubmenu)) 190 | { 191 | this->p_menuOptions.clear(); 192 | this->p_showSubmenusLastOptions.push_back(this->p_currentOption); 193 | this->p_shownSubmenus.push_back(newSubmenu); 194 | this->p_currentSubmenu = newSubmenu; 195 | this->p_currentOption = 1; 196 | this->p_submenuLevel++; 197 | } 198 | } 199 | 200 | void Menu::setCurrentOption(std::uint32_t newValue) const 201 | { 202 | this->p_currentOption = newValue; 203 | } 204 | 205 | void Menu::setMaxVisibleOptions(std::uint32_t newValue) const 206 | { 207 | this->p_maxVisibleOptions = newValue; 208 | } 209 | 210 | void Menu::setPreviousSubmenu() const 211 | { 212 | if (this->p_submenuLevel > 0) 213 | { 214 | std::string newSubmenu = this->p_shownSubmenus.at(static_cast(this->p_submenuLevel - 1)); 215 | std::uint32_t currentOption = this->p_showSubmenusLastOptions.at(static_cast(this->p_submenuLevel - 1)); 216 | 217 | if (Utils::doesElementExistInVector(this->p_menuSubmenus, newSubmenu)) 218 | { 219 | this->p_currentSubmenu = newSubmenu; 220 | this->p_currentOption = currentOption; 221 | this->p_shownSubmenus.pop_back(); 222 | this->p_showSubmenusLastOptions.pop_back(); 223 | this->p_submenuLevel--; 224 | } 225 | } 226 | else 227 | { 228 | this->p_onMenuOpen = false; 229 | this->p_onMenuClose = true; 230 | } 231 | } 232 | 233 | const Vec2 Menu::getPosition() const 234 | { 235 | return this->p_menuPosition; 236 | } 237 | 238 | const std::string Menu::getCurrentSubmenu() const 239 | { 240 | return this->p_currentSubmenu; 241 | } 242 | 243 | const std::uint32_t Menu::getCurrentOption() const 244 | { 245 | return this->p_currentOption; 246 | } 247 | 248 | const std::uint32_t Menu::getMaxVisibleOptions() const 249 | { 250 | return this->p_maxVisibleOptions; 251 | } 252 | 253 | void Menu::playSound(const char* soundRef, const char* soundName) const 254 | { 255 | AUDIO::PLAY_SOUND_FRONTEND(-1, (char*)soundName, (char*)soundRef, FALSE); 256 | } 257 | 258 | void Menu::checkBinds() const 259 | { 260 | if (this->p_pressedKeys.OPEN) 261 | { 262 | if (this->p_menuOpened) 263 | { 264 | this->p_onMenuOpen = false; 265 | this->p_onMenuClose = true; 266 | } 267 | else 268 | { 269 | this->p_menuOpened = true; 270 | this->p_onMenuOpen = true; 271 | this->p_onMenuClose = false; 272 | } 273 | 274 | if (this->p_currentSubmenu == "main" || this->p_currentSubmenu == "null") 275 | { 276 | this->p_shownSubmenus.clear(); 277 | this->p_currentSubmenu = "main"; 278 | this->p_shownSubmenus.push_back(this->p_currentSubmenu); 279 | this->p_submenuLevel = 0; 280 | } 281 | 282 | this->playSound("HUD_FRONTEND_DEFAULT_SOUNDSET", "CONTINUE"); 283 | } 284 | 285 | if (this->p_menuOpened) 286 | { 287 | if (this->p_pressedKeys.UP) 288 | { 289 | if (this->p_currentOption == 1) 290 | this->p_currentOption = (std::uint32_t)this->p_menuOptions.size(); 291 | else 292 | --this->p_currentOption; 293 | 294 | this->playSound("HUD_FRONTEND_DEFAULT_SOUNDSET", "NAV_UP_DOWN"); 295 | } 296 | 297 | if (this->p_pressedKeys.DOWN) 298 | { 299 | if (this->p_currentOption > this->p_menuOptions.size() - 1) 300 | this->p_currentOption = 1; 301 | else 302 | ++this->p_currentOption; 303 | 304 | this->playSound("HUD_FRONTEND_DEFAULT_SOUNDSET", "NAV_UP_DOWN"); 305 | } 306 | 307 | if (this->p_pressedKeys.LEFT || this->p_pressedKeys.RIGHT) 308 | { 309 | this->playSound("HUD_FRONTEND_DEFAULT_SOUNDSET", "NAV_UP_DOWN"); 310 | } 311 | 312 | if (this->p_pressedKeys.BACK) 313 | { 314 | this->setPreviousSubmenu(); 315 | this->playSound("HUD_FRONTEND_DEFAULT_SOUNDSET", "BACK"); 316 | } 317 | } 318 | } 319 | 320 | void Menu::listenKeyboard() const 321 | { 322 | if (IsKeyJustUp(this->p_menuBinds.OPEN) || isControllerJustDown(this->p_menuContrBinds.OPEN)) 323 | { 324 | this->p_pressedKeys.OPEN = true; 325 | } 326 | if (IsKeyJustUp(this->p_menuBinds.UP) || isControllerJustDown(this->p_menuContrBinds.UP)) 327 | { 328 | this->p_pressedKeys.UP = true; 329 | } 330 | if (IsKeyJustUp(this->p_menuBinds.DOWN) || isControllerJustDown(this->p_menuContrBinds.DOWN)) 331 | { 332 | this->p_pressedKeys.DOWN = true; 333 | } 334 | if (IsKeyJustUp(this->p_menuBinds.LEFT) || isControllerJustDown(this->p_menuContrBinds.LEFT)) 335 | { 336 | this->p_pressedKeys.LEFT = true; 337 | } 338 | if (IsKeyJustUp(this->p_menuBinds.RIGHT) || isControllerJustDown(this->p_menuContrBinds.RIGHT)) 339 | { 340 | this->p_pressedKeys.RIGHT = true; 341 | } 342 | if (IsKeyJustUp(this->p_menuBinds.ACCEPT) || isControllerJustDown(this->p_menuContrBinds.ACCEPT)) 343 | { 344 | this->p_pressedKeys.ACCEPT = true; 345 | } 346 | if (IsKeyJustUp(this->p_menuBinds.BACK) || isControllerJustDown(this->p_menuContrBinds.BACK)) 347 | { 348 | this->p_pressedKeys.BACK = true; 349 | } 350 | } 351 | 352 | void Menu::resetKeyboard() const 353 | { 354 | this->p_menuOptions.clear(); 355 | this->p_pressedKeys.ACCEPT = false; 356 | this->p_pressedKeys.BACK = false; 357 | this->p_pressedKeys.OPEN = false; 358 | this->p_pressedKeys.UP = false; 359 | this->p_pressedKeys.DOWN = false; 360 | this->p_pressedKeys.LEFT = false; 361 | this->p_pressedKeys.RIGHT = false; 362 | } 363 | 364 | void Menu::enableControls() const 365 | { 366 | if (!this->p_menuOpened) 367 | { 368 | for (auto e : this->p_controlsToDisable) 369 | { 370 | CONTROLS::ENABLE_CONTROL_ACTION(0, e, TRUE); 371 | } 372 | } 373 | } 374 | 375 | void Menu::disableControls() const 376 | { 377 | for (auto e : this->p_controlsToDisable) 378 | { 379 | CONTROLS::DISABLE_CONTROL_ACTION(0, e, TRUE); 380 | } 381 | } 382 | 383 | void Menu::drawHeader() const 384 | { 385 | Utils::drawRect(this->p_menuPosition, this->p_menuSize, this->p_menuColors.mainRect); 386 | 387 | Utils::drawText(this->p_menuName, 388 | Vec2(this->p_menuPosition.Get().x, this->p_menuPosition.Get().y - 15.f), 389 | 90.f, this->p_menuColors.mainText, true); 390 | } 391 | 392 | void Menu::drawNavbar(std::string submenuName) const 393 | { 394 | Utils::drawRect(this->p_menuPosition + Vec2(0.f, this->p_menuSize.Get().y / 1.5f), 395 | Vec2(this->p_menuSize.Get().x, 30.f), 396 | this->p_menuColors.navbarRect); 397 | 398 | Utils::drawText(submenuName, 399 | this->p_menuPosition + Vec2(-(this->p_menuSize.Get().x / 2.0689f), this->p_menuSize.Get().y / 1.8947f), 400 | 50.f, this->p_menuColors.navbarText); 401 | 402 | Utils::drawText(std::string(std::to_string(this->p_currentOption) + " / " + std::to_string(this->p_menuOptions.size())), 403 | this->p_menuPosition + Vec2(this->p_menuSize.Get().x / 2.0689f, this->p_menuSize.Get().y / 1.8947f), 404 | 50.f, this->p_menuColors.navbarText, false, true); 405 | } 406 | 407 | void Menu::drawOptionValues(Option* option, int currentOption, bool isSelected) const 408 | { 409 | if (option->getOptionType() == "Submenu") 410 | { 411 | Utils::drawSprite("commonmenu", "arrowright", 412 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.21f), currentOption * 30.f + (this->p_menuSize.Get().y / 1.5f)), 413 | Vec2(27.f, 27.f), isSelected ? RGBA(this->p_menuColors.selectedOptionText) : RGBA(this->p_menuColors.optionText)); 414 | } 415 | 416 | if (option->getOptionType() == "Toggle") 417 | { 418 | const bool boolState = option->getBooleanValue(); 419 | const char* currentSprite = isSelected ? (boolState ? "shop_box_tickb" : "shop_box_blankb") : (boolState ? "shop_box_tick" : "shop_box_blank"); 420 | 421 | Utils::drawSprite("commonmenu", currentSprite, 422 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.21f), currentOption * 30.f + (this->p_menuSize.Get().y / 1.5f)), 423 | Vec2(38.5f, 38.5f), this->p_menuColors.sprites); 424 | } 425 | 426 | if (option->getOptionType() == "Slider") 427 | { 428 | if (option->getSliderType() != Enums::SLIDER_TYPE::NONE) 429 | { 430 | bool isInteger = option->getSliderType() == Enums::SLIDER_TYPE::INT; 431 | float value = isInteger ? *option->getIntegerAddress() : *option->getFloatAddress(); 432 | float max = isInteger ? option->getIntegerMax() : option->getFloatMax(); 433 | std::string optionText = ""; 434 | 435 | if (!isInteger) 436 | { 437 | int secondNumber = static_cast((fmod(value, 1) * 10.0) * 10); 438 | int maxSecondNumber = static_cast((fmod(max, 1) * 10.0) * 10); 439 | 440 | optionText = std::string(std::to_string((int)value) + "." + std::to_string(secondNumber).substr(0, 2)) 441 | + " / " + 442 | std::string(std::to_string((int)max) + "." + std::to_string(maxSecondNumber).substr(0, 2)); 443 | } 444 | else 445 | optionText = std::to_string((int)value) + " / " + std::to_string((int)max); 446 | 447 | 448 | Utils::drawText(optionText, 449 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.0689f) - (isSelected ? 20.f : 0.f), currentOption * 30.f + (this->p_menuSize.Get().y / 1.8947f)), 450 | 50.f, 451 | isSelected ? this->p_menuColors.selectedOptionText : this->p_menuColors.optionText, false, true); 452 | 453 | if (isSelected) 454 | { 455 | Utils::drawSprite("commonmenu", "shop_arrows_upanddown", 456 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.21f), currentOption * 30.f + (this->p_menuSize.Get().y / 1.5f)), 457 | Vec2(25.f, 25.f), isSelected ? RGBA(this->p_menuColors.selectedOptionText) : RGBA(this->p_menuColors.optionText), 90); 458 | } 459 | } 460 | } 461 | 462 | if (option->getOptionType() == "Vector") 463 | { 464 | Utils::drawText(option->getVectorValue(*option->getIntegerAddress()), 465 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.0689f) - (isSelected ? 20.f : 0.f), currentOption * 30.f + (this->p_menuSize.Get().y / 1.8947f)), 466 | 50.f, 467 | isSelected ? this->p_menuColors.selectedOptionText : this->p_menuColors.optionText, false, true); 468 | 469 | if (isSelected) 470 | { 471 | Utils::drawSprite("commonmenu", "shop_arrows_upanddown", 472 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.21f), currentOption * 30.f + (this->p_menuSize.Get().y / 1.5f)), 473 | Vec2(25.f, 25.f), isSelected ? RGBA(this->p_menuColors.selectedOptionText) : RGBA(this->p_menuColors.optionText), 90); 474 | } 475 | } 476 | } 477 | 478 | void Menu::initOptionActions(Option* option, bool isSelected) const 479 | { 480 | if (isSelected) 481 | { 482 | if (this->p_pressedKeys.ACCEPT) 483 | { 484 | if (option->getOptionType() == "Toggle") 485 | { 486 | option->setBooleanValue(!option->getBooleanValue()); 487 | } 488 | 489 | if (option->getOptionType() == "Submenu") 490 | { 491 | this->setCurrentSubmenu(option->getSubmenu()); 492 | } 493 | 494 | option->useFunction(); 495 | } 496 | 497 | if (this->p_pressedKeys.LEFT) 498 | { 499 | if (option->getSliderType() != Enums::SLIDER_TYPE::NONE) 500 | { 501 | bool isInteger = option->getSliderType() == Enums::SLIDER_TYPE::INT; 502 | float value = isInteger ? *option->getIntegerAddress() : *option->getFloatAddress(); 503 | float min = isInteger ? option->getIntegerMin() : option->getFloatMin(); 504 | float max = isInteger ? option->getIntegerMax() : option->getFloatMax(); 505 | float step = isInteger ? option->getIntegerStep() : option->getFloatStep(); 506 | const float newValue = value -= step; 507 | 508 | isInteger ? 509 | option->setIntegerValue(static_cast(value < min ? max : newValue)) : 510 | option->setFloatValue(value < min ? max : newValue); 511 | } 512 | 513 | option->useFunction(); 514 | } 515 | 516 | if (this->p_pressedKeys.RIGHT) 517 | { 518 | if (option->getSliderType() != Enums::SLIDER_TYPE::NONE) 519 | { 520 | bool isInteger = option->getSliderType() == Enums::SLIDER_TYPE::INT; 521 | float value = isInteger ? *option->getIntegerAddress() : *option->getFloatAddress(); 522 | float min = isInteger ? option->getIntegerMin() : option->getFloatMin(); 523 | float max = isInteger ? option->getIntegerMax() : option->getFloatMax(); 524 | float step = isInteger ? option->getIntegerStep() : option->getFloatStep(); 525 | const float newValue = value += step; 526 | 527 | isInteger ? 528 | option->setIntegerValue(static_cast(value > max ? min : newValue)) : 529 | option->setFloatValue(value > max ? min : newValue); 530 | } 531 | 532 | option->useFunction(); 533 | } 534 | } 535 | } 536 | 537 | void Menu::drawOption(Option* option, std::uint32_t ID) const 538 | { 539 | bool isSelected = (this->p_currentOption >= this->p_maxVisibleOptions ? this->p_maxVisibleOptions : this->p_currentOption) == ID; 540 | 541 | this->initOptionActions(option, isSelected); 542 | 543 | Utils::drawRect(this->p_menuPosition + Vec2(0.f, ID * 30.f + (this->p_menuSize.Get().y / 1.5f)), 544 | Vec2(this->p_menuSize.Get().x, 30.f), 545 | this->p_menuColors.background); 546 | 547 | Utils::drawText(option->getLeftText(), 548 | this->p_menuPosition + Vec2(-(this->p_menuSize.Get().x / 2.0689f), ID * 30.f + (this->p_menuSize.Get().y / 1.8947f)), 549 | 50.f, 550 | isSelected ? this->p_menuColors.selectedOptionText : this->p_menuColors.optionText); 551 | 552 | Utils::drawText(option->getRightText(), 553 | this->p_menuPosition + Vec2((this->p_menuSize.Get().x / 2.0689f), ID * 30.f + (this->p_menuSize.Get().y / 1.8947f)), 554 | 50.f, 555 | isSelected ? this->p_menuColors.selectedOptionText : this->p_menuColors.optionText, false, true); 556 | 557 | isSelected ? this->drawInfo(option) : void(); 558 | } 559 | 560 | void Menu::drawOptions() const 561 | { 562 | static int curOption = 0; 563 | 564 | std::vector options = this->p_menuOptions; 565 | std::uint32_t totalSize = (std::uint32_t)options.size(); 566 | std::uint32_t currentOption = this->p_currentOption; 567 | std::uint32_t maxVisOptions = this->p_maxVisibleOptions; 568 | std::uint32_t start = 0; 569 | std::uint32_t end = totalSize > maxVisOptions ? maxVisOptions : totalSize; 570 | 571 | if ((totalSize > maxVisOptions) && (currentOption > maxVisOptions)) 572 | { 573 | start = currentOption - maxVisOptions; 574 | end = currentOption; 575 | } 576 | 577 | for (std::uint32_t i = start; i < end; i++) 578 | { 579 | drawOption(options.at(i), curOption); 580 | curOption++; 581 | } 582 | curOption = 1; 583 | 584 | this->handleScrollbar(); 585 | 586 | // Second loop for create options values (like a sprites) in front of the scroller 587 | for (std::uint32_t i = start; i < end; i++) 588 | { 589 | bool isSelected = (this->p_currentOption >= this->p_maxVisibleOptions ? this->p_maxVisibleOptions : this->p_currentOption) == curOption; 590 | 591 | this->drawOptionValues(options.at(i), curOption, isSelected); 592 | curOption++; 593 | } 594 | 595 | curOption = 1; 596 | } 597 | 598 | void Menu::drawFooter() const 599 | { 600 | std::uint32_t size = (int)this->p_menuOptions.size(); 601 | std::uint32_t maxVis = this->p_maxVisibleOptions; 602 | int optionID = size > maxVis ? maxVis + 1 : size + 1; 603 | 604 | Utils::drawRect(this->p_menuPosition + Vec2(0.f, optionID * 30.f + (this->p_menuSize.Get().y / 1.5f)), 605 | Vec2(this->p_menuSize.Get().x, 30.f), 606 | this->p_menuColors.footerRect); 607 | 608 | Utils::drawText(MENU_VERSION, 609 | this->p_menuPosition + Vec2(-(this->p_menuSize.Get().x / 2.0689f), optionID * 30.f + (this->p_menuSize.Get().y / 1.8947f)), 610 | 50.f, 611 | this->p_menuColors.footerText); 612 | 613 | Utils::drawSprite("commonmenu", "shop_arrows_upanddown", 614 | this->p_menuPosition + Vec2(0.f, optionID * 30.f + (this->p_menuSize.Get().y / 1.5f)), 615 | Vec2(30.f, 30.f), RGBA(this->p_menuColors.optionText)); 616 | } 617 | 618 | void Menu::drawInfo(Option* option) const 619 | { 620 | if (!option->getDescription().empty()) 621 | { 622 | std::uint32_t size = (std::uint32_t)this->p_menuOptions.size(); 623 | std::uint32_t maxVis = this->p_maxVisibleOptions; 624 | std::uint32_t descriptionSize = (std::uint32_t)option->getDescription().size(); 625 | int optionID = size > maxVis ? maxVis + 2 : size + 2; 626 | constexpr std::uint32_t maxChars = 46; // 42 627 | std::uint32_t descriptionLines = static_cast(descriptionSize / maxChars); 628 | float descriptionMath = descriptionLines == 0 ? descriptionLines + 1 : (descriptionLines + 1) * (6.f + (descriptionLines * 2)); 629 | 630 | Utils::drawRect(this->p_menuPosition + Vec2(0.f, optionID * 30.f + (this->p_menuSize.Get().y / 1.5f) - 8.f), 631 | Vec2(this->p_menuSize.Get().x, 2.5f), 632 | this->p_menuColors.descriptionLine); 633 | 634 | Utils::drawRect(this->p_menuPosition + Vec2(0.f, optionID * 30.f + (this->p_menuSize.Get().y / 1.5f) + 8.f + descriptionMath), 635 | Vec2(this->p_menuSize.Get().x, (descriptionLines + 1) * 30.f), 636 | this->p_menuColors.descriptionRect); 637 | 638 | Utils::drawText(std::string(option->getDescription()), 639 | this->p_menuPosition + Vec2(-(this->p_menuSize.Get().x / 2.0689f), optionID * 30.f + (this->p_menuSize.Get().y / 1.8947f) + 8.f), 640 | 50.f, 641 | this->p_menuColors.descriptionText, false, false, false, 0.2642f); 642 | } 643 | } 644 | 645 | void Menu::handleScrollbar() const 646 | { 647 | if (this->p_currentOption > this->p_maxVisibleOptions) 648 | this->p_currentYOption = std::lerp(this->p_currentYOption, static_cast(this->p_maxVisibleOptions), this->p_scrollerSpeed); 649 | else 650 | this->p_currentYOption = std::lerp(this->p_currentYOption, static_cast(this->p_currentOption), this->p_scrollerSpeed); 651 | 652 | Utils::drawRect(this->p_menuPosition + Vec2(0.f, this->p_currentYOption * 30.f + (this->p_menuSize.Get().y / 1.5f)), 653 | Vec2(this->p_menuSize.Get().x, 30.f), 654 | this->p_menuColors.scroller); 655 | } 656 | 657 | void Menu::handleFadeAnimation() const 658 | { 659 | if (this->p_onMenuOpen && !this->p_onMenuClose) 660 | { 661 | p_menuOpacityMultiplier = std::lerp(p_menuOpacityMultiplier, 1.f, this->p_menuFadeSpeed); 662 | 663 | if ((int)(p_menuOpacityMultiplier + 0.05f) == 1) 664 | { 665 | this->p_onMenuOpen = false; 666 | } 667 | } 668 | 669 | if (this->p_onMenuClose && !this->p_onMenuOpen) 670 | { 671 | p_menuOpacityMultiplier = std::lerp(p_menuOpacityMultiplier, 0.f, this->p_menuFadeSpeed); 672 | 673 | if (p_menuOpacityMultiplier < 0.01f) 674 | { 675 | this->p_menuOpened = false; 676 | this->p_onMenuClose = false; 677 | } 678 | } 679 | 680 | this->p_menuColors.UpdateAlpha(this->p_defaultMenuColors, p_menuOpacityMultiplier); 681 | } 682 | } -------------------------------------------------------------------------------- /src/menu.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "structs.hpp" 16 | #include "timer.hpp" 17 | #include "option.hpp" 18 | #include "constVariables.hpp" 19 | #include "utils.hpp" 20 | #include "keyboard.hpp" 21 | 22 | namespace Source { 23 | using namespace Structs; 24 | 25 | class Menu 26 | { 27 | public: 28 | explicit Menu(std::string menuName, MENU_STRUCT menuStruct); 29 | ~Menu(); 30 | 31 | /* 32 | -> menuOptions function is the main loop of menu. You can create that with creating another void with parameter: Menu* currentMenu, and create options reffering to first parameter. 33 | -> featuresLoop function is the your void with all features loop. */ 34 | void draw(std::function menuOptions, std::function featuresLoop); 35 | /* You can see the all options on Source::Options namespace */ 36 | void addOption(Option* option) const; 37 | /* Every submenu you have to register and put necessary options in it */ 38 | void registerSubmenu(std::string submenuName, std::string submenuID, std::function submenuElements) const; 39 | 40 | void setPosition(Vec2 newPosition) const; 41 | void setColor(Enums::ColorType colorType, RGBA newColor) const; 42 | void setColor(Enums::ColorType colorType, RGBAF newColor) const; 43 | void setName(std::string newName) const; 44 | void setCurrentSubmenu(std::string newSubmenu) const; 45 | void setCurrentOption(std::uint32_t newValue) const; 46 | void setMaxVisibleOptions(std::uint32_t newValue) const; 47 | void setPreviousSubmenu() const; 48 | 49 | const Vec2 getPosition() const; 50 | const std::string getCurrentSubmenu() const; 51 | const std::uint32_t getCurrentOption() const; 52 | const std::uint32_t getMaxVisibleOptions() const; 53 | 54 | private: 55 | void playSound(const char* soundRef, const char* soundName) const; 56 | 57 | void checkBinds() const; 58 | void listenKeyboard() const; 59 | void resetKeyboard() const; 60 | 61 | void enableControls() const; 62 | void disableControls() const; 63 | 64 | void drawHeader() const; 65 | void drawNavbar(std::string submenuName) const; 66 | void drawOptionValues(Option* option, int currentOption, bool isSelected) const; 67 | void initOptionActions(Option* option, bool isSelected) const; 68 | void drawOption(Option* option, std::uint32_t ID) const; 69 | void drawOptions() const; 70 | void drawFooter() const; 71 | void drawInfo(Option* option) const; 72 | void handleScrollbar() const; 73 | 74 | void handleFadeAnimation() const; 75 | 76 | private: 77 | std::shared_ptr p_delay; 78 | mutable std::vector p_menuOptions; 79 | mutable std::vector p_menuSubmenus; 80 | mutable std::vector p_shownSubmenus; 81 | mutable std::vector p_showSubmenusLastOptions; 82 | mutable std::vector p_controlsToDisable; 83 | mutable std::string p_menuName; 84 | mutable MENU_COLORS p_menuColors; 85 | mutable MENU_COLORS p_defaultMenuColors; 86 | mutable MENU_BINDS p_menuBinds; 87 | mutable MENU_CONTROLLER_BINDS p_menuContrBinds; 88 | mutable Vec2 p_menuSize; 89 | mutable Vec2 p_menuPosition; 90 | mutable PRESSED_KEYS p_pressedKeys; 91 | mutable std::string p_currentSubmenu; 92 | mutable std::string p_lastSubmenu; 93 | mutable std::uint32_t p_submenuLevel; 94 | mutable std::uint32_t p_lastOption; 95 | mutable std::uint32_t p_currentOption; 96 | mutable std::uint32_t p_maxVisibleOptions; 97 | mutable float p_currentYOption; 98 | mutable float p_scrollerSpeed; 99 | mutable float p_menuOpacityMultiplier; 100 | mutable float p_menuFadeSpeed; 101 | mutable bool p_onMenuOpen; 102 | mutable bool p_onMenuClose; 103 | mutable bool p_menuOpened; 104 | }; 105 | } -------------------------------------------------------------------------------- /src/option.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #include "option.hpp" 10 | 11 | namespace Source { 12 | Option::Option(std::string optionText, 13 | std::string optionRightText, 14 | std::string optionDescription, 15 | std::function optionCallback, 16 | int* optionInteger, 17 | int Imin, int Imax, int Istep, 18 | float* optionFloat, 19 | float Fmin, float Fmax, float Fstep, 20 | bool* optionBoolean, 21 | std::vector* optionStringVector, 22 | std::string optionSubmenu) 23 | { 24 | this->p_optionLeftText = optionText; 25 | this->p_optionRightText = optionRightText; 26 | this->p_optionDescription = optionDescription; 27 | this->p_optionFunction = optionCallback; 28 | this->p_optionInteger = optionInteger; 29 | this->p_optionIntegerMin = Imin; 30 | this->p_optionIntegerMax = Imax; 31 | this->p_optionIntegerStep = Istep; 32 | this->p_optionFloat = optionFloat; 33 | this->p_optionFloatMin = Fmin; 34 | this->p_optionFloatMax = Fmax; 35 | this->p_optionFloatStep = Fstep; 36 | this->p_optionBoolean = optionBoolean; 37 | this->p_optionStringVector = optionStringVector; 38 | this->p_optionSubmenu = optionSubmenu; 39 | this->p_optionType = "null"; 40 | this->p_optionSliderType = Enums::SLIDER_TYPE::NONE; 41 | } 42 | 43 | void Option::setLeftText(std::string newText) const 44 | { 45 | this->p_optionLeftText = newText; 46 | } 47 | 48 | void Option::setRightText(std::string newText) const 49 | { 50 | this->p_optionRightText = newText; 51 | } 52 | 53 | void Option::setDescription(std::string newText) const 54 | { 55 | this->p_optionDescription = newText; 56 | } 57 | 58 | void Option::setOptionType(std::string newType) const 59 | { 60 | this->p_optionType = newType; 61 | } 62 | 63 | void Option::setFunction(std::function newFunction) const 64 | { 65 | this->p_optionFunction = newFunction; 66 | } 67 | 68 | void Option::setBooleanValue(bool newValue) const 69 | { 70 | *this->p_optionBoolean = newValue; 71 | } 72 | 73 | void Option::setStringVectorValue(std::vector newValue) const 74 | { 75 | *this->p_optionStringVector = newValue; 76 | } 77 | 78 | void Option::setSliderType(Enums::SLIDER_TYPE type) const 79 | { 80 | this->p_optionSliderType = type; 81 | } 82 | 83 | void Option::setIntegerValue(int newValue) const 84 | { 85 | *this->p_optionInteger = newValue; 86 | } 87 | 88 | void Option::setFloatValue(float newValue) const 89 | { 90 | *this->p_optionFloat = newValue; 91 | } 92 | 93 | const std::string Option::getLeftText() const 94 | { 95 | return this->p_optionLeftText; 96 | } 97 | 98 | const std::string Option::getRightText() const 99 | { 100 | return this->p_optionRightText; 101 | } 102 | 103 | const std::string Option::getDescription() const 104 | { 105 | return this->p_optionDescription; 106 | } 107 | 108 | const std::string Option::getOptionType() const 109 | { 110 | return this->p_optionType; 111 | } 112 | 113 | const void Option::useFunction() const 114 | { 115 | this->p_optionFunction(); 116 | } 117 | 118 | const bool Option::getBooleanValue() const 119 | { 120 | return *this->p_optionBoolean; 121 | } 122 | 123 | const std::string Option::getVectorValue(std::uint32_t index) const 124 | { 125 | return this->p_optionStringVector->at((std::size_t)index); 126 | } 127 | 128 | const Enums::SLIDER_TYPE Option::getSliderType() const 129 | { 130 | return this->p_optionSliderType; 131 | } 132 | 133 | const std::string Option::getSubmenu() const 134 | { 135 | return this->p_optionSubmenu; 136 | } 137 | 138 | const int* Option::getIntegerAddress() const 139 | { 140 | return this->p_optionInteger; 141 | } 142 | 143 | const int Option::getIntegerMin() const 144 | { 145 | return this->p_optionIntegerMin; 146 | } 147 | 148 | const int Option::getIntegerMax() const 149 | { 150 | return this->p_optionIntegerMax; 151 | } 152 | 153 | const int Option::getIntegerStep() const 154 | { 155 | return this->p_optionIntegerStep; 156 | } 157 | 158 | const float* Option::getFloatAddress() const 159 | { 160 | return this->p_optionFloat; 161 | } 162 | 163 | const float Option::getFloatMin() const 164 | { 165 | return this->p_optionFloatMin; 166 | } 167 | 168 | const float Option::getFloatMax() const 169 | { 170 | return this->p_optionFloatMax; 171 | } 172 | 173 | const float Option::getFloatStep() const 174 | { 175 | return this->p_optionFloatStep; 176 | } 177 | } -------------------------------------------------------------------------------- /src/option.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include 11 | #include 12 | #include 13 | #include "structs.hpp" 14 | #include "constVariables.hpp" 15 | 16 | namespace Source { 17 | class Option 18 | { 19 | public: 20 | /*I don't know if texts in game has any limitations, but description won't display big strings (I don't really know why)*/ 21 | Option(std::string optionText, 22 | std::string optionRightText = "", 23 | std::string optionDescription = "", 24 | std::function optionCallback = [] {}, 25 | int* optionInteger = nullptr, 26 | int Imin = 0, int Imax = 0, int Istep = 1, 27 | float* optionFloat = nullptr, 28 | float Fmin = 0.f, float Fmax = 0.f, float Fstep = 0.1f, 29 | bool* optionBoolean = 0, 30 | std::vector* optionStringVector = {}, 31 | std::string optionSubmenu = ""); 32 | 33 | void setLeftText(std::string newText) const; 34 | void setRightText(std::string newText) const; 35 | void setDescription(std::string newText) const; 36 | void setOptionType(std::string newType) const; 37 | void setFunction(std::function newFunction) const; 38 | void setBooleanValue(bool newValue) const; 39 | void setStringVectorValue(std::vector newValue) const; 40 | void setSliderType(Enums::SLIDER_TYPE type) const; 41 | void setIntegerValue(int newValue) const; 42 | void setFloatValue(float newValue) const; 43 | 44 | const std::string getLeftText() const; 45 | const std::string getRightText() const; 46 | const std::string getDescription() const; 47 | const std::string getOptionType() const; 48 | const void useFunction() const; 49 | const std::string getVectorValue(std::uint32_t index) const; 50 | const Enums::SLIDER_TYPE getSliderType() const; 51 | const std::string getSubmenu() const; 52 | const bool getBooleanValue() const; 53 | const int* getIntegerAddress() const; 54 | const int getIntegerMin() const; 55 | const int getIntegerMax() const; 56 | const int getIntegerStep() const; 57 | const float* getFloatAddress() const; 58 | const float getFloatMin() const; 59 | const float getFloatMax() const; 60 | const float getFloatStep() const; 61 | 62 | private: 63 | mutable std::string p_optionLeftText; 64 | mutable std::string p_optionRightText; 65 | mutable std::string p_optionDescription; 66 | mutable std::string p_optionSubmenu; 67 | mutable std::string p_optionType; 68 | mutable std::function p_optionFunction; 69 | mutable Enums::SLIDER_TYPE p_optionSliderType; 70 | mutable std::vector* p_optionStringVector; 71 | mutable int* p_optionInteger; 72 | mutable int p_optionIntegerMin; 73 | mutable int p_optionIntegerMax; 74 | mutable int p_optionIntegerStep; 75 | mutable float* p_optionFloat; 76 | mutable float p_optionFloatMax; 77 | mutable float p_optionFloatMin; 78 | mutable float p_optionFloatStep; 79 | mutable bool* p_optionBoolean; 80 | mutable int* p_vectorInteger; 81 | }; 82 | } -------------------------------------------------------------------------------- /src/script.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #include 10 | #include "script.hpp" 11 | #include "menu.hpp" 12 | #include "structs.hpp" 13 | #include 14 | #include "blankOption.hpp" 15 | #include "toggleOption.hpp" 16 | #include "sliderOption.hpp" 17 | #include "vectorOption.hpp" 18 | #include "utils.hpp" 19 | #include "submenuOption.hpp" 20 | 21 | bool m_Godmode = false; 22 | bool m_SuperJump = false; 23 | int m_WantedLevel = 0; 24 | int m_VectorInteger = 0; 25 | std::vector m_Vector = { "Red", "Green", "Blue" }; 26 | 27 | void MenuOptions(Source::Menu* curMenu) 28 | { 29 | using namespace Source; 30 | 31 | static auto position = curMenu->getPosition().Get(); 32 | 33 | curMenu->registerSubmenu("Main Menu", "main", [curMenu] { 34 | curMenu->addOption(new Options::SliderOption("Position X", &position.x, 190.f, 1100.f, 10.f, "", [curMenu] { 35 | curMenu->setPosition(Vec2(position.x, position.y)); 36 | })); 37 | 38 | curMenu->addOption(new Options::SliderOption("Position Y", &position.y, 50.f, 270.f, 10.f, "Example Float Slider Option", [curMenu] { 39 | curMenu->setPosition(Vec2(position.x, position.y)); 40 | })); 41 | 42 | curMenu->addOption(new Options::ToggleOption("Godmode", &m_Godmode, "Example Bool Option")); 43 | curMenu->addOption(new Options::ToggleOption("Super Jump", &m_SuperJump, "Example Bool Option")); 44 | 45 | curMenu->addOption(new Options::SliderOption("Wanted Level", &m_WantedLevel, 0, 5, 1, "Example Int Slider Option", [] { 46 | PLAYER::SET_PLAYER_WANTED_LEVEL(PLAYER::PLAYER_ID(), m_WantedLevel, FALSE); 47 | PLAYER::SET_PLAYER_WANTED_LEVEL_NOW(PLAYER::PLAYER_ID(), TRUE); 48 | })); 49 | 50 | curMenu->addOption(new Options::BlankOption("Show Zone", "Notify Player's Current Zone", [] { 51 | Vec3 playerPos(ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), TRUE)); 52 | 53 | Utils::messageMap(UI::_GET_LABEL_TEXT((char*)playerPos.getGamezone())); 54 | })); 55 | 56 | curMenu->addOption(new Options::VectorOption("Header Color", &m_Vector, &m_VectorInteger, "Example Vector Slider Option", [curMenu] { 57 | switch (m_VectorInteger) 58 | { 59 | case 0: 60 | curMenu->setColor(Enums::ColorType::MAIN_RECT, RGBA(245, 59, 87, 245)); 61 | break; 62 | case 1: 63 | curMenu->setColor(Enums::ColorType::MAIN_RECT, RGBA(76, 209, 55, 245)); 64 | break; 65 | case 2: 66 | curMenu->setColor(Enums::ColorType::MAIN_RECT, RGBA(0, 168, 255, 245)); 67 | break; 68 | 69 | default: break; 70 | } 71 | })); 72 | 73 | curMenu->addOption(new Options::SubmenuOption("Example Sub", "test1", "Jump to another sub!")); 74 | }); 75 | 76 | curMenu->registerSubmenu("Example Test", "test1", [curMenu] { 77 | for (int i = 0; i < 30; i++) 78 | { 79 | if (i == 5) 80 | curMenu->addOption(new Options::BlankOption("Blank 5", "Simple Blank Option 1")); 81 | else if (i == 15) 82 | curMenu->addOption(new Options::BlankOption("Half", "Simple Blank Option 2")); 83 | else 84 | curMenu->addOption(new Options::BlankOption("Blank", "Simple Blank Option")); 85 | } 86 | }); 87 | } 88 | 89 | void FeaturesLoop() 90 | { 91 | PLAYER::SET_PLAYER_INVINCIBLE(PLAYER::PLAYER_ID(), m_Godmode); 92 | 93 | if (m_SuperJump) 94 | { 95 | GAMEPLAY::SET_SUPER_JUMP_THIS_FRAME(PLAYER::PLAYER_ID()); 96 | } 97 | } 98 | 99 | void Source::MainLoop() 100 | { 101 | MENU_STRUCT menuStruct; 102 | menuStruct.menuColors.mainRect = RGBA(108, 92, 231, 245); // Example overwrite on the main menu struct 103 | 104 | const std::shared_ptr menu = std::make_shared("Source Base", menuStruct); 105 | 106 | while (true) 107 | { 108 | menu->draw(MenuOptions, FeaturesLoop); 109 | WAIT(0); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/script.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include "constVariables.hpp" 11 | 12 | namespace Source { 13 | void MainLoop(); 14 | } -------------------------------------------------------------------------------- /src/sliderOption.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include "option.hpp" 11 | 12 | namespace Source { 13 | namespace Options 14 | { 15 | class SliderOption : public Option 16 | { 17 | public: 18 | /* Supporting: int, float */ 19 | /*I don't know if texts in game has any limitations, but description won't display big strings (I don't really know why)*/ 20 | SliderOption(std::string optionText, int* sliderSource, int min, int max, int step = 1, std::string optionDescription = "", std::function optionCallback = [] {}) 21 | : Option(std::move(optionText), "", std::move(optionDescription), std::move(optionCallback), std::move(sliderSource), std::move(min), std::move(max), std::move(step)) 22 | { 23 | this->setOptionType("Slider"); 24 | this->setSliderType(Enums::SLIDER_TYPE::INT); 25 | } 26 | 27 | SliderOption(std::string optionText, float* sliderSource, float min, float max, float step = 1, std::string optionDescription = "", std::function optionCallback = [] {}) 28 | : Option(std::move(optionText), "", std::move(optionDescription), std::move(optionCallback), nullptr, 0, 0, 0, std::move(sliderSource), std::move(min), std::move(max), std::move(step)) 29 | { 30 | this->setOptionType("Slider"); 31 | this->setSliderType(Enums::SLIDER_TYPE::FLOAT); 32 | } 33 | }; 34 | } 35 | } -------------------------------------------------------------------------------- /src/structs.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | namespace Enums 18 | { 19 | enum class ColorType : int 20 | { 21 | MAIN_RECT = -1, 22 | RECT_TEXT, 23 | NAVBAR_RECT, 24 | NAVBAR_TEXT, 25 | BACKGROUND, 26 | OPTION_TEXT, 27 | FOOTER_RECT, 28 | FOOTER_TEXT, 29 | DESCRIPTION_RECT, 30 | DESCRIPTION_TEXT 31 | }; 32 | 33 | enum class SLIDER_TYPE : int 34 | { 35 | NONE = -5, 36 | INT = 0, 37 | FLOAT 38 | }; 39 | }; 40 | 41 | namespace Structs 42 | { 43 | class RGBAF 44 | { 45 | public: 46 | RGBAF(std::uint32_t Red = 0U, std::uint32_t Green = 0U, std::uint32_t Blue = 0U, std::uint32_t Alpha = 255U, std::uint32_t Font = eFont::FontHouseScript) 47 | : r(Red), g(Green), b(Blue), a(Alpha), f(Font) {} 48 | 49 | std::uint32_t r = 0U; 50 | std::uint32_t g = 0U; 51 | std::uint32_t b = 0U; 52 | std::uint32_t a = 255U; 53 | std::uint32_t f = eFont::FontHouseScript; 54 | }; 55 | 56 | class RGBA 57 | { 58 | public: 59 | RGBA(std::uint32_t Red = 0U, std::uint32_t Green = 0U, std::uint32_t Blue = 0U, std::uint32_t Alpha = 255U) 60 | : r(Red), g(Green), b(Blue), a(Alpha) {} 61 | 62 | RGBA(RGBAF rgba) 63 | : r(rgba.r), g(rgba.g), b(rgba.b), a(rgba.a) {} 64 | 65 | std::uint32_t r = 0U; 66 | std::uint32_t g = 0U; 67 | std::uint32_t b = 0U; 68 | std::uint32_t a = 255U; 69 | }; 70 | 71 | struct MENU_BINDS 72 | { 73 | std::uint32_t OPEN = VK_INSERT; 74 | std::uint32_t UP = VK_UP; 75 | std::uint32_t DOWN = VK_DOWN; 76 | std::uint32_t LEFT = VK_LEFT; 77 | std::uint32_t RIGHT = VK_RIGHT; 78 | std::uint32_t ACCEPT = VK_RETURN; 79 | std::uint32_t BACK = VK_BACK; 80 | }; 81 | 82 | struct MENU_CONTROLLER_BINDS 83 | { 84 | std::uint32_t OPEN = eControl::ControlVehicleHorn; 85 | std::uint32_t OPEN2 = eControl::ControlScriptRB; 86 | std::uint32_t UP = eControl::ControlFrontendUp; 87 | std::uint32_t DOWN = eControl::ControlFrontendDown; 88 | std::uint32_t LEFT = eControl::ControlFrontendLeft; 89 | std::uint32_t RIGHT = eControl::ControlFrontendRight; 90 | std::uint32_t ACCEPT = eControl::ControlFrontendAccept; 91 | std::uint32_t BACK = eControl::ControlFrontendCancel; 92 | }; 93 | 94 | struct PRESSED_KEYS 95 | { 96 | bool OPEN = false; 97 | bool UP = false; 98 | bool DOWN = false; 99 | bool LEFT = false; 100 | bool RIGHT = false; 101 | bool ACCEPT = false; 102 | bool BACK = false; 103 | }; 104 | 105 | struct MENU_COLORS 106 | { 107 | RGBA mainRect; 108 | RGBAF mainText; 109 | RGBA navbarRect; 110 | RGBAF navbarText; 111 | RGBA background; 112 | RGBAF optionText; 113 | RGBA scroller; 114 | RGBAF selectedOptionText; 115 | RGBA footerRect; 116 | RGBAF footerText; 117 | RGBA descriptionLine; 118 | RGBA descriptionRect; 119 | RGBAF descriptionText; 120 | RGBA sprites; 121 | 122 | MENU_COLORS() 123 | { 124 | mainRect = RGBA(245, 59, 87, 245); 125 | mainText = RGBAF(210, 218, 226, 255); 126 | navbarRect = RGBA(15, 15, 15, 245); 127 | navbarText = RGBAF(210, 218, 226, 255, eFont::FontChaletComprimeCologne); 128 | background = RGBA(30, 39, 46, 170); 129 | optionText = RGBAF(210, 218, 226, 255, eFont::FontChaletComprimeCologne); 130 | scroller = RGBA(210, 218, 226, 235); // 245 131 | selectedOptionText = RGBAF(30, 39, 46, 255, eFont::FontChaletComprimeCologne); 132 | footerRect = RGBA(15, 15, 15, 245); 133 | footerText = RGBAF(210, 218, 226, 255, eFont::FontChaletComprimeCologne); 134 | descriptionLine = RGBA(255, 255, 255, 245); 135 | descriptionRect = RGBA(15, 15, 15, 160); 136 | descriptionText = RGBAF(210, 218, 226, 255, eFont::FontChaletComprimeCologne); 137 | sprites = RGBA(255, 255, 255, 255); 138 | } 139 | 140 | void UpdateAlpha(MENU_COLORS defaultColors, float alphaMultiplier) 141 | { 142 | mainRect.a = (int)((float)defaultColors.mainRect.a * alphaMultiplier); 143 | mainText.a = (int)((float)defaultColors.mainText.a * alphaMultiplier); 144 | navbarRect.a = (int)((float)defaultColors.navbarRect.a * alphaMultiplier); 145 | mainRect.a = (int)((float)defaultColors.mainRect.a * alphaMultiplier); 146 | navbarText.a = (int)((float)defaultColors.navbarText.a * alphaMultiplier); 147 | background.a = (int)((float)defaultColors.background.a * alphaMultiplier); 148 | optionText.a = (int)((float)defaultColors.optionText.a * alphaMultiplier); 149 | scroller.a = (int)((float)defaultColors.scroller.a * alphaMultiplier); 150 | selectedOptionText.a = (int)((float)defaultColors.selectedOptionText.a * alphaMultiplier); 151 | footerRect.a = (int)((float)defaultColors.footerRect.a * alphaMultiplier); 152 | footerText.a = (int)((float)defaultColors.footerText.a * alphaMultiplier); 153 | descriptionLine.a = (int)((float)defaultColors.descriptionLine.a * alphaMultiplier); 154 | descriptionRect.a = (int)((float)defaultColors.descriptionRect.a * alphaMultiplier); 155 | descriptionText.a = (int)((float)defaultColors.descriptionText.a * alphaMultiplier); 156 | sprites.a = (int)((float)defaultColors.sprites.a * alphaMultiplier); 157 | } 158 | }; 159 | 160 | struct MENU_STRUCT 161 | { 162 | MENU_BINDS menuBinds; // Binds for keyboard 163 | MENU_COLORS menuColors; 164 | MENU_CONTROLLER_BINDS menuControllerBinds; // Binds for controller 165 | }; 166 | 167 | struct Vector2 168 | { 169 | float x; 170 | float y; 171 | }; 172 | 173 | class Vec3 174 | { 175 | public: 176 | Vec3() : p_X(0.f), p_Y(0.f), p_Z(0.f) {} 177 | Vec3(float x, float y, float z) : p_X(x), p_Y(y), p_Z(z) {} 178 | Vec3(Vector3 coords) : p_X(coords.x), p_Y(coords.y), p_Z(coords.z) {} 179 | 180 | Vector3 Get() const 181 | { 182 | Vector3 vector = { 0.f, 0, 0.f, 0, 0.f, 0 }; 183 | vector.x = p_X; 184 | vector.y = p_Y; 185 | vector.z = p_Z; 186 | 187 | return vector; 188 | } 189 | 190 | const char* getGamezone() const 191 | { 192 | return ZONE::GET_NAME_OF_ZONE(this->p_X, this->p_Y, this->p_Z); 193 | } 194 | 195 | Vec3 operator + (Vec3 vector) 196 | { 197 | const auto newX = this->p_X + vector.p_X; 198 | const auto newY = this->p_Y + vector.p_Y; 199 | const auto newZ = this->p_Z + vector.p_Z; 200 | 201 | return Vec3(newX, newY, newZ); 202 | } 203 | 204 | Vec3 operator - (Vec3 vector) 205 | { 206 | const auto newX = this->p_X - vector.p_X; 207 | const auto newY = this->p_Y - vector.p_Y; 208 | const auto newZ = this->p_Z - vector.p_Z; 209 | 210 | return Vec3(newX, newY, newZ); 211 | } 212 | 213 | Vec3 operator * (Vec3 vector) 214 | { 215 | const auto newX = this->p_X * vector.p_X; 216 | const auto newY = this->p_Y * vector.p_Y; 217 | const auto newZ = this->p_Z * vector.p_Z; 218 | 219 | return Vec3(newX, newY, newZ); 220 | } 221 | 222 | Vec3 operator / (Vec3 vector) 223 | { 224 | const auto newX = this->p_X / vector.p_X; 225 | const auto newY = this->p_Y / vector.p_Y; 226 | const auto newZ = this->p_Z / vector.p_Z; 227 | 228 | return Vec3(newX, newY, newZ); 229 | } 230 | private: 231 | float p_X = 0.f; 232 | float p_Y = 0.f; 233 | float p_Z = 0.f; 234 | }; 235 | 236 | class Vec2 237 | { 238 | public: 239 | Vec2() : p_X(0.f), p_Y(0.f) {} 240 | Vec2(float x, float y) : p_X(x), p_Y(y) {} 241 | 242 | Vector2 Get() const 243 | { 244 | Vector2 newVector = { 0.f, 0.f }; 245 | newVector.x = p_X; 246 | newVector.y = p_Y; 247 | 248 | return newVector; 249 | } 250 | 251 | Vec2 operator + (Vec2 vector) 252 | { 253 | const auto newX = this->p_X + vector.p_X; 254 | const auto newY = this->p_Y + vector.p_Y; 255 | 256 | return Vec2(newX, newY); 257 | } 258 | 259 | Vec2 operator - (Vec2 vector) 260 | { 261 | const auto newX = this->p_X - vector.p_X; 262 | const auto newY = this->p_Y - vector.p_Y; 263 | 264 | return Vec2(newX, newY); 265 | } 266 | 267 | Vec2 operator * (Vec2 vector) 268 | { 269 | const auto newX = this->p_X * vector.p_X; 270 | const auto newY = this->p_Y * vector.p_Y; 271 | 272 | return Vec2(newX, newY); 273 | } 274 | 275 | Vec2 operator / (Vec2 vector) 276 | { 277 | const auto newX = this->p_X / vector.p_X; 278 | const auto newY = this->p_Y / vector.p_Y; 279 | 280 | return Vec2(newX, newY); 281 | } 282 | private: 283 | float p_X = 0.f; 284 | float p_Y = 0.f; 285 | }; 286 | }; -------------------------------------------------------------------------------- /src/submenuOption.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include "option.hpp" 11 | 12 | namespace Source { 13 | namespace Options 14 | { 15 | class SubmenuOption : public Option 16 | { 17 | public: 18 | /*I don't know if texts in game has any limitations, but description won't display big strings (I don't really know why)*/ 19 | SubmenuOption(std::string optionText, std::string newSubmenu, std::string optionDescription = "", std::function optionCallback = [] {}) 20 | : Option(std::move(optionText), "", std::move(optionDescription), std::move(optionCallback), 0, 0, 0, 0, 0, 0, 0, 0, nullptr, 0, std::move(newSubmenu)) 21 | { 22 | this->setOptionType("Submenu"); 23 | } 24 | }; 25 | } 26 | } -------------------------------------------------------------------------------- /src/timer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include 11 | #include 12 | #include 13 | #include "constVariables.hpp" 14 | 15 | namespace Source { 16 | class Timer 17 | { 18 | public: 19 | /* Do the reset after every use */ 20 | explicit Timer(std::chrono::milliseconds delay) 21 | { 22 | this->p_now = std::chrono::high_resolution_clock::now(); 23 | this->p_delay = delay; 24 | } 25 | 26 | void WaitThen(std::function callback) 27 | { 28 | std::chrono::steady_clock::time_point now = std::chrono::high_resolution_clock::now(); 29 | if ((now.time_since_epoch().count() - this->p_now.time_since_epoch().count()) >= this->p_delay.count()) 30 | { 31 | callback(); 32 | } 33 | } 34 | 35 | void Reset() 36 | { 37 | this->p_now = std::chrono::high_resolution_clock::now(); 38 | } 39 | private: 40 | std::chrono::steady_clock::time_point p_now; 41 | std::chrono::steady_clock::duration p_delay; 42 | }; 43 | } -------------------------------------------------------------------------------- /src/toggleOption.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include "option.hpp" 11 | 12 | namespace Source { 13 | namespace Options 14 | { 15 | class ToggleOption : public Option 16 | { 17 | public: 18 | /*I don't know if texts in game has any limitations, but description won't display big strings (I don't really know why)*/ 19 | ToggleOption(std::string optionText, bool* toogleValue, std::string optionDescription = "", std::function optionCallback = [] {}) 20 | : Option(std::move(optionText), "", std::move(optionDescription), std::move(optionCallback), 0, 0, 0, 0, 0, 0, 0, 0, std::move(toogleValue)) 21 | { 22 | this->setOptionType("Toggle"); 23 | } 24 | }; 25 | } 26 | } -------------------------------------------------------------------------------- /src/utils.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include 11 | #include 12 | #include "structs.hpp" 13 | 14 | static void EnableDebugConsole() 15 | { 16 | AllocConsole(); 17 | auto fp = freopen("CONOUT$", "w", stdout); 18 | } 19 | 20 | #ifndef NDEBUG 21 | #define DO_DEBUG(func) func() 22 | #define ENABLE_CONSOLE EnableDebugConsole() 23 | #define FREE_CONSOLE FreeConsole() 24 | #else 25 | #define DO_DEBUG(func) void() 26 | #define ENABLE_CONSOLE void() 27 | #define FREE_CONSOLE void() 28 | #endif 29 | 30 | namespace Utils 31 | { 32 | /* delayTime in miliseconds, default is 5000 (5s) */ 33 | inline void messageBottom(std::string message, std::uint32_t delayTime = 5000) 34 | { 35 | UI::BEGIN_TEXT_COMMAND_PRINT((char*)"STRING"); 36 | UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME((char*)message.c_str()); 37 | UI::END_TEXT_COMMAND_PRINT(delayTime, TRUE); 38 | } 39 | 40 | inline void messageMap(std::string message) 41 | { 42 | UI::BEGIN_TEXT_COMMAND_THEFEED_POST((char*)"STRING"); 43 | UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME((char*)message.c_str()); 44 | UI::_DRAW_NOTIFICATION_3(FALSE, FALSE); 45 | } 46 | 47 | template 48 | inline bool doesElementExistInVector(std::vector vector, Type valueToFind) 49 | { 50 | for (auto element : vector) 51 | { 52 | if (element == valueToFind) 53 | return true; 54 | else continue; 55 | } 56 | 57 | return false; 58 | } 59 | 60 | inline const Structs::Vec2 screenResolution() 61 | { 62 | int screenWidth, screenHeight; 63 | GRAPHICS::GET_SCREEN_RESOLUTION(&screenWidth, &screenHeight); 64 | 65 | return Structs::Vec2((float)screenWidth, (float)screenHeight); 66 | } 67 | 68 | inline const void drawRect(Structs::Vec2 rectCoords, Structs::Vec2 rectSize, Structs::RGBA rectColor) 69 | { 70 | const auto resolution = screenResolution(); 71 | 72 | GRAPHICS::DRAW_RECT( 73 | rectCoords.Get().x / resolution.Get().x, 74 | rectCoords.Get().y / resolution.Get().y, 75 | rectSize.Get().x / resolution.Get().x, 76 | rectSize.Get().y / resolution.Get().y, 77 | rectColor.r, rectColor.g, rectColor.b, rectColor.a 78 | ); 79 | } 80 | 81 | inline const void drawText(std::string text, Structs::Vec2 textPosition, float fontSize, Structs::RGBAF textFontColor, bool centre = false, bool rightAlign = false, bool outline = false, float textWrap = 1.5f) 82 | { 83 | const auto resolution = screenResolution(); 84 | 85 | const Structs::Vec2 newPosition( 86 | textPosition.Get().x / resolution.Get().x, 87 | textPosition.Get().y / resolution.Get().y 88 | ); 89 | 90 | UI::SET_TEXT_FONT(textFontColor.f); 91 | UI::SET_TEXT_SCALE(0.f, fontSize / 100); 92 | UI::SET_TEXT_COLOUR(textFontColor.r, textFontColor.g, textFontColor.b, textFontColor.a); 93 | outline ? UI::SET_TEXT_OUTLINE() : void(); 94 | UI::SET_TEXT_CENTRE(centre); 95 | UI::SET_TEXT_WRAP(0.f, newPosition.Get().x + textWrap); 96 | if (rightAlign) 97 | { 98 | UI::SET_TEXT_WRAP(0.f, newPosition.Get().x); 99 | UI::SET_TEXT_RIGHT_JUSTIFY(true); 100 | } 101 | UI::BEGIN_TEXT_COMMAND_DISPLAY_TEXT((char*)"STRING"); 102 | UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME((char*)std::string(text).c_str()); 103 | UI::END_TEXT_COMMAND_DISPLAY_TEXT(newPosition.Get().x, newPosition.Get().y); 104 | } 105 | 106 | inline const void drawSprite(const char* textureDict, const char* textureName, Structs::Vec2 spritePosition, Structs::Vec2 spriteSize, Structs::RGBA spriteColor, int rotation = 0) 107 | { 108 | const auto resolution = screenResolution(); 109 | 110 | const Structs::Vec2 newPosition( 111 | spritePosition.Get().x / resolution.Get().x, 112 | spritePosition.Get().y / resolution.Get().y 113 | ); 114 | 115 | const Structs::Vec2 newSize( 116 | spriteSize.Get().x / resolution.Get().x, 117 | spriteSize.Get().y / resolution.Get().y 118 | ); 119 | 120 | if (GRAPHICS::HAS_STREAMED_TEXTURE_DICT_LOADED((char*)textureDict)) 121 | { 122 | GRAPHICS::DRAW_SPRITE((char*)textureDict, (char*)textureName, 123 | newPosition.Get().x, newPosition.Get().y, 124 | newSize.Get().x, newSize.Get().y, 125 | (float)rotation, 126 | spriteColor.r, spriteColor.g, spriteColor.b, spriteColor.a); 127 | } 128 | else GRAPHICS::REQUEST_STREAMED_TEXTURE_DICT((char*)textureDict, FALSE); 129 | } 130 | } -------------------------------------------------------------------------------- /src/vectorOption.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Last Update Date: 2021-07-28 3 | Trainer Base Created by: Xxsource98 4 | Github Link: https://github.com/Xxsource98/SourceBase 5 | Project License: GNU General Public License v3.0 6 | Base Version: 1.1 7 | */ 8 | 9 | #pragma once 10 | #include "option.hpp" 11 | 12 | namespace Source { 13 | namespace Options 14 | { 15 | class VectorOption : public Option 16 | { 17 | public: 18 | /* Supporting: std::vector */ 19 | /*I don't know if texts in game has any limitations, but description won't display big strings (I don't really know why)*/ 20 | VectorOption(std::string optionText, std::vector* optionVector, int* optionInteger, std::string optionDescription = "", std::function optionCallback = [] {}) 21 | : Option(std::move(optionText), "", std::move(optionDescription), std::move(optionCallback), std::move(optionInteger), 0, std::move((int)optionVector->size() - 1), 1, nullptr, 0.f, 0.f, 0.f, nullptr, std::move(optionVector)) 22 | { 23 | this->setOptionType("Vector"); 24 | this->setSliderType(Enums::SLIDER_TYPE::INT); 25 | } 26 | }; 27 | } 28 | } --------------------------------------------------------------------------------