From d2a20347aa8e410a3ddc897905a738cc09bfa29c Mon Sep 17 00:00:00 2001 From: hmmehdi Date: Thu, 3 Nov 2022 10:49:17 +0100 Subject: [PATCH 1/3] feat(esx_lscustom): headlights colors --- [esx_addons]/esx_lscustom/client/main.lua | 21 +++++++++++++++- [esx_addons]/esx_lscustom/config.lua | 30 ++++++++++++++++++++++- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/[esx_addons]/esx_lscustom/client/main.lua b/[esx_addons]/esx_lscustom/client/main.lua index c5c79fd6..7b684ed4 100644 --- a/[esx_addons]/esx_lscustom/client/main.lua +++ b/[esx_addons]/esx_lscustom/client/main.lua @@ -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, @@ -290,6 +298,17 @@ 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 + print(xenonColors[i].label, xenonColors[i].index) + table.insert(elements, { + label = xenonColors[i].label .. ' - $' .. price .. '', + 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) diff --git a/[esx_addons]/esx_lscustom/config.lua b/[esx_addons]/esx_lscustom/config.lua index 3ed2514d..7d3c951d 100644 --- a/[esx_addons]/esx_lscustom/config.lua +++ b/[esx_addons]/esx_lscustom/config.lua @@ -425,6 +425,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 = "Electric Blue", index = 2}, + {label = "Mint Green", index = 3}, + {label = "Lime Green", index = 4}, + {label = TranslateCap('yellow'), index = 5}, + {label = "Golden Shower", index = 6}, + {label = TranslateCap('orange'), index = 7}, + {label = TranslateCap('red'), index = 8}, + {label = "Pony Pink", index = 9}, + {label = "Hot Pink", index = 10}, + {label = TranslateCap('purple'), index = 11}, + {label = "Blacklight", index = 11}, + } + + return xenonColors +end + function GetPlatesName(index) if (index == 0) then return TranslateCap('blue_on_white_1') @@ -500,7 +521,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'), @@ -801,6 +823,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', From ad732a32f20c9041f1d31666e9ce733c4799426a Mon Sep 17 00:00:00 2001 From: hmmehdi Date: Thu, 17 Nov 2022 23:35:14 +0100 Subject: [PATCH 2/3] fix(esx_lscustom): remove print --- [esx_addons]/esx_lscustom/client/main.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/[esx_addons]/esx_lscustom/client/main.lua b/[esx_addons]/esx_lscustom/client/main.lua index 7b684ed4..4e177968 100644 --- a/[esx_addons]/esx_lscustom/client/main.lua +++ b/[esx_addons]/esx_lscustom/client/main.lua @@ -302,7 +302,6 @@ function GetAction(data) local xenonColors = GetXenonColors() price = math.floor(vehiclePrice * v.price / 100) for i = 1, #xenonColors, 1 do - print(xenonColors[i].label, xenonColors[i].index) table.insert(elements, { label = xenonColors[i].label .. ' - $' .. price .. '', modType = k, From 964e468340d1321d39f5e4ede3a533ab2d252845 Mon Sep 17 00:00:00 2001 From: hmmehdi Date: Thu, 17 Nov 2022 23:35:27 +0100 Subject: [PATCH 3/3] feat(esx_lscustom): xenon headlights translations --- [esx_addons]/esx_lscustom/config.lua | 14 +++++++------- [esx_addons]/esx_lscustom/locales/br.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/de.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/en.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/es.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/fr.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/hu.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/it.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/pl.lua | 7 +++++++ [esx_addons]/esx_lscustom/locales/si.lua | 7 +++++++ 10 files changed, 70 insertions(+), 7 deletions(-) diff --git a/[esx_addons]/esx_lscustom/config.lua b/[esx_addons]/esx_lscustom/config.lua index 7d3c951d..4c642493 100644 --- a/[esx_addons]/esx_lscustom/config.lua +++ b/[esx_addons]/esx_lscustom/config.lua @@ -430,17 +430,17 @@ function GetXenonColors() {label = TranslateCap('neon'), index = -1}, {label = TranslateCap('white'), index = 0}, {label = TranslateCap('blue'), index = 1}, - {label = "Electric Blue", index = 2}, - {label = "Mint Green", index = 3}, - {label = "Lime Green", index = 4}, + {label = TranslateCap('electric_blue'), index = 2}, + {label = TranslateCap('mintgreen'), index = 3}, + {label = TranslateCap('lime_green'), index = 4}, {label = TranslateCap('yellow'), index = 5}, - {label = "Golden Shower", index = 6}, + {label = TranslateCap('goldenshower'), index = 6}, {label = TranslateCap('orange'), index = 7}, {label = TranslateCap('red'), index = 8}, - {label = "Pony Pink", index = 9}, - {label = "Hot Pink", index = 10}, + {label = TranslateCap('ponypink'), index = 9}, + {label = TranslateCap('hotpink'), index = 10}, {label = TranslateCap('purple'), index = 11}, - {label = "Blacklight", index = 11}, + {label = TranslateCap('blacklight'), index = 11}, } return xenonColors diff --git a/[esx_addons]/esx_lscustom/locales/br.lua b/[esx_addons]/esx_lscustom/locales/br.lua index b723f6c0..9b6763e0 100644 --- a/[esx_addons]/esx_lscustom/locales/br.lua +++ b/[esx_addons]/esx_lscustom/locales/br.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/de.lua b/[esx_addons]/esx_lscustom/locales/de.lua index 0318749d..fe04d692 100644 --- a/[esx_addons]/esx_lscustom/locales/de.lua +++ b/[esx_addons]/esx_lscustom/locales/de.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/en.lua b/[esx_addons]/esx_lscustom/locales/en.lua index 945780fa..937538d5 100644 --- a/[esx_addons]/esx_lscustom/locales/en.lua +++ b/[esx_addons]/esx_lscustom/locales/en.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/es.lua b/[esx_addons]/esx_lscustom/locales/es.lua index acf45096..9906d613 100644 --- a/[esx_addons]/esx_lscustom/locales/es.lua +++ b/[esx_addons]/esx_lscustom/locales/es.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/fr.lua b/[esx_addons]/esx_lscustom/locales/fr.lua index 33d0c9ab..22a52b91 100644 --- a/[esx_addons]/esx_lscustom/locales/fr.lua +++ b/[esx_addons]/esx_lscustom/locales/fr.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/hu.lua b/[esx_addons]/esx_lscustom/locales/hu.lua index 2c1b084a..70e492ed 100644 --- a/[esx_addons]/esx_lscustom/locales/hu.lua +++ b/[esx_addons]/esx_lscustom/locales/hu.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/it.lua b/[esx_addons]/esx_lscustom/locales/it.lua index 96477649..e65ea29a 100644 --- a/[esx_addons]/esx_lscustom/locales/it.lua +++ b/[esx_addons]/esx_lscustom/locales/it.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/pl.lua b/[esx_addons]/esx_lscustom/locales/pl.lua index fcce5b66..8039a6f3 100644 --- a/[esx_addons]/esx_lscustom/locales/pl.lua +++ b/[esx_addons]/esx_lscustom/locales/pl.lua @@ -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', } diff --git a/[esx_addons]/esx_lscustom/locales/si.lua b/[esx_addons]/esx_lscustom/locales/si.lua index ce4bee13..8d8a9b70 100644 --- a/[esx_addons]/esx_lscustom/locales/si.lua +++ b/[esx_addons]/esx_lscustom/locales/si.lua @@ -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', }