mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 23:01:26 +00:00
full context implementation
This commit is contained in:
@@ -238,15 +238,18 @@ function OpenMobileTaxiActionsMenu()
|
||||
|
||||
ESX.OpenContext("right", elements, function(menu,element)
|
||||
if element.value == "billing" then
|
||||
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'billing', {
|
||||
title = TranslateCap('invoice_amount')
|
||||
}, function(data, menu)
|
||||
local elements2 = {
|
||||
{unselectable = true, icon = "fas fa-taxi", title = element.title},
|
||||
{title = "Amount", input = true, inputType = "number", inputMin = 1, inputMax = 250000, inputPlaceholder = "Amount to bill.."},
|
||||
{icon = "fas fa-check-double", title = "Confirm", value = "confirm"}
|
||||
}
|
||||
|
||||
local amount = tonumber(data.value)
|
||||
ESX.OpenContext("right", elements2, function(menu2,element2)
|
||||
local amount = tonumber(menu2.eles[2].inputValue)
|
||||
if amount == nil then
|
||||
ESX.ShowNotification(TranslateCap('amount_invalid'))
|
||||
else
|
||||
menu.close()
|
||||
ESX.CloseContext()
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
if closestPlayer == -1 or closestDistance > 3.0 then
|
||||
ESX.ShowNotification(TranslateCap('no_players_near'))
|
||||
@@ -256,8 +259,6 @@ function OpenMobileTaxiActionsMenu()
|
||||
ESX.ShowNotification(TranslateCap('billing_sent'))
|
||||
end
|
||||
end
|
||||
end, function(data, menu)
|
||||
menu.close()
|
||||
end)
|
||||
elseif element.value == "start_job" then
|
||||
if OnJob then
|
||||
|
||||
Reference in New Issue
Block a user