MakeQSP.bat 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. @ECHO off
  2. :: Set those lines to fit your setup.
  3. :: This is where glife.qsp will be copied. If you don't want to move it just comment (::) the line below.
  4. :: set CP_TO=..\GL_ECV
  5. :: This is the program used to open the QSPFILE. If you comment this line windows will launch the default app for the ".qsp" extension.
  6. set QSPGUI=QSP\Player-video\qspgui.exe
  7. set QGEN=QSP\QGen5\QGen.exe
  8. :: The file that will be generated or open
  9. set QSPFILE=..\Game\glife.qsp
  10. set PYTHONBIN=..\..\python\App\python.exe
  11. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  12. :menu
  13. cls
  14. echo.
  15. echo :: QSP Compiler and Launcher
  16. echo.
  17. if defined QGEN (
  18. if not exist "%QGEN%" (
  19. echo QGEN : [ERROR] - %QGEN% not found. Using DEFAULT application.
  20. set QGEN=
  21. ) else ( echo QGEN : [OK] - "%QGEN%")
  22. ) else echo QGEN : [NOT DEFINED] - Using DEFAULT application.
  23. if defined PYTHONBIN (
  24. if not exist "%PYTHONBIN%" (
  25. echo PYTHONBIN : [ERROR] - %PYTHONBIN% not found. Using DEFAULT application.
  26. set PYTHONBIN=
  27. ) else ( echo PYTHONBIN : [OK] - "%PYTHONBIN%")
  28. ) else echo PYTHONBIN : [NOT DEFINED] - Using DEFAULT application.
  29. if defined QSPGUI (
  30. if not exist "%QSPGUI%" (
  31. echo QSP EXEC : [ERROR] - %QSPGUI% not found.
  32. set QSPGUI=
  33. ) else ( echo QSP EXEC : [OK] - "%QSPGUI%")
  34. ) else ( echo QSP EXEC : [NOT DEFINED] - Using Windows DEFAULT.)
  35. if defined QSPFILE (
  36. if not exist "%QSPFILE%" (
  37. echo QSP FILE : [WARNING] - %QSPFILE% not found.
  38. ) else ( echo QSP FILE : [OK] - "%QSPFILE%")
  39. ) else ( echo QSP FILE : [NOT DEFINED] - ERROR: CAN'T CONTINUE.)
  40. if defined CP_TO (
  41. if not exist "%CP_TO%" (
  42. echo COPY : [ERROR] - Destination "%CP_TO%" not found. Copy DISABLED.
  43. set CP_TO=
  44. ) else ( echo COPY : [OK] - "%CP_TO%")
  45. ) else ( echo COPY : [DISABLED] )
  46. echo.
  47. if defined NOT_FOUND (
  48. echo ERROR: Option '%action%' wasn't recognized. Is it lowercase?
  49. set NOT_FOUND=
  50. )
  51. echo.
  52. echo ACTIONS: (B)uild (R)un (F)ull (Q)Gen (E)xit
  53. echo.
  54. set /p action=Choose an action:
  55. if defined QSPFILE (
  56. if %action% == b goto build
  57. if %action% == r goto run
  58. if %action% == f goto build
  59. if %action% == q goto qgen
  60. )
  61. if %action% == e goto exit
  62. set NOT_FOUND=1
  63. goto menu
  64. :build
  65. echo.
  66. echo Building ...
  67. @ECHO ON
  68. %PYTHONBIN% -3 txtmerge.py locations glife.txt
  69. txt2gam.exe glife.txt %QSPFILE% > nul
  70. @ECHO OFF
  71. echo.
  72. if defined CP_TO ( echo Copying %QSPFILE% to "%CP_TO%" ... & copy %QSPFILE% %CP_TO% > nul )
  73. echo.
  74. echo Done.
  75. pause
  76. if %action% == f ( goto run ) else ( goto menu )
  77. :qgen
  78. echo.
  79. echo Running ...
  80. if defined CP_TO ( start %QGEN% %CP_TO%\%QSPFILE% ) else ( start %QGEN% %QSPFILE% )
  81. goto menu
  82. :run
  83. echo.
  84. echo Running ...
  85. if defined CP_TO ( start %QSPGUI% %CP_TO%\%QSPFILE% ) else ( start %QSPGUI% %QSPFILE% )
  86. goto menu
  87. :exit