Merge pull request #619 from JUX84/feat_lscustom_xenon_color

feat(esx_lscustom): headlights colors
This commit is contained in:
Gellipapa
2022-11-27 18:30:40 +01:00
committed by GitHub
11 changed files with 111 additions and 2 deletions
+19 -1
View File
@@ -163,6 +163,14 @@ function UpdateMods(data)
props['modSmokeEnabled'] = true
ESX.Game.SetVehicleProperties(vehicle, props)
props = {}
elseif data.modType == 'xenonColor' then
if data.modNum then
props['modXenon'] = true
else
props['modXenon'] = false
end
ESX.Game.SetVehicleProperties(vehicle, props)
props = {}
end
props[data.modType] = data.modNum
@@ -211,7 +219,7 @@ function GetAction(data)
if v.modType then
if v.modType == 22 then
if v.modType == 22 or v.modType == 'xenonColor' then
table.insert(elements, {
label = " " .. TranslateCap('by_default'),
modType = k,
@@ -298,6 +306,16 @@ function GetAction(data)
modType = k,
modNum = true
})
elseif v.modType == 'xenonColor' then -- XENON COLOR
local xenonColors = GetXenonColors()
price = math.floor(vehiclePrice * v.price / 100)
for i = 1, #xenonColors, 1 do
table.insert(elements, {
label = xenonColors[i].label .. ' - <span style="color:green;">$' .. price .. '</span>',
modType = k,
modNum = xenonColors[i].index
})
end
elseif v.modType == 'neonColor' or v.modType == 'tyreSmokeColor' then -- NEON & SMOKE COLOR
local neons = GetNeons()
price = math.floor(vehiclePrice * v.price / 100)
+29 -1
View File
@@ -427,6 +427,27 @@ function GetNeons()
return neons
end
function GetXenonColors()
local xenonColors = {
{label = TranslateCap('neon'), index = -1},
{label = TranslateCap('white'), index = 0},
{label = TranslateCap('blue'), index = 1},
{label = TranslateCap('electric_blue'), index = 2},
{label = TranslateCap('mintgreen'), index = 3},
{label = TranslateCap('lime_green'), index = 4},
{label = TranslateCap('yellow'), index = 5},
{label = TranslateCap('goldenshower'), index = 6},
{label = TranslateCap('orange'), index = 7},
{label = TranslateCap('red'), index = 8},
{label = TranslateCap('ponypink'), index = 9},
{label = TranslateCap('hotpink'), index = 10},
{label = TranslateCap('purple'), index = 11},
{label = TranslateCap('blacklight'), index = 11},
}
return xenonColors
end
function GetPlatesName(index)
if (index == 0) then
return TranslateCap('blue_on_white_1')
@@ -502,7 +523,8 @@ Config.Menus = {
modHorns = TranslateCap('horns'),
neonColor = TranslateCap('neons'),
resprays = TranslateCap('respray'),
modXenon = TranslateCap('headlights'),
-- modXenon = TranslateCap('headlights'),
xenonColor = TranslateCap('headlights'),
plateIndex = TranslateCap('licenseplates'),
wheels = TranslateCap('wheels'),
modPlateHolder = TranslateCap('modplateholder'),
@@ -803,6 +825,12 @@ Config.Menus = {
modType = 22,
price = 3.72
},
xenonColor = {
label = TranslateCap('headlights'),
parent = 'cosmetics',
modType = 'xenonColor',
price = 3.72
},
bodyparts = {
label = TranslateCap('bodyparts'),
parent = 'cosmetics',
+7
View File
@@ -266,4 +266,11 @@ Locales['br'] = {
['fuel_tank'] = 'tanque de combustível',
['windows'] = 'janelas',
['stickers'] = 'autocolantes',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['de'] = {
['fuel_tank'] = 'Treibstofftank',
['windows'] = 'Fenster',
['stickers'] = 'Designs',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['en'] = {
['fuel_tank'] = 'fuel tank',
['windows'] = 'windows',
['stickers'] = 'Livery',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['es'] = {
['fuel_tank'] = 'depósito de combustible',
['windows'] = 'ventanas',
['stickers'] = 'calcomanías',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['fr'] = {
['fuel_tank'] = 'bouchon du réservoir',
['windows'] = 'fenêtres',
['stickers'] = 'autocollants',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['hu'] = {
['fuel_tank'] = 'üzemanyag tartály',
['windows'] = 'ablakok',
['stickers'] = 'matricák',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['it'] = {
['fuel_tank'] = 'serbatoio carburante',
['windows'] = 'finestrini',
['stickers'] = 'Livrea',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['pl'] = {
['fuel_tank'] = 'zbiornik paliwa',
['windows'] = 'okna',
['stickers'] = 'naklejki',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}
+7
View File
@@ -266,4 +266,11 @@ Locales['si'] = {
['fuel_tank'] = 'rezervoar za gorivo',
['windows'] = 'okna',
['stickers'] = 'nalepke',
-- Xenon Colors
['mintgreen'] = 'Mint Green',
['goldenshower'] = 'Golden Shower',
['ponypink'] = 'Pony Pink',
['hotpink'] = 'Hot Pink',
['blacklight'] = 'Blacklight',
}