init.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. -- Copyright (c) 2013-18 rubenwardy. MIT.
  2. -- The global award namespace
  3. awards = {
  4. show_mode = "hud",
  5. registered_triggers = {},
  6. }
  7. -- Internationalization support.
  8. awards.gettext, awards.ngettext = dofile(minetest.get_modpath("awards").."/src/intllib.lua")
  9. -- Load files
  10. dofile(minetest.get_modpath("awards").."/src/data.lua")
  11. dofile(minetest.get_modpath("awards").."/src/api_awards.lua")
  12. dofile(minetest.get_modpath("awards").."/src/api_triggers.lua")
  13. dofile(minetest.get_modpath("awards").."/src/chat_commands.lua")
  14. dofile(minetest.get_modpath("awards").."/src/gui.lua")
  15. dofile(minetest.get_modpath("awards").."/src/triggers.lua")
  16. dofile(minetest.get_modpath("awards").."/src/awards.lua")
  17. awards.load()
  18. minetest.register_on_shutdown(awards.save)
  19. -- Backwards compatibility
  20. awards.give_achievement = awards.unlock
  21. awards.getFormspec = awards.get_formspec
  22. awards.showto = awards.show_to
  23. awards.register_onDig = awards.register_on_dig
  24. awards.register_onPlace = awards.register_on_place
  25. awards.register_onDeath = awards.register_on_death
  26. awards.register_onChat = awards.register_on_chat
  27. awards.register_onJoin = awards.register_on_join
  28. awards.register_onCraft = awards.register_on_craft
  29. awards.def = awards.registered_awards
  30. awards.register_achievement = awards.register_award