@echo off
REM ==============================================================================
REM Reset Gooner Training Academy to Fresh Install
REM Windows Batch Script
REM ==============================================================================

echo.
echo ========================================================================
echo  Gooner Training Academy - Fresh Install Reset
echo ========================================================================
echo.
echo This will DELETE ALL local data including settings and progress.
echo This action CANNOT be undone!
echo.

choice /C YN /M "Are you sure you want to continue"
if errorlevel 2 goto :cancel
if errorlevel 1 goto :proceed

:cancel
echo.
echo Reset cancelled. No changes were made.
pause
exit /b 0

:proceed
echo.
echo Starting reset process...
echo.

REM Close any running Electron instances
echo [1/2] Closing running instances...
taskkill /F /IM electron.exe 2>nul
timeout /t 2 /nobreak >nul

REM Clear Electron userData directory (this is where localStorage persists)
echo [2/2] Clearing Electron user data...
set USERDATA_PATH=%APPDATA%\webGame
if exist "%USERDATA_PATH%" (
    echo Deleting: %USERDATA_PATH%
    rmdir /S /Q "%USERDATA_PATH%"
    echo Deleted Electron user data directory
) else (
    echo User data directory not found (this is normal for first run)
)

echo.
echo ========================================================================
echo  Reset Complete!
echo ========================================================================
echo.
echo All settings and progress have been cleared.
echo Next time you run 'npm start', it will be like a fresh install.
echo.
pause
exit /b 0
