N3MTV / gcphone

Téléphone pour FiveM
104 stars 225 forks source link

[SOLUTION] Support CTRL + V #358

Closed AlanSnt closed 4 years ago

AlanSnt commented 4 years ago

Hello, if anyone has an idea to make sure that we can paste links or other by doing ctrl + V, in the areas where we can write

Thanks

AlanSnt commented 4 years ago

ok I found it was enough for me to replace the input system by that of esx dialog, which supports the ctrl v

For this modified RegisterNUICallback ('reponseText', function (data, cb) Like this

RegisterNUICallback('reponseText', function(data, cb)
  local limit = data.limit or 255
  local text = data.text or ''

  ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'menuDiag',{
    title = 'Messages',
    type  = 'big'
    },
    function(data, menu)
    local text = data.value
    menu.close()
    cb(json.encode({text = text}))
    end,
  function(data, menu)
    menu.close()
  end)
end)