:: correct ALDETH.DLG

SETLOCAL
cd /d %DPATH%

WeiDU.exe ALDETH.DLG --out .\BWP_workspace


set "source=.\BWP_workspace\ALDETH.D"

:: first all empty lines must be deleted because otherwise batch will not work correctly

set "t=text.tmp"
if exist "%t%" del "%t%"

for /F "tokens=*" %%A in (%source%) do (
	echo %%A >> %t%
)

move "%t%" %source%


::the term to be replaced may not begin with a tilde!

set "search= ~et"
set "replace= ~Set"
call ".\%BWIPFIX%\sr_code.bat"

set "search= ~tartStore"
set "replace= ~StartStore"
call ".\%BWIPFIX%\sr_code.bat"

set "search=S~ "
set "replace=~ "
call ".\%BWIPFIX%\sr_code.bat"

set "search= ~ddJournalEntry"
set "replace= ~AddJournalEntry"
call ".\%BWIPFIX%\sr_code.bat"

set "search=A~ "
set "replace=~ "
call ".\%BWIPFIX%\sr_code.bat"

set "search= ~learAllActions"
set "replace= ~ClearAllActions"
call ".\%BWIPFIX%\sr_code.bat"

set "search=C~ "
set "replace=~ "
call ".\%BWIPFIX%\sr_code.bat"

set "search= ~akePartyItem"
set "replace= ~TakePartyItem"
call ".\%BWIPFIX%\sr_code.bat"

set "search=T~ "
set "replace=~ "
call ".\%BWIPFIX%\sr_code.bat"


WeiDU.exe .\BWP_workspace\ALDETH.D --out .\override
