setup_maps.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. set -e
  3. # Go back if we're inside the scripts folder
  4. if [ -f setup_maps.sh ]; then
  5. cd ..
  6. fi
  7. cd mods/ctf/ctf_map/maps/
  8. # Copy textures from map sub-dirs to ctf_map_core/textures
  9. for f in *; do
  10. if [ -d ${f} ]; then
  11. # Copy map screenshot to textures dir
  12. if [ -f ${f}/screenshot.png ]; then
  13. cp ${f}/screenshot.png ../textures/${f}_screenshot.png
  14. fi
  15. # Move skybox textures into map skybox folder if they aren't already there
  16. if [ -f ${f}/skybox_1.png ]; then
  17. if ![ -d ${f}/skybox/ ]; then
  18. mkdir ${f}/skybox/
  19. fi
  20. cp ${f}/skybox_1.png ${f}/skybox/Up.png
  21. cp ${f}/skybox_2.png ${f}/skybox/Down.png
  22. cp ${f}/skybox_3.png ${f}/skybox/Front.png
  23. cp ${f}/skybox_4.png ${f}/skybox/Back.png
  24. cp ${f}/skybox_5.png ${f}/skybox/Left.png
  25. cp ${f}/skybox_6.png ${f}/skybox/Right.png
  26. rm ${f}/skybox_*.png
  27. fi
  28. # Move skybox textures to textures dir where Minetest can find them
  29. if [ -d ${f}/skybox/ ]; then
  30. cp ${f}/skybox/Up.png ../textures/${f}Up.png
  31. cp ${f}/skybox/Down.png ../textures/${f}Down.png
  32. cp ${f}/skybox/Front.png ../textures/${f}Front.png
  33. cp ${f}/skybox/Back.png ../textures/${f}Back.png
  34. cp ${f}/skybox/Left.png ../textures/${f}Left.png
  35. cp ${f}/skybox/Right.png ../textures/${f}Right.png
  36. fi
  37. fi
  38. done