@echo off
set silent=false
if "%~1" EQU "silent" call :makeSilent
:restart
title Doing stuff...
echo.
echo Setting variables...
set gameDir=C:\Program Files (x86)\Steam\steamapps\common\left 4 dead 2
echo Compiling weapon viewmodel...
echo.
"%gameDir%\bin\studiomdl.exe" -game "%gameDir%\left4dead2" -nop4 -verbose "v_huntingrifle.qc"
echo.
echo Done compiling viewmodel, compiling world model...
echo.
"%gameDir%\bin\studiomdl.exe" -game "%gameDir%\left4dead2" -nop4 -verbose "w_huntingrifle.qc"
echo.
echo Done compiling, copying files to addon folder...
echo.
copy /y "%gameDir%\left4dead2\models\v_models\v_huntingrifle.*" "C:\Users\#trigger_hurt\Documents\#Projects\Left 4 Dead 2\L4D2 - Source Files\Addons\Hunting Rifle Fix\models\v_models\"
copy /y "%gameDir%\left4dead2\models\w_models\weapons\w_sniper_mini14.*" "C:\Users\#trigger_hurt\Documents\#Projects\Left 4 Dead 2\L4D2 - Source Files\Addons\Hunting Rifle Fix\models\w_models\weapons\"
echo.
echo Done copying, packing VPK...
echo.
"%gameDir%\bin\vpk.exe" "C:\Users\#trigger_hurt\Documents\#Projects\Left 4 Dead 2\L4D2 - Source Files\Addons\Hunting Rifle Fix"
echo.
echo Done packing VPK, updating VPK in Left 4 Dead 2...
echo.
copy /y "C:\Users\#trigger_hurt\Documents\#Projects\Left 4 Dead 2\L4D2 - Source Files\Addons\hunting rifle fix.vpk" "%gameDir%\left4dead2\addons\Hunting Rifle Fix.vpk"
echo.
echo Done updating VPK in Left 4 Dead 2, updating VPK in DropBox...
echo.
copy /y "%gameDir%\left4dead2\addons\Hunting Rifle Fix.vpk" "C:\Users\#trigger_hurt\Dropbox\Hunting Rifle Fix.vpk"
if "%silent%" EQU "true" exit
<nul set /p "=Press any key to try again."
pause>nul
goto restart

:makeSilent
mode con cols=64 lines=1
set silent=true
goto :eof

:normal
mode con cols=160
goto :eof
