New Improvements & Bug Fixes

+ Added new Wheel-Damage script which causes wheels to fly off if the car is hit hard.
+ Added newer version of the police siren LVC menu.
+ Changed a bunch of keybinds in order to facilitate FivePD.
+ Readded the accidentally removed emote menu and removed NoDriveBy.
+ Updated the server theme alittle away from just RP.
+ Updated to server artifacts version to 6372
This commit is contained in:
Jacob
2023-04-02 20:38:32 +01:00
parent ec2eef4ed2
commit 775709ddef
224 changed files with 12037 additions and 20 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+5 -2
View File
@@ -292,7 +292,10 @@ Citizen.CreateThread(function()
drawTimeText = ""
end
Citizen.Wait(1)
local player = GetPlayerPed(-1)
DrawTextAOP(AOPxNew, AOPyNew, 1.0,1.0,0.45, drawTimeText, 255, 255, 255, 255)
DrawTextAOP(AOPxNew, AOPyNew2, 1.0,1.0,0.45, "~r~Discord: ~w~elite-gaming.gg" , 255, 255, 255, 255)
--[[local player = GetPlayerPed(-1)
local veh = GetVehiclePedIsIn(player)
local mph = math.ceil(GetEntitySpeed(veh) * 2.23)
@@ -321,7 +324,7 @@ Citizen.CreateThread(function()
DrawTextAOP(AOPxNew, AOPyNew, 1.0,1.0,0.45, drawTimeText, 255, 255, 255, 255)
DrawTextAOP(AOPxNew, AOPyNew2, 1.0,1.0,0.45, "~w~Current " .. featColor .. "AOP: ~w~" .. FaxCurAOP .. featColor , 255, 255, 255, 255)
end
end
end]]--
end
end)
+1 -1
View File
@@ -9,7 +9,7 @@
<link rel="stylesheet" type="text/css" href="assets/css/custom.css">
</head>
<body>
<audio id="loading" autoplay loop ><source src="https://elite-gaming.gg/assets/magic-beatsaber.mp3" type="audio/mp3"></audio>
<audio id="loading" autoplay loop ><source src="https://elite-gaming.gg/assets/Magic-BeatSaber.mp3" type="audio/mp3"></audio>
<div id="main">
<div id="page-loader">
<div class="spinner-container">
+1 -1
View File
@@ -1,6 +1,6 @@
-- Configuration
local button = 56 -- 167 (F6 by default) Set to F9
local button = 9999 -- 167 (F6 by default) Removed
local commandEnabled = true -- (false by default) If you set this to true, typing "/engine" in chat will also toggle your engine.
-- You're all set now!
+694
View File
@@ -0,0 +1,694 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0052)https://www.gnu.org/licenses/gpl-3.0-standalone.html -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GNU General Public License v3.0 - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml" href="http://www.gnu.org/licenses/gpl-3.0.rdf">
</head>
<body>
<h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 29 June 2007</p>
<p>Copyright © 2007 Free Software Foundation, Inc.
&lt;<a href="https://fsf.org/">https://fsf.org/</a>&gt;</p><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.</p>
<h4 id="preamble">Preamble</h4>
<p>The GNU General Public License is a free, copyleft license for
software and other kinds of works.</p>
<p>The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.</p>
<p>When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.</p>
<p>To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.</p>
<p>For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.</p>
<p>Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.</p>
<p>For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.</p>
<p>Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.</p>
<p>Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.</p>
<p>The precise terms and conditions for copying, distribution and
modification follow.</p>
<h4 id="terms">TERMS AND CONDITIONS</h4>
<h5 id="section0">0. Definitions.</h5>
<p>“This License” refers to version 3 of the GNU General Public License.</p>
<p>“Copyright” also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.</p>
<p>“The Program” refers to any copyrightable work licensed under this
License. Each licensee is addressed as “you”. “Licensees” and
“recipients” may be individuals or organizations.</p>
<p>To “modify” a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a “modified version” of the
earlier work or a work “based on” the earlier work.</p>
<p>A “covered work” means either the unmodified Program or a work based
on the Program.</p>
<p>To “propagate” a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.</p>
<p>To “convey” a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.</p>
<p>An interactive user interface displays “Appropriate Legal Notices”
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.</p>
<h5 id="section1">1. Source Code.</h5>
<p>The “source code” for a work means the preferred form of the work
for making modifications to it. “Object code” means any non-source
form of a work.</p>
<p>A “Standard Interface” means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.</p>
<p>The “System Libraries” of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
“Major Component”, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.</p>
<p>The “Corresponding Source” for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.</p>
<p>The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.</p>
<p>The Corresponding Source for a work in source code form is that
same work.</p>
<h5 id="section2">2. Basic Permissions.</h5>
<p>All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.</p>
<p>You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.</p>
<p>Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.</p>
<h5 id="section3">3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h5>
<p>No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.</p>
<p>When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.</p>
<h5 id="section4">4. Conveying Verbatim Copies.</h5>
<p>You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.</p>
<p>You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.</p>
<h5 id="section5">5. Conveying Modified Source Versions.</h5>
<p>You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:</p>
<ul>
<li>a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.</li>
<li>b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
“keep intact all notices”.</li>
<li>c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.</li>
<li>d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.</li>
</ul>
<p>A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
“aggregate” if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.</p>
<h5 id="section6">6. Conveying Non-Source Forms.</h5>
<p>You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:</p>
<ul>
<li>a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.</li>
<li>b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.</li>
<li>c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.</li>
<li>d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.</li>
<li>e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.</li>
</ul>
<p>A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.</p>
<p>A “User Product” is either (1) a “consumer product”, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, “normally used” refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.</p>
<p>“Installation Information” for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.</p>
<p>If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).</p>
<p>The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.</p>
<p>Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.</p>
<h5 id="section7">7. Additional Terms.</h5>
<p>“Additional permissions” are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.</p>
<p>When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.</p>
<p>Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:</p>
<ul>
<li>a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or</li>
<li>b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or</li>
<li>c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or</li>
<li>d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or</li>
<li>e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or</li>
<li>f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.</li>
</ul>
<p>All other non-permissive additional terms are considered “further
restrictions” within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.</p>
<p>If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.</p>
<p>Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.</p>
<h5 id="section8">8. Termination.</h5>
<p>You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).</p>
<p>However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.</p>
<p>Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.</p>
<p>Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.</p>
<h5 id="section9">9. Acceptance Not Required for Having Copies.</h5>
<p>You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.</p>
<h5 id="section10">10. Automatic Licensing of Downstream Recipients.</h5>
<p>Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.</p>
<p>An “entity transaction” is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.</p>
<p>You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.</p>
<h5 id="section11">11. Patents.</h5>
<p>A “contributor” is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's “contributor version”.</p>
<p>A contributor's “essential patent claims” are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, “control” includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.</p>
<p>Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.</p>
<p>In the following three paragraphs, a “patent license” is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To “grant” such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.</p>
<p>If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. “Knowingly relying” means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.</p>
<p>If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.</p>
<p>A patent license is “discriminatory” if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.</p>
<p>Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.</p>
<h5 id="section12">12. No Surrender of Others' Freedom.</h5>
<p>If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.</p>
<h5 id="section13">13. Use with the GNU Affero General Public License.</h5>
<p>Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.</p>
<h5 id="section14">14. Revised Versions of this License.</h5>
<p>The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.</p>
<p>Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License “or any later version” applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.</p>
<p>If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.</p>
<p>Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.</p>
<h5 id="section15">15. Disclaimer of Warranty.</h5>
<p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
<h5 id="section16">16. Limitation of Liability.</h5>
<p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.</p>
<h5 id="section17">17. Interpretation of Sections 15 and 16.</h5>
<p>If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.</p>
<p>END OF TERMS AND CONDITIONS</p>
<h4 id="howto">How to Apply These Terms to Your New Programs</h4>
<p>If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.</p>
<p>To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the “copyright” line and a pointer to where the full notice is found.</p>
<pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.
</pre>
<p>Also add information on how to contact you by electronic and paper mail.</p>
<p>If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:</p>
<pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</pre>
<p>The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an “about box”.</p>
<p>You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
&lt;<a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>&gt;.</p>
<p>The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
&lt;<a href="https://www.gnu.org/licenses/why-not-lgpl.html">https://www.gnu.org/licenses/why-not-lgpl.html</a>&gt;.</p>
</body></html>
+98
View File
@@ -0,0 +1,98 @@
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Dylan Malandain.
--- DateTime: 29/10/2019 02:40
---
---@class RageUI
RageUI = {}
---@class Item
RageUI.Item = {}
---@class Panel
RageUI.Panel = {}
---@class Window
RageUI.Window = {}
---@class RMenu
RMenu = setmetatable({}, RMenu)
---@type table
local TotalMenus = {}
---Add
---@param Type string
---@param Name string
---@param Menu table
---@return RMenu
---@public
function RMenu.Add(Type, Name, Menu)
if RMenu[Type] ~= nil then
RMenu[Type][Name] = {
Menu = Menu
}
else
RMenu[Type] = {}
RMenu[Type][Name] = {
Menu = Menu
}
end
return table.insert(TotalMenus, Menu)
end
---Get
---@param Type string
---@param Name string
---@return table
---@public
function RMenu:Get(Type, Name)
if self[Type] ~= nil and self[Type][Name] ~= nil then
return self[Type][Name].Menu
end
end
---GetType
---@param Type string
---@return table
---@public
function RMenu:GetType(Type)
if self[Type] ~= nil then
return self[Type]
end
end
---Settings
---@param Type string
---@param Name string
---@param Settings string
---@param Value any optional
---@return void
---@public
function RMenu:Settings(Type, Name, Settings, Value)
if Value ~= nil then
self[Type][Name][Settings] = Value
else
return self[Type][Name][Settings]
end
end
---Delete
---@param Type string
---@param Name string
---@return void
---@public
function RMenu:Delete(Type, Name)
self[Type][Name] = nil
collectgarbage()
end
---DeleteType
---@param Type string
---@return void
---@public
function RMenu:DeleteType(Type)
self[Type] = nil
collectgarbage()
end
+35
View File
@@ -0,0 +1,35 @@
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Dylan Malandain.
--- DateTime: 24/07/2019 03:38
---
---PlaySound
---
--- Reference : N/A
---
---@param Library string
---@param Sound string
---@param IsLooped boolean
---@return nil
---@public
function RageUI.PlaySound(Library, Sound, IsLooped)
local audioId
if not IsLooped then
PlaySoundFrontend(-1, Sound, Library, true)
else
if not audioId then
Citizen.CreateThread(function()
audioId = GetSoundId()
PlaySoundFrontend(audioId, Sound, Library, true)
Citizen.Wait(0.01)
StopSound(audioId)
ReleaseSoundId(audioId)
audioId = nil
end)
end
end
end
+30
View File
@@ -0,0 +1,30 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@class Enum
local enums = {
__index = function(table, key)
if rawget(table.enums, key) then
return key
end
end
}
---Enum
---@param t table
---@return Enum
function RageUI.Enum(t)
local e = { enums = t }
return setmetatable(e, enums)
end
+44
View File
@@ -0,0 +1,44 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@class Keys
Keys = {};
---Register
---@param Controls string
---@param ControlName string
---@param Description string
---@param Action function
---@return Keys
---@public
function Keys.Register(Controls, ControlName, Description, Action)
local _Keys = {
CONTROLS = Controls
}
RegisterKeyMapping(string.format('rageui-%s', ControlName), Description, "keyboard", Controls)
RegisterCommand(string.format('rageui-%s', ControlName), function(source, args)
if (Action ~= nil) then
Action();
end
end, false)
return setmetatable(_Keys, Keys)
end
---Exists
---@param Controls string
---@return boolean
function Keys:Exists(Controls)
return self.CONTROLS == Controls and true or false
end
+18
View File
@@ -0,0 +1,18 @@
---RenderRectangle
---
--- Reference : https://github.com/iTexZoz/NativeUILua_Reloaded/blob/master/UIElements/UIResRectangle.lua#L84
---
---@param X number
---@param Y number
---@param Width number
---@param Height number
---@param R number
---@param G number
---@param B number
---@param A number
---@return nil
---@public
function RenderRectangle(X, Y, Width, Height, R, G, B, A)
local X, Y, Width, Height = (tonumber(X) or 0) / 1920, (tonumber(Y) or 0) / 1080, (tonumber(Width) or 0) / 1920, (tonumber(Height) or 0) / 1080
DrawRect(X + Width * 0.5, Y + Height * 0.5, Width, Height, tonumber(R) or 255, tonumber(G) or 255, tonumber(B) or 255, tonumber(A) or 255)
end
+27
View File
@@ -0,0 +1,27 @@
---RenderSprite
---
--- Reference : https://github.com/iTexZoz/NativeUILua_Reloaded/blob/master/UIElements/Sprite.lua#L90
---
---@param TextureDictionary string
---@param TextureName string
---@param X number
---@param Y number
---@param Width number
---@param Height number
---@param Heading number
---@param R number
---@param G number
---@param B number
---@param A number
---@return nil
---@public
function RenderSprite(TextureDictionary, TextureName, X, Y, Width, Height, Heading, R, G, B, A)
---@type number
local X, Y, Width, Height = (tonumber(X) or 0) / 1920, (tonumber(Y) or 0) / 1080, (tonumber(Width) or 0) / 1920, (tonumber(Height) or 0) / 1080
if not HasStreamedTextureDictLoaded(TextureDictionary) then
RequestStreamedTextureDict(TextureDictionary, true)
end
DrawSprite(TextureDictionary, TextureName, X + Width * 0.5, Y + Height * 0.5, Width, Height, Heading or 0, tonumber(R) or 255, tonumber(G) or 255, tonumber(B) or 255, tonumber(A) or 255)
end
+155
View File
@@ -0,0 +1,155 @@
---StringToArray
---
--- Reference : Frazzle <3
---
---@param str string
function StringToArray(str)
local charCount = #str
local strCount = math.ceil(charCount / 99)
local strings = {}
for i = 1, strCount do
local start = (i - 1) * 99 + 1
local clamp = math.clamp(#string.sub(str, start), 0, 99)
local finish = ((i ~= 1) and (start - 1) or 0) + clamp
strings[i] = string.sub(str, start, finish)
end
return strings
end
---AddText
---
--- Reference : Frazzle <3
---
---@param str string
function AddText(str)
local str = tostring(str)
local charCount = #str
if charCount < 100 then
AddTextComponentSubstringPlayerName(str)
else
local strings = StringToArray(str)
for s = 1, #strings do
AddTextComponentSubstringPlayerName(strings[s])
end
end
end
---GetLineCount
---
--- Reference : Frazzle <3
---
---@param Text string
---@param X number
---@param Y number
---@param Font number
---@param Scale number
---@param R number
---@param G number
---@param B number
---@param A number
---@param Alignment string
---@param DropShadow boolean
---@param Outline boolean
---@param WordWrap number
---@return function
---@public
function GetLineCount(Text, X, Y, Font, Scale, R, G, B, A, Alignment, DropShadow, Outline, WordWrap)
---@type table
local Text, X, Y = tostring(Text), (tonumber(X) or 0) / 1920, (tonumber(Y) or 0) / 1080
SetTextFont(Font or 0)
SetTextScale(1.0, Scale or 0)
SetTextColour(tonumber(R) or 255, tonumber(G) or 255, tonumber(B) or 255, tonumber(A) or 255)
if DropShadow then
SetTextDropShadow()
end
if Outline then
SetTextOutline()
end
if Alignment ~= nil then
if Alignment == 1 or Alignment == "Center" or Alignment == "Centre" then
SetTextCentre(true)
elseif Alignment == 2 or Alignment == "Right" then
SetTextRightJustify(true)
end
end
if tonumber(WordWrap) and tonumber(WordWrap) ~= 0 then
if Alignment == 1 or Alignment == "Center" or Alignment == "Centre" then
SetTextWrap(X - ((WordWrap / 1920) / 2), X + ((WordWrap / 1920) / 2))
elseif Alignment == 2 or Alignment == "Right" then
SetTextWrap(0, X)
else
SetTextWrap(X, X + (WordWrap / 1920))
end
else
if Alignment == 2 or Alignment == "Right" then
SetTextWrap(0, X)
end
end
BeginTextCommandLineCount("CELL_EMAIL_BCON")
AddText(Text)
return GetTextScreenLineCount(X, Y)
end
---RenderText
---
--- Reference : https://github.com/iTexZoz/NativeUILua_Reloaded/blob/master/UIElements/UIResText.lua#L189
---
---@param Text string
---@param X number
---@param Y number
---@param Font number
---@param Scale number
---@param R number
---@param G number
---@param B number
---@param A number
---@param Alignment string
---@param DropShadow boolean
---@param Outline boolean
---@param WordWrap number
---@return nil
---@public
function RenderText(Text, X, Y, Font, Scale, R, G, B, A, Alignment, DropShadow, Outline, WordWrap)
---@type table
local Text, X, Y = tostring(Text), (tonumber(X) or 0) / 1920, (tonumber(Y) or 0) / 1080
SetTextFont(Font or 0)
SetTextScale(1.0, Scale or 0)
SetTextColour(tonumber(R) or 255, tonumber(G) or 255, tonumber(B) or 255, tonumber(A) or 255)
if DropShadow then
SetTextDropShadow()
end
if Outline then
SetTextOutline()
end
if Alignment ~= nil then
if Alignment == 1 or Alignment == "Center" or Alignment == "Centre" then
SetTextCentre(true)
elseif Alignment == 2 or Alignment == "Right" then
SetTextRightJustify(true)
end
end
if tonumber(WordWrap) and tonumber(WordWrap) ~= 0 then
if Alignment == 1 or Alignment == "Center" or Alignment == "Centre" then
SetTextWrap(X - ((WordWrap / 1920) / 2), X + ((WordWrap / 1920) / 2))
elseif Alignment == 2 or Alignment == "Right" then
SetTextWrap(0, X)
else
SetTextWrap(X, X + (WordWrap / 1920))
end
else
if Alignment == 2 or Alignment == "Right" then
SetTextWrap(0, X)
end
end
BeginTextCommandDisplayText("CELL_EMAIL_BCON")
AddText(Text)
EndTextCommandDisplayText(X, Y)
end
+64
View File
@@ -0,0 +1,64 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@class Visual
Visual = Visual or {};
local function AddLongString(txt)
for i = 100, string.len(txt), 99 do
local sub = string.sub(txt, i, i + 99)
AddTextComponentSubstringPlayerName(sub)
end
end
function Visual.Popup()
end
function Visual.Radar()
end
function Visual.Subtitle(text, time)
ClearPrints()
BeginTextCommandPrint("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandPrint(time and math.ceil(time) or 0, true)
end
function Visual.FloatingHelpText(text, sound, loop)
BeginTextCommandDisplayHelp("jamyfafi")
AddTextComponentSubstringPlayerName(text)
if string.len(text) > 99 then
AddLongString(text)
end
EndTextCommandDisplayHelp(0, loop or 0, sound or true, -1)
end
function Visual.Prompt(text, spinner)
BeginTextCommandBusyspinnerOn("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandBusyspinnerOn(spinner or 1)
end
function Visual.PromptDuration(duration, text, spinner)
Citizen.CreateThread(function()
Citizen.Wait(0)
Visual.Prompt(text, spinner)
Citizen.Wait(duration)
if (BusyspinnerIsOn()) then
BusyspinnerOff();
end
end)
end
+20
View File
@@ -0,0 +1,20 @@
fx_version 'adamant'
games { 'gta5' };
name 'RageUI';
description 'RageUI, and a project specially created to replace the NativeUILua-Reloaded library. This library allows to create menus similar to the one of Grand Theft Auto online.'
client_scripts {
"RMenu.lua",
"menu/RageUI.lua",
"menu/Menu.lua",
"menu/MenuController.lua",
"components/*.lua",
"menu/elements/*.lua",
"menu/items/*.lua",
"menu/panels/*.lua",
"menu/windows/*.lua",
}
+385
View File
@@ -0,0 +1,385 @@
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Dylan Malandain.
--- DateTime: 21/04/2019 21:20
---
---CreateMenu
---@param Title string
---@param Subtitle string
---@param X number
---@param Y number
---@param TextureDictionary string
---@param TextureName string
---@param R number
---@param G number
---@param B number
---@param A number
---@return RageUIMenus
---@public
function RageUI.CreateMenu(Title, Subtitle, X, Y, TextureDictionary, TextureName, R, G, B, A)
---@type table
local Menu = {}
Menu.Display = {};
Menu.InstructionalButtons = {}
Menu.Display.Header = true;
Menu.Display.Glare = true;
Menu.Display.Subtitle = true;
Menu.Display.Background = true;
Menu.Display.Navigation = true;
Menu.Display.InstructionalButton = true;
Menu.Title = Title or ""
Menu.TitleFont = 6
Menu.TitleScale = 1.0
Menu.Subtitle = string.upper(Subtitle) or nil
Menu.SubtitleHeight = -37
Menu.Description = nil
Menu.DescriptionHeight = RageUI.Settings.Items.Description.Background.Height
Menu.X = X or 0
Menu.Y = Y or 0
Menu.Parent = nil
Menu.WidthOffset = RageUI.UI.Style[RageUI.UI.Current].Width
Menu.Open = false
Menu.Controls = RageUI.Settings.Controls
Menu.Index = 1
Menu.Sprite = { Dictionary = TextureDictionary or "commonmenu", Texture = TextureName or "interaction_bgd", Color = { R = R, G = G, B = B, A = A } }
Menu.Rectangle = nil
Menu.Pagination = { Minimum = 1, Maximum = 10, Total = 10 }
Menu.Safezone = true
Menu.SafeZoneSize = nil
Menu.EnableMouse = false
Menu.Options = 0
Menu.Closable = true
Menu.InstructionalScaleform = RequestScaleformMovie("INSTRUCTIONAL_BUTTONS")
Menu.CursorStyle = 1
if string.starts(Menu.Subtitle, "~") then
Menu.PageCounterColour = string.sub(Menu.Subtitle, 1, 3)
else
Menu.PageCounterColour = ""
end
if Menu.Subtitle ~= "" then
local SubtitleLineCount = GetLineCount(Menu.Subtitle, Menu.X + RageUI.Settings.Items.Subtitle.Text.X, Menu.Y + RageUI.Settings.Items.Subtitle.Text.Y, 0, RageUI.Settings.Items.Subtitle.Text.Scale, 245, 245, 245, 255, nil, false, false, RageUI.Settings.Items.Subtitle.Background.Width + Menu.WidthOffset)
if SubtitleLineCount > 1 then
Menu.SubtitleHeight = 18 * SubtitleLineCount
else
Menu.SubtitleHeight = 0
end
end
Citizen.CreateThread(function()
if not HasScaleformMovieLoaded(Menu.InstructionalScaleform) then
Menu.InstructionalScaleform = RequestScaleformMovie("INSTRUCTIONAL_BUTTONS")
while not HasScaleformMovieLoaded(Menu.InstructionalScaleform) do
Citizen.Wait(0)
end
end
end)
Citizen.CreateThread(function()
local ScaleformMovie = RequestScaleformMovie("MP_MENU_GLARE")
while not HasScaleformMovieLoaded(ScaleformMovie) do
Citizen.Wait(0)
end
end)
return setmetatable(Menu, RageUI.Menus)
end
---CreateSubMenu
---@param ParentMenu function
---@param Title string
---@param Subtitle string
---@param X number
---@param Y number
---@param TextureDictionary string
---@param TextureName string
---@param R number
---@param G number
---@param B number
---@param A number
---@return RageUIMenus
---@public
function RageUI.CreateSubMenu(ParentMenu, Title, Subtitle, X, Y, TextureDictionary, TextureName, R, G, B, A)
if ParentMenu ~= nil then
if ParentMenu() then
local Menu = RageUI.CreateMenu(Title or ParentMenu.Title, string.upper(Subtitle) or string.upper(ParentMenu.Subtitle), X or ParentMenu.X, Y or ParentMenu.Y)
Menu.Parent = ParentMenu
Menu.WidthOffset = ParentMenu.WidthOffset
Menu.Safezone = ParentMenu.Safezone
if ParentMenu.Sprite then
Menu.Sprite = { Dictionary = TextureDictionary or ParentMenu.Sprite.Dictionary, Texture = TextureName or ParentMenu.Sprite.Texture, Color = { R = R or ParentMenu.Sprite.Color.R, G = G or ParentMenu.Sprite.Color.G, B = B or ParentMenu.Sprite.Color.B, A = A or ParentMenu.Sprite.Color.A } }
else
Menu.Rectangle = ParentMenu.Rectangle
end
return setmetatable(Menu, RageUI.Menus)
else
return nil
end
else
return nil
end
end
function RageUI.Menus:DisplayHeader(boolean)
self.Display.Header = boolean;
return self.Display.Header;
end
function RageUI.Menus:DisplayGlare(boolean)
self.Display.Glare = boolean;
return self.Display.Glare;
end
function RageUI.Menus:DisplaySubtitle(boolean)
self.Display.Subtitle = boolean;
return self.Display.Subtitle;
end
function RageUI.Menus:DisplayNavigation(boolean)
self.Display.Navigation = boolean;
return self.Display.Navigation;
end
function RageUI.Menus:DisplayInstructionalButton(boolean)
self.Display.InstructionalButton = boolean;
return self.Display.InstructionalButton;
end
---SetTitle
---@param Title string
---@return nil
---@public
function RageUI.Menus:SetTitle(Title)
self.Title = Title
end
function RageUI.Menus:SetStyleSize(Value)
local witdh
if Value >= 0 and Value <= 100 then
witdh = Value
else
witdh = 100
end
self.WidthOffset = witdh
end
---GetStyleSize
---@return any
---@public
function RageUI.Menus:GetStyleSize()
if (self.WidthOffset == 100) then
return "RageUI"
elseif (self.WidthOffset == 0) then
return "NativeUI";
else
return self.WidthOffset;
end
end
---SetStyleSize
---@param Int string
---@return void
---@public
function RageUI.Menus:SetCursorStyle(Int)
self.CursorStyle = Int or 1 or 0
SetMouseCursorSprite(Int)
end
---ResetCursorStyle
---@return void
---@public
function RageUI.Menus:ResetCursorStyle()
self.CursorStyle = 1
SetMouseCursorSprite(1)
end
---UpdateCursorStyle
---@return void
---@public
function RageUI.Menus:UpdateCursorStyle()
SetMouseCursorSprite(self.CursorStyle)
end
---RefreshIndex
---@return void
---@public
function RageUI.Menus:RefreshIndex()
self.Index = 1
end
---SetSubtitle
---@param Subtitle string
---@return nil
---@public
function RageUI.Menus:SetSubtitle(Subtitle)
self.Subtitle = string.upper(Subtitle) or string.upper(self.Subtitle)
if string.starts(self.Subtitle, "~") then
self.PageCounterColour = string.sub(self.Subtitle, 1, 3)
else
self.PageCounterColour = ""
end
if self.Subtitle ~= "" then
local SubtitleLineCount = GetLineCount(self.Subtitle, self.X + RageUI.Settings.Items.Subtitle.Text.X, self.Y + RageUI.Settings.Items.Subtitle.Text.Y, 0, RageUI.Settings.Items.Subtitle.Text.Scale, 245, 245, 245, 255, nil, false, false, RageUI.Settings.Items.Subtitle.Background.Width + self.WidthOffset)
if SubtitleLineCount > 1 then
self.SubtitleHeight = 18 * SubtitleLineCount
else
self.SubtitleHeight = 0
end
else
self.SubtitleHeight = -37
end
end
---PageCounter
---@param Subtitle string
---@return nil
---@public
function RageUI.Menus:SetPageCounter(Subtitle)
self.PageCounter = Subtitle
end
---EditSpriteColor
---@param Colors table
---@return nil
---@public
function RageUI.Menus:EditSpriteColor(color)
if self.Sprite.Dictionary == "commonmenu" then
self.Sprite.Color = color
end
end
---SetPosition
---@param X number
---@param Y number
---@return nil
---@public
function RageUI.Menus:SetPosition(X, Y)
self.X = tonumber(X) or self.X
self.Y = tonumber(Y) or self.Y
end
---SetTotalItemsPerPage
---@param Value number
---@return nil
---@public
function RageUI.Menus:SetTotalItemsPerPage(Value)
self.Pagination.Total = tonumber(Value) or self.Pagination.Total
end
---SetRectangleBanner
---@param R number
---@param G number
---@param B number
---@param A number
---@return nil
---@public
function RageUI.Menus:SetRectangleBanner(R, G, B, A)
self.Rectangle = { R = tonumber(R) or 255, G = tonumber(G) or 255, B = tonumber(B) or 255, A = tonumber(A) or 255 }
self.Sprite = nil
end
---SetSpriteBanner
---@param TextureDictionary string
---@param Texture string
---@return nil
---@public
function RageUI.Menus:SetSpriteBanner(TextureDictionary, Texture)
self.Sprite = { Dictionary = TextureDictionary or "commonmenu", Texture = Texture or "interaction_bgd" }
self.Rectangle = nil
end
function RageUI.Menus:Closable(boolean)
if type(boolean) == "boolean" then
self.Closable = boolean
else
error("Type is not boolean")
end
end
function RageUI.Menus:AddInstructionButton(button)
if type(button) == "table" and #button == 2 then
table.insert(self.InstructionalButtons, button)
self.UpdateInstructionalButtons(true);
end
end
function RageUI.Menus:RemoveInstructionButton(button)
if type(button) == "table" then
for i = 1, #self.InstructionalButtons do
if button == self.InstructionalButtons[i] then
table.remove(self.InstructionalButtons, i)
self.UpdateInstructionalButtons(true);
break
end
end
else
if tonumber(button) then
if self.InstructionalButtons[tonumber(button)] then
table.remove(self.InstructionalButtons, tonumber(button))
self.UpdateInstructionalButtons(true);
end
end
end
end
function RageUI.Menus:UpdateInstructionalButtons(Visible)
if not Visible then
return
end
BeginScaleformMovieMethod(self.InstructionalScaleform, "CLEAR_ALL")
EndScaleformMovieMethod()
BeginScaleformMovieMethod(self.InstructionalScaleform, "TOGGLE_MOUSE_BUTTONS")
ScaleformMovieMethodAddParamInt(0)
EndScaleformMovieMethod()
BeginScaleformMovieMethod(self.InstructionalScaleform, "CREATE_CONTAINER")
EndScaleformMovieMethod()
BeginScaleformMovieMethod(self.InstructionalScaleform, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(0)
PushScaleformMovieMethodParameterButtonName(GetControlInstructionalButton(2, 176, 0))
PushScaleformMovieMethodParameterString(GetLabelText("HUD_INPUT2"))
EndScaleformMovieMethod()
if self.Closable then
BeginScaleformMovieMethod(self.InstructionalScaleform, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(1)
PushScaleformMovieMethodParameterButtonName(GetControlInstructionalButton(2, 177, 0))
PushScaleformMovieMethodParameterString(GetLabelText("HUD_INPUT3"))
EndScaleformMovieMethod()
end
local count = 2
if (self.InstructionalButtons ~= nil) then
for i = 1, #self.InstructionalButtons do
if self.InstructionalButtons[i] then
if #self.InstructionalButtons[i] == 2 then
BeginScaleformMovieMethod(self.InstructionalScaleform, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(count)
PushScaleformMovieMethodParameterButtonName(self.InstructionalButtons[i][1])
PushScaleformMovieMethodParameterString(self.InstructionalButtons[i][2])
EndScaleformMovieMethod()
count = count + 1
end
end
end
end
BeginScaleformMovieMethod(self.InstructionalScaleform, "DRAW_INSTRUCTIONAL_BUTTONS")
ScaleformMovieMethodAddParamInt(-1)
EndScaleformMovieMethod()
end
+350
View File
@@ -0,0 +1,350 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
RageUI.LastControl = false
local ControlActions = {
'Left',
'Right',
'Select',
'Click',
}
---GoUp
---@param Options number
---@return nil
---@public
function RageUI.GoUp(Options)
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
Options = CurrentMenu.Options
if CurrentMenu() then
if (Options ~= 0) then
if Options > CurrentMenu.Pagination.Total then
if CurrentMenu.Index <= CurrentMenu.Pagination.Minimum then
if CurrentMenu.Index == 1 then
CurrentMenu.Pagination.Minimum = Options - (CurrentMenu.Pagination.Total - 1)
CurrentMenu.Pagination.Maximum = Options
CurrentMenu.Index = Options
else
CurrentMenu.Pagination.Minimum = (CurrentMenu.Pagination.Minimum - 1)
CurrentMenu.Pagination.Maximum = (CurrentMenu.Pagination.Maximum - 1)
CurrentMenu.Index = CurrentMenu.Index - 1
end
else
CurrentMenu.Index = CurrentMenu.Index - 1
end
else
if CurrentMenu.Index == 1 then
CurrentMenu.Pagination.Minimum = Options - (CurrentMenu.Pagination.Total - 1)
CurrentMenu.Pagination.Maximum = Options
CurrentMenu.Index = Options
else
CurrentMenu.Index = CurrentMenu.Index - 1
end
end
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].UpDown.audioName, Audio[Audio.Use].UpDown.audioRef)
RageUI.LastControl = true
if (CurrentMenu.onIndexChange ~= nil) then
Citizen.CreateThread(function()
CurrentMenu.onIndexChange(CurrentMenu.Index)
end)
end
else
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Error.audioName, Audio[Audio.Use].Error.audioRef)
end
end
end
end
---GoDown
---@param Options number
---@return nil
---@public
function RageUI.GoDown(Options)
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
Options = CurrentMenu.Options
if CurrentMenu() then
if (Options ~= 0) then
if Options > CurrentMenu.Pagination.Total then
if CurrentMenu.Index >= CurrentMenu.Pagination.Maximum then
if CurrentMenu.Index == Options then
CurrentMenu.Pagination.Minimum = 1
CurrentMenu.Pagination.Maximum = CurrentMenu.Pagination.Total
CurrentMenu.Index = 1
else
CurrentMenu.Pagination.Maximum = (CurrentMenu.Pagination.Maximum + 1)
CurrentMenu.Pagination.Minimum = CurrentMenu.Pagination.Maximum - (CurrentMenu.Pagination.Total - 1)
CurrentMenu.Index = CurrentMenu.Index + 1
end
else
CurrentMenu.Index = CurrentMenu.Index + 1
end
else
if CurrentMenu.Index == Options then
CurrentMenu.Pagination.Minimum = 1
CurrentMenu.Pagination.Maximum = CurrentMenu.Pagination.Total
CurrentMenu.Index = 1
else
CurrentMenu.Index = CurrentMenu.Index + 1
end
end
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].UpDown.audioName, Audio[Audio.Use].UpDown.audioRef)
RageUI.LastControl = false
if (CurrentMenu.onIndexChange ~= nil) then
Citizen.CreateThread(function()
CurrentMenu.onIndexChange(CurrentMenu.Index)
end)
end
else
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Error.audioName, Audio[Audio.Use].Error.audioRef)
end
end
end
end
function RageUI.GoActionControl(Controls, Action)
if Controls[Action or 'Left'].Enabled then
for Index = 1, #Controls[Action or 'Left'].Keys do
if not Controls[Action or 'Left'].Pressed then
if IsDisabledControlJustPressed(Controls[Action or 'Left'].Keys[Index][1], Controls[Action or 'Left'].Keys[Index][2]) then
Controls[Action or 'Left'].Pressed = true
Citizen.CreateThread(function()
Controls[Action or 'Left'].Active = true
Citizen.Wait(0.01)
Controls[Action or 'Left'].Active = false
Citizen.Wait(175)
while Controls[Action or 'Left'].Enabled and IsDisabledControlPressed(Controls[Action or 'Left'].Keys[Index][1], Controls[Action or 'Left'].Keys[Index][2]) do
Controls[Action or 'Left'].Active = true
Citizen.Wait(1)
Controls[Action or 'Left'].Active = false
Citizen.Wait(124)
end
Controls[Action or 'Left'].Pressed = false
if (Action ~= ControlActions[5]) then
Citizen.Wait(10)
end
end)
break
end
end
end
end
end
function RageUI.GoActionControlSlider(Controls, Action)
if Controls[Action].Enabled then
for Index = 1, #Controls[Action].Keys do
if not Controls[Action].Pressed then
if IsDisabledControlJustPressed(Controls[Action].Keys[Index][1], Controls[Action].Keys[Index][2]) then
Controls[Action].Pressed = true
Citizen.CreateThread(function()
Controls[Action].Active = true
Citizen.Wait(1)
Controls[Action].Active = false
while Controls[Action].Enabled and IsDisabledControlPressed(Controls[Action].Keys[Index][1], Controls[Action].Keys[Index][2]) do
Controls[Action].Active = true
Citizen.Wait(1)
Controls[Action].Active = false
end
Controls[Action].Pressed = false
end)
break
end
end
end
end
end
---Controls
---@return nil
---@public
function RageUI.Controls()
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() then
if CurrentMenu.Open then
local Controls = CurrentMenu.Controls;
---@type number
local Options = CurrentMenu.Options
RageUI.Options = CurrentMenu.Options
if CurrentMenu.EnableMouse then
DisableAllControlActions(2)
end
if not IsInputDisabled(2) then
for Index = 1, #Controls.Enabled.Controller do
EnableControlAction(Controls.Enabled.Controller[Index][1], Controls.Enabled.Controller[Index][2], true)
end
else
for Index = 1, #Controls.Enabled.Keyboard do
EnableControlAction(Controls.Enabled.Keyboard[Index][1], Controls.Enabled.Keyboard[Index][2], true)
end
end
if Controls.Up.Enabled then
for Index = 1, #Controls.Up.Keys do
if not Controls.Up.Pressed then
if IsDisabledControlJustPressed(Controls.Up.Keys[Index][1], Controls.Up.Keys[Index][2]) then
Controls.Up.Pressed = true
Citizen.CreateThread(function()
RageUI.GoUp(Options)
Citizen.Wait(175)
while Controls.Up.Enabled and IsDisabledControlPressed(Controls.Up.Keys[Index][1], Controls.Up.Keys[Index][2]) do
RageUI.GoUp(Options)
Citizen.Wait(50)
end
Controls.Up.Pressed = false
end)
break
end
end
end
end
if Controls.Down.Enabled then
for Index = 1, #Controls.Down.Keys do
if not Controls.Down.Pressed then
if IsDisabledControlJustPressed(Controls.Down.Keys[Index][1], Controls.Down.Keys[Index][2]) then
Controls.Down.Pressed = true
Citizen.CreateThread(function()
RageUI.GoDown(Options)
Citizen.Wait(175)
while Controls.Down.Enabled and IsDisabledControlPressed(Controls.Down.Keys[Index][1], Controls.Down.Keys[Index][2]) do
RageUI.GoDown(Options)
Citizen.Wait(50)
end
Controls.Down.Pressed = false
end)
break
end
end
end
end
for i = 1, #ControlActions do
RageUI.GoActionControl(Controls, ControlActions[i])
end
RageUI.GoActionControlSlider(Controls, 'SliderLeft')
RageUI.GoActionControlSlider(Controls, 'SliderRight')
if Controls.Back.Enabled then
for Index = 1, #Controls.Back.Keys do
if not Controls.Back.Pressed then
if IsDisabledControlJustPressed(Controls.Back.Keys[Index][1], Controls.Back.Keys[Index][2]) then
Controls.Back.Pressed = true
Citizen.Wait(10)
break
end
end
end
end
end
end
end
end
---Navigation
---@return nil
---@public
function RageUI.Navigation()
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() and (CurrentMenu.Display.Navigation) then
if CurrentMenu.EnableMouse then
SetMouseCursorActiveThisFrame()
end
if RageUI.Options > CurrentMenu.Pagination.Total then
---@type boolean
local UpHovered = false
---@type boolean
local DownHovered = false
if not CurrentMenu.SafeZoneSize then
CurrentMenu.SafeZoneSize = { X = 0, Y = 0 }
if CurrentMenu.Safezone then
CurrentMenu.SafeZoneSize = RageUI.GetSafeZoneBounds()
SetScriptGfxAlign(76, 84)
SetScriptGfxAlignParams(0, 0, 0, 0)
end
end
if CurrentMenu.EnableMouse then
UpHovered = RageUI.IsMouseInBounds(CurrentMenu.X + CurrentMenu.SafeZoneSize.X, CurrentMenu.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height)
DownHovered = RageUI.IsMouseInBounds(CurrentMenu.X + CurrentMenu.SafeZoneSize.X, CurrentMenu.Y + RageUI.Settings.Items.Navigation.Rectangle.Height + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height)
if CurrentMenu.Controls.Click.Active then
if UpHovered then
RageUI.GoUp(RageUI.Options)
elseif DownHovered then
RageUI.GoDown(RageUI.Options)
end
end
if UpHovered then
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height, 30, 30, 30, 255)
else
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height, 0, 0, 0, 200)
end
if DownHovered then
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + RageUI.Settings.Items.Navigation.Rectangle.Height + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height, 30, 30, 30, 255)
else
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + RageUI.Settings.Items.Navigation.Rectangle.Height + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height, 0, 0, 0, 200)
end
else
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + RageUI.Settings.Items.Navigation.Rectangle.Y, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height, 0, 0, 0, 200)
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + RageUI.Settings.Items.Navigation.Rectangle.Height + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + RageUI.Settings.Items.Navigation.Rectangle.Y, RageUI.Settings.Items.Navigation.Rectangle.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Navigation.Rectangle.Height, 0, 0, 0, 200)
end
RenderSprite(RageUI.Settings.Items.Navigation.Arrows.Dictionary, RageUI.Settings.Items.Navigation.Arrows.Texture, CurrentMenu.X + RageUI.Settings.Items.Navigation.Arrows.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + RageUI.Settings.Items.Navigation.Arrows.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, RageUI.Settings.Items.Navigation.Arrows.Width, RageUI.Settings.Items.Navigation.Arrows.Height)
RageUI.ItemOffset = RageUI.ItemOffset + (RageUI.Settings.Items.Navigation.Rectangle.Height * 2)
end
end
end
end
---GoBack
---@return nil
---@public
function RageUI.GoBack()
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Back.audioName, Audio[Audio.Use].Back.audioRef)
if CurrentMenu.Parent ~= nil then
if CurrentMenu.Parent() then
RageUI.NextMenu = CurrentMenu.Parent
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
end
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
end
end
end
+620
View File
@@ -0,0 +1,620 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
print("^4RageUI - https://github.com/iTexZoz/RageUI - OpenSource Advanced UI Api^0")
function math.round(num, numDecimalPlaces)
return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num))
end
function string.starts(String, Start)
return string.sub(String, 1, string.len(Start)) == Start
end
---@class RageUIMenus
RageUI.Menus = setmetatable({}, RageUI.Menus)
---@type table
---@return boolean
RageUI.Menus.__call = function()
return true
end
---@type table
RageUI.Menus.__index = RageUI.Menus
---@type table
RageUI.CurrentMenu = nil
---@type table
RageUI.NextMenu = nil
---@type number
RageUI.Options = 0
---@type number
RageUI.ItemOffset = 0
---@type number
RageUI.StatisticPanelCount = 0
---@class UISize
RageUI.UI = {
Current = "NativeUI",
Style = {
RageUI = {
Width = 0
},
NativeUI = {
Width = 0
}
}
}
---@class Settings
RageUI.Settings = {
Debug = false,
Controls = {
Up = {
Enabled = true,
Active = false,
Pressed = false,
Keys = {
{ 0, 172 },
{ 1, 172 },
{ 2, 172 },
{ 0, 241 },
{ 1, 241 },
{ 2, 241 },
},
},
Down = {
Enabled = true,
Active = false,
Pressed = false,
Keys = {
{ 0, 173 },
{ 1, 173 },
{ 2, 173 },
{ 0, 242 },
{ 1, 242 },
{ 2, 242 },
},
},
Left = {
Enabled = true,
Active = false,
Pressed = false,
Keys = {
{ 0, 174 },
{ 1, 174 },
{ 2, 174 },
},
},
Right = {
Enabled = true,
Pressed = false,
Active = false,
Keys = {
{ 0, 175 },
{ 1, 175 },
{ 2, 175 },
},
},
SliderLeft = {
Enabled = true,
Active = false,
Pressed = false,
Keys = {
{ 0, 174 },
{ 1, 174 },
{ 2, 174 },
},
},
SliderRight = {
Enabled = true,
Pressed = false,
Active = false,
Keys = {
{ 0, 175 },
{ 1, 175 },
{ 2, 175 },
},
},
Select = {
Enabled = true,
Pressed = false,
Active = false,
Keys = {
{ 0, 201 },
{ 1, 201 },
{ 2, 201 },
},
},
Back = {
Enabled = true,
Active = false,
Pressed = false,
Keys = {
{ 0, 177 },
{ 1, 177 },
{ 2, 177 },
{ 0, 199 },
{ 1, 199 },
{ 2, 199 },
},
},
Click = {
Enabled = true,
Active = false,
Pressed = false,
Keys = {
{ 0, 24 },
},
},
Enabled = {
Controller = {
{ 0, 2 }, -- Look Up and Down
{ 0, 1 }, -- Look Left and Right
{ 0, 25 }, -- Aim
{ 0, 24 }, -- Attack
},
Keyboard = {
{ 0, 201 }, -- Select
{ 0, 195 }, -- X axis
{ 0, 196 }, -- Y axis
{ 0, 187 }, -- Down
{ 0, 188 }, -- Up
{ 0, 189 }, -- Left
{ 0, 190 }, -- Right
{ 0, 202 }, -- Back
{ 0, 217 }, -- Select
{ 0, 242 }, -- Scroll down
{ 0, 241 }, -- Scroll up
{ 0, 239 }, -- Cursor X
{ 0, 240 }, -- Cursor Y
{ 0, 31 }, -- Move Up and Down
{ 0, 30 }, -- Move Left and Right
{ 0, 21 }, -- Sprint
{ 0, 22 }, -- Jump
{ 0, 23 }, -- Enter
{ 0, 75 }, -- Exit Vehicle
{ 0, 71 }, -- Accelerate Vehicle
{ 0, 72 }, -- Vehicle Brake
{ 0, 59 }, -- Move Vehicle Left and Right
{ 0, 89 }, -- Fly Yaw Left
{ 0, 9 }, -- Fly Left and Right
{ 0, 8 }, -- Fly Up and Down
{ 0, 90 }, -- Fly Yaw Right
{ 0, 76 }, -- Vehicle Handbrake
},
},
},
Audio = {
Id = nil,
Use = "NativeUI",
RageUI = {
UpDown = {
audioName = "HUD_FREEMODE_SOUNDSET",
audioRef = "NAV_UP_DOWN",
},
LeftRight = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "NAV_LEFT_RIGHT",
},
Select = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "SELECT",
},
Back = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "BACK",
},
Error = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "ERROR",
},
Slider = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "CONTINUOUS_SLIDER",
Id = nil
},
},
NativeUI = {
UpDown = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "NAV_UP_DOWN",
},
LeftRight = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "NAV_LEFT_RIGHT",
},
Select = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "SELECT",
},
Back = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "BACK",
},
Error = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "ERROR",
},
Slider = {
audioName = "HUD_FRONTEND_DEFAULT_SOUNDSET",
audioRef = "CONTINUOUS_SLIDER",
Id = nil
},
}
},
Items = {
Title = {
Background = { Width = 431, Height = 107 },
Text = { X = 215, Y = 20, Scale = 1.15 },
},
Subtitle = {
Background = { Width = 431, Height = 37 },
Text = { X = 8, Y = 3, Scale = 0.35 },
PreText = { X = 425, Y = 3, Scale = 0.35 },
},
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 0, Width = 431 },
Navigation = {
Rectangle = { Y = 4, Width = 431, Height = 18 },
Offset = 5,
Arrows = { Dictionary = "commonmenu", Texture = "shop_arrows_upanddown", X = 190, Y = 0, Width = 45, Height = 45 },
},
Description = {
Bar = { Y = 8, Width = 431, Height = 4 },
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 8, Width = 431, Height = 30 },
Text = { X = 8, Y = 10, Scale = 0.35 },
},
},
Panels = {
Grid = {
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 4, Width = 431, Height = 275 },
Grid = { Dictionary = "pause_menu_pages_char_mom_dad", Texture = "nose_grid", X = 115.5, Y = 47.5, Width = 200, Height = 200 },
Circle = { Dictionary = "mpinventory", Texture = "in_world_circle", X = 115.5, Y = 47.5, Width = 20, Height = 20 },
Text = {
Top = { X = 215.5, Y = 15, Scale = 0.35 },
Bottom = { X = 215.5, Y = 250, Scale = 0.35 },
Left = { X = 57.75, Y = 130, Scale = 0.35 },
Right = { X = 373.25, Y = 130, Scale = 0.35 },
},
},
Percentage = {
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 4, Width = 431, Height = 76 },
Bar = { X = 9, Y = 50, Width = 413, Height = 10 },
Text = {
Left = { X = 25, Y = 15, Scale = 0.35 },
Middle = { X = 215.5, Y = 15, Scale = 0.35 },
Right = { X = 398, Y = 15, Scale = 0.35 },
},
},
},
}
function RageUI.SetScaleformParams(scaleform, data)
data = data or {}
for k, v in pairs(data) do
PushScaleformMovieFunction(scaleform, v.name)
if v.param then
for _, par in pairs(v.param) do
if math.type(par) == "integer" then
PushScaleformMovieFunctionParameterInt(par)
elseif type(par) == "boolean" then
PushScaleformMovieFunctionParameterBool(par)
elseif math.type(par) == "float" then
PushScaleformMovieFunctionParameterFloat(par)
elseif type(par) == "string" then
PushScaleformMovieFunctionParameterString(par)
end
end
end
if v.func then
v.func()
end
PopScaleformMovieFunctionVoid()
end
end
function RageUI.IsMouseInBounds(X, Y, Width, Height)
local MX, MY = math.round(GetControlNormal(2, 239) * 1920) / 1920, math.round(GetControlNormal(2, 240) * 1080) / 1080
X, Y = X / 1920, Y / 1080
Width, Height = Width / 1920, Height / 1080
return (MX >= X and MX <= X + Width) and (MY > Y and MY < Y + Height)
end
function RageUI.GetSafeZoneBounds()
local SafeSize = GetSafeZoneSize()
SafeSize = math.round(SafeSize, 2)
SafeSize = (SafeSize * 100) - 90
SafeSize = 10 - SafeSize
local W, H = 1920, 1080
return { X = math.round(SafeSize * ((W / H) * 5.4)), Y = math.round(SafeSize * 5.4) }
end
function RageUI.Visible(Menu, Value)
if Menu ~= nil and Menu() then
if Value == true or Value == false then
if Value then
if RageUI.CurrentMenu ~= nil then
if RageUI.CurrentMenu.Closed ~= nil then
RageUI.CurrentMenu.Closed()
end
RageUI.CurrentMenu.Open = not Value
Menu:UpdateInstructionalButtons(Value);
Menu:UpdateCursorStyle();
end
RageUI.CurrentMenu = Menu
else
RageUI.CurrentMenu = nil
end
Menu.Open = Value
RageUI.Options = 0
RageUI.ItemOffset = 0
RageUI.LastControl = false
else
return Menu.Open
end
end
end
function RageUI.CloseAll()
if RageUI.CurrentMenu ~= nil then
local parent = RageUI.CurrentMenu.Parent
while parent ~= nil do
parent.Index = 1
parent.Pagination.Minimum = 1
parent.Pagination.Maximum = parent.Pagination.Total
parent = parent.Parent
end
RageUI.CurrentMenu.Index = 1
RageUI.CurrentMenu.Pagination.Minimum = 1
RageUI.CurrentMenu.Pagination.Maximum = RageUI.CurrentMenu.Pagination.Total
RageUI.CurrentMenu.Open = false
RageUI.CurrentMenu = nil
end
RageUI.Options = 0
RageUI.ItemOffset = 0
ResetScriptGfxAlign()
end
function RageUI.Banner()
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() and (CurrentMenu.Display.Header) then
RageUI.ItemsSafeZone(CurrentMenu)
if CurrentMenu.Sprite.Dictionary then
RenderSprite(CurrentMenu.Sprite.Dictionary, CurrentMenu.Sprite.Texture, CurrentMenu.X, CurrentMenu.Y, RageUI.Settings.Items.Title.Background.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Title.Background.Height, nil)
else
RenderRectangle(CurrentMenu.X, CurrentMenu.Y, RageUI.Settings.Items.Title.Background.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Title.Background.Height, CurrentMenu.Rectangle.R, CurrentMenu.Rectangle.G, CurrentMenu.Rectangle.B, CurrentMenu.Rectangle.A)
end
if (CurrentMenu.Display.Glare) then
local ScaleformMovie = RequestScaleformMovie("MP_MENU_GLARE")
---@type number
local Glarewidth = RageUI.Settings.Items.Title.Background.Width
---@type number
local Glareheight = RageUI.Settings.Items.Title.Background.Height
---@type number
local GlareX = CurrentMenu.X / 1920 + (CurrentMenu.SafeZoneSize.X / (64.399 - (CurrentMenu.WidthOffset * 0.065731)))
---@type number
local GlareY = CurrentMenu.Y / 1080 + CurrentMenu.SafeZoneSize.Y / 33.195020746888
RageUI.SetScaleformParams(ScaleformMovie, {
{ name = "SET_DATA_SLOT", param = { GetGameplayCamRelativeHeading() } }
})
DrawScaleformMovie(ScaleformMovie, GlareX, GlareY, Glarewidth / 430, Glareheight / 100, 255, 255, 255, 255, 0)
end
RenderText(CurrentMenu.Title, CurrentMenu.X + RageUI.Settings.Items.Title.Text.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + RageUI.Settings.Items.Title.Text.Y, CurrentMenu.TitleFont, CurrentMenu.TitleScale, 255, 255, 255, 255, 1)
RageUI.ItemOffset = RageUI.ItemOffset + RageUI.Settings.Items.Title.Background.Height
end
end
end
function RageUI.Subtitle()
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() and (CurrentMenu.Display.Subtitle) then
RageUI.ItemsSafeZone(CurrentMenu)
if CurrentMenu.Subtitle ~= "" then
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + RageUI.ItemOffset, RageUI.Settings.Items.Subtitle.Background.Width + CurrentMenu.WidthOffset, RageUI.Settings.Items.Subtitle.Background.Height + CurrentMenu.SubtitleHeight, 0, 0, 0, 255)
RenderText(CurrentMenu.Subtitle, CurrentMenu.X + RageUI.Settings.Items.Subtitle.Text.X, CurrentMenu.Y + RageUI.Settings.Items.Subtitle.Text.Y + RageUI.ItemOffset, 0, RageUI.Settings.Items.Subtitle.Text.Scale, 245, 245, 245, 255, nil, false, false, RageUI.Settings.Items.Subtitle.Background.Width + CurrentMenu.WidthOffset)
if CurrentMenu.Index > CurrentMenu.Options or CurrentMenu.Index < 0 then
CurrentMenu.Index = 1
end
if (CurrentMenu ~= nil) then
if (CurrentMenu.Index > CurrentMenu.Pagination.Total) then
local offset = CurrentMenu.Index - CurrentMenu.Pagination.Total
CurrentMenu.Pagination.Minimum = 1 + offset
CurrentMenu.Pagination.Maximum = CurrentMenu.Pagination.Total + offset
else
CurrentMenu.Pagination.Minimum = 1
CurrentMenu.Pagination.Maximum = CurrentMenu.Pagination.Total
end
end
if CurrentMenu.PageCounter == nil then
RenderText(CurrentMenu.PageCounterColour .. CurrentMenu.Index .. " / " .. CurrentMenu.Options, CurrentMenu.X + RageUI.Settings.Items.Subtitle.PreText.X + CurrentMenu.WidthOffset, CurrentMenu.Y + RageUI.Settings.Items.Subtitle.PreText.Y + RageUI.ItemOffset, 0, RageUI.Settings.Items.Subtitle.PreText.Scale, 245, 245, 245, 255, 2)
else
RenderText(CurrentMenu.PageCounter, CurrentMenu.X + RageUI.Settings.Items.Subtitle.PreText.X + CurrentMenu.WidthOffset, CurrentMenu.Y + RageUI.Settings.Items.Subtitle.PreText.Y + RageUI.ItemOffset, 0, RageUI.Settings.Items.Subtitle.PreText.Scale, 245, 245, 245, 255, 2)
end
RageUI.ItemOffset = RageUI.ItemOffset + RageUI.Settings.Items.Subtitle.Background.Height
end
end
end
end
function RageUI.Background()
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() and (CurrentMenu.Display.Background) then
RageUI.ItemsSafeZone(CurrentMenu)
SetScriptGfxDrawOrder(0)
RenderSprite(RageUI.Settings.Items.Background.Dictionary, RageUI.Settings.Items.Background.Texture, CurrentMenu.X, CurrentMenu.Y + RageUI.Settings.Items.Background.Y + CurrentMenu.SubtitleHeight, RageUI.Settings.Items.Background.Width + CurrentMenu.WidthOffset, RageUI.ItemOffset, 0, 0, 0, 0, 255)
SetScriptGfxDrawOrder(1)
end
end
end
function RageUI.Description()
local CurrentMenu = RageUI.CurrentMenu;
local Description = RageUI.Settings.Items.Description;
if CurrentMenu ~= nil and CurrentMenu.Description ~= nil then
if CurrentMenu() then
RageUI.ItemsSafeZone(CurrentMenu)
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + Description.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Description.Bar.Width + CurrentMenu.WidthOffset, Description.Bar.Height, 0, 0, 0, 255)
RenderSprite(Description.Background.Dictionary, Description.Background.Texture, CurrentMenu.X, CurrentMenu.Y + Description.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Description.Background.Width + CurrentMenu.WidthOffset, CurrentMenu.DescriptionHeight, 0, 0, 0, 255)
RenderText(CurrentMenu.Description, CurrentMenu.X + Description.Text.X, CurrentMenu.Y + Description.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Description.Text.Scale, 255, 255, 255, 255, nil, false, false, Description.Background.Width + CurrentMenu.WidthOffset - 8.0)
RageUI.ItemOffset = RageUI.ItemOffset + CurrentMenu.DescriptionHeight + Description.Bar.Y
end
end
end
function RageUI.Render()
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() then
if CurrentMenu.Safezone then
ResetScriptGfxAlign()
end
if (CurrentMenu.Display.InstructionalButton) then
if not CurrentMenu.InitScaleform then
CurrentMenu:UpdateInstructionalButtons(true)
CurrentMenu.InitScaleform = true
end
DrawScaleformMovieFullscreen(CurrentMenu.InstructionalScaleform, 255, 255, 255, 255, 0)
end
CurrentMenu.Options = RageUI.Options
CurrentMenu.SafeZoneSize = nil
RageUI.Controls()
RageUI.Options = 0
RageUI.StatisticPanelCount = 0
RageUI.ItemOffset = 0
if CurrentMenu.Controls.Back.Enabled and CurrentMenu.Closable then
if CurrentMenu.Controls.Back.Pressed then
CurrentMenu.Controls.Back.Pressed = false
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Back.audioName, Audio[Audio.Use].Back.audioRef)
if CurrentMenu.Closed ~= nil then
collectgarbage()
CurrentMenu.Closed()
end
if CurrentMenu.Parent ~= nil then
if CurrentMenu.Parent() then
RageUI.NextMenu = CurrentMenu.Parent
CurrentMenu:UpdateCursorStyle()
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
end
else
RageUI.NextMenu = nil
RageUI.Visible(CurrentMenu, false)
end
end
end
if RageUI.NextMenu ~= nil then
if RageUI.NextMenu() then
RageUI.Visible(CurrentMenu, false)
RageUI.Visible(RageUI.NextMenu, true)
CurrentMenu.Controls.Select.Active = false
RageUI.NextMenu = nil
RageUI.LastControl = false
end
end
end
end
end
function RageUI.ItemsDescription(CurrentMenu, Description, Selected)
---@type table
if Description ~= "" or Description ~= nil then
local SettingsDescription = RageUI.Settings.Items.Description;
if Selected and CurrentMenu.Description ~= Description then
CurrentMenu.Description = Description or nil
---@type number
local DescriptionLineCount = GetLineCount(CurrentMenu.Description, CurrentMenu.X + SettingsDescription.Text.X, CurrentMenu.Y + SettingsDescription.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsDescription.Text.Scale, 255, 255, 255, 255, nil, false, false, SettingsDescription.Background.Width + (CurrentMenu.WidthOffset - 5.0))
if DescriptionLineCount > 1 then
CurrentMenu.DescriptionHeight = SettingsDescription.Background.Height * DescriptionLineCount
else
CurrentMenu.DescriptionHeight = SettingsDescription.Background.Height + 7
end
end
end
end
function RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton)
---@type boolean
local Hovered = false
Hovered = RageUI.IsMouseInBounds(CurrentMenu.X + CurrentMenu.SafeZoneSize.X, CurrentMenu.Y + SettingsButton.Rectangle.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.Rectangle.Width + CurrentMenu.WidthOffset, SettingsButton.Rectangle.Height)
if Hovered and not Selected then
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + SettingsButton.Rectangle.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.Rectangle.Width + CurrentMenu.WidthOffset, SettingsButton.Rectangle.Height, 255, 255, 255, 20)
if CurrentMenu.Controls.Click.Active then
CurrentMenu.Index = Option
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Error.audioName, Audio[Audio.Use].Error.audioRef)
end
end
return Hovered;
end
function RageUI.ItemsSafeZone(CurrentMenu)
if not CurrentMenu.SafeZoneSize then
CurrentMenu.SafeZoneSize = { X = 0, Y = 0 }
if CurrentMenu.Safezone then
CurrentMenu.SafeZoneSize = RageUI.GetSafeZoneBounds()
SetScriptGfxAlign(76, 84)
SetScriptGfxAlignParams(0, 0, 0, 0)
end
end
end
function RageUI.CurrentIsEqualTo(Current, To, Style, DefaultStyle)
return Current == To and Style or DefaultStyle or {};
end
function RageUI.IsVisible(Menu, Items, Panels)
if (RageUI.Visible(Menu)) and (UpdateOnscreenKeyboard() ~= 0) and (UpdateOnscreenKeyboard() ~= 3) then
RageUI.Banner()
RageUI.Subtitle()
if (Items ~= nil) then
Items()
end
RageUI.Background();
RageUI.Navigation();
RageUI.Description();
if (Panels ~= nil) then
Panels()
end
RageUI.Render()
end
end
---SetStyleAudio
---@param StyleAudio string
---@return void
---@public
function RageUI.SetStyleAudio(StyleAudio)
RageUI.Settings.Audio.Use = StyleAudio or "RageUI"
end
function RageUI.GetStyleAudio()
return RageUI.Settings.Audio.Use or "RageUI"
end
@@ -0,0 +1,286 @@
RageUI.BadgeStyle = {
-- DEFAULT BADGE
None = function()
return {
BadgeTexture = "",
BadgeDictionary = "commonmenu"
}
end,
BronzeMedal = function()
return {
BadgeTexture = "mp_medal_bronze",
}
end,
GoldMedal = function()
return {
BadgeTexture = "mp_medal_gold",
}
end,
SilverMedal = function()
return {
BadgeTexture = "medal_silver",
}
end,
Alert = function()
return {
BadgeTexture = "mp_alerttriangle",
}
end,
Crown = function(Selected)
return {
BadgeTexture = "mp_hostcrown",
BadgeColour = Selected and { R = 0, G = 0, B = 0, A = 255 } or { R = 255, G = 255, B = 255, A = 255 }
}
end,
Ammo = function(Selected)
return {
BadgeTexture = Selected and "shop_ammo_icon_b" or "shop_ammo_icon_a",
}
end,
Armour = function(Selected)
return {
BadgeTexture = Selected and "shop_armour_icon_b" or "shop_armour_icon_a",
}
end,
Barber = function(Selected)
return {
BadgeTexture = Selected and "shop_barber_icon_b" or "shop_barber_icon_a",
}
end,
Clothes = function(Selected)
return {
BadgeTexture = Selected and "shop_clothing_icon_b" or "shop_clothing_icon_a",
}
end,
Franklin = function(Selected)
return {
BadgeTexture = Selected and "shop_franklin_icon_b" or "shop_franklin_icon_a",
}
end,
Bike = function(Selected)
return {
BadgeTexture = Selected and "shop_garage_bike_icon_b" or "shop_garage_bike_icon_a",
}
end,
Car = function(Selected)
return {
BadgeTexture = Selected and "shop_garage_icon_b" or "shop_garage_icon_a",
}
end,
Boat = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_boat_black" or "mp_specitem_boat",
BadgeDictionary = "mpinventory"
}
end,
Heli = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_heli_black" or "mp_specitem_heli",
BadgeDictionary = "mpinventory"
}
end,
Plane = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_plane_black" or "mp_specitem_plane",
BadgeDictionary = "mpinventory"
}
end,
BoatPickup = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_boatpickup_black" or "mp_specitem_boatpickup",
BadgeDictionary = "mpinventory"
}
end,
Card = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_keycard_black" or "mp_specitem_keycard",
BadgeDictionary = "mpinventory"
}
end,
Gun = function(Selected)
return {
BadgeTexture = Selected and "shop_gunclub_icon_b" or "shop_gunclub_icon_a",
}
end,
Heart = function(Selected)
return {
BadgeTexture = Selected and "shop_health_icon_b" or "shop_health_icon_a",
}
end,
Makeup = function(Selected)
return {
BadgeTexture = Selected and "shop_makeup_icon_b" or "shop_makeup_icon_a",
}
end,
Mask = function(Selected)
return {
BadgeTexture = Selected and "shop_mask_icon_b" or "shop_mask_icon_a",
}
end,
Michael = function(Selected)
return {
BadgeTexture = Selected and "shop_michael_icon_b" or "shop_michael_icon_a",
}
end,
Star = function()
return {
BadgeTexture = "shop_new_star",
}
end,
Tattoo = function(Selected)
return {
BadgeTexture = Selected and "shop_tattoos_icon_b" or "shop_tattoos_icon_a",
}
end,
Trevor = function(Selected)
return {
BadgeTexture = Selected and "shop_trevor_icon_b" or "shop_trevor_icon_a",
}
end,
Lock = function(Selected)
return {
BadgeTexture = "shop_lock",
BadgeColour = Selected and { R = 0, G = 0, B = 0, A = 255 } or { R = 255, G = 255, B = 255, A = 255 }
}
end,
Tick = function(Selected)
return {
BadgeTexture = "shop_tick_icon",
BadgeColour = Selected and { R = 0, G = 0, B = 0, A = 255 } or { R = 255, G = 255, B = 255, A = 255 }
}
end,
Key = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_cuffkeys_black" or "mp_specitem_cuffkeys",
BadgeDictionary = "mpinventory"
}
end,
Coke = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_coke_black" or "mp_specitem_coke",
BadgeDictionary = "mpinventory"
}
end,
Heroin = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_heroin_black" or "mp_specitem_heroin",
BadgeDictionary = "mpinventory"
}
end,
Meth = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_meth_black" or "mp_specitem_meth",
BadgeDictionary = "mpinventory"
}
end,
Weed = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_weed_black" or "mp_specitem_weed",
BadgeDictionary = "mpinventory"
}
end,
Package = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_package_black" or "mp_specitem_package",
BadgeDictionary = "mpinventory"
}
end,
Cash = function(Selected)
return {
BadgeTexture = Selected and "mp_specitem_cash_black" or "mp_specitem_cash",
BadgeDictionary = "mpinventory"
}
end,
RP = function(Selected)
return {
BadgeTexture = "mp_anim_rp",
BadgeDictionary = "mphud"
}
end,
LSPD = function()
return {
BadgeTexture = "mpgroundlogo_cops",
BadgeDictionary = "3dtextures"
}
end,
Vagos = function()
return {
BadgeTexture = "mpgroundlogo_vagos",
BadgeDictionary = "3dtextures"
}
end,
Bikers = function()
return {
BadgeTexture = "mpgroundlogo_bikers",
BadgeDictionary = "3dtextures"
}
end,
-- CASINO
Badbeat = function()
return {
BadgeTexture = "badbeat",
BadgeDictionary = "mpawardcasino"
}
end,
CashingOut = function()
return {
BadgeTexture = "cashingout",
BadgeDictionary = "mpawardcasino"
}
end,
FullHouse = function()
return {
BadgeTexture = "fullhouse",
BadgeDictionary = "mpawardcasino"
}
end,
HighRoller = function()
return {
BadgeTexture = "highroller",
BadgeDictionary = "mpawardcasino"
}
end,
HouseKeeping = function()
return {
BadgeTexture = "housekeeping",
BadgeDictionary = "mpawardcasino"
}
end,
LooseCheng = function()
return {
BadgeTexture = "loosecheng",
BadgeDictionary = "mpawardcasino"
}
end,
LuckyLucky = function()
return {
BadgeTexture = "luckylucky",
BadgeDictionary = "mpawardcasino"
}
end,
PlayToWin = function()
return {
BadgeTexture = "playtowin",
BadgeDictionary = "mpawardcasino"
}
end,
StraightFlush = function()
return {
BadgeTexture = "straightflush",
BadgeDictionary = "mpawardcasino"
}
end,
StrongArmTactics = function()
return {
BadgeTexture = "strongarmtactics",
BadgeDictionary = "mpawardcasino"
}
end,
TopPair = function()
return {
BadgeTexture = "toppair",
BadgeDictionary = "mpawardcasino"
}
end,
}
@@ -0,0 +1,225 @@
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Dylan Malandain.
--- DateTime: 24/07/2019 02:26
---
RageUI.ItemsColour = {
PureWhite = { 255, 255, 255, 255 },
White = { 240, 240, 240, 255 },
Black = { 0, 0, 0, 255 },
Grey = { 155, 155, 155, 255 },
GreyLight = { 205, 205, 205, 255 },
GreyDark = { 77, 77, 77, 255 },
Red = { 224, 50, 50, 255 },
RedLight = { 240, 153, 153, 255 },
RedDark = { 112, 25, 25, 255 },
Blue = { 93, 182, 229, 255 },
BlueLight = { 174, 219, 242, 255 },
BlueDark = { 47, 92, 115, 255 },
Yellow = { 240, 200, 80, 255 },
YellowLight = { 254, 235, 169, 255 },
YellowDark = { 126, 107, 41, 255 },
Orange = { 255, 133, 85, 255 },
OrangeLight = { 255, 194, 170, 255 },
OrangeDark = { 127, 66, 42, 255 },
Green = { 114, 204, 114, 255 },
GreenLight = { 185, 230, 185, 255 },
GreenDark = { 57, 102, 57, 255 },
Purple = { 132, 102, 226, 255 },
PurpleLight = { 192, 179, 239, 255 },
PurpleDark = { 67, 57, 111, 255 },
Pink = { 203, 54, 148, 255 },
RadarHealth = { 53, 154, 71, 255 },
RadarArmour = { 93, 182, 229, 255 },
RadarDamage = { 235, 36, 39, 255 },
NetPlayer1 = { 194, 80, 80, 255 },
NetPlayer2 = { 156, 110, 175, 255 },
NetPlayer3 = { 255, 123, 196, 255 },
NetPlayer4 = { 247, 159, 123, 255 },
NetPlayer5 = { 178, 144, 132, 255 },
NetPlayer6 = { 141, 206, 167, 255 },
NetPlayer7 = { 113, 169, 175, 255 },
NetPlayer8 = { 211, 209, 231, 255 },
NetPlayer9 = { 144, 127, 153, 255 },
NetPlayer10 = { 106, 196, 191, 255 },
NetPlayer11 = { 214, 196, 153, 255 },
NetPlayer12 = { 234, 142, 80, 255 },
NetPlayer13 = { 152, 203, 234, 255 },
NetPlayer14 = { 178, 98, 135, 255 },
NetPlayer15 = { 144, 142, 122, 255 },
NetPlayer16 = { 166, 117, 94, 255 },
NetPlayer17 = { 175, 168, 168, 255 },
NetPlayer18 = { 232, 142, 155, 255 },
NetPlayer19 = { 187, 214, 91, 255 },
NetPlayer20 = { 12, 123, 86, 255 },
NetPlayer21 = { 123, 196, 255, 255 },
NetPlayer22 = { 171, 60, 230, 255 },
NetPlayer23 = { 206, 169, 13, 255 },
NetPlayer24 = { 71, 99, 173, 255 },
NetPlayer25 = { 42, 166, 185, 255 },
NetPlayer26 = { 186, 157, 125, 255 },
NetPlayer27 = { 201, 225, 255, 255 },
NetPlayer28 = { 240, 240, 150, 255 },
NetPlayer29 = { 237, 140, 161, 255 },
NetPlayer30 = { 249, 138, 138, 255 },
NetPlayer31 = { 252, 239, 166, 255 },
NetPlayer32 = { 240, 240, 240, 255 },
SimpleBlipDefault = { 159, 201, 166, 255 },
MenuBlue = { 140, 140, 140, 255 },
MenuGreyLight = { 140, 140, 140, 255 },
MenuBlueExtraDark = { 40, 40, 40, 255 },
MenuYellow = { 240, 160, 0, 255 },
MenuYellowDark = { 240, 160, 0, 255 },
MenuGreen = { 240, 160, 0, 255 },
MenuGrey = { 140, 140, 140, 255 },
MenuGreyDark = { 60, 60, 60, 255 },
MenuHighlight = { 30, 30, 30, 255 },
MenuStandard = { 140, 140, 140, 255 },
MenuDimmed = { 75, 75, 75, 255 },
MenuExtraDimmed = { 50, 50, 50, 255 },
BriefTitle = { 95, 95, 95, 255 },
MidGreyMp = { 100, 100, 100, 255 },
NetPlayer1Dark = { 93, 39, 39, 255 },
NetPlayer2Dark = { 77, 55, 89, 255 },
NetPlayer3Dark = { 124, 62, 99, 255 },
NetPlayer4Dark = { 120, 80, 80, 255 },
NetPlayer5Dark = { 87, 72, 66, 255 },
NetPlayer6Dark = { 74, 103, 83, 255 },
NetPlayer7Dark = { 60, 85, 88, 255 },
NetPlayer8Dark = { 105, 105, 64, 255 },
NetPlayer9Dark = { 72, 63, 76, 255 },
NetPlayer10Dark = { 53, 98, 95, 255 },
NetPlayer11Dark = { 107, 98, 76, 255 },
NetPlayer12Dark = { 117, 71, 40, 255 },
NetPlayer13Dark = { 76, 101, 117, 255 },
NetPlayer14Dark = { 65, 35, 47, 255 },
NetPlayer15Dark = { 72, 71, 61, 255 },
NetPlayer16Dark = { 85, 58, 47, 255 },
NetPlayer17Dark = { 87, 84, 84, 255 },
NetPlayer18Dark = { 116, 71, 77, 255 },
NetPlayer19Dark = { 93, 107, 45, 255 },
NetPlayer20Dark = { 6, 61, 43, 255 },
NetPlayer21Dark = { 61, 98, 127, 255 },
NetPlayer22Dark = { 85, 30, 115, 255 },
NetPlayer23Dark = { 103, 84, 6, 255 },
NetPlayer24Dark = { 35, 49, 86, 255 },
NetPlayer25Dark = { 21, 83, 92, 255 },
NetPlayer26Dark = { 93, 98, 62, 255 },
NetPlayer27Dark = { 100, 112, 127, 255 },
NetPlayer28Dark = { 120, 120, 75, 255 },
NetPlayer29Dark = { 152, 76, 93, 255 },
NetPlayer30Dark = { 124, 69, 69, 255 },
NetPlayer31Dark = { 10, 43, 50, 255 },
NetPlayer32Dark = { 95, 95, 10, 255 },
Bronze = { 180, 130, 97, 255 },
Silver = { 150, 153, 161, 255 },
Gold = { 214, 181, 99, 255 },
Platinum = { 166, 221, 190, 255 },
Gang1 = { 29, 100, 153, 255 },
Gang2 = { 214, 116, 15, 255 },
Gang3 = { 135, 125, 142, 255 },
Gang4 = { 229, 119, 185, 255 },
SameCrew = { 252, 239, 166, 255 },
Freemode = { 45, 110, 185, 255 },
PauseBg = { 0, 0, 0, 255 },
Friendly = { 93, 182, 229, 255 },
Enemy = { 194, 80, 80, 255 },
Location = { 240, 200, 80, 255 },
Pickup = { 114, 204, 114, 255 },
PauseSingleplayer = { 114, 204, 114, 255 },
FreemodeDark = { 22, 55, 92, 255 },
InactiveMission = { 154, 154, 154, 255 },
Damage = { 194, 80, 80, 255 },
PinkLight = { 252, 115, 201, 255 },
PmMitemHighlight = { 252, 177, 49, 255 },
ScriptVariable = { 0, 0, 0, 255 },
Yoga = { 109, 247, 204, 255 },
Tennis = { 241, 101, 34, 255 },
Golf = { 214, 189, 97, 255 },
ShootingRange = { 112, 25, 25, 255 },
FlightSchool = { 47, 92, 115, 255 },
NorthBlue = { 93, 182, 229, 255 },
SocialClub = { 234, 153, 28, 255 },
PlatformBlue = { 11, 55, 123, 255 },
PlatformGreen = { 146, 200, 62, 255 },
PlatformGrey = { 234, 153, 28, 255 },
FacebookBlue = { 66, 89, 148, 255 },
IngameBg = { 0, 0, 0, 255 },
Darts = { 114, 204, 114, 255 },
Waypoint = { 164, 76, 242, 255 },
Michael = { 101, 180, 212, 255 },
Franklin = { 171, 237, 171, 255 },
Trevor = { 255, 163, 87, 255 },
GolfP1 = { 240, 240, 240, 255 },
GolfP2 = { 235, 239, 30, 255 },
GolfP3 = { 255, 149, 14, 255 },
GolfP4 = { 246, 60, 161, 255 },
WaypointLight = { 210, 166, 249, 255 },
WaypointDark = { 82, 38, 121, 255 },
PanelLight = { 0, 0, 0, 255 },
MichaelDark = { 72, 103, 116, 255 },
FranklinDark = { 85, 118, 85, 255 },
TrevorDark = { 127, 81, 43, 255 },
ObjectiveRoute = { 240, 200, 80, 255 },
PausemapTint = { 0, 0, 0, 255 },
PauseDeselect = { 100, 100, 100, 255 },
PmWeaponsPurchasable = { 45, 110, 185, 255 },
PmWeaponsLocked = { 240, 240, 240, 255 },
ScreenBg = { 0, 0, 0, 255 },
Chop = { 224, 50, 50, 255 },
PausemapTintHalf = { 0, 0, 0, 255 },
NorthBlueOfficial = { 0, 71, 133, 255 },
ScriptVariable2 = { 0, 0, 0, 255 },
H = { 33, 118, 37, 255 },
HDark = { 37, 102, 40, 255 },
T = { 234, 153, 28, 255 },
TDark = { 225, 140, 8, 255 },
HShard = { 20, 40, 0, 255 },
ControllerMichael = { 48, 255, 255, 255 },
ControllerFranklin = { 48, 255, 0, 255 },
ControllerTrevor = { 176, 80, 0, 255 },
ControllerChop = { 127, 0, 0, 255 },
VideoEditorVideo = { 53, 166, 224, 255 },
VideoEditorAudio = { 162, 79, 157, 255 },
VideoEditorText = { 104, 192, 141, 255 },
HbBlue = { 29, 100, 153, 255 },
HbYellow = { 234, 153, 28, 255 },
VideoEditorScore = { 240, 160, 1, 255 },
VideoEditorAudioFadeout = { 59, 34, 57, 255 },
VideoEditorTextFadeout = { 41, 68, 53, 255 },
VideoEditorScoreFadeout = { 82, 58, 10, 255 },
HeistBackground = { 37, 102, 40, 255 },
VideoEditorAmbient = { 240, 200, 80, 255 },
VideoEditorAmbientFadeout = { 80, 70, 34, 255 },
Gb = { 255, 133, 85, 255 },
G = { 255, 194, 170, 255 },
B = { 255, 133, 85, 255 },
LowFlow = { 240, 200, 80, 255 },
LowFlowDark = { 126, 107, 41, 255 },
G1 = { 247, 159, 123, 255 },
G2 = { 226, 134, 187, 255 },
G3 = { 239, 238, 151, 255 },
G4 = { 113, 169, 175, 255 },
G5 = { 160, 140, 193, 255 },
G6 = { 141, 206, 167, 255 },
G7 = { 181, 214, 234, 255 },
G8 = { 178, 144, 132, 255 },
G9 = { 0, 132, 114, 255 },
G10 = { 216, 85, 117, 255 },
G11 = { 30, 100, 152, 255 },
G12 = { 43, 181, 117, 255 },
G13 = { 233, 141, 79, 255 },
G14 = { 137, 210, 215, 255 },
G15 = { 134, 125, 141, 255 },
Adversary = { 109, 34, 33, 255 },
DegenRed = { 255, 0, 0, 255 },
DegenYellow = { 255, 255, 0, 255 },
DegenGreen = { 0, 255, 0, 255 },
DegenCyan = { 0, 255, 255, 255 },
DegenBlue = { 0, 0, 255, 255 },
DegenMagenta = { 255, 0, 255, 255 },
Stunt1 = { 38, 136, 234, 255 },
Stunt2 = { 224, 50, 50, 255 },
}
@@ -0,0 +1,69 @@
RageUI.PanelColour = {
HairCut = {
{ 22, 19, 19 }, -- 0
{ 30, 28, 25 }, -- 1
{ 76, 56, 45 }, -- 2
{ 69, 34, 24 }, -- 3
{ 123, 59, 31 }, -- 4
{ 149, 68, 35 }, -- 5
{ 165, 87, 50 }, -- 6
{ 175, 111, 72 }, -- 7
{ 159, 105, 68 }, -- 8
{ 198, 152, 108 }, -- 9
{ 213, 170, 115 }, -- 10
{ 223, 187, 132 }, -- 11
{ 202, 164, 110 }, -- 12
{ 238, 204, 130 }, -- 13
{ 229, 190, 126 }, -- 14
{ 250, 225, 167 }, -- 15
{ 187, 140, 96 }, -- 16
{ 163, 92, 60 }, -- 17
{ 144, 52, 37 }, -- 18
{ 134, 21, 17 }, -- 19
{ 164, 24, 18 }, -- 20
{ 195, 33, 24 }, -- 21
{ 221, 69, 34 }, -- 22
{ 229, 71, 30 }, -- 23
{ 208, 97, 56 }, -- 24
{ 113, 79, 38 }, -- 25
{ 132, 107, 95 }, -- 26
{ 185, 164, 150 }, -- 27
{ 218, 196, 180 }, -- 28
{ 247, 230, 217 }, -- 29
{ 102, 72, 93 }, -- 30
{ 162, 105, 138 }, -- 31
{ 171, 174, 11 }, -- 32
{ 239, 61, 200 }, -- 33
{ 255, 69, 152 }, -- 34
{ 255, 178, 191 }, -- 35
{ 12, 168, 146 }, -- 36
{ 8, 146, 165 }, -- 37
{ 11, 82, 134 }, -- 38
{ 118, 190, 117 }, -- 39
{ 52, 156, 104 }, -- 40
{ 22, 86, 85 }, -- 41
{ 152, 177, 40 }, -- 42
{ 127, 162, 23 }, -- 43
{ 241, 200, 98 }, -- 44
{ 238, 178, 16 }, -- 45
{ 224, 134, 14 }, -- 46
{ 247, 157, 15 }, -- 47
{ 243, 143, 16 }, -- 48
{ 231, 70, 15 }, -- 49
{ 255, 101, 21 }, -- 50
{ 254, 91, 34 }, -- 51
{ 252, 67, 21 }, -- 52
{ 196, 12, 15 }, -- 53
{ 143, 10, 14 }, -- 54
{ 44, 27, 22 }, -- 55
{ 80, 51, 37 }, -- 56
{ 98, 54, 37 }, -- 57
{ 60, 31, 24 }, -- 58
{ 69, 43, 32 }, -- 59
{ 8, 10, 14 }, -- 60
{ 212, 185, 158 }, -- 61
{ 212, 185, 158 }, -- 62
{ 213, 170, 115 }, -- 63
},
}
+117
View File
@@ -0,0 +1,117 @@
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 38 },
Text = { X = 8, Y = 3, Scale = 0.33 },
LeftBadge = { Y = -2, Width = 40, Height = 40 },
RightBadge = { X = 385, Y = -2, Width = 40, Height = 40 },
RightText = { X = 420, Y = 4, Scale = 0.35 },
SelectedSprite = { Dictionary = "commonmenu", Texture = "gradient_nav", Y = 0, Width = 431, Height = 38 },
}
---ButtonWithStyle
---@param Label string
---@param Description string
---@param Style table
---@param Enabled boolean
---@param Callback function
---@param Submenu table
---@return nil
---@public
function RageUI.Button(Label, Description, Style, Enabled, Callback, Submenu)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() then
---@type number
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
---@type boolean
local Selected = CurrentMenu.Index == Option
RageUI.ItemsSafeZone(CurrentMenu)
local LeftBadgeOffset = ((Style.LeftBadge == RageUI.BadgeStyle.None or tonumber(Style.LeftBadge) == nil) and 0 or 27)
local RightBadgeOffset = ((Style.RightBadge == RageUI.BadgeStyle.None or tonumber(Style.RightBadge) == nil) and 0 or 32)
local Hovered = false;
if Style.Color ~= nil then
if Style.Color.BackgroundColor ~= nil then
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height, Style.Color.BackgroundColor[1], Style.Color.BackgroundColor[2], Style.Color.BackgroundColor[3])
end
end
---@type boolean
if CurrentMenu.EnableMouse == true then
Hovered = RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton);
end
if Selected then
if Style.Color == nil then
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
end
if Style.Color ~= nil and Style.Color.HightLightColor ~= nil then
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height, Style.Color.HightLightColor[1], Style.Color.HightLightColor[2], Style.Color.HightLightColor[3])
else
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
end
end
if type(Style) == 'table' then
if Style.LeftBadge ~= nil then
if Style.LeftBadge ~= RageUI.BadgeStyle.None and tonumber(Style.LeftBadge) ~= nil then
RenderSprite(RageUI.GetBadgeDictionary(Style.LeftBadge, Selected), RageUI.GetBadgeTexture(Style.LeftBadge, Selected), CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, RageUI.GetBadgeColour(Style.LeftBadge, Selected))
end
end
if Style.RightBadge ~= nil then
if Style.RightBadge ~= RageUI.BadgeStyle.None and tonumber(Style.RightBadge) ~= nil then
RenderSprite(RageUI.GetBadgeDictionary(Style.RightBadge, Selected), RageUI.GetBadgeTexture(Style.RightBadge, Selected), CurrentMenu.X + SettingsButton.RightBadge.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.RightBadge.Width, SettingsButton.RightBadge.Height, 0, RageUI.GetBadgeColour(Style.RightBadge, Selected))
end
end
end
if Enabled == true or Enabled == nil then
if Selected then
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 0, 0, 0, Style.RightLabelOpacity or 255, 2)
end
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
else
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 245, 245, 245, Style.RightLabelOpacity or 255, 2)
end
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255)
end
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 163, 159, 148, 255)
end
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
RageUI.ItemsDescription(CurrentMenu, Description, Selected);
if (Enabled) then
if Selected and (CurrentMenu.Controls.Select.Active or (Hovered and CurrentMenu.Controls.Click.Active)) then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
if (Callback.onSelected ~= nil) and (Selected) then
Callback.onSelected();
end
if Submenu ~= nil then
if Submenu() then
RageUI.NextMenu = Submenu
end
end
end
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
+183
View File
@@ -0,0 +1,183 @@
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 38 },
Text = { X = 8, Y = 3, Scale = 0.33 },
LeftBadge = { Y = -2, Width = 40, Height = 40 },
RightBadge = { X = 385, Y = -2, Width = 40, Height = 40 },
RightText = { X = 420, Y = 4, Scale = 0.35 },
SelectedSprite = { Dictionary = "commonmenu", Texture = "gradient_nav", Y = 0, Width = 431, Height = 38 },
}
---@type table
local SettingsCheckbox = {
Dictionary = "commonmenu", Textures = {
"shop_box_blankb", -- 1
"shop_box_tickb", -- 2
"shop_box_blank", -- 3
"shop_box_tick", -- 4
"shop_box_crossb", -- 5
"shop_box_cross", -- 6
},
X = 380, Y = -6, Width = 50, Height = 50
}
RageUI.CheckboxStyle = {
Tick = 1,
Cross = 2
}
---StyleCheckBox
---@param Selected number
---@param Checked boolean
---@param Box number
---@param BoxSelect number
---@return nil
local function StyleCheckBox(Selected, Checked, Box, BoxSelect, OffSet)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
if OffSet == nil then
OffSet = 0
end
if Selected then
if Checked then
RenderSprite(SettingsCheckbox.Dictionary, SettingsCheckbox.Textures[Box], CurrentMenu.X + SettingsCheckbox.X + CurrentMenu.WidthOffset - OffSet, CurrentMenu.Y + SettingsCheckbox.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsCheckbox.Width, SettingsCheckbox.Height)
else
RenderSprite(SettingsCheckbox.Dictionary, SettingsCheckbox.Textures[1], CurrentMenu.X + SettingsCheckbox.X + CurrentMenu.WidthOffset - OffSet, CurrentMenu.Y + SettingsCheckbox.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsCheckbox.Width, SettingsCheckbox.Height)
end
else
if Checked then
RenderSprite(SettingsCheckbox.Dictionary, SettingsCheckbox.Textures[BoxSelect], CurrentMenu.X + SettingsCheckbox.X + CurrentMenu.WidthOffset - OffSet, CurrentMenu.Y + SettingsCheckbox.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsCheckbox.Width, SettingsCheckbox.Height)
else
RenderSprite(SettingsCheckbox.Dictionary, SettingsCheckbox.Textures[3], CurrentMenu.X + SettingsCheckbox.X + CurrentMenu.WidthOffset - OffSet, CurrentMenu.Y + SettingsCheckbox.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsCheckbox.Width, SettingsCheckbox.Height)
end
end
end
function RageUI.Checkbox(Label, Description, Checked, Style, Actions)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() then
---@type number
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
---@type number
local Selected = CurrentMenu.Index == Option
local LeftBadgeOffset = ((Style.LeftBadge == RageUI.BadgeStyle.None or Style.LeftBadge == nil) and 0 or 27)
local RightBadgeOffset = ((Style.RightBadge == RageUI.BadgeStyle.None or Style.RightBadge == nil) and 0 or 32)
local BoxOffset = 0
RageUI.ItemsSafeZone(CurrentMenu)
local Hovered = false;
---@type boolean
if CurrentMenu.EnableMouse == true and (CurrentMenu.CursorStyle == 0) or (CurrentMenu.CursorStyle == 1) then
Hovered = RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton);
end
if Selected then
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
end
if type(Style) == "table" then
if Style.Enabled == true or Style.Enabled == nil then
if Selected then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255)
end
if type(Style) == 'table' then
if Style.LeftBadge ~= nil then
if Style.LeftBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
if Style.RightBadge ~= nil then
if Style.RightBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.RightBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X + SettingsButton.RightBadge.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.RightBadge.Width, SettingsButton.RightBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
end
else
---@type table
local LeftBadge = RageUI.BadgeStyle.Lock
---@type number
local LeftBadgeOffset = ((LeftBadge == RageUI.BadgeStyle.None or LeftBadge == nil) and 0 or 27)
if Selected then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 163, 159, 148, 255)
end
if LeftBadge ~= RageUI.BadgeStyle.None and LeftBadge ~= nil then
local BadgeData = LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour.A or 255)
end
end
if Style.Enabled == true or Style.Enabled == nil then
if Selected then
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 0, 0, 0, 255, 2)
BoxOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
end
else
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 245, 245, 245, 255, 2)
BoxOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
end
end
end
BoxOffset = RightBadgeOffset + BoxOffset
if Style.Style ~= nil then
if Style.Style == RageUI.CheckboxStyle.Tick then
StyleCheckBox(Selected, Checked, 2, 4, BoxOffset)
elseif Style.Style == RageUI.CheckboxStyle.Cross then
StyleCheckBox(Selected, Checked, 5, 6, BoxOffset)
else
StyleCheckBox(Selected, Checked, 2, 4, BoxOffset)
end
else
StyleCheckBox(Selected, Checked, 2, 4, BoxOffset)
end
if Selected and (CurrentMenu.Controls.Select.Active or (Hovered and CurrentMenu.Controls.Click.Active)) and (Style.Enabled == true or Style.Enabled == nil) then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
Checked = not Checked
if (Checked) then
if (Actions.onChecked ~= nil) then
Actions.onChecked();
end
else
if (Actions.onUnChecked ~= nil) then
Actions.onUnChecked();
end
end
end
else
error("UICheckBox Style is not a `table`")
end
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
RageUI.ItemsDescription(CurrentMenu, Description, Selected)
if (Actions.onSelected ~= nil) and (Selected) then
Actions.onSelected(Checked);
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
+158
View File
@@ -0,0 +1,158 @@
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 38 },
Text = { X = 8, Y = 3, Scale = 0.33 },
LeftBadge = { Y = -2, Width = 40, Height = 40 },
RightBadge = { X = 385, Y = -2, Width = 40, Height = 40 },
RightText = { X = 420, Y = 4, Scale = 0.35 },
SelectedSprite = { Dictionary = "commonmenu", Texture = "gradient_nav", Y = 0, Width = 431, Height = 38 },
}
---@type table
local SettingsList = {
LeftArrow = { Dictionary = "commonmenu", Texture = "arrowleft", X = 378, Y = 3, Width = 30, Height = 30 },
RightArrow = { Dictionary = "commonmenu", Texture = "arrowright", X = 400, Y = 3, Width = 30, Height = 30 },
Text = { X = 403, Y = 3, Scale = 0.35 },
}
function RageUI.List(Label, Items, Index, Description, Style, Enabled, Actions, Submenu)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() then
---@type number
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
---@type number
local Selected = CurrentMenu.Index == Option
---@type boolean
local LeftArrowHovered, RightArrowHovered = false, false
RageUI.ItemsSafeZone(CurrentMenu)
local Hovered = false;
local LeftBadgeOffset = ((Style.LeftBadge == RageUI.BadgeStyle.None or Style.LeftBadge == nil) and 0 or 27)
local RightBadgeOffset = ((Style.RightBadge == RageUI.BadgeStyle.None or Style.RightBadge == nil) and 0 or 32)
local RightOffset = 0
---@type boolean
if CurrentMenu.EnableMouse == true and (CurrentMenu.CursorStyle == 0) or (CurrentMenu.CursorStyle == 1) then
Hovered = RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton);
end
local ListText = (type(Items[Index]) == "table") and string.format("← %s →", Items[Index].Name) or string.format("← %s →", Items[Index]) or "NIL"
if Selected then
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
end
if Enabled == true or Enabled == nil then
if Selected then
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 0, 0, 0, 255, 2)
RightOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
end
else
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RightOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 245, 245, 245, 255, 2)
end
end
end
RightOffset = RightBadgeOffset * 1.3 + RightOffset
if Enabled == true or Enabled == nil then
if Selected then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
RenderText(ListText, CurrentMenu.X + SettingsList.Text.X + 15 + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsList.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsList.Text.Scale, 0, 0, 0, 255, 2)
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255)
RenderText(ListText, CurrentMenu.X + SettingsList.Text.X + 15 + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsList.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsList.Text.Scale, 245, 245, 245, 255, 2)
end
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 163, 159, 148, 255)
if Selected then
RenderText(ListText, CurrentMenu.X + SettingsList.Text.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsList.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsList.Text.Scale, 163, 159, 148, 255, 2)
else
RenderText(ListText, CurrentMenu.X + SettingsList.Text.X + 15 + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsList.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsList.Text.Scale, 163, 159, 148, 255, 2)
end
end
if type(Style) == "table" then
if Style.Enabled == true or Style.Enabled == nil then
if type(Style) == 'table' then
if Style.LeftBadge ~= nil then
if Style.LeftBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
if Style.RightBadge ~= nil then
if Style.RightBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.RightBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X + SettingsButton.RightBadge.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.RightBadge.Width, SettingsButton.RightBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
end
else
---@type table
local LeftBadge = RageUI.BadgeStyle.Lock
---@type number
if LeftBadge ~= RageUI.BadgeStyle.None and LeftBadge ~= nil then
local BadgeData = LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour.A or 255)
end
end
else
error("UICheckBox Style is not a `table`")
end
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
RageUI.ItemsDescription(CurrentMenu, Description, Selected);
if Selected and (CurrentMenu.Controls.Left.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) and not (CurrentMenu.Controls.Right.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) then
Index = Index - 1
if Index < 1 then
Index = #Items
end
if (Actions.onListChange ~= nil) then
Actions.onListChange(Index, Items[Index]);
end
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].LeftRight.audioName, Audio[Audio.Use].LeftRight.audioRef)
elseif Selected and (CurrentMenu.Controls.Right.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) and not (CurrentMenu.Controls.Left.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) then
Index = Index + 1
if Index > #Items then
Index = 1
end
if (Actions.onListChange ~= nil) then
Actions.onListChange(Index, Items[Index]);
end
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].LeftRight.audioName, Audio[Audio.Use].LeftRight.audioRef)
end
if Selected and (CurrentMenu.Controls.Select.Active or ((Hovered and CurrentMenu.Controls.Click.Active) and (not LeftArrowHovered and not RightArrowHovered))) then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
if (Actions.onSelected ~= nil) then
Actions.onSelected(Index, Items[Index]);
end
if Submenu ~= nil and type(Submenu) == "table" then
RageUI.NextMenu = Submenu[Index]
end
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
@@ -0,0 +1,46 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 29 },
Text = { X = 8, Y = 0, Scale = 0.33 },
}
function RageUI.Separator(Label)
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() then
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
if (Label ~= nil) then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + (CurrentMenu.WidthOffset * 2.5 ~= 0 and CurrentMenu.WidthOffset * 2.5 or 200), CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255, 1)
end
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
if (CurrentMenu.Index == Option) then
if (RageUI.LastControl) then
CurrentMenu.Index = Option - 1
if (CurrentMenu.Index < 1) then
CurrentMenu.Index = RageUI.CurrentMenu.Options
end
else
CurrentMenu.Index = Option + 1
end
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
+173
View File
@@ -0,0 +1,173 @@
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 38 },
Text = { X = 8, Y = 3, Scale = 0.33 },
LeftBadge = { Y = -2, Width = 40, Height = 40 },
RightBadge = { X = 385, Y = -2, Width = 40, Height = 40 },
RightText = { X = 420, Y = 4, Scale = 0.35 },
SelectedSprite = { Dictionary = "commonmenu", Texture = "gradient_nav", Y = 0, Width = 431, Height = 38 },
}
---@type table
local SettingsSlider = {
Background = { X = 250, Y = 14.5, Width = 150, Height = 9 },
Slider = { X = 250, Y = 14.5, Width = 75, Height = 9 },
Divider = { X = 323.5, Y = 9, Width = 2.5, Height = 20 },
LeftArrow = { Dictionary = "commonmenutu", Texture = "arrowleft", X = 235, Y = 11.5, Width = 15, Height = 15 },
RightArrow = { Dictionary = "commonmenutu", Texture = "arrowright", X = 400, Y = 11.5, Width = 15, Height = 15 },
}
function RageUI.Slider(Label, ProgressStart, ProgressMax, IncrementQty, Description, Divider, Style, Enabled, Actions)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
local Audio = RageUI.Settings.Audio
if CurrentMenu ~= nil then
if CurrentMenu() then
local Items = {}
for i = 1, ProgressMax do
table.insert(Items, i)
end
---@type number
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
---@type number
local Selected = CurrentMenu.Index == Option
---@type boolean
local LeftArrowHovered, RightArrowHovered = false, false
RageUI.ItemsSafeZone(CurrentMenu)
local Hovered = false;
--if type(Style) == "table" then
local LeftBadgeOffset = ((Style.LeftBadge == RageUI.BadgeStyle.None or Style.LeftBadge == nil) and 0 or 27)
local RightBadgeOffset = ((Style.RightBadge == RageUI.BadgeStyle.None or Style.RightBadge == nil) and 0 or 32)
--end
local RightOffset = 0
---@type boolean
if CurrentMenu.EnableMouse == true and (CurrentMenu.CursorStyle == 0) or (CurrentMenu.CursorStyle == 1) then
Hovered = RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton);
end
if Selected then
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
LeftArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.SafeZoneSize.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height)
RightArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.SafeZoneSize.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height)
end
if Enabled == true or Enabled == nil then
if Selected then
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 0, 0, 0, 255, 2)
RightOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
end
else
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RightOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 245, 245, 245, 255, 2)
end
end
end
RightOffset = RightOffset + RightBadgeOffset
if Enabled == true or Enabled == nil then
if Selected then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
RenderSprite(SettingsSlider.LeftArrow.Dictionary, SettingsSlider.LeftArrow.Texture, CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height, 0, 0, 0, 0, 255)
RenderSprite(SettingsSlider.RightArrow.Dictionary, SettingsSlider.RightArrow.Texture, CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height, 0, 0, 0, 0, 255)
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255)
end
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 163, 159, 148, 255)
if Selected then
RenderSprite(SettingsSlider.LeftArrow.Dictionary, SettingsSlider.LeftArrow.Texture, CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height, 163, 159, 148, 255)
RenderSprite(SettingsSlider.RightArrow.Dictionary, SettingsSlider.RightArrow.Texture, CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height, 163, 159, 148, 255)
end
end
if type(Style) == "table" then
if Style.Enabled == true or Style.Enabled == nil then
if type(Style) == 'table' then
if Style.LeftBadge ~= nil then
if Style.LeftBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
if Style.RightBadge ~= nil then
if Style.RightBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.RightBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X + SettingsButton.RightBadge.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.RightBadge.Width, SettingsButton.RightBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
end
else
---@type table
local LeftBadge = RageUI.BadgeStyle.Lock
if LeftBadge ~= RageUI.BadgeStyle.None and LeftBadge ~= nil then
local BadgeData = LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour.A or 255)
end
end
else
error("UICheckBox Style is not a `table`")
end
RenderRectangle(CurrentMenu.X + SettingsSlider.Background.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Background.Width, SettingsSlider.Background.Height, 4, 32, 57, 255)
RenderRectangle(CurrentMenu.X + SettingsSlider.Slider.X + (((SettingsSlider.Background.Width - SettingsSlider.Slider.Width) / (#Items - 1)) * (ProgressStart - 1)) + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.Slider.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Slider.Width, SettingsSlider.Slider.Height, 57, 116, 200, 255)
if Divider then
RenderRectangle(CurrentMenu.X + SettingsSlider.Divider.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.Divider.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Divider.Width, SettingsSlider.Divider.Height, 245, 245, 245, 255)
end
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
RageUI.ItemsDescription(CurrentMenu, Description, Selected);
if Enabled == true or Enabled == nil then
if Selected and (CurrentMenu.Controls.Left.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) and not (CurrentMenu.Controls.Right.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) then
ProgressStart = ProgressStart - IncrementQty or 1
if ProgressStart < 1 then
ProgressStart = #Items
end
if (Actions.onSliderChange ~= nil) then
Actions.onSliderChange(ProgressStart);
end
RageUI.PlaySound(Audio[Audio.Use].LeftRight.audioName, Audio[Audio.Use].LeftRight.audioRef)
elseif Selected and (CurrentMenu.Controls.Right.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) and not (CurrentMenu.Controls.Left.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) then
ProgressStart = ProgressStart + IncrementQty or 1
if ProgressStart > #Items then
ProgressStart = 1
end
if (Actions.onSliderChange ~= nil) then
Actions.onSliderChange(ProgressStart);
end
RageUI.PlaySound(Audio[Audio.Use].LeftRight.audioName, Audio[Audio.Use].LeftRight.audioRef)
end
if Selected and (CurrentMenu.Controls.Select.Active or ((Hovered and CurrentMenu.Controls.Click.Active) and (not LeftArrowHovered and not RightArrowHovered))) then
if (Actions.onSelected ~= nil) then
Actions.onSelected(ProgressStart);
end
if Style.MuteOnSelected ~= nil then
if Style.MuteOnSelected ~= true then
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
end
else
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
end
end
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
@@ -0,0 +1,118 @@
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 38 },
Text = { X = 8, Y = 3, Scale = 0.33 },
SelectedSprite = { Dictionary = "commonmenu", Texture = "gradient_nav", Y = 0, Width = 431, Height = 38 },
}
---@type table
local SettingsSlider = {
Background = { X = 250, Y = 14.5, Width = 150, Height = 9 },
Slider = { X = 250, Y = 14.5, Width = 75, Height = 9 },
Divider = { X = 323.5, Y = 9, Width = 2.5, Height = 20 },
LeftArrow = { Dictionary = "mpleaderboard", Texture = "leaderboard_female_icon", X = 215, Y = 0, Width = 40, Height = 40 },
RightArrow = { Dictionary = "mpleaderboard", Texture = "leaderboard_male_icon", X = 395, Y = 0, Width = 40, Height = 40 },
}
local Items = {}
for i = 1, 10 do
table.insert(Items, i)
end
function RageUI.UISliderHeritage(Label, ItemIndex, Description, Actions, Value)
local CurrentMenu = RageUI.CurrentMenu;
local Audio = RageUI.Settings.Audio
if CurrentMenu ~= nil then
if CurrentMenu() then
---@type number
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
---@type number
local value = Value or 0.1
local Selected = CurrentMenu.Index == Option
---@type boolean
local LeftArrowHovered, RightArrowHovered = false, false
RageUI.ItemsSafeZone(CurrentMenu)
local Hovered = false;
local RightOffset = 0
---@type boolean
if CurrentMenu.EnableMouse == true and (CurrentMenu.CursorStyle == 0) or (CurrentMenu.CursorStyle == 1) then
Hovered = RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton);
end
if Selected then
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
LeftArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.SafeZoneSize.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height)
RightArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.SafeZoneSize.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height)
end
RightOffset = RightOffset
if Selected then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
RenderSprite(SettingsSlider.LeftArrow.Dictionary, SettingsSlider.LeftArrow.Texture, CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height, 0, 0, 0, 0, 255)
RenderSprite(SettingsSlider.RightArrow.Dictionary, SettingsSlider.RightArrow.Texture, CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height, 0, 0, 0, 0, 255)
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255)
RenderSprite(SettingsSlider.LeftArrow.Dictionary, SettingsSlider.LeftArrow.Texture, CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height, 0, 255, 255, 255, 255)
RenderSprite(SettingsSlider.RightArrow.Dictionary, SettingsSlider.RightArrow.Texture, CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height, 0, 255, 255, 255, 255)
end
RenderRectangle(CurrentMenu.X + SettingsSlider.Background.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Background.Width, SettingsSlider.Background.Height, 4, 32, 57, 255)
RenderRectangle(CurrentMenu.X + SettingsSlider.Slider.X + (((SettingsSlider.Background.Width - SettingsSlider.Slider.Width) / (#Items)) * (ItemIndex)) + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.Slider.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Slider.Width, SettingsSlider.Slider.Height, 57, 116, 200, 255)
RenderRectangle(CurrentMenu.X + SettingsSlider.Divider.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.Divider.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Divider.Width, SettingsSlider.Divider.Height, 245, 245, 245, 255)
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
RageUI.ItemsDescription(CurrentMenu, Description, Selected);
if Selected and (CurrentMenu.Controls.SliderLeft.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) and not (CurrentMenu.Controls.SliderRight.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) then
ItemIndex = ItemIndex - value
if ItemIndex < 0.1 then
ItemIndex = 0.0
else
RageUI.PlaySound(Audio[Audio.Use].Slider.audioName, Audio[Audio.Use].Slider.audioRef, true)
end
if (Actions.onSliderChange ~= nil) then
Actions.onSliderChange(ItemIndex / 10, ItemIndex);
end
elseif Selected and (CurrentMenu.Controls.SliderRight.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) and not (CurrentMenu.Controls.SliderLeft.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) then
ItemIndex = ItemIndex + value
if ItemIndex > #Items then
ItemIndex = 10
else
RageUI.PlaySound(Audio[Audio.Use].Slider.audioName, Audio[Audio.Use].Slider.audioRef, true)
end
if (Actions.onSliderChange ~= nil) then
Actions.onSliderChange(ItemIndex / 10, ItemIndex);
end
end
if Selected and (CurrentMenu.Controls.Select.Active or ((Hovered and CurrentMenu.Controls.Click.Active) and (not LeftArrowHovered and not RightArrowHovered))) then
if (Actions.onSelected ~= nil) then
Actions.onSelected(ItemIndex / 10, ItemIndex);
end
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef, false)
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
@@ -0,0 +1,186 @@
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Dylan Malandain.
--- DateTime: 21/11/2019 01:33
---
---@type table
local SettingsButton = {
Rectangle = { Y = 0, Width = 431, Height = 38 },
Text = { X = 8, Y = 3, Scale = 0.33 },
LeftBadge = { Y = -2, Width = 40, Height = 40 },
RightBadge = { X = 385, Y = -2, Width = 40, Height = 40 },
RightText = { X = 420, Y = 4, Scale = 0.35 },
SelectedSprite = { Dictionary = "commonmenu", Texture = "gradient_nav", Y = 0, Width = 431, Height = 38 },
}
---@type table
local SettingsSlider = {
Background = { X = 250, Y = 14.5, Width = 150, Height = 9 },
Slider = { X = 250, Y = 14.5, Width = 150, Height = 9 },
LeftArrow = { Dictionary = "commonmenutu", Texture = "arrowleft", X = 235, Y = 11.5, Width = 15, Height = 15 },
RightArrow = { Dictionary = "commonmenutu", Texture = "arrowright", X = 400, Y = 11.5, Width = 15, Height = 15 },
}
---Slider
---@param Label string
---@param ProgressStart number
---@param ProgressMax number
---@param Description string
---@param Enabled boolean
---@param Callback function
function RageUI.SliderProgress(Label, ProgressStart, ProgressMax, Description, Style, Enabled, Actions)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
local Audio = RageUI.Settings.Audio
if CurrentMenu ~= nil then
if CurrentMenu() then
local Items = {}
for i = 1, ProgressMax do
table.insert(Items, i)
end
---@type number
local Option = RageUI.Options + 1
if CurrentMenu.Pagination.Minimum <= Option and CurrentMenu.Pagination.Maximum >= Option then
---@type number
local Selected = CurrentMenu.Index == Option
---@type boolean
local LeftArrowHovered, RightArrowHovered = false, false
RageUI.ItemsSafeZone(CurrentMenu)
local Hovered = false;
local LeftBadgeOffset = ((Style.LeftBadge == RageUI.BadgeStyle.None or Style.LeftBadge == nil) and 0 or 27)
local RightBadgeOffset = ((Style.RightBadge == RageUI.BadgeStyle.None or Style.RightBadge == nil) and 0 or 32)
local RightOffset = 0
---@type boolean
if CurrentMenu.EnableMouse == true and (CurrentMenu.CursorStyle == 0) or (CurrentMenu.CursorStyle == 1) then
Hovered = RageUI.ItemsMouseBounds(CurrentMenu, Selected, Option, SettingsButton);
end
if Selected then
RenderSprite(SettingsButton.SelectedSprite.Dictionary, SettingsButton.SelectedSprite.Texture, CurrentMenu.X, CurrentMenu.Y + SettingsButton.SelectedSprite.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.SelectedSprite.Width + CurrentMenu.WidthOffset, SettingsButton.SelectedSprite.Height)
LeftArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.SafeZoneSize.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height)
RightArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.SafeZoneSize.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height)
end
if Enabled == true or Enabled == nil then
if Selected then
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 0, 0, 0, 255, 2)
RightOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
end
else
if Style.RightLabel ~= nil and Style.RightLabel ~= "" then
RightOffset = MeasureStringWidth(Style.RightLabel, 0, 0.35)
RenderText(Style.RightLabel, CurrentMenu.X + SettingsButton.RightText.X - RightBadgeOffset + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightText.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.RightText.Scale, 245, 245, 245, 255, 2)
end
end
end
RightOffset = RightOffset + RightBadgeOffset
if Enabled == true or Enabled == nil then
if Selected then
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 0, 0, 0, 255)
RenderSprite(SettingsSlider.LeftArrow.Dictionary, SettingsSlider.LeftArrow.Texture, CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height, 0, 0, 0, 0, 255)
RenderSprite(SettingsSlider.RightArrow.Dictionary, SettingsSlider.RightArrow.Texture, CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height, 0, 0, 0, 0, 255)
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 245, 245, 245, 255)
end
else
RenderText(Label, CurrentMenu.X + SettingsButton.Text.X + LeftBadgeOffset, CurrentMenu.Y + SettingsButton.Text.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, SettingsButton.Text.Scale, 163, 159, 148, 255)
if Selected then
RenderSprite(SettingsSlider.LeftArrow.Dictionary, SettingsSlider.LeftArrow.Texture, CurrentMenu.X + SettingsSlider.LeftArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.LeftArrow.Width, SettingsSlider.LeftArrow.Height, 163, 159, 148, 255)
RenderSprite(SettingsSlider.RightArrow.Dictionary, SettingsSlider.RightArrow.Texture, CurrentMenu.X + SettingsSlider.RightArrow.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.RightArrow.Width, SettingsSlider.RightArrow.Height, 163, 159, 148, 255)
end
end
if type(Style) == "table" then
if Style.Enabled == true or Style.Enabled == nil then
if type(Style) == 'table' then
if Style.LeftBadge ~= nil then
if Style.LeftBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
if Style.RightBadge ~= nil then
if Style.RightBadge ~= RageUI.BadgeStyle.None then
local BadgeData = Style.RightBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X + SettingsButton.RightBadge.X + CurrentMenu.WidthOffset, CurrentMenu.Y + SettingsButton.RightBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.RightBadge.Width, SettingsButton.RightBadge.Height, 0, BadgeData.BadgeColour and BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour and BadgeData.BadgeColour.A or 255)
end
end
end
else
---@type table
local LeftBadge = RageUI.BadgeStyle.Lock
if LeftBadge ~= RageUI.BadgeStyle.None and LeftBadge ~= nil then
local BadgeData = LeftBadge(Selected)
RenderSprite(BadgeData.BadgeDictionary or "commonmenu", BadgeData.BadgeTexture or "", CurrentMenu.X, CurrentMenu.Y + SettingsButton.LeftBadge.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsButton.LeftBadge.Width, SettingsButton.LeftBadge.Height, 0, BadgeData.BadgeColour.R or 255, BadgeData.BadgeColour.G or 255, BadgeData.BadgeColour.B or 255, BadgeData.BadgeColour.A or 255)
end
end
else
error("UICheckBox Style is not a `table`")
end
if (type(Style.ProgressBackgroundColor) == "table") then
RenderRectangle(CurrentMenu.X + SettingsSlider.Background.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, SettingsSlider.Background.Width, SettingsSlider.Background.Height, Style.ProgressBackgroundColor.R, Style.ProgressBackgroundColor.G, Style.ProgressBackgroundColor.B, Style.ProgressBackgroundColor.A)
else
error("Style ProgressBackgroundColor is not a table or undefined")
end
if (type(Style.ProgressColor) == "table") then
RenderRectangle(CurrentMenu.X + SettingsSlider.Slider.X + CurrentMenu.WidthOffset - RightOffset, CurrentMenu.Y + SettingsSlider.Slider.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, (((SettingsSlider.Slider.Width) / (#Items - 1)) * (ProgressStart - 1)), SettingsSlider.Slider.Height, Style.ProgressColor.R, Style.ProgressColor.G, Style.ProgressColor.B, Style.ProgressColor.A)
else
error("Style ProgressColor is not a table or undefined")
end
RageUI.ItemOffset = RageUI.ItemOffset + SettingsButton.Rectangle.Height
RageUI.ItemsDescription(CurrentMenu, Description, Selected);
if Selected and (CurrentMenu.Controls.Left.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) and not (CurrentMenu.Controls.Right.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) then
ProgressStart = ProgressStart - 1
if ProgressStart < 1 then
ProgressStart = #Items
end
if (Actions.onSliderChange ~= nil) then
Actions.onSliderChange(ProgressStart);
end
RageUI.PlaySound(Audio[Audio.Use].LeftRight.audioName, Audio[Audio.Use].LeftRight.audioRef)
elseif Selected and (CurrentMenu.Controls.Right.Active or (CurrentMenu.Controls.Click.Active and RightArrowHovered)) and not (CurrentMenu.Controls.Left.Active or (CurrentMenu.Controls.Click.Active and LeftArrowHovered)) then
ProgressStart = ProgressStart + 1
if ProgressStart > #Items then
ProgressStart = 1
end
if (Actions.onSliderChange ~= nil) then
Actions.onSliderChange(ProgressStart);
end
RageUI.PlaySound(Audio[Audio.Use].LeftRight.audioName, Audio[Audio.Use].LeftRight.audioRef)
end
if Selected and (CurrentMenu.Controls.Select.Active or ((Hovered and CurrentMenu.Controls.Click.Active) and (not LeftArrowHovered and not RightArrowHovered))) then
if (Actions.onSelected ~= nil) then
Actions.onSelected(ProgressStart);
end
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
end
end
RageUI.Options = RageUI.Options + 1
end
end
end
@@ -0,0 +1,100 @@
---@type table
local Colour = {
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 4, Width = 431, Height = 112 },
LeftArrow = { Dictionary = "commonmenu", Texture = "arrowleft", X = 7.5, Y = 15, Width = 30, Height = 30 },
RightArrow = { Dictionary = "commonmenu", Texture = "arrowright", X = 393.5, Y = 15, Width = 30, Height = 30 },
Header = { X = 215.5, Y = 15, Scale = 0.35 },
Box = { X = 15, Y = 55, Width = 44.5, Height = 44.5 },
SelectedRectangle = { X = 15, Y = 47, Width = 44.5, Height = 8 },
}
---ColourPanel
---@param Title string
---@param Colours thread
---@param MinimumIndex number
---@param CurrentIndex number
---@param Callback function
---@return nil
---@public
function RageUI.ColourPanel(Title, Colours, MinimumIndex, CurrentIndex, Action, Index)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() and (CurrentMenu.Index == Index) then
---@type number
local Maximum = (#Colours > 9) and 9 or #Colours
---@type boolean
local Hovered = RageUI.IsMouseInBounds(CurrentMenu.X + Colour.Box.X + CurrentMenu.SafeZoneSize.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.Box.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, (Colour.Box.Width * Maximum), Colour.Box.Height)
---@type number
local LeftArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + Colour.LeftArrow.X + CurrentMenu.SafeZoneSize.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.LeftArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.LeftArrow.Width, Colour.LeftArrow.Height)
---@type number
local RightArrowHovered = RageUI.IsMouseInBounds(CurrentMenu.X + Colour.RightArrow.X + CurrentMenu.SafeZoneSize.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.RightArrow.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.RightArrow.Width, Colour.RightArrow.Height)
---@type boolean
local Selected = false
RenderSprite(Colour.Background.Dictionary, Colour.Background.Texture, CurrentMenu.X, CurrentMenu.Y + Colour.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.Background.Width + CurrentMenu.WidthOffset, Colour.Background.Height)
RenderSprite(Colour.LeftArrow.Dictionary, Colour.LeftArrow.Texture, CurrentMenu.X + Colour.LeftArrow.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.LeftArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.LeftArrow.Width, Colour.LeftArrow.Height)
RenderSprite(Colour.RightArrow.Dictionary, Colour.RightArrow.Texture, CurrentMenu.X + Colour.RightArrow.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.RightArrow.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.RightArrow.Width, Colour.RightArrow.Height)
RenderRectangle(CurrentMenu.X + Colour.SelectedRectangle.X + (Colour.Box.Width * (CurrentIndex - MinimumIndex)) + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.SelectedRectangle.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.SelectedRectangle.Width, Colour.SelectedRectangle.Height, 245, 245, 245, 255)
for Index = 1, Maximum do
RenderRectangle(CurrentMenu.X + Colour.Box.X + (Colour.Box.Width * (Index - 1)) + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.Box.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.Box.Width, Colour.Box.Height, table.unpack(Colours[MinimumIndex + Index - 1]))
end
RenderText((Title and Title or "") .. " (" .. CurrentIndex .. " of " .. #Colours .. ")", CurrentMenu.X + RageUI.Settings.Panels.Grid.Text.Top.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + RageUI.Settings.Panels.Grid.Text.Top.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, RageUI.Settings.Panels.Grid.Text.Top.Scale, 245, 245, 245, 255, 1)
if Hovered or LeftArrowHovered or RightArrowHovered then
if RageUI.Settings.Controls.Click.Active then
Selected = true
if LeftArrowHovered then
CurrentIndex = CurrentIndex - 1
if CurrentIndex < 1 then
CurrentIndex = #Colours
MinimumIndex = #Colours - Maximum + 1
elseif CurrentIndex < MinimumIndex then
MinimumIndex = MinimumIndex - 1
end
elseif RightArrowHovered then
CurrentIndex = CurrentIndex + 1
if CurrentIndex > #Colours then
CurrentIndex = 1
MinimumIndex = 1
elseif CurrentIndex > MinimumIndex + Maximum - 1 then
MinimumIndex = MinimumIndex + 1
end
elseif Hovered then
for Index = 1, Maximum do
if RageUI.IsMouseInBounds(CurrentMenu.X + Colour.Box.X + (Colour.Box.Width * (Index - 1)) + CurrentMenu.SafeZoneSize.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Colour.Box.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Colour.Box.Width, Colour.Box.Height) then
CurrentIndex = MinimumIndex + Index - 1
end
end
end
if (Action.onColorChange ~= nil) then
Action.onColorChange(MinimumIndex, CurrentIndex)
end
end
end
RageUI.ItemOffset = RageUI.ItemOffset + Colour.Background.Height + Colour.Background.Y
if (Hovered or LeftArrowHovered or RightArrowHovered) and RageUI.Settings.Controls.Click.Active then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Select.audioName, Audio[Audio.Use].Select.audioRef)
end
end
end
end
@@ -0,0 +1,127 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
local GridType = RageUI.Enum {
Default = 1,
Horizontal = 2,
Vertical = 3
}
local GridSprite = {
[GridType.Default] = { Dictionary = "pause_menu_pages_char_mom_dad", Texture = "nose_grid", },
[GridType.Horizontal] = { Dictionary = "RageUI", Texture = "horizontal_grid", },
[GridType.Vertical] = { Dictionary = "RageUI", Texture = "vertical_grid", },
}
local Grid = {
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 4, Width = 431, Height = 275 },
Grid = { X = 115.5, Y = 47.5, Width = 200, Height = 200 },
Circle = { Dictionary = "mpinventory", Texture = "in_world_circle", X = 115.5, Y = 47.5, Width = 20, Height = 20 },
Text = {
Top = { X = 215.5, Y = 15, Scale = 0.35 },
Bottom = { X = 215.5, Y = 250, Scale = 0.35 },
Left = { X = 57.75, Y = 130, Scale = 0.35 },
Right = { X = 373.25, Y = 130, Scale = 0.35 },
},
}
local function UIGridPanel(Type, StartedX, StartedY, TopText, BottomText, LeftText, RightText, Action, Index)
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() and ((CurrentMenu.Index == Index)) then
local X = Type == GridType.Default and StartedX or Type == GridType.Horizontal and StartedX or Type == GridType.Vertical and 0.5
local Y = Type == GridType.Default and StartedY or Type == GridType.Horizontal and 0.5 or Type == GridType.Vertical and StartedY
local Hovered = RageUI.IsMouseInBounds(CurrentMenu.X + Grid.Grid.X + CurrentMenu.SafeZoneSize.X + 20, CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20, Grid.Grid.Width + CurrentMenu.WidthOffset - 40, Grid.Grid.Height - 40)
local Selected = false
local CircleX = CurrentMenu.X + Grid.Grid.X + (CurrentMenu.WidthOffset / 2) + 20
local CircleY = CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20
if X < 0.0 or X > 1.0 then
X = 0.0
end
if Y < 0.0 or Y > 1.0 then
Y = 0.0
end
CircleX = CircleX + ((Grid.Grid.Width - 40) * X) - (Grid.Circle.Width / 2)
CircleY = CircleY + ((Grid.Grid.Height - 40) * Y) - (Grid.Circle.Height / 2)
RenderSprite(Grid.Background.Dictionary, Grid.Background.Texture, CurrentMenu.X, CurrentMenu.Y + Grid.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Grid.Background.Width + CurrentMenu.WidthOffset, Grid.Background.Height)
RenderSprite(GridSprite[Type].Dictionary, GridSprite[Type].Texture, CurrentMenu.X + Grid.Grid.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Grid.Grid.Width, Grid.Grid.Height)
RenderSprite(Grid.Circle.Dictionary, Grid.Circle.Texture, CircleX, CircleY, Grid.Circle.Width, Grid.Circle.Height)
if (Type == GridType.Default) then
RenderText(TopText or "", CurrentMenu.X + Grid.Text.Top.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Top.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Top.Scale, 245, 245, 245, 255, 1)
RenderText(BottomText or "", CurrentMenu.X + Grid.Text.Bottom.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Bottom.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Bottom.Scale, 245, 245, 245, 255, 1)
RenderText(LeftText or "", CurrentMenu.X + Grid.Text.Left.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Left.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Left.Scale, 245, 245, 245, 255, 1)
RenderText(RightText or "", CurrentMenu.X + Grid.Text.Right.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Right.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Right.Scale, 245, 245, 245, 255, 1)
end
if (Type == GridType.Vertical) then
RenderText(TopText or "", CurrentMenu.X + Grid.Text.Top.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Top.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Top.Scale, 245, 245, 245, 255, 1)
RenderText(BottomText or "", CurrentMenu.X + Grid.Text.Bottom.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Bottom.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Bottom.Scale, 245, 245, 245, 255, 1)
end
if (Type == GridType.Horizontal) then
RenderText(LeftText or "", CurrentMenu.X + Grid.Text.Left.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Left.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Left.Scale, 245, 245, 245, 255, 1)
RenderText(RightText or "", CurrentMenu.X + Grid.Text.Right.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Grid.Text.Right.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Grid.Text.Right.Scale, 245, 245, 245, 255, 1)
end
if Hovered then
if IsDisabledControlPressed(0, 24) then
Selected = true
CircleX = math.round(GetControlNormal(2, 239) * 1920) - CurrentMenu.SafeZoneSize.X - (Grid.Circle.Width / 2)
CircleY = math.round(GetControlNormal(2, 240) * 1080) - CurrentMenu.SafeZoneSize.Y - (Grid.Circle.Height / 2)
if CircleX > (CurrentMenu.X + Grid.Grid.X + (CurrentMenu.WidthOffset / 2) + 20 + Grid.Grid.Width - 40) then
CircleX = CurrentMenu.X + Grid.Grid.X + (CurrentMenu.WidthOffset / 2) + 20 + Grid.Grid.Width - 40
elseif CircleX < (CurrentMenu.X + Grid.Grid.X + 20 - (Grid.Circle.Width / 2)) then
CircleX = CurrentMenu.X + Grid.Grid.X + 20 - (Grid.Circle.Width / 2)
end
if CircleY > (CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20 + Grid.Grid.Height - 40) then
CircleY = CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20 + Grid.Grid.Height - 40
elseif CircleY < (CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20 - (Grid.Circle.Height / 2)) then
CircleY = CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20 - (Grid.Circle.Height / 2)
end
X = math.round((CircleX - (CurrentMenu.X + Grid.Grid.X + (CurrentMenu.WidthOffset / 2) + 20) + (Grid.Circle.Width / 2)) / (Grid.Grid.Width - 40), 2)
Y = math.round((CircleY - (CurrentMenu.Y + Grid.Grid.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + 20) + (Grid.Circle.Height / 2)) / (Grid.Grid.Height - 40), 2)
if (X ~= StartedX) and (Y ~= StartedY) then
Action.onPositionChange(X, Y)
end
StartedX = X;
StartedY = Y;
if X > 1.0 then
X = 1.0
end
if Y > 1.0 then
Y = 1.0
end
end
end
RageUI.ItemOffset = RageUI.ItemOffset + Grid.Background.Height + Grid.Background.Y
if Hovered and Selected then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Slider.audioName, Audio[Audio.Use].Slider.audioRef, true)
if (Action.onSelected ~= nil) then
Action.onSelected(X, Y);
end
end
end
end
end
function RageUI.Grid(StartedX, StartedY, TopText, BottomText, LeftText, RightText, Action, Index)
UIGridPanel(GridType.Default, StartedX, StartedY, TopText, BottomText, LeftText, RightText, Action, Index)
end
function RageUI.GridHorizontal(StartedX, LeftText, RightText, Action, Index)
UIGridPanel(GridType.Horizontal, StartedX, nil, nil, nil, LeftText, RightText, Action, Index)
end
function RageUI.GridVertical(StartedY, TopText, BottomText, Action, Index)
UIGridPanel(GridType.Vertical, nil, StartedY, TopText, BottomText, nil, nil, Action, Index)
end
@@ -0,0 +1,81 @@
local Percentage = {
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 4, Width = 431, Height = 76 },
Bar = { X = 9, Y = 50, Width = 413, Height = 10 },
Text = {
Left = { X = 25, Y = 15, Scale = 0.35 },
Middle = { X = 215.5, Y = 15, Scale = 0.35 },
Right = { X = 398, Y = 15, Scale = 0.35 },
},
}
---PercentagePanel
---@param Percent number
---@param HeaderText string
---@param MinText string
---@param MaxText string
---@param Callback function
---@param Index number
---@return nil
---@public
function RageUI.PercentagePanel(Percent, HeaderText, MinText, MaxText, Action, Index)
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() and (Index == nil or (CurrentMenu.Index == Index)) then
---@type boolean
local Hovered = RageUI.IsMouseInBounds(CurrentMenu.X + Percentage.Bar.X + CurrentMenu.SafeZoneSize.X, CurrentMenu.Y + Percentage.Bar.Y + CurrentMenu.SafeZoneSize.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset - 4, Percentage.Bar.Width + CurrentMenu.WidthOffset, Percentage.Bar.Height + 8)
---@type boolean
local Selected = false
---@type number
local Progress = Percentage.Bar.Width
if Percent < 0.0 then
Percent = 0.0
elseif Percent > 1.0 then
Percent = 1.0
end
Progress = Progress * Percent
RenderSprite(Percentage.Background.Dictionary, Percentage.Background.Texture, CurrentMenu.X, CurrentMenu.Y + Percentage.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Percentage.Background.Width + CurrentMenu.WidthOffset, Percentage.Background.Height)
RenderRectangle(CurrentMenu.X + Percentage.Bar.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Percentage.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Percentage.Bar.Width, Percentage.Bar.Height, 87, 87, 87, 255)
RenderRectangle(CurrentMenu.X + Percentage.Bar.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Percentage.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Progress, Percentage.Bar.Height, 245, 245, 245, 255)
RenderText(HeaderText or "Opacity", CurrentMenu.X + Percentage.Text.Middle.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Percentage.Text.Middle.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Percentage.Text.Middle.Scale, 245, 245, 245, 255, 1)
RenderText(MinText or "0%", CurrentMenu.X + Percentage.Text.Left.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Percentage.Text.Left.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Percentage.Text.Left.Scale, 245, 245, 245, 255, 1)
RenderText(MaxText or "100%", CurrentMenu.X + Percentage.Text.Right.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + Percentage.Text.Right.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Percentage.Text.Right.Scale, 245, 245, 245, 255, 1)
if Hovered then
if IsDisabledControlPressed(0, 24) then
Selected = true
Progress = math.round(GetControlNormal(2, 239) * 1920) - CurrentMenu.SafeZoneSize.X - (CurrentMenu.X + Percentage.Bar.X + (CurrentMenu.WidthOffset / 2))
if Progress < 0 then
Progress = 0
elseif Progress > (Percentage.Bar.Width) then
Progress = Percentage.Bar.Width
end
Percent = math.round(Progress / Percentage.Bar.Width, 2)
if (Action.onProgressChange ~= nil) then
Action.onProgressChange(Percent)
end
end
end
RageUI.ItemOffset = RageUI.ItemOffset + Percentage.Background.Height + Percentage.Background.Y
if Hovered and Selected then
local Audio = RageUI.Settings.Audio
RageUI.PlaySound(Audio[Audio.Use].Slider.audioName, Audio[Audio.Use].Slider.audioRef, true)
if (Action.onSelected ~= nil) then
Action.onSelected(Percent)
end
end
end
end
end
@@ -0,0 +1,68 @@
local Statistics = {
Background = { Dictionary = "commonmenu", Texture = "gradient_bgd", Y = 4, Width = 431, Height = 42 },
Text = {
Left = { X = -40, Y = 15, Scale = 0.35 },
},
Bar = { Right = 8, Y = 27, Width = 200, Height = 10, OffsetRatio = 0.5 },
Divider = {
[1] = { X = 200, Y = 27, Width = 2, Height = 10 },
[2] = { X = 200, Y = 27, Width = 2, Height = 10 },
[3] = { X = 200, Y = 27, Width = 2, Height = 10 },
[4] = { X = 200, Y = 27, Width = 2, Height = 10 },
[5] = { X = 200, Y = 27, Width = 2, Height = 10 },
}
}
function RageUI.StatisticPanel(Percent, Text, Index)
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() and (Index == nil or (CurrentMenu.Index == Index)) then
---@type number
local BarWidth = Statistics.Bar.Width + CurrentMenu.WidthOffset * Statistics.Bar.OffsetRatio
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + Statistics.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + (RageUI.StatisticPanelCount * 42), Statistics.Background.Width + CurrentMenu.WidthOffset, Statistics.Background.Height, 0, 0, 0, 170)
RenderText(Text or "", CurrentMenu.X + 8.0, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Text.Left.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Statistics.Text.Left.Scale, 245, 245, 245, 255, 0)
RenderRectangle(CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right + CurrentMenu.WidthOffset, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, BarWidth, Statistics.Bar.Height, 87, 87, 87, 255)
RenderRectangle(CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right + CurrentMenu.WidthOffset, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Percent * BarWidth, Statistics.Bar.Height, 255, 255, 255, 255)
for i = 1, #Statistics.Divider, 1 do
RenderRectangle((CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right) + i * ((BarWidth - (#Statistics.Divider / Statistics.Divider[i].Width)) / (#Statistics.Divider + 1)) + CurrentMenu.WidthOffset, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Divider[i].Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Statistics.Divider[i].Width, Statistics.Divider[i].Height, 0, 0, 0, 255)
end
RageUI.StatisticPanelCount = RageUI.StatisticPanelCount + 1
end
end
end
function RageUI.StatisticPanelAdvanced(Text, Percent, RGBA1, Percent2, RGBA2, RGBA3, Index)
local CurrentMenu = RageUI.CurrentMenu
if CurrentMenu ~= nil then
if CurrentMenu() and (Index == nil or (CurrentMenu.Index == Index)) then
RGBA1 = RGBA1 or { 255, 255, 255, 255 }
local BarWidth = Statistics.Bar.Width + CurrentMenu.WidthOffset * Statistics.Bar.OffsetRatio
---@type number
RenderRectangle(CurrentMenu.X, CurrentMenu.Y + Statistics.Background.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset + (RageUI.StatisticPanelCount * 42), Statistics.Background.Width + CurrentMenu.WidthOffset, Statistics.Background.Height, 0, 0, 0, 170)
RenderText(Text or "", CurrentMenu.X + 8.0, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Text.Left.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, 0, Statistics.Text.Left.Scale, 245, 245, 245, 255, 0)
RenderRectangle(CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right + CurrentMenu.WidthOffset, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, BarWidth, Statistics.Bar.Height, 87, 87, 87, 255)
RenderRectangle(CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right + CurrentMenu.WidthOffset, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Percent * BarWidth, Statistics.Bar.Height, RGBA1[1], RGBA1[2], RGBA1[3], RGBA1[4])
RGBA2 = RGBA2 or { 0, 153, 204, 255 }
RGBA3 = RGBA3 or { 185, 0, 0, 255 }
if Percent2 and Percent2 > 0 then
local X = CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right + CurrentMenu.WidthOffset + Percent * BarWidth
RenderRectangle(X, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Percent2 * BarWidth, Statistics.Bar.Height, RGBA2[1], RGBA2[2], RGBA2[3], RGBA2[4])
elseif Percent2 and Percent2 < 0 then
local X = CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right + CurrentMenu.WidthOffset + Percent * BarWidth
RenderRectangle(X, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Bar.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Percent2 * BarWidth, Statistics.Bar.Height, RGBA3[1], RGBA3[2], RGBA3[3], RGBA3[4])
end
for i = 1, #Statistics.Divider, 1 do
RenderRectangle((CurrentMenu.X + RageUI.Settings.Items.Title.Background.Width - BarWidth - Statistics.Bar.Right) + i * ((BarWidth - (#Statistics.Divider / Statistics.Divider[i].Width)) / (#Statistics.Divider + 1)) + CurrentMenu.WidthOffset, (RageUI.StatisticPanelCount * 40) + CurrentMenu.Y + Statistics.Divider[i].Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Statistics.Divider[i].Width, Statistics.Divider[i].Height, 0, 0, 0, 255)
end
RageUI.StatisticPanelCount = RageUI.StatisticPanelCount + 1
end
end
end
@@ -0,0 +1,52 @@
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@type table
local Heritage = {
Background = { Dictionary = "pause_menu_pages_char_mom_dad", Texture = "mumdadbg", Width = 431, Height = 228 },
Mum = { Dictionary = "char_creator_portraits", X = 25, Width = 228, Height = 228 },
Dad = { Dictionary = "char_creator_portraits", X = 195, Width = 228, Height = 228 },
}
---@type Window
function RageUI.Window.Heritage(Mum, Dad)
---@type table
local CurrentMenu = RageUI.CurrentMenu;
if CurrentMenu ~= nil then
if CurrentMenu() then
if Mum < 0 or Mum > 21 then
Mum = 0
end
if Dad < 0 or Dad > 23 then
Dad = 0
end
if Mum == 21 then
Mum = "special_female_" .. (tonumber(string.sub(Mum, 2, 2)) - 1)
else
Mum = "female_" .. Mum
end
if Dad >= 21 then
Dad = "special_male_" .. (tonumber(string.sub(Dad, 2, 2)) - 1)
else
Dad = "male_" .. Dad
end
RenderSprite(Heritage.Background.Dictionary, Heritage.Background.Texture, CurrentMenu.X, CurrentMenu.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Heritage.Background.Width + (CurrentMenu.WidthOffset / 1), Heritage.Background.Height)
RenderSprite(Heritage.Dad.Dictionary, Dad, CurrentMenu.X + Heritage.Dad.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Heritage.Dad.Width, Heritage.Dad.Height)
RenderSprite(Heritage.Mum.Dictionary, Mum, CurrentMenu.X + Heritage.Mum.X + (CurrentMenu.WidthOffset / 2), CurrentMenu.Y + CurrentMenu.SubtitleHeight + RageUI.ItemOffset, Heritage.Mum.Width, Heritage.Mum.Height)
RageUI.ItemOffset = RageUI.ItemOffset + Heritage.Background.Height
end
end
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -37,4 +37,4 @@
town_a = 255
-- Determine rather the HUD should only display when player(s) are inside a vehicle or not
checkForVehicle = true
checkForVehicle = false
File diff suppressed because one or more lines are too long
+13
View File
@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: azeroth
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+37
View File
@@ -0,0 +1,37 @@
![Group 2 (13)](https://user-images.githubusercontent.com/76072277/212427113-123c0e95-9982-41de-a4fd-32ac33340bd2.png)
[![Love](http://ForTheBadge.com/images/badges/built-with-love.svg)](https://github.com/Azerothwav) [![name](https://img.shields.io/badge/Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://forum.cfx.re/t/realistic-vehicle-failure-repair-fix/4887760/2) [![name](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UCH7coJ4d1gqh8BMMHacGQ5A) [![LUA](https://img.shields.io/badge/Lua-2C2D72?style=for-the-badge&logo=lua&logoColor=white)](https://www.lua.org) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/azeroth)
# Installation
curl https://github.com/Azerothwav/Az_wheeldamage
# Informations
This script allows you to add a new element of realism to your server by adding the possibility of losing wheels.
![alt text](https://media.discordapp.net/attachments/912680553503948821/996428698565754890/unknown.png?width=1405&height=701)
## Requirements to trigger the loss of wheels:
- Make a jump that lasts more than 1 second (configurable in the config.lua)
- Make a collision with a certain speed (configurable in the config.lua)
The wheels are removable to be put back on the original vehicle.
![alt text](https://media.discordapp.net/attachments/912680553503948821/996428806766198804/unknown.png)
## Integration for other script
A trigger is available to allow your mechanic script to repair the damaged vehicle.
TriggerEvent("az_wheel:fixvehicle")
## Limitation
The limitations of GTA make that the motorcycle wheels are not detachable, so they are immune. I also limited the wheels for boats, planes and helicopters. The off-road wheels allow to override the fact of losing a wheel via height but not via collisions.
## Known bugs:
- Vehicles can sometimes bug and go under the map (rare but it can happen)
## Framework
**QBCore / ESX / Standalone / Custom**
# Preview
https://www.youtube.com/watch?v=TYFLSRikyyA&t=1s
+466
View File
@@ -0,0 +1,466 @@
Config.InitFrameWork()
local WheelAlreadyBroken = {}
local objroue = {}
table.insert(WheelAlreadyBroken, {index = 'none', vehicule = 'none'})
local RouePos = {
[0] = {bone = 'wheel_lf', props = 'prop_wheel_01'},
[1] = {bone = 'wheel_rf', props = 'prop_wheel_01'},
[2] = {bone = 'wheel_lr', props = 'prop_wheel_01'},
[3] = {bone = 'wheel_rr', props = 'prop_wheel_01'},
}
startcheck = true
local havefind = false
local havefind2 = false
local havefind3 = false
local havefind4 = false
Citizen.CreateThread(function()
while startcheck do
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local wait = 1000
if vehicle ~= 0 and GetPedInVehicleSeat(GetVehiclePedIsIn(PlayerPedId()), -1) == PlayerPedId() then
local classveh = GetVehicleClass(vehicle)
local classwheel = GetVehicleWheelType(vehicle)
if classveh == 14 or classveh == 15 or classveh == 16 or classveh == 8 or classwheel == 4 then
else
wait = 0
local roue = GetVehicleNumberOfWheels(vehicle) - 1
for i = 0, roue, 1 do
if tonumber(GetVehicleWheelSuspensionCompression(vehicle, i)) == 0.00 and not injump and GetVehicleWheelXOffset(vehicle, i) ~= '-nan' then
injump = true
Citizen.SetTimeout(Config.TimeToDetachWheel, function()
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i then
havefind = true
end
end
if not havefind then
ChechIfDetach(vehicle, i)
else
if i < 3 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i + 1 then
havefind2 = true
end
end
if not havefind2 then
ChechIfDetach(vehicle, i + 1)
else
if i < 3 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i + 2 then
havefind3 = true
end
end
if not havefind3 then
ChechIfDetach(vehicle, i + 2)
else
if i < 3 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i + 3 then
havefind4 = true
end
end
if not havefind4 then
ChechIfDetach(vehicle, i + 3)
end
end
end
end
end
end
end
end)
end
end
end
end
Citizen.Wait(wait)
end
end)
local inchek = false
Citizen.CreateThread(function()
lastkm = nil
oldcompteurlaunch = false
local wait = 1000
while startcheck do
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
if vehicle ~= 0 and GetPedInVehicleSeat(GetVehiclePedIsIn(PlayerPedId()), -1) == PlayerPedId() then
local classveh = GetVehicleClass(vehicle)
if classveh == 14 or classveh == 15 or classveh == 16 or classveh == 8 then
else
wait = 0
if not oldcompteurlaunch then
oldcompteurlaunch = true
Citizen.SetTimeout(1000, function()
lastkm = math.ceil(GetEntitySpeed(vehicle) * 3.6)
oldcompteurlaunch = false
end)
end
if lastkm then
if HasEntityCollidedWithAnything(vehicle) and lastkm >= Config.KmMax then
if not inchek and GetVehicleWheelXOffset(vehicle, i) ~= '-nan' then
inchek = true
local roue = GetVehicleNumberOfWheels(vehicle) - 1
for i = 0, roue, 1 do
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i then
havefind = true
end
end
if not havefind then
ChechIfDetachGround(vehicle, i)
else
if i < 3 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i + 1 then
havefind2 = true
end
end
if not havefind2 then
ChechIfDetachGround(vehicle, i + 1)
else
if i < 3 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i + 2 then
havefind3 = true
end
end
if not havefind3 then
ChechIfDetachGround(vehicle, i + 2)
else
if i < 3 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i + 3 then
havefind4 = true
end
end
if not havefind4 then
ChechIfDetachGround(vehicle, i + 3)
end
end
end
end
end
end
end
end
end
end
end
end
end
Citizen.Wait(wait)
end
end)
local wheelpickup = false
if Config.CommandFix then
RegisterCommand("startfix", function()
for k, v in pairs(WheelAlreadyBroken) do
local playercoords = GetEntityCoords(GetPlayerPed(-1))
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
if vehicle ~= 0 then
if vehicle == v.vehicule then
wheelpickup = true
SetCurrentPedWeapon(GetPlayerPed(-1), 0xA2719263)
AttachEntityToEntity(v.obj, GetPlayerPed(-1), GetPedBoneIndex(GetPlayerPed(-1), 28422), 0.0, 0.0, 0.0, 135.0, 0.0, 0.0, 1, 1, 0, 0, 2, 1)
Config.SendNotification(Config.Lang["StartFixWheel"])
Citizen.Wait(5000)
startdistancevehiclevar = true
Startdistancevehicle(v.vehicule, v.obj, v.index)
end
else
Config.SendNotification(Config.Lang["EnterInVehicleToFix"])
end
end
end, false)
end
if Config.TriggerFix then
RegisterNetEvent('az_wheel:fixvehicle')
AddEventHandler('az_wheel:fixvehicle', function()
for k, v in pairs(WheelAlreadyBroken) do
local playercoords = GetEntityCoords(GetPlayerPed(-1))
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
if vehicle ~= 0 then
if vehicle == v.vehicule then
wheelpickup = true
SetCurrentPedWeapon(GetPlayerPed(-1), 0xA2719263)
AttachEntityToEntity(v.obj, GetPlayerPed(-1), GetPedBoneIndex(GetPlayerPed(-1), 28422), 0.0, 0.0, 0.0, 135.0, 0.0, 0.0, 1, 1, 0, 0, 2, 1)
Config.SendNotification(Config.Lang["StartFixWheel"])
Citizen.Wait(5000)
startdistancevehiclevar = true
Startdistancevehicle(v.vehicule, v.obj, v.index)
end
else
Config.SendNotification(Config.Lang["EnterInVehicleToFix"])
end
end
end)
end
Citizen.CreateThread(function()
while true do
local wait = 1000
for k, v in pairs(WheelAlreadyBroken) do
local playercoords = GetEntityCoords(GetPlayerPed(-1))
local coordsroue = GetEntityCoords(v.obj)
if GetDistanceBetweenCoords(playercoords, coordsroue, true) < 2 then
wait = 0
if not wheelpickup then
DrawText3Ds(coordsroue.x, coordsroue.y, coordsroue.z + 0.50, Config.Lang["PressToPickWheel"])
end
if IsControlJustReleased(0, 38) and not wheelpickup then
wheelpickup = true
SetCurrentPedWeapon(GetPlayerPed(-1), 0xA2719263)
AttachEntityToEntity(v.obj, GetPlayerPed(-1), GetPedBoneIndex(GetPlayerPed(-1), 28422), 0.0, 0.0, 0.0, 135.0, 0.0, 0.0, 1, 1, 0, 0, 2, 1)
startdistancevehiclevar = true
Startdistancevehicle(v.vehicule, v.obj, v.index)
end
end
end
Citizen.Wait(wait)
end
end)
local sendtoserver = false
function Startdistancevehicle(vehicule, obj, index)
local wait = 1000
local draw3dtext = false
Citizen.CreateThread(function()
while startdistancevehiclevar do
local vehiclecoords = GetEntityCoords(vehicule)
local playercoords = GetEntityCoords(GetPlayerPed(-1))
local vehicleheading = GetEntityHeading(vehicule)
if GetDistanceBetweenCoords(playercoords, vehiclecoords, true) < 3 then
wait = 0
if not draw3dtext then
DrawText3Ds(vehiclecoords.x, vehiclecoords.y, vehiclecoords.z, Config.Lang["PressToFixWheel"])
end
if IsControlJustReleased(0, 38) then
local findplayerin = false
for l = 0, 5, 1 do
if GetPedInVehicleSeat(vehicule, l - 1) ~= 0 then
findplayerin = true
end
end
if not findplayerin then
draw3dtext = true
Citizen.SetTimeout(5000, function()
sendtoserver = false
end)
local phantomveh = CreateVehicle(GetHashKey("baller"), vehiclecoords, vehicleheading, false, false)
FreezeEntityPosition(phantomveh, true)
SetEntityCollision(phantomveh, false, false)
SetEntityVisible(phantomveh, false, false)
for k, v in pairs(RouePos) do
if k == index then
local roueposition = GetWorldPositionOfEntityBone(phantomveh, GetEntityBoneIndexByName(phantomveh, v.bone))
TaskStartScenarioInPlace(GetPlayerPed(-1), "CODE_HUMAN_MEDIC_KNEEL", 0, true)
Citizen.Wait(Config.TimeToAttachWheel)
ClearPedTasksImmediately(GetPlayerPed(-1))
if not sendtoserver then
sendtoserver = true
TriggerServerEvent('az_wheel:updatewheel', VehToNet(vehicule), index, GetVehicleWheelXOffset(phantomveh, index), ObjToNet(obj))
end
DeleteEntity(phantomveh)
end
end
Citizen.SetTimeout(2500, function()
wheelpickup = false
if index == 0 then
if havefind then
havefind = false
end
elseif index == 1 then
if havefind2 then
havefind2 = false
end
elseif index == 2 then
if havefind3 then
havefind3 = false
end
elseif index == 3 then
if havefind4 then
havefind4 = false
end
end
end)
startdistancevehiclevar = false
else
Config.SendNotification(Config.Lang["PlayerInVeh"])
end
end
end
Citizen.Wait(wait)
end
end)
end
function DrawText3Ds(x,y,z, text)
local onScreen,_x,_y=World3dToScreen2d(x,y,z)
local px,py,pz=table.unpack(GetGameplayCamCoords())
SetTextScale(0.32, 0.32)
SetTextFont(4)
SetTextProportional(1)
SetTextColour(255, 255, 255, 255)
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x,_y)
local factor = (string.len(text)) / 500
DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 0, 0, 0, 80)
end
function ChechIfDetachGround(vehicle, i)
if not incooldowncheckground then
local findwheel = false
local havefind = false
local inground = false
incooldowncheckground = true
Citizen.SetTimeout(1000, function()
incooldowncheckground = false
inchek = false
end)
if GetVehicleWheelXOffset(vehicle, i) ~= '-nan' then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i then
havefind = true
end
if v.obj == objroue[i] then
havefind = true
end
end
if not havefind then
for k, v in pairs(RouePos) do
if k == i then
if objroue[i] == nil then
local roueposition = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, v.bone))
if not HasModelLoaded(v.props) then
RequestModel(v.props)
while not HasModelLoaded(v.props) do
Citizen.Wait(1)
end
end
objroue[i] = CreateObject(v.props, roueposition, false)
TriggerServerEvent('az_wheel:setoffsetserver', VehToNet(vehicle), i, -math.random(1000, 1025), objroue[i])
end
end
end
else
if i < 3 then
ChechIfDetachGround(vehicle, i + 1)
end
end
end
end
end
function ChechIfDetach(vehicle, i)
if not incooldowncheck then
local havefind = false
local inground = false
local hauteur = 0
incooldowncheck = true
Citizen.SetTimeout(1000, function()
incooldowncheck = false
injump = false
if inchek then
inchek = false
end
end)
if tonumber(GetVehicleWheelSuspensionCompression(vehicle, i)) == 0.00 and GetVehicleWheelXOffset(vehicle, i) ~= '-nan' then
for k, v in pairs(WheelAlreadyBroken) do
if v.index == i then
havefind = true
end
if v.obj and v.obj ~= nil then
if v.obj == objroue[i] then
havefind = true
end
end
end
if not havefind then
while not inground do
for n = 0, 4, 1 do
hauteur = hauteur + tonumber(GetVehicleWheelSuspensionCompression(vehicle, i))
if hauteur > 0 then
inground = true
end
end
Citizen.Wait(0)
end
for k, v in pairs(RouePos) do
if k == i then
if objroue[i] == nil then
local roueposition = GetWorldPositionOfEntityBone(vehicle, GetEntityBoneIndexByName(vehicle, v.bone))
if not HasModelLoaded(v.props) then
RequestModel(v.props)
while not HasModelLoaded(v.props) do
Citizen.Wait(1)
end
end
objroue[i] = CreateObject(v.props, roueposition, false)
TriggerServerEvent('az_wheel:setoffsetserver', VehToNet(vehicle), i, -math.random(1000, 1025), objroue[i])
end
end
end
else
if i < 3 then
ChechIfDetach(vehicle, i + 1)
end
end
end
end
end
RegisterNetEvent('az_wheel:setoffset')
AddEventHandler('az_wheel:setoffset', function(veh, index, offset, obj)
if index and veh and offset then
table.insert(WheelAlreadyBroken, {index = index, vehicule = NetToVeh(veh), obj = obj})
SetVehicleWheelXOffset(NetToVeh(veh), index, offset)
end
end)
RegisterNetEvent('az_wheel:updatewheelclient')
AddEventHandler('az_wheel:updatewheelclient', function(veh, index, offset, obj)
if index and veh and offset and obj then
SetVehicleWheelXOffset(NetToVeh(veh), index, offset)
for z, w in pairs(WheelAlreadyBroken) do
if w.obj == obj and w.index == index then
WheelAlreadyBroken[z] = nil
end
end
DeleteEntity(obj)
for k, v in pairs(objroue) do
if v == obj then
objroue[k] = nil
end
end
Citizen.Wait(5000)
end
end)
Citizen.CreateThread(function()
while true do
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
if vehicle ~= 0 then
if #WheelAlreadyBroken > 0 then
for k, v in pairs(WheelAlreadyBroken) do
if v.index and v.index ~= nil and v.vehicule and v.vehicule ~= 'none' then
if v.vehicule == vehicle then
SetEntityCollision(v.vehicule, true, true)
SetVehicleWheelXOffset(v.vehicule, v.index, -math.random(1000, 1025))
end
end
end
end
end
Citizen.Wait(0)
end
end)
+38
View File
@@ -0,0 +1,38 @@
Config = {}
Config.FrameWork = "" -- ESX / QBCore / custom
Config.TriggerFix = false
Config.CommandFix = true
Config.TimeToDetachWheel = 1000
Config.TimeToAttachWheel = 5000
Config.KmMax = 175
Config.Lang = {
["StartFixWheel"] = 'Repair of the wheels thrown, please exit the vehicle',
["EnterInVehicleToFix"] = 'No vehicle found, please enter the vehicle to be repaired',
["PressToPickWheel"] = 'Press E to pick up the wheel',
["PressToFixWheel"] = 'Press E to fix the wheel',
["PlayerInVeh"] = 'There is someone in the vehicle'
}
Config.SendNotification = function(msg)
if Config.FrameWork == "ESX" then
ESX.ShowNotification(msg)
elseif Config.FrameWork == "QBCore" then
QBCore.Functions.Notify(msg, 'success')
elseif Config.FrameWork == "custom" then
print(msg)
end
end
Config.InitFrameWork = function()
if Config.FrameWork == "ESX" then
ESX = nil TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
elseif Config.FrameWork == "QBCore" then
QBCore = exports['qb-core']:GetCoreObject()
elseif Config.FrameWork == "custom" then
end
end
+14
View File
@@ -0,0 +1,14 @@
fx_version "adamant"
game "gta5"
shared_scripts {
"config.lua"
}
client_scripts {
'client/*.lua'
}
server_scripts {
"server/*.lua"
}
+9
View File
@@ -0,0 +1,9 @@
RegisterNetEvent('az_wheel:updatewheel')
AddEventHandler('az_wheel:updatewheel', function(veh, index, offset, obj)
TriggerClientEvent('az_wheel:updatewheelclient', -1, veh, index, offset, obj)
end)
RegisterNetEvent('az_wheel:setoffsetserver')
AddEventHandler('az_wheel:setoffsetserver', function(veh, index, offset, obj)
TriggerClientEvent('az_wheel:setoffset', -1, veh, index, offset, obj)
end)
@@ -28,11 +28,11 @@ Config = {
}
Config.Splash = {
Header_IMG = 'https://forum.cfx.re/uploads/default/original/3X/a/6/a6ad03c9fb60fa7888424e7c9389402846107c7e.png',
Header_IMG = '',
Enabled = false,
Wait = 10, -- How many seconds should splash page be shown for? (Max is 12)
Heading1 = "Welcome to Elite Gaming RP.",
Heading2 = "Make sure to join our Discord and check out our website!",
Discord_Link = 'https://discord.gg/x6PwsHtVjE',
Website_Link = 'https://elite-gaming.co.uk',
Website_Link = 'https://elite-gaming.gg',
}
@@ -25,7 +25,7 @@ AddEventHandler('Badger_Discord_API:PlayerLoaded', function()
end)
--card = '{"type":"AdaptiveCard","$schema":"http://adaptivecards.io/schemas/adaptive-card.json","version":"1.2","body":[{"type":"Container","items":[{"type":"TextBlock","text":"Badger_Discord_API","wrap":true,"fontType":"Default","size":"ExtraLarge","weight":"Bolder","color":"Light","horizontalAlignment":"Center"},{"type":"TextBlock","text":"' .. Config.Splash.Heading1 .. '","wrap":true,"size":"Large","weight":"Bolder","color":"Light"},{"type":"TextBlock","text":"' .. Config.Splash.Heading2 .. '","wrap":true,"color":"Light","size":"Medium"},{"type":"ColumnSet","height":"stretch","minHeight":"100px","bleed":true,"horizontalAlignment":"Center","columns":[{"type":"Column","width":"stretch","items":[{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Discord","url":"' .. Config.Splash.Discord_Link .. '","style":"positive"}]}],"height":"stretch"},{"type":"Column","width":"stretch","items":[{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Website","style":"positive","url":"' .. Config.Splash.Website_Link .. '"}]}]}]},{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Click to join Badger\'s Discord","style":"destructive","iconUrl":"https://i.gyazo.com/c629f37bb1aeed2c1bc1768fdc93bc1a.gif","url":"https://discord.com/invite/WjB5VFz"}]}],"style":"default","bleed":true,"height":"stretch","isVisible":true}]}'
card = '{"type":"AdaptiveCard","$schema":"http://adaptivecards.io/schemas/adaptive-card.json","version":"1.2","body":[{"type":"Image","url":"' .. Config.Splash.Header_IMG .. '","horizontalAlignment":"Center"},{"type":"Container","items":[{"type":"TextBlock","text":"Badger_Discord_API","wrap":true,"fontType":"Default","size":"ExtraLarge","weight":"Bolder","color":"Light","horizontalAlignment":"Center"},{"type":"TextBlock","text":"' .. Config.Splash.Heading1 .. '","wrap":true,"size":"Large","weight":"Bolder","color":"Light", "horizontalAlignment":"Center"},{"type":"TextBlock","text":"' .. Config.Splash.Heading2 .. '","wrap":true,"color":"Light","size":"Medium","horizontalAlignment":"Center"},{"type":"ColumnSet","height":"stretch","minHeight":"100px","bleed":true,"horizontalAlignment":"Center","columns":[{"type":"Column","width":"stretch","items":[{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Discord","url":"' .. Config.Splash.Discord_Link .. '","style":"positive"}]}],"height":"stretch"},{"type":"Column","width":"stretch","items":[{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Website","style":"positive","url":"' .. Config.Splash.Website_Link .. '"}]}]}]},{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Click to join Badger\'s Discord","style":"destructive","iconUrl":"https://i.gyazo.com/c629f37bb1aeed2c1bc1768fdc93bc1a.gif","url":"https://discord.com/invite/WjB5VFz"}]}],"style":"default","bleed":true,"height":"stretch","isVisible":true}]}'
card = '{"type":"AdaptiveCard","$schema":"http://adaptivecards.io/schemas/adaptive-card.json","version":"1.2","body":[{"type":"Image","url":"' .. Config.Splash.Header_IMG .. '","horizontalAlignment":"Center"},{"type":"Container","items":[{"type":"TextBlock","text":"Server Information","wrap":true,"fontType":"Default","size":"ExtraLarge","weight":"Bolder","color":"Light","horizontalAlignment":"Center"},{"type":"TextBlock","text":"' .. Config.Splash.Heading1 .. '","wrap":true,"size":"Large","weight":"Bolder","color":"Light", "horizontalAlignment":"Center"},{"type":"TextBlock","text":"' .. Config.Splash.Heading2 .. '","wrap":true,"color":"Light","size":"Medium","horizontalAlignment":"Center"},{"type":"ColumnSet","height":"stretch","minHeight":"100px","bleed":true,"horizontalAlignment":"Center","columns":[{"type":"Column","width":"stretch","items":[{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Discord","url":"' .. Config.Splash.Discord_Link .. '","style":"positive"}]}],"height":"stretch"},{"type":"Column","width":"stretch","items":[{"type":"ActionSet","actions":[{"type":"Action.OpenUrl","title":"Website","style":"positive","url":"' .. Config.Splash.Website_Link .. '"}]}]}]}],"style":"default","bleed":true,"height":"stretch","isVisible":true}]}'
if Config.Splash.Enabled then
AddEventHandler('playerConnecting', function(name, setKickReason, deferrals)
-- Player is connecting
@@ -1,6 +1,6 @@
-- Made by Tazio
local DISCORD_WEBHOOK = "https://discord.com/api/webhooks/807394115561979935/-gtiRGG6drFwJ_8e2vGG-SxJPhEb-tQTq_0r0664Q8CdtkLvj6BDxmiyE8Oc92VYuCMH"
local DISCORD_WEBHOOK = "https://discord.com/api/webhooks/982313609268961320/HkhB-ih8xJLBEsntxBDk6xauyWo7mr8SDmWETK7GsnzEfMolxxQXZYnus5lf82Rcv4NQ"
local DISCORD_NAME = "Elite Gaming RP"
local STEAM_KEY = "0C034D20C57C8D6C5A8EED855916981F"
local DISCORD_IMAGE = "https://i.imgur.com/lF8nHnz.jpg" -- default is FiveM logo
+1 -1
View File
@@ -1,5 +1,5 @@
#The Control to toggle the Menu (default is 344=F11) list at https://wiki.fivem.net/wiki/Controls
toggleMenu=344
toggleMenu=56
#Should chase camera be enabled for users to select? (1 - yes, 0 - no)
chaseCameraEnabled=1
#Should drone camera be enabled for users to select? (1 - yes, 0 - no)
-2
View File
@@ -3674,6 +3674,4 @@
"multiplier": 15,
"itemLocation": 0
},
]
+92
View File
@@ -0,0 +1,92 @@
--[[
---------------------------------------------------
LUXART VEHICLE CONTROL V3 (FOR FIVEM)
---------------------------------------------------
Coded by Lt.Caine
ELS Clicks by Faction
Additional Modification by TrevorBarns
---------------------------------------------------
FILE: cl_plugins.lua
PURPOSE: Builds RageUI Plugin Menu based on plugins
settings. Handles Plugin -> LVC event communication
---------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
---------------------------------------------------
]]
-- RAGE UI
-- Draws specific button with callback to plugins menu if the plugin is found and enabled. (controlled in plugins settings file)
CreateThread(function()
while true do
while plugins_installed and IsMenuOpen() do
RageUI.IsVisible(RMenu:Get('lvc', 'plugins'), function()
-----------------------------------------------------------------------------------------------------------------
if tkd_masterswitch ~= nil then
RageUI.Button(Lang:t('plugins.menu_tkd'), Lang:t('plugins.menu_tkd_desc'), {RightLabel = '→→→'}, tkd_masterswitch, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'tkdsettings'))
end
-----------------------------------------------------------------------------------------------------------------
if ei_masterswitch ~= nil then
RageUI.Button(Lang:t('plugins.menu_ei'), Lang:t('plugins.menu_ei_desc'), {RightLabel = '→→→'}, ei_masterswitch, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'extrasettings'))
end
-----------------------------------------------------------------------------------------------------------------
if ta_masterswitch ~= nil then
RageUI.Button(Lang:t('plugins.menu_ta'), Lang:t('plugins.menu_ta_desc'), {RightLabel = '→→→'}, ta_masterswitch, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'tasettings'))
end
-----------------------------------------------------------------------------------------------------------------
if trailer_masterswitch ~= nil then
RageUI.Button(Lang:t('plugins.menu_ts'), Lang:t('plugins.menu_ts_desc'), {RightLabel = '→→→'}, trailer_masterswitch, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'trailersettings'))
end
-----------------------------------------------------------------------------------------------------------------
if ec_masterswitch ~= nil then
RageUI.Button(Lang:t('plugins.menu_ec'), Lang:t('plugins.menu_ec_desc'), {RightLabel = '→→→'}, ec_masterswitch, {
onSelected = function()
end,
}, RMenu:Get('lvc', 'extracontrols'))
end
-----------------------------------------------------------------------------------------------------------------
end)
Wait(0)
end
Wait(500)
end
end)
-- FUNCTIONS
-- IsPluginMenuOpen is called inside IsMenuOpen (LVC/UI/cl_ragemenu.lua) to separate them, this is useful for plugin updates separate of main LVC updates.
local ec_shortcut_menu_visible = false
function IsPluginMenuOpen()
if ec_masterswitch then
ec_shortcut_menu_visible = EC.is_menu_open
end
return RageUI.Visible(RMenu:Get('lvc', 'tkdsettings')) or
RageUI.Visible(RMenu:Get('lvc', 'extrasettings')) or
RageUI.Visible(RMenu:Get('lvc', 'tasettings')) or
RageUI.Visible(RMenu:Get('lvc', 'trailersettings')) or
RageUI.Visible(RMenu:Get('lvc', 'trailerextras')) or
RageUI.Visible(RMenu:Get('lvc', 'trailerdoors')) or
RageUI.Visible(RMenu:Get('lvc', 'extracontrols')) or
ec_shortcut_menu_visible
end
@@ -0,0 +1,21 @@
--------------------EXTRA INTEGRATION SETTINGS---------------------
ec_masterswitch = true
-- Determines if extra_integration plugin can be activated.
allow_custom_controls = true
-- Enabled/Disables menu which allows for custom controls to be set.
--[[ Documentation / Wiki: https://github.com/TrevorBarns/luxart-vehicle-control/wiki/Extra-Controls ]]
EXTRA_CONTROLS = {
['DEFAULT'] = {
-- { '<name>', Extras = {<extras table>}, Combo = <default combo>, Key = <default key>, (opt.) Audio = < button soundFX> }
},
}
CONTROLS = {
-- COMBOS = { <list of index/key ID of approved combo-keys> }, List of Controls: https://docs.fivem.net/docs/game-references/controls/
-- KEYS = { <list of index/key ID of approved toggle keys> }
-- ex: COMBOS = { 326, 155, 19, 349 }, --LCTRL, LSHIFT, LALT, TAB
-- ex: KEYS = { 187, 188, 189, 190, 20 }, -- ARROW LFT, DWN, UP, RGT, Z
COMBOS = { },
KEYS = { }
}
@@ -0,0 +1,243 @@
--[[
---------------------------------------------------
LUXART VEHICLE CONTROL V3 (FOR FIVEM)
---------------------------------------------------
Coded by Lt.Caine
ELS Clicks by Faction
Additional Modification by TrevorBarns
---------------------------------------------------
FILE: cl_ragemenu.lua
PURPOSE: Handle RageUI
---------------------------------------------------
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
---------------------------------------------------
]]
if ec_masterswitch then
RMenu.Add('lvc', 'extracontrols', RageUI.CreateSubMenu(RMenu:Get('lvc', 'plugins'),' ', Lang:t('plugins.menu_ec'), 0, 0, "lvc", "lvc_plugin_logo"))
RMenu:Get('lvc', 'extracontrols'):DisplayGlare(false)
RMenu:Get('lvc', 'extracontrols'):SetTotalItemsPerPage(13)
--RageUI Confirm UI elements
local confirm_d_msg
local confirm_s_msg
local confirm_l_msg
local confirm_s_desc
local confirm_l_desc
local profile_s_op = 75
local profile_l_op = 75
-- Handle user input to cancel confirmation message for SAVE/LOAD
CreateThread(function()
while true do
while not RageUI.Settings.Controls.Back.Enabled do
for Index = 1, #RageUI.Settings.Controls.Back.Keys do
if IsDisabledControlJustPressed(RageUI.Settings.Controls.Back.Keys[Index][1], RageUI.Settings.Controls.Back.Keys[Index][2]) then
confirm_s_msg = nil
confirm_s_desc = nil
profile_s_op = 75
confirm_l_msg = nil
confirm_l_desc = nil
profile_l_op = 75
confirm_r_msg = nil
confirm_d_msg = nil
Wait(10)
RageUI.Settings.Controls.Back.Enabled = true
break
end
end
Wait(0)
end
Wait(100)
end
end)
local is_loop_on = false
--[[Loop to be called when dynamically created menus are opened,
loop continues until closed updating the EC.is_menu_open var,
which is used in cl_plugins.lua for IsPluginsMenuOpen()]]
local function StartIsMenuOpenLoop()
if not is_loop_on then
is_loop_on = true
CreateThread(function()
while is_loop_on do
EC.is_menu_open = false
for i, extra_shortcut in ipairs(EC.table) do
if RageUI.Visible(RMenu:Get('lvc', 'extracontrols_'..i)) then
EC.is_menu_open = true
end
end
if not EC.is_menu_open then
is_loop_on = false
end
Wait(1)
end
end)
end
end
CreateThread(function()
Wait(1000)
local choice
local shortcut_prefix
if allow_custom_controls then
shortcut_prefix = Lang:t('plugins.ec_shortcut_prefix_change')
else
shortcut_prefix = Lang:t('plugins.ec_shortcut_prefix_view')
end
while true do
RageUI.IsVisible(RMenu:Get('lvc', 'extracontrols'), function()
RageUI.Checkbox(Lang:t('menu.enabled'), Lang:t('plugins.ec_enabled_desc'), EC.controls_enabled, {}, {
onChecked = function()
EC.controls_enabled = true
end,
onUnChecked = function()
EC.controls_enabled = false
end
})
RageUI.Separator(Lang:t('plugins.ec_shortcuts_separator'))
-- Buttons for dynamic shortcut menu
if #EC.table > 0 then
for i, extra_shortcut in ipairs(EC.table) do
RageUI.Button(extra_shortcut.Name, Lang:t('plugins.ec_shortcut_desc', { prefix = shortcut_prefix }), {RightLabel = '→→→'}, true, {
onSelected = function()
StartIsMenuOpenLoop()
end,
}, RMenu:Get('lvc', 'extracontrols'..'_'..i))
end
if allow_custom_controls then
RageUI.Separator(Lang:t('menu.storage'))
RageUI.Button(Lang:t('plugins.ec_save'), confirm_s_desc or Lang:t('plugins.ec_save_desc'), {RightLabel = confirm_s_msg or '('.. EC.profile .. ')', RightLabelOpacity = profile_s_op}, true, {
onSelected = function()
if confirm_s_msg == Lang:t('menu.save_override') then
EC:SaveSettings()
HUD:ShowNotification(Lang:t('menu.save_success'), true)
confirm_s_msg = nil
confirm_s_desc = nil
profile_s_op = 75
else
RageUI.Settings.Controls.Back.Enabled = false
profile_s_op = 255
confirm_s_msg = Lang:t('menu.save_override')
confirm_s_desc = Lang:t('menu.save_override_desc', { profile = EC.profile })
confirm_l_msg = nil
profile_l_op = 75
confirm_r_msg = nil
confirm_d_msg = nil
end
end,
})
RageUI.Button(Lang:t('plugins.ec_load'), confirm_l_desc or Lang:t('plugins.ec_load_desc'), {RightLabel = confirm_l_msg or '('.. EC.profile .. ')', RightLabelOpacity = profile_l_op}, true, {
onSelected = function()
if confirm_l_msg == Lang:t('menu.save_override') then
EC:LoadSettings()
HUD:ShowNotification(Lang:t('menu.load_success'), true)
confirm_l_msg = nil
confirm_l_desc = nil
profile_l_op = 75
else
RageUI.Settings.Controls.Back.Enabled = false
profile_l_op = 255
confirm_l_msg = Lang:t('menu.save_override')
confirm_l_desc = Lang:t('menu.load_override')
confirm_s_msg = nil
profile_s_op = 75
confirm_r_msg = nil
confirm_d_msg = nil
end
end,
})
RageUI.Button(Lang:t('plugins.ec_reset'), Lang:t('plugins.ec_reset_desc'), {RightLabel = confirm_r_msg}, true, {
onSelected = function()
if confirm_r_msg == Lang:t('menu.save_override') then
EC:LoadBackupTable()
HUD:ShowNotification(Lang:t('menu.reset_success'), true)
confirm_r_msg = nil
else
RageUI.Settings.Controls.Back.Enabled = false
confirm_r_msg = Lang:t('menu.save_override')
confirm_l_msg = nil
profile_l_op = 75
confirm_s_msg = nil
profile_s_op = 75
confirm_d_msg = nil
end
end,
})
RageUI.Button(Lang:t('plugins.ec_factory_reset'), Lang:t('plugins.ec_factory_reset_desc'), {RightLabel = confirm_d_msg}, true, {
onSelected = function()
if confirm_d_msg == Lang:t('menu.save_override') then
EC:DeleteProfiles()
UTIL:Print(Lang:t('plugins.ec_factory_reset_success_console'), true)
HUD:ShowNotification(Lang:t('plugins.ec_factory_reset_success_frontend'), true)
confirm_d_msg = nil
else
RageUI.Settings.Controls.Back.Enabled = false
confirm_d_msg = Lang:t('menu.save_override')
confirm_l_msg = nil
profile_l_op = 75
confirm_s_msg = nil
profile_s_op = 75
confirm_r_msg = nil
end
end,
})
end
else
RageUI.Button(Lang:t('plugins.ec_no_shortcuts'), Lang:t('plugins.ec_no_shortcuts_desc'), {RightLabel = '→→→'}, false, {
onSelected = function()
end,
})
end
end)
if allow_custom_controls then
for i, extra_shortcut in ipairs(EC.table) do
RageUI.IsVisible(RMenu:Get('lvc', 'extracontrols_'..i), function()
RageUI.List(Lang:t('plugins.ec_combo'), EC.approved_combo_strings, EC.combo_id[i], Lang:t('plugins.ec_combo_desc'), {}, EC.combo_id[i] ~= nil, {
onListChange = function(Index, Item)
EC.combo_id[i] = Index
extra_shortcut.Combo = CONTROLS.COMBOS[Index]
end,
})
RageUI.List(Lang:t('plugins.ec_key'), EC.approved_key_strings, EC.key_id[i], Lang:t('plugins.ec_key_desc'), {}, true, {
onListChange = function(Index, Item)
EC.key_id[i] = Index
extra_shortcut.Key = CONTROLS.KEYS[Index]
end,
})
RageUI.Checkbox(Lang:t('plugins.ec_controller_support'), Lang:t('plugins.ec_controller_support_desc'), extra_shortcut.Controller_Support, { Enabled = EC.combo_id[i] == 1}, {
onChecked = function()
extra_shortcut.Controller_Support = true
end,
onUnChecked = function()
extra_shortcut.Controller_Support = false
end
})
end)
end
else
for i, extra_shortcut in ipairs(EC.table) do
RageUI.IsVisible(RMenu:Get('lvc', 'extracontrols_'..i), function()
RageUI.Button(Lang:t('plugins.ec_combo'), Lang:t('plugins.ec_combo_desc'), {RightLabel = EC.approved_combo_strings[EC.combo_id[i]]}, true, {})
RageUI.Button(Lang:t('plugins.ec_key'), Lang:t('plugins.ec_key_desc'), {RightLabel = EC.approved_key_strings[EC.key_id[i]]}, true, {})
end)
end
end
Wait(0)
end
end)
end

Some files were not shown because too many files have changed in this diff Show More