::///////////////////////////////////////////////////////////////////////////////////////////////////
:: PEG_PC Batch Execute for Masamaru's sr2pegtool
::///////////////////////////////////////////////////////////////////////////////////////////////////
:: Version : BETA
:: Compiled by : _eb_ of Saints Row Mods [https://www.saintsrowmods.com/forum/members/_eb_.307476/]
:: Compiled on : October 23, 2021
:: Based on : DarthParametric of Deadly Stream's "NSS2NCS Batch Compile"
:: : ReiKaz of Resident Evil Modding Forum [https://residentevilmodding.boards.net/thread/12359/wem-ogg-wav-converter-batch]
:: : Flachzangen of Nexus Mods [https://www.nexusmods.com/kotor/mods/1384]
::///////////////////////////////////////////////////////////////////////////////////////////////////
@ECHO OFF
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (set "DEL=%%a")
title [SR2] PEG_PC Batch Execute for Masamaru's sr2pegtool
echo.----------------------------------------------------
echo PEG_PC Batch Execute for Masamaru's sr2pegtool BETA
echo.----------------------------------------------------
echo.
echo Howdy, Saints. Please be sure this script and the relevant PEG_PC files are
echo -- located in the same folder to where sr2pegtool.EXE's located, 'aight?
echo.
echo.
echo.
echo 1: Extract
echo 2: Rebuild
echo.
Set /P _inputtype= Choose which option ya want, Saints? [1 / 2] :
echo.
IF /I "%_inputtype%"=="1" GOTO :extract
IF /I "%_inputtype%"=="2" GOTO :rebuild
echo Error: Oops, unknown input -- abort process...
echo.
call :colorEcho 0e "[EXIT]"
echo.
echo.
pause
exit
Rem 1: Extract
:extract
echo.
echo [hitting ENTER without assigning any KEY will abort this process]
echo.
set /P input=" Continue [anyKEY] / Exit [N] :"
if %input% ==N exit
if %input% ==n exit
echo.
echo.=====[extracting files]==========
echo.
:: START
Rem For files in PEG_PC format, execute them using sr2pegtool --
for %%F in (*.peg_pc) do (
sr2pegtool.exe %%~nF.peg_pc
)
:: END
echo.
echo.
call :colorEcho 0e "[EXIT]"
echo.
echo.
pause
exit
Rem 2: Rebuild [UNTESTED]
:rebuild
echo.
echo Make sure all the extracted files [textures and PEG_DESC] are located
echo -- in the same folder to where sr2pegtool.EXE's located, 'aight?
echo.
echo.
echo [hitting ENTER without assigning any KEY will abort this process]
echo.
set /P input=" Continue [anyKEY] / Exit [N] :"
if %input% ==N exit
if %input% ==n exit
echo.
echo.=====[rebuilding files]==========
echo.
:: START
Rem For files in PEG_DESC format, execute them using sr2pegtool --
for %%F in (*.peg_desc) do (
sr2pegtool.exe %%~nF.peg_desc
)
:: END
echo.
echo.
call :colorEcho 0e "[EXIT]"
echo.
echo.
pause
exit
:colorEcho
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i