formspec.lua 972 B

123456789101112131415161718192021222324252627282930
  1. local esc = minetest.formspec_escape
  2. local title, text = '', ''
  3. sign_formspec =
  4. 'size[11,8]'..
  5. 'no_prepend[]'..
  6. 'bgcolor[#080808BB;true]'..
  7. 'background[0,0;11,8;hall_plaque.png]'
  8. function hall.edit_sign(title, bottom, left, right)
  9. local formspec =
  10. sign_formspec..
  11. "field[0.5,1;7.5,0;title;"..esc("Title:")..";"..esc(title) .. "]" ..
  12. "textarea[1,1.5;4.25,3;left;;"..esc(left).."]" ..
  13. "textarea[6.25,1.5;4.25,3;right;;"..esc(right).."]" ..
  14. "textarea[1,4;9.5,3;bottom;;"..esc(bottom).."]" ..
  15. "button_exit[4,6.5;3,1;save;Save]"
  16. return formspec
  17. end
  18. function hall.view_sign(title, bottom, left, right)
  19. local formspec =
  20. sign_formspec..
  21. 'hypertext[0,0;11,1;;<center><style color=black size=40>'..esc(title)..'</style></center>]'..
  22. "textarea[1,1.5;4.25,3;;;"..esc(left).."]"..
  23. "textarea[6.25,1.5;4.25,3;;;"..esc(right).."]"..
  24. "textarea[1,4;9.5,3;;;"..esc(bottom).."]"
  25. return formspec
  26. end