:: 2KHS Start script
::
:: The script fixes user specific settings in the original configuration files.
:: It creates a iso folder in which the iso named "NHL 2K11 (USA).iso" must be placed.
:: It moves 2KHS textures to subfolder in order to patch it more easily.
::
:: Known limitations:
::  Error handling is non-existent, so it will just print errors when folders exist, this is expected
::
:: Version history:
::  V1: 2019-06-08: Add to original 2KHS package, Nike The Bike, http://PlayNHL.TK
::  V2: 2019-07-27: Add png folder fix and add to NHL2K package, Nike The Bike, http://PlayNHL.TK
::
@ECHO OFF
:: Replace paths and djneo for %username% in Dolphin configuration
set filepath="%~dp0\config\dolphin.ini"
set outfilepath="%~dp0\config\dolphin.ini.tmp"
set isopath=%~dp0\Iso
set oldpath1=H:\HRY
set oldpath2=H:/HRY
powershell -Command "(Get-Content '%filepath%').Replace('djneo','%username%').Replace('%oldpath1%','%isopath%').Replace('%oldpath2%','%isopath%') | Set-Content '%outfilepath%'"
move /y %outfilepath% %filepath%
::Move textures to subfolder for easier patching
set oldtexturepath="%~dp0/Load/Textures/SH3E54/"
set newtexturepath="%~dp0/Load/Textures/SH3E54/0000-2KHS/"
mkdir %newtexturepath%
move /y %oldtexturepath%\*.* %newtexturepath%
:: Move also png folder
set oldtexturepath="%~dp0/Load/Textures/SH3E54/png/"
set newtexturepath="%~dp0/Load/Textures/SH3E54/0000-2KHS/png/"
mkdir %newtexturepath%
move /y %oldtexturepath%\*.* %newtexturepath%
::Create ISO path if missing
mkdir "%isopath%"
::Run 2KHS using Dolphin
cmd.exe /c start "2KHS" /High "%~dp0\Ishiiruka.1066 (e28d1ca28).x64\Dolphin.exe" "%isopath%\NHL 2K11 (USA).iso" /high
