-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
patch.bat
116 lines (105 loc) · 2.76 KB
/
patch.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
ECHO Checking python...
CALL :venv
SET snek=py
WHERE %snek% >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
SET snek=python
WHERE !snek! >nul 2>&1
IF !ERRORLEVEL! NEQ 0 (
ECHO Can't find python. Likely incorrect install or not installed.
GOTO quit
)
)
ECHO Using %snek%
%snek% --version
%snek% -m pip show unitypy | findstr /B "Version Location"
REM Newline
ECHO.
REM Treat first arg as label call if exists.
IF [%1] NEQ [] (
GOTO %1
) ELSE (
ECHO Patching options:
ECHO 0. Everything
ECHO 1. UI ^(menus, etc^)
ECHO 2. MDB ^(skills, misisons, etc^)
ECHO 3. Dialogue ^(story^)
SET /P mode=Enter the numbers for the parts you wish to patch, in order ^(eg. 12, not 21^):
CALL update.bat
IF !mode! EQU 123 (
SET mode=0
)
IF !mode! EQU 1 (
CALL :tlg
) ELSE IF !mode! EQU 2 (
CALL :mdb
) ELSE IF !mode! EQU 3 (
CALL :dialogue
) ELSE IF !mode! EQU 12 (
CALL :tlg
CALL :mdb
) ELSE IF !mode! EQU 13 (
CALL :tlg
CALL :dialogue
) ELSE IF !mode! EQU 23 (
CALL :mdb
CALL :dialogue
) ELSE IF !mode! EQU 0 (
CALL :tlg
CALL :mdb
CALL :dialogue
) ELSE (
ECHO Invalid choice
)
GOTO quit
)
:install
IF NOT EXIST ".venv" (
ECHO Creating venv
%snek% -m venv .venv
CALL :venv
) ELSE ( ECHO Using pre-existing venv )
ECHO Installing required libraries...
%snek% -m pip install -r src\requirements.txt --find-links=wheels/ --prefer-binary --disable-pip-version-check --upgrade
IF %ERRORLEVEL% NEQ 0 (
ECHO.
echo [93mSomething went wrong. Please screenshot as much as possible or copy this whole window when asking for help. You can hide your username if you want.[0m
GOTO quit
)
%snek% src/post-install.py
GOTO quit
:uninstall
ECHO Uninstalling patch...
%snek% src/restore.py --uninstall
GOTO quit
:dialogue
ECHO Importing all translatable types that are present in your game files...
ECHO By default, already patched files are skipped. To forcefully rewrite all files, set update to false in the config.
REM Or manually import parts, see import.py -h
%snek% src/import.py --full-import --overwrite --read-defaults
ECHO Removing furigana...
%snek% src/ruby-remover.py
ECHO Cleaning up outdated backups...
%snek% src/filecopy.py --remove-old
EXIT /B 0
:mdb
ECHO Attempting mdb backup...
ECHO Original will be stored at \Users\^<name^>\AppData\LocalLow\Cygames\umamusume\master\master.mdb.bak
%snek% src/mdb/import.py --backup
ECHO Importing mdb text...
%snek% src/mdb/import.py --read-defaults
EXIT /B 0
:tlg
%snek% src/manage.py --move
EXIT /B 0
:venv
IF EXIST ".venv" (
ECHO Using venv
.venv\Scripts\activate.bat
)
EXIT /B 0
:quit
PAUSE
EXIT /B