quit.lua 645 B

1234567891011121314151617181920212223242526272829
  1. return {
  2. tag = 'callbacks',
  3. summary = 'Called before quitting.',
  4. description = [[
  5. This callback is called right before the application is about to quit. Use it to perform any
  6. necessary cleanup work. A truthy value can be returned from this callback to abort quitting.
  7. ]],
  8. arguments = {},
  9. returns = {
  10. {
  11. type = 'boolean',
  12. name = 'abort',
  13. description = 'Whether quitting should be aborted.'
  14. }
  15. },
  16. example = [[
  17. function lovr.quit()
  18. if shouldQuit() then
  19. return false
  20. else
  21. return true
  22. end
  23. end
  24. ]],
  25. related = {
  26. 'lovr.event.quit',
  27. 'lovr.load'
  28. }
  29. }