1
0

MakeQSP.bat 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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=tools\Player-video\qspgui.exe
  7. set QGEN=tools\QGen5\QGen.exe
  8. :: The file that will be generated or open
  9. set QSPFILE=glife-internet-home.qsp
  10. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  11. :menu
  12. cls
  13. echo.
  14. echo :: QSP Compiler and Launcher
  15. echo.
  16. if defined QGEN (
  17. if not exist "%QGEN%" (
  18. echo QGEN : [ERROR] - %QGEN% not found. Using DEFAULT application.
  19. set QGEN=
  20. ) else ( echo QGEN : [OK] - "%QGEN%")
  21. ) else echo QGEN : [NOT DEFINED] - Using DEFAULT application.
  22. if defined QSPGUI (
  23. if not exist "%QSPGUI%" (
  24. echo QSP EXEC : [ERROR] - %QSPGUI% not found.
  25. set QSPGUI=
  26. ) else ( echo QSP EXEC : [OK] - "%QSPGUI%")
  27. ) else ( echo QSP EXEC : [NOT DEFINED] - Using Windows DEFAULT.)
  28. if defined QSPFILE (
  29. if not exist "%QSPFILE%" (
  30. echo QSP FILE : [WARNING] - %QSPFILE% not found.
  31. ) else ( echo QSP FILE : [OK] - "%QSPFILE%")
  32. ) else ( echo QSP FILE : [NOT DEFINED] - ERROR: CAN'T CONTINUE.)
  33. if defined CP_TO (
  34. if not exist "%CP_TO%" (
  35. echo COPY : [ERROR] - Destination "%CP_TO%" not found. Copy DISABLED.
  36. set CP_TO=
  37. ) else ( echo COPY : [OK] - "%CP_TO%")
  38. ) else ( echo COPY : [DISABLED] )
  39. echo.
  40. if defined NOT_FOUND (
  41. echo ERROR: Option '%action%' wasn't recognized. Is it lowercase?
  42. set NOT_FOUND=
  43. )
  44. echo.
  45. echo ACTIONS: (B)uild (R)un (F)ull (Q)Gen (E)xit
  46. echo.
  47. set /p action=Choose an action:
  48. if defined QSPFILE (
  49. if %action% == b goto build
  50. if %action% == r goto run
  51. if %action% == f goto build
  52. if %action% == q goto qgen
  53. if %action% == B goto build
  54. if %action% == R goto run
  55. if %action% == F goto build
  56. if %action% == Q goto qgen
  57. )
  58. if %action% == e goto exit
  59. if %action% == E goto exit
  60. set NOT_FOUND=1
  61. goto menu
  62. :build
  63. echo.
  64. echo Building ...
  65. @ECHO ON
  66. python tools\txtmerge.py locations glife.txt
  67. tools\txt2gam.exe glife.txt %QSPFILE% > nul
  68. @ECHO OFF
  69. echo.
  70. if defined CP_TO ( echo Copying %QSPFILE% to "%CP_TO%" ... & copy %QSPFILE% %CP_TO% > nul )
  71. echo.
  72. echo Done.
  73. pause
  74. if %action% == f ( goto run ) else ( goto menu )
  75. :qgen
  76. echo.
  77. echo Running ...
  78. if defined CP_TO ( start %QGEN% %CP_TO%\%QSPFILE% ) else ( start %QGEN% %QSPFILE% )
  79. goto exit
  80. :run
  81. echo.
  82. echo Running ...
  83. if defined CP_TO ( start %QSPGUI% %CP_TO%\%QSPFILE% ) else ( start %QSPGUI% %QSPFILE% )
  84. :exit