A stealth-based 2D platformer where you don't have to kill anyone unless you want to. https://www.semicolin.games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
753 B

  1. #!/usr/bin/env python3
  2. import glob
  3. import os
  4. import re
  5. import sys
  6. TEMPLATE = r"""<?xml version="1.0" encoding="utf-8" ?>
  7. <XnaContent>
  8. <Asset Type="System.String">
  9. <![CDATA[
  10. %s
  11. ]]>
  12. </Asset>
  13. </XnaContent>
  14. """
  15. def main(args):
  16. this_dir = os.path.dirname(os.path.realpath(__file__))
  17. sneak_root = os.path.join(this_dir, '..', '..', '..')
  18. os.chdir(sneak_root)
  19. json_files = sorted(glob.glob('Content/sprites/**/*.json', recursive=True))
  20. for json_file in json_files:
  21. with open(json_file) as json:
  22. outfile_name = re.sub(r'.json$', '_json.xml', json_file)
  23. result = TEMPLATE % json.read()
  24. with open(outfile_name, 'w') as out:
  25. out.write(result)
  26. return 0
  27. if __name__ == '__main__':
  28. sys.exit(main(sys.argv[1:]))