proclib/run_windows.bat

45 lines
1.2 KiB
Batchfile

@echo off
:: Print some general info
echo ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
echo proclib frontend script
echo ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
echo This script supports drag'n'dropping of structure definition files!
echo SDL-specific commands:
echo Space/Enter -- recreate and link structure(s)
echo Z -- recreate structure(s)
echo X -- link structure(s)
echo Q -- quit
echo --
:: Ask the user what program to use (main or SDL)
echo Select program to use:
echo 1) SDL viewer
echo 2) console/ASCII viewer
echo 3) quit/cancel
set /p select=:
if "%select%"=="1" (
set proc_command=bin\sdl.exe
) else if "%select%"=="" (
set proc_command=bin\sdl.exe
) else if "%select%"=="2" (
set proc_command=bin\main.exe
) else (
exit
)
:: Ensure our working dir is the same as the script
cd "%~dp0"
:: Use first arg (drag'n'dropped file) as our definitions if provided
set struct_file=%~f1
if "%1"=="" (
set /p struct_file=Structure definition file[e.g., "structs/castle.txt"]:
)
echo Loading %struct_file%!
:: Get our structure to create and run!
set struct_name=%~f2
if "%2"=="" (
set /p struct_name=Structure to run["e.g., "start"]:
)
echo Generating %struct_name%!
%proc_command% %struct_file% %struct_name%
pause