@echo OFF
TITLE Tar's Mod Swapper 1.8 for EAW or CE
ECHO.

IF NOT EXIST bindings.ini GOTO ERROR1
IF EXIST ancientshiplist.txt GOTO ERROR2

IF EXIST IsAncient.txt GOTO ANCIENT
IF EXIST IsStock.txt GOTO STOCK
IF EXIST IsMod1.txt GOTO MOD1
IF EXIST IsMod2.txt GOTO MOD2
IF NOT EXIST Is*.txt GOTO ERROR4

:ANCIENT
ECHO Current specs are Ancient 1.8.
ECHO.
MOVE shiplist.txt Ancient
MOVE ftrlist.txt Ancient
CD..\Strings
MOVE strings.txt Ancient
MOVE aaStrings.txt Ancient
MOVE shipnames.txt Ancient
MOVE quicktips.txt Ancient
CD..\MODELS
MOVE model.siz ..\specs\Ancient
CD..\specs
GOTO SELECTION

:STOCK
ECHO Current specs are Stock.
ECHO.
MOVE shiplist.txt Stock
MOVE ftrlist.txt Stock
CD..\Strings
MOVE strings.txt Stock
MOVE aaStrings.txt Stock
MOVE shipnames.txt Stock
MOVE quicktips.txt Stock
CD..\MODELS
MOVE model.siz ..\specs\Stock
CD..\specs
GOTO SELECTION

:MOD1
ECHO Current specs are Mod1.
ECHO.
MOVE shiplist.txt Mod1
MOVE ftrlist.txt Mod1
CD..\Strings
MOVE strings.txt Mod1
MOVE aaStrings.txt Mod1
MOVE shipnames.txt Mod1
MOVE quicktips.txt Mod1
CD..\MODELS
MOVE model.siz ..\specs\Mod1
CD..\specs
GOTO SELECTION

:MOD2
ECHO Current specs are Mod2.
ECHO.
MOVE shiplist.txt Mod2
MOVE ftrlist.txt Mod2
CD..\Strings
MOVE strings.txt Mod2
MOVE aaStrings.txt Mod2
MOVE shipnames.txt Mod2
MOVE quicktips.txt Mod2
CD..\MODELS
MOVE model.siz ..\specs\Mod2
CD..\specs
GOTO SELECTION

:SELECTION
ECHO.
ECHO Enter a letter or number below to choose your specs.
ECHO.
ECHO a = Ancient 1.8
ECHO s = Stock
ECHO 1 = Mod1 (if present)
ECHO 2 = Mod2 (if present)
ECHO.

SET vChoice=0
SET /p vChoice=?

IF '%vChoice%'=='a' GOTO UseAncient
IF '%vChoice%'=='A' GOTO UseAncient
IF '%vChoice%'=='s' GOTO UseStock
IF '%vChoice%'=='S' GOTO UseStock
IF '%vChoice%'=='1' GOTO UseMod1
IF '%vChoice%'=='2' GOTO UseMod2

GOTO SELECTION

:UseAncient
REN Is*.txt IsAncient.txt
ECHO Activating Ancient shiplist and ftrlist...
ECHO.
CD Ancient
IF NOT EXIST shiplist.txt GOTO ERROR3
MOVE shiplist.txt ..
MOVE ftrlist.txt ..
MOVE model.siz ..\..\MODELS
CD..\..\Strings\Ancient
MOVE strings.txt ..
MOVE aaStrings.txt ..
MOVE shipnames.txt ..
MOVE quicktips.txt ..

ECHO Active specs are now Ancient 1.8.
ECHO.

GOTO END

:UseStock
REN Is*.txt IsStock.txt
ECHO Activating Stock shiplist and ftrlist...
ECHO.
CD Stock
IF NOT EXIST shiplist.txt GOTO ERROR3
MOVE shiplist.txt ..
MOVE ftrlist.txt ..
MOVE model.siz ..\..\MODELS
CD..\..\Strings\Stock
MOVE strings.txt ..
MOVE aaStrings.txt ..
MOVE shipnames.txt ..
MOVE quicktips.txt ..
ECHO Active specs are now Stock.
ECHO.

GOTO END

:UseMod1
REN Is*.txt IsMod1.txt
ECHO Activating Mod1 shiplist and ftrlist...
ECHO.
CD Mod1
IF NOT EXIST shiplist.txt GOTO ERROR3
MOVE shiplist.txt ..
MOVE ftrlist.txt ..
MOVE model.siz ..\..\MODELS
CD..\..\Strings\Mod1
MOVE strings.txt ..
MOVE aaStrings.txt ..
MOVE shipnames.txt ..
MOVE quicktips.txt ..
ECHO Active specs are now Mod1.
ECHO.

GOTO END

:UseMod2
REN Is*.txt IsMod2.txt
ECHO Activating Mod2 shiplist and ftrlist...
ECHO.
CD Mod2
IF NOT EXIST shiplist.txt GOTO ERROR3
MOVE shiplist.txt ..
MOVE ftrlist.txt ..
MOVE model.siz ..\..\MODELS
CD..\..\Strings\Mod2
MOVE strings.txt ..
MOVE aaStrings.txt ..
MOVE shipnames.txt ..
MOVE quicktips.txt ..
ECHO Active specs are now Mod2.
ECHO.

GOTO END

:ERROR1
ECHO Directory Error! "Mod_Swapper.bat" must be in the "..\Assets\Specs" folder.
GOTO END

:ERROR2
ECHO Setup Error! Run "Setup.bat" first (and only once). See "readme.txt". 
GOTO END

:ERROR3
ECHO No specs present! Choose another mod or the stock specs.
CD..
GOTO SELECTION

:ERROR4
ECHO Is*.txt not found! This file is needed for lightweight memory.
GOTO END

:END
ECHO.
ECHO Finished.
PAUSE