init.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. default = default or {}
  2. guicolors = guicolors or {}
  3. guicolors.modpath = minetest.get_modpath("guicolors")
  4. function default.get_hotbar_bg(x,y)
  5. local out = ""
  6. for i=0,7,1 do
  7. out = out .. "image[" .. x+i .. "," .. y .. ";1,1;gui_hb_bg.png]"
  8. end
  9. return out
  10. end
  11. default.formspec = {}
  12. default.formspec.get_form_colors = function()
  13. local colors = "bgcolor[#080808BB;true]"
  14. return colors
  15. end
  16. default.formspec.get_slot_colors = function()
  17. local colors = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
  18. return colors
  19. end
  20. default.formspec.get_form_image = function()
  21. local image = "background[5,5;1,1;gui_formbg.png;true]"
  22. return image
  23. end
  24. default.gui_bg = default.formspec.get_form_colors()
  25. default.gui_bg_img = default.formspec.get_form_image()
  26. default.gui_slots = default.formspec.get_slot_colors()
  27. default.formspec.get_default_form = function()
  28. local formspec = "size[8,8.5]" ..
  29. default.formspec.get_form_colors() ..
  30. default.formspec.get_slot_colors() ..
  31. default.formspec.get_form_image() ..
  32. "list[current_player;main;0,4.25;8,1;]" ..
  33. "list[current_player;main;0,5.5;8,3;8]" ..
  34. "list[current_player;craft;3,0.5;3,3;]" ..
  35. "list[current_player;craftpreview;7,1.5;1,1;]" ..
  36. --"image[7,2.5;1,1;gui_furnace_arrow_bg.png]" ..
  37. "image[6,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]" ..
  38. "listring[current_player;main]" ..
  39. "listring[current_player;craft]" ..
  40. default.get_hotbar_bg(0,4.25)
  41. return formspec
  42. end