Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. eventTextAreaCallback = function(i,n,c)
  2. local p = string.split(c,"[^%.]+")
  3. -- Keyboard
  4. if p[1] == "keyboard" then
  5. if p[2] == "name" then
  6. if p[3] == "submit" then
  7. -- envia e fecha
  8. mode.universe.uicloseSplash(n)
  9. else
  10. if p[3] == "backspace" then
  11. -- apaga a ultima index da tabela do nome (nome é uma tabela pra ser mais facil de manusear dps)
  12. table.remove(mode.universe.info[n].settings.name)
  13. elseif p[3] == "clear" then
  14. -- reseta o nome
  15. mode.universe.info[n].settings.name = {}
  16. elseif p[3] == "insert" then
  17. -- poe a letra
  18. if #mode.universe.info[n].settings.name < 16 then
  19. mode.universe.info[n].settings.name[#mode.universe.info[n].settings.name + 1] = string.char(p[4])
  20. end
  21. end
  22. -- atualiza a textarea com a tabela name (usa o table.concat)
  23. mode.universe.uikeyboard(p[2],mode.universe.info[n].settings.name,n)
  24. end
  25. end
  26. return
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement