mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 09:48:52 +00:00
Merge pull request #575 from lexinor/branch_for_prs
refactor(esx_society/client/main.lua) : Fixed stuff in boss menu and added translations
This commit is contained in:
@@ -115,7 +115,8 @@ function OpenBossMenu(society, close, options)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-wallet", title = TranslateCap('withdraw_amount'), description = "Withdraw money from the society account"},
|
||||
{icon = "fas fa-wallet", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount to withdraw..", inputMin = 1, inputMax = 250000, name = "withdraw"},
|
||||
{icon = "fas fa-check", title = "Confirm", value = "confirm"}
|
||||
{icon = "fas fa-check", title = "Confirm", value = "confirm"},
|
||||
{icon = "fas fa-arrow-left", title = "Return", value = "return"}
|
||||
}
|
||||
ESX.RefreshContext(elements)
|
||||
elseif element.value == "confirm" then
|
||||
@@ -130,7 +131,8 @@ function OpenBossMenu(society, close, options)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-wallet", title = TranslateCap('deposit_amount'), description = "Deposit some money into the society account"},
|
||||
{icon = "fas fa-wallet", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount to deposit..", inputMin = 1, inputMax = 250000, name = "deposit"},
|
||||
{icon = "fas fa-check", title = "Confirm", value = "confirm2"}
|
||||
{icon = "fas fa-check", title = "Confirm", value = "confirm2"},
|
||||
{icon = "fas fa-arrow-left", title = "Return", value = "return"}
|
||||
}
|
||||
ESX.RefreshContext(elements)
|
||||
elseif element.value == "confirm2" then
|
||||
@@ -145,7 +147,8 @@ function OpenBossMenu(society, close, options)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-wallet", title = TranslateCap('wash_money_amount'), description = "Deposit some money into the money wash"},
|
||||
{icon = "fas fa-wallet", title = "Amount", input = true, inputType = "number", inputPlaceholder = "Amount to wash..", inputMin = 1, inputMax = 250000, name = "wash"},
|
||||
{icon = "fas fa-check", title = "Confirm", value = "confirm3"}
|
||||
{icon = "fas fa-check", title = "Confirm", value = "confirm3"},
|
||||
{icon = "fas fa-arrow-left", title = "Return", value = "return"}
|
||||
}
|
||||
ESX.RefreshContext(elements)
|
||||
elseif element.value == "confirm3" then
|
||||
@@ -157,33 +160,40 @@ function OpenBossMenu(society, close, options)
|
||||
ESX.CloseContext()
|
||||
end
|
||||
elseif element.value == "manage_employees" then
|
||||
OpenManageEmployeesMenu(society)
|
||||
OpenManageEmployeesMenu(society, options)
|
||||
elseif element.value == "manage_salary" then
|
||||
OpenManageSalaryMenu(society)
|
||||
OpenManageSalaryMenu(society, options)
|
||||
elseif element.value == "manage_grades" then
|
||||
OpenManageGradesMenu(society)
|
||||
OpenManageGradesMenu(society, options)
|
||||
elseif element.value == "return" then
|
||||
OpenBossMenu(society, nil, options)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end, society)
|
||||
end
|
||||
|
||||
function OpenManageEmployeesMenu(society)
|
||||
function OpenManageEmployeesMenu(society, options)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-users", title = TranslateCap('employee_management')},
|
||||
{icon = "fas fa-users", title = TranslateCap('employee_list'), value = "employee_list"},
|
||||
{icon = "fas fa-users", title = TranslateCap('recruit'), value = "recruit"}
|
||||
}
|
||||
|
||||
elements[#elements+1] = {icon = "fas fa-arrow-left", title = "Return", value = "return"}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "employee_list" then
|
||||
OpenEmployeeList(society)
|
||||
OpenEmployeeList(society, options)
|
||||
elseif element.value == "recruit" then
|
||||
OpenRecruitMenu(society)
|
||||
OpenRecruitMenu(society, options)
|
||||
elseif element.value == "return" then
|
||||
OpenBossMenu(society, nil, options)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenEmployeeList(society)
|
||||
function OpenEmployeeList(society, options)
|
||||
ESX.TriggerServerCallback('esx_society:getEmployees', function(employees)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-user", title = "Employees"}
|
||||
@@ -199,7 +209,7 @@ function OpenEmployeeList(society)
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "return" then
|
||||
OpenManageEmployeesMenu(society)
|
||||
OpenManageEmployeesMenu(society, options)
|
||||
else
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-user", title = element.title},
|
||||
@@ -211,15 +221,15 @@ function OpenEmployeeList(society)
|
||||
local employee = element.data
|
||||
if element2.value == "promote" then
|
||||
ESX.CloseContext()
|
||||
OpenPromoteMenu(society, employee)
|
||||
OpenPromoteMenu(society, employee, options)
|
||||
elseif element2.value == "fire" then
|
||||
ESX.ShowNotification(TranslateCap('you_have_fired', employee.name))
|
||||
|
||||
ESX.TriggerServerCallback('esx_society:setJob', function()
|
||||
OpenEmployeeList(society)
|
||||
OpenEmployeeList(society, options)
|
||||
end, employee.identifier, 'unemployed', 0, 'fire')
|
||||
elseif element2.value == "return" then
|
||||
OpenEmployeeList(society)
|
||||
OpenEmployeeList(society, options)
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -227,7 +237,7 @@ function OpenEmployeeList(society)
|
||||
end, society)
|
||||
end
|
||||
|
||||
function OpenRecruitMenu(society)
|
||||
function OpenRecruitMenu(society, options)
|
||||
ESX.TriggerServerCallback('esx_society:getOnlinePlayers', function(players)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-user", title = TranslateCap('recruiting')}
|
||||
@@ -243,7 +253,7 @@ function OpenRecruitMenu(society)
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "return" then
|
||||
OpenManageEmployeesMenu(society)
|
||||
OpenManageEmployeesMenu(society, options)
|
||||
else
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-user", title = "Confirm"},
|
||||
@@ -255,7 +265,7 @@ function OpenRecruitMenu(society)
|
||||
ESX.ShowNotification(TranslateCap('you_have_hired', element.name))
|
||||
|
||||
ESX.TriggerServerCallback('esx_society:setJob', function()
|
||||
OpenRecruitMenu(society)
|
||||
OpenRecruitMenu(society, options)
|
||||
end, element.identifier, society, 0, 'hire')
|
||||
end
|
||||
end)
|
||||
@@ -264,7 +274,7 @@ function OpenRecruitMenu(society)
|
||||
end)
|
||||
end
|
||||
|
||||
function OpenPromoteMenu(society, employee)
|
||||
function OpenPromoteMenu(society, employee, options)
|
||||
ESX.TriggerServerCallback('esx_society:getJob', function(job)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-user", title = TranslateCap('promote_employee', employee.name)}
|
||||
@@ -280,21 +290,21 @@ function OpenPromoteMenu(society, employee)
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "return" then
|
||||
OpenEmployeeList(society)
|
||||
OpenEmployeeList(society, options)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('you_have_promoted', employee.name, element.title))
|
||||
|
||||
ESX.TriggerServerCallback('esx_society:setJob', function()
|
||||
OpenEmployeeList(society)
|
||||
OpenEmployeeList(society, options)
|
||||
end, employee.identifier, society, element.value, 'promote')
|
||||
end
|
||||
end, function(menu)
|
||||
OpenEmployeeList(society)
|
||||
OpenEmployeeList(society, options)
|
||||
end)
|
||||
end, society)
|
||||
end
|
||||
|
||||
function OpenManageSalaryMenu(society)
|
||||
function OpenManageSalaryMenu(society, options)
|
||||
ESX.TriggerServerCallback('esx_society:getJob', function(job)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-wallet", title = TranslateCap('salary_management')}
|
||||
@@ -309,6 +319,8 @@ function OpenManageSalaryMenu(society)
|
||||
value = job.grades[i].grade
|
||||
}
|
||||
end
|
||||
|
||||
elements[#elements+1] = {icon = "fas fa-arrow-left", title = "Return", value = "return"}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements = {
|
||||
@@ -322,21 +334,25 @@ function OpenManageSalaryMenu(society)
|
||||
local amount = tonumber(menu.eles[2].inputValue)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount'))
|
||||
ESX.ShowNotification(TranslateCap('invalid_value_nochanges'))
|
||||
OpenManageSalaryMenu(society, options)
|
||||
elseif amount > Config.MaxSalary then
|
||||
ESX.ShowNotification(TranslateCap('invalid_amount_max'))
|
||||
OpenManageSalaryMenu(society, options)
|
||||
else
|
||||
ESX.CloseContext()
|
||||
ESX.TriggerServerCallback('esx_society:setJobSalary', function()
|
||||
OpenManageSalaryMenu(society)
|
||||
OpenManageSalaryMenu(society, options)
|
||||
end, society, menu.eles[1].value, amount)
|
||||
end
|
||||
elseif element.value == "return" then
|
||||
OpenBossMenu(society, nil, options)
|
||||
end
|
||||
end)
|
||||
end, society)
|
||||
end
|
||||
|
||||
function OpenManageGradesMenu(society)
|
||||
function OpenManageGradesMenu(society, options)
|
||||
ESX.TriggerServerCallback('esx_society:getJob', function(job)
|
||||
local elements = {
|
||||
{unselectable = true, icon = "fas fa-wallet", title = TranslateCap('grade_management')}
|
||||
@@ -347,6 +363,8 @@ function OpenManageGradesMenu(society)
|
||||
|
||||
elements[#elements+1] = {icon = "fas fa-wallet", title = ('%s'):format(gradeLabel), value = job.grades[i].grade}
|
||||
end
|
||||
|
||||
elements[#elements+1] = {icon = "fas fa-arrow-left", title = "Return", value = "return"}
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
local elements = {
|
||||
@@ -357,11 +375,18 @@ function OpenManageGradesMenu(society)
|
||||
|
||||
ESX.RefreshContext(elements)
|
||||
if element.value == "confirm" then
|
||||
local label = tostring(menu.eles[2].inputValue)
|
||||
if menu.eles[2].inputValue then
|
||||
local label = tostring(menu.eles[2].inputValue)
|
||||
|
||||
ESX.TriggerServerCallback('esx_society:setJobLabel', function()
|
||||
OpenManageGradesMenu(society)
|
||||
ESX.TriggerServerCallback('esx_society:setJobLabel', function()
|
||||
OpenManageGradesMenu(society, options)
|
||||
end, society, menu.eles[1].value, label)
|
||||
else
|
||||
ESX.ShowNotification(TranslateCap('invalid_value_nochanges'))
|
||||
OpenManageGradesMenu(society, options)
|
||||
end
|
||||
elseif element.value == "return" then
|
||||
OpenBossMenu(society, nil, options)
|
||||
end
|
||||
end)
|
||||
end, society)
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['br'] = {
|
||||
['have_deposited'] = 'você depositou ~r~$%s',
|
||||
['have_withdrawn'] = 'você retirou $%s',
|
||||
['invalid_amount'] = 'montante inválido',
|
||||
['invalid_amount_max'] = 'esse salário não é permitido',
|
||||
['invalid_amount_max'] = 'esse salário não é permitido',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'não',
|
||||
['promote'] = 'promover',
|
||||
['promote_employee'] = 'promover %s',
|
||||
|
||||
@@ -14,6 +14,8 @@ Locales['cs'] = {
|
||||
['have_withdrawn'] = 'vybral jsi $%s',
|
||||
['invalid_amount'] = 'neplatná částka',
|
||||
['invalid_amount_max'] = 'tento plat není povolen',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'ne',
|
||||
['promote'] = 'povýšit',
|
||||
['promote_employee'] = 'povýšit %s',
|
||||
|
||||
@@ -15,6 +15,8 @@ Locales['en'] = {
|
||||
['check_balance'] = 'balance is ~g~$%s',
|
||||
['invalid_amount'] = 'invalid amount',
|
||||
['invalid_amount_max'] = 'that salary is not allowed',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'no',
|
||||
['promote'] = 'promote',
|
||||
['promote_employee'] = 'promote %s',
|
||||
|
||||
@@ -11,10 +11,11 @@ Locales['es'] = {
|
||||
['fire'] = 'Despedir',
|
||||
['grade'] = 'Cargo',
|
||||
['have_deposited'] = 'Has depositado ~r~%s$',
|
||||
['check_balance'] = 'el balance es ~g~$%s',
|
||||
['have_withdrawn'] = 'Has retirado %s$',
|
||||
['invalid_amount'] = 'Cantidad inválida',
|
||||
['invalid_amount_max'] = 'Ese salario no está permitido',
|
||||
['invalid_amount_max'] = 'Ese salario no está permitido',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'No',
|
||||
['promote'] = 'Ascender',
|
||||
['promote_employee'] = 'Ascender %s',
|
||||
@@ -22,9 +23,6 @@ Locales['es'] = {
|
||||
['recruiting'] = 'Contratando',
|
||||
['salary_amount'] = 'Cantidad de salario',
|
||||
['salary_management'] = 'Gestión de salario',
|
||||
['grade_management'] = 'gestión de etiquetas de grado',
|
||||
['grade_label'] = 'etiqueta de grado',
|
||||
['check_society_balance'] = 'comprobar el balance de la sociedad',
|
||||
['wash_money'] = 'Limpiar dinero',
|
||||
['wash_money_amount'] = 'Cantidad para limpiar',
|
||||
['withdraw_amount'] = 'Retirar cantidad',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['fi'] = {
|
||||
['have_deposited'] = 'sinä talletit ~r~€%s',
|
||||
['have_withdrawn'] = 'sinä nostit €%s',
|
||||
['invalid_amount'] = 'virheellinen summa',
|
||||
['invalid_amount_max'] = 'that salary is not allowed',
|
||||
['invalid_amount_max'] = 'that salary is not allowed',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'ei',
|
||||
['promote'] = 'ylennä',
|
||||
['promote_employee'] = 'ylennä henkilö %s',
|
||||
|
||||
@@ -13,6 +13,8 @@ Locales['fr'] = {
|
||||
['have_deposited'] = 'vous avez déposé ~r~$%s',
|
||||
['have_withdrawn'] = 'vous avez retiré $%s',
|
||||
['invalid_amount'] = 'montant invalide',
|
||||
['invalid_value'] = 'valeur invalide',
|
||||
['invalid_value_nochanges']= 'valeur invalide, aucun changements appliqués',
|
||||
['invalid_amount_max'] = 'ce salaire est non réglementaire',
|
||||
['no'] = 'non',
|
||||
['promote'] = 'promouvoir',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['hu'] = {
|
||||
['have_deposited'] = 'Sikeresen beraktál ~r~%s $',
|
||||
['have_withdrawn'] = 'Sikeresen kivettél %s $',
|
||||
['invalid_amount'] = 'Érvénytelen mennyiség',
|
||||
['invalid_amount_max'] = 'Ez az összeg több mint a megengedett',
|
||||
['invalid_amount_max'] = 'Ez az összeg több mint a megengedett',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'Nem',
|
||||
['promote'] = 'Elöléptetés',
|
||||
['promote_employee'] = 'Elöléptetés %s',
|
||||
|
||||
@@ -12,9 +12,10 @@ Locales['it'] = {
|
||||
['grade'] = 'grado',
|
||||
['have_deposited'] = 'hai depositato ~r~$%s',
|
||||
['have_withdrawn'] = 'hai prelevato $%s',
|
||||
['check_balance'] = 'il bilancio è ~g~$%s',
|
||||
['invalid_amount'] = 'importo non valido',
|
||||
['invalid_amount_max'] = 'quel salario non è consentito',
|
||||
['invalid_amount_max'] = 'quel salario non è consentito',
|
||||
['invalid_value'] = 'valore non valido',
|
||||
['invalid_value_nochanges']= 'valore non valido, nessuna modifica applicata',
|
||||
['no'] = 'no',
|
||||
['promote'] = 'promuovi',
|
||||
['promote_employee'] = 'promuovere il dipendente %s',
|
||||
@@ -22,9 +23,6 @@ Locales['it'] = {
|
||||
['recruiting'] = 'reclutamento',
|
||||
['salary_amount'] = 'importo dello stipendio',
|
||||
['salary_management'] = 'gestione stipendi',
|
||||
['grade_management'] = 'gestione dei gradi',
|
||||
['grade_label'] = 'grado',
|
||||
['check_society_balance'] = 'controlla bilancio società',
|
||||
['wash_money'] = 'ricicla denaro',
|
||||
['wash_money_amount'] = 'importo da riciclare',
|
||||
['withdraw_amount'] = 'ritira importo',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['nl'] = {
|
||||
['have_deposited'] = 'je hebt gestort ~r~$%s',
|
||||
['have_withdrawn'] = 'je hebt opgenomen $%s',
|
||||
['invalid_amount'] = 'ongeldige hoeveelheid',
|
||||
['invalid_amount_max'] = 'dit salaris is niet toegestaan',
|
||||
['invalid_amount_max'] = 'dit salaris is niet toegestaan',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'nee',
|
||||
['promote'] = 'promoveer',
|
||||
['promote_employee'] = 'promoveer %s',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['pl'] = {
|
||||
['have_deposited'] = 'zdeponowałeś ~r~$%s',
|
||||
['have_withdrawn'] = 'wypłaciłeś $%s',
|
||||
['invalid_amount'] = 'nieprawidłowa wartość',
|
||||
['invalid_amount_max'] = 'that salary is not allowed',
|
||||
['invalid_amount_max'] = 'that salary is not allowed',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'nie',
|
||||
['promote'] = 'awansuj',
|
||||
['promote_employee'] = 'awansuj %s',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['si'] = {
|
||||
['have_deposited'] = 'deponirali ste ~r~$%s',
|
||||
['have_withdrawn'] = 'umaknili ste $%s',
|
||||
['invalid_amount'] = 'neveljaven znesek',
|
||||
['invalid_amount_max'] = 'ta plača ni dovoljena',
|
||||
['invalid_amount_max'] = 'ta plača ni dovoljena',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'ne',
|
||||
['promote'] = 'spodbujam',
|
||||
['promote_employee'] = 'promoviraj %s',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['sv'] = {
|
||||
['have_deposited'] = 'du har satt in ~r~%s SEK',
|
||||
['have_withdrawn'] = 'du har tagit ut %s SEK',
|
||||
['invalid_amount'] = 'ogiltigt belopp',
|
||||
['invalid_amount_max'] = 'den lönen är inte tillåten',
|
||||
['invalid_amount_max'] = 'den lönen är inte tillåten',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'nej',
|
||||
['promote'] = 'befodra',
|
||||
['promote_employee'] = 'befodra %s',
|
||||
|
||||
@@ -13,7 +13,9 @@ Locales['tr'] = {
|
||||
['have_deposited'] = '~r~%s lira yatırdın',
|
||||
['have_withdrawn'] = '$%s lira çektin',
|
||||
['invalid_amount'] = 'miktar hatalı',
|
||||
['invalid_amount_max'] = 'bu maaşa izin verilmiyor',
|
||||
['invalid_amount_max'] = 'bu maaşa izin verilmiyor',
|
||||
['invalid_value'] = 'invalid value',
|
||||
['invalid_value_nochanges']= 'invalid value, no changes applied',
|
||||
['no'] = 'hayır',
|
||||
['promote'] = 'yükseltme',
|
||||
['promote_employee'] = 'yükselt %s',
|
||||
|
||||
Reference in New Issue
Block a user