init.lua 881 B

1234567891011121314151617181920212223
  1. -- Set formspec prepend and hotbar textures
  2. minetest.register_on_joinplayer(function(player)
  3. local formspec = [[
  4. bgcolor[#AAAAAAFF;true]
  5. listcolors[#F0F0F069;#FFFFFF90;#141318;#30434C;#FFF] ]]
  6. local name = player:get_player_name()
  7. local info = minetest.get_player_information(name)
  8. -- 'info and' is a temporary workaround for an engine bug
  9. if info and info.formspec_version > 1 then
  10. formspec = formspec .. "background9[5,5;1,1;gui_formbg.png;true;10]"
  11. else
  12. formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]"
  13. end
  14. -- Set the string to be added to every mainmenu formspec, used for theming
  15. player:set_formspec_prepend(formspec)
  16. -- Set hotbar textures.
  17. -- To use, uncomment these 2 lines and add textures to the textures folder.
  18. --player:hud_set_hotbar_image("gui_hotbar.png")
  19. --player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
  20. end)