init.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. -- Minetest 0.4 mod: default
  2. -- See README.txt for licensing and other information.
  3. -- The API documentation in here was moved into game_api.txt
  4. -- Definitions made by this mod that other mods can use too
  5. default = {}
  6. default.LIGHT_MAX = 14
  7. -- GUI related stuff
  8. default.gui_bg = ""
  9. default.gui_bg_img = ""
  10. default.gui_slots = ""
  11. minetest.register_on_joinplayer(function(player)
  12. player:set_formspec_prepend([[
  13. bgcolor[#080808BB;true]
  14. background[5,5;1,1;gui_formbg.png;true]
  15. listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]])
  16. end)
  17. function default.get_hotbar_bg(x,y)
  18. local out = ""
  19. for i=0,7,1 do
  20. out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
  21. end
  22. return out
  23. end
  24. default.gui_survival_form = "size[8,8.5]"..
  25. default.gui_bg..
  26. default.gui_bg_img..
  27. default.gui_slots..
  28. "list[current_player;main;0,4.25;8,1;]"..
  29. "list[current_player;main;0,5.5;8,3;8]"..
  30. "list[current_player;craft;1.75,0.5;3,3;]"..
  31. "list[current_player;craftpreview;5.75,1.5;1,1;]"..
  32. "image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
  33. "listring[current_player;main]"..
  34. "listring[current_player;craft]"..
  35. default.get_hotbar_bg(0,4.25)
  36. -- Load files
  37. local default_path = minetest.get_modpath("default")
  38. dofile(default_path.."/functions.lua")
  39. dofile(default_path.."/trees.lua")
  40. dofile(default_path.."/nodes.lua")
  41. dofile(default_path.."/chests.lua")
  42. dofile(default_path.."/furnace.lua")
  43. dofile(default_path.."/torch.lua")
  44. dofile(default_path.."/tools.lua")
  45. dofile(default_path.."/item_entity.lua")
  46. dofile(default_path.."/craftitems.lua")
  47. dofile(default_path.."/crafting.lua")
  48. dofile(default_path.."/mapgen.lua")
  49. dofile(default_path.."/aliases.lua")
  50. dofile(default_path.."/legacy.lua")