There are 2 types of effects "step"
and "breath"
. Both support single and multi colors as well as custom input from user for the first color.
parameter | description | required |
---|---|---|
title |
Button name in Effects menu | YES |
type |
"step" OR "breath" | YES |
input |
Allow the user to enter a RGB value | OPTIONAL |
colors |
a list with colors | YES |
{
title = "Red & White",
type = "breath",
colors = {
{255, 0, 0},
{255, 255, 255}
}
}
For more examples see ./config/colors.lua
Neons will be enabled and disabled based on the values inside anim
parameter | description | required |
---|---|---|
title |
Button name in Toggles menu | YES |
echo |
Play the effect in a loop (reverse play once finished) | OPTIONAL |
anim |
a list with neons state step by step | YES |
xenon |
a list with xenon state step by step | OPTIONAL |
anim
=> each element of the list contains a list with 4 values which ca be either 1 or 0
These indicates if the specific neons should be on or off. The order is the following LEFT, RIGHT, FRONT, BACK
xenon
=> same as anim
1=ON, 0=OFF
So if we wanna have an effect which will turn on the sides and then the front an rear one, it will look like this:
...
anim = {
{1, 1, 0, 0},
{0, 0, 1, 1}
}
...
-- this will toggle the neons in this order: (REAR) > (SIDES) > (FRONT + XENON)
{
title = "Forward",
echo = false,
anim = {
{0, 0, 0, 1},
{1, 1, 0, 0},
{0, 0, 1, 0}
},
xenon = {0, 0, 1}
}
For more examples see ./config/toggles.lua
Functions can be accessed through exports.de_underglow:FUNCTION_NAME
, if you find a use case for something that isn't accesible let me know.
---@param bool => Show or hide the menu
function ToggleMenu(bool)
---@param handle => Car handle
---@param data => table with 4 elements which can be 1 or 0, order follows `SetVehicleNeonEnabled` format
function ToggleVehicleNeons(handle, data)
---@param handle => Car handle
---@param e => effect data table
---@info Needs to be run in a loop with max 10ms for Citizen.Wait, it also uses the Citizen.Wait function internaly
-------- so a speratate thread is more suited
function AnimVehicleNeonsColor(handle, e)
---@param handle => Car handle
---@param e => effect data table
---@info Needs to be run in a loop with max 100ms for Citizen.Wait
function AnimVehicleNeonsToggle(handle, e)
local deug = exports.de_underglow -- Store the functions in a variable
local show_menu = false
CreateThread(function()
while true do
Wait(0)
if IsControlJustPressed(0, 38) then
show_menu = not show_menu
deug:ToggleMenu(show_menu)
end
end
end)