init.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. -- Unified Inventory for Minetest 0.4.8+
  2. local modpath = minetest.get_modpath(minetest.get_current_modname())
  3. local worldpath = minetest.get_worldpath()
  4. -- Data tables definitions
  5. unified_inventory = {
  6. activefilter = {},
  7. active_search_direction = {},
  8. alternate = {},
  9. current_page = {},
  10. current_searchbox = {},
  11. current_index = {},
  12. current_item = {},
  13. current_craft_direction = {},
  14. registered_craft_types = {},
  15. crafts_for = {usage = {}, recipe = {} },
  16. players = {},
  17. items_list_size = 0,
  18. items_list = {},
  19. filtered_items_list_size = {},
  20. filtered_items_list = {},
  21. pages = {},
  22. buttons = {},
  23. -- Homepos stuff
  24. home_pos = {},
  25. home_filename = worldpath.."/unified_inventory_home.home",
  26. -- Default inventory page
  27. default = "craft",
  28. -- intllib
  29. gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end,
  30. -- "Lite" mode
  31. lite_mode = minetest.setting_getbool("unified_inventory_lite"),
  32. pagecols = 8,
  33. pagerows = 10,
  34. page_y = 0,
  35. formspec_y = 1,
  36. main_button_x = 0,
  37. main_button_y = 9,
  38. craft_result_x = 0.3,
  39. craft_result_y = 0.5,
  40. form_header_y = 0
  41. }
  42. -- Disable default creative inventory
  43. local creative = rawget(_G, "creative") or rawget(_G, "creative_inventory")
  44. if creative then
  45. function creative.set_creative_formspec(player, start_i, pagenum)
  46. return
  47. end
  48. end
  49. dofile(modpath.."/group.lua")
  50. dofile(modpath.."/api.lua")
  51. dofile(modpath.."/internal.lua")
  52. dofile(modpath.."/callbacks.lua")
  53. dofile(modpath.."/register.lua")
  54. dofile(modpath.."/bags.lua")
  55. dofile(modpath.."/item_names.lua")
  56. if minetest.get_modpath("datastorage") then
  57. dofile(modpath.."/waypoints.lua")
  58. end