-
Notifications
You must be signed in to change notification settings - Fork 0
/
4K.bat
360 lines (328 loc) · 9.15 KB
/
4K.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
@echo off
setlocal EnableExtensions
setlocal EnableDelayedExpansion
if not exist "4K/resource/convert.exe" (
echo Downloading utility to modify receptor images
powershell.exe -nologo -Command "& {Invoke-WebRequest 'https://soyoats.com/a/osu-skin-convert.exe' -OutFile 4K/resource/convert.exe}"
)
:: Customize Window
title osu! skin wizard
:: Greetings
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set "tim=%%I"
set "tim=%tim:~8,4%"
if "%tim%" geq "20" echo Good Night, %username% :)?&goto :done
if "%tim%" geq "18" echo Good Evening, %username% :3&goto :done
if "%tim%" geq "12" echo Good Afternoon, %username% :P&goto :done
if "%tim%" geq "06" echo Good Morning, %username% :O&goto :done
:done
echo/
echo What would you like to customize?
echo/
:: Main menu options
echo Main:
echo 1. Rice notes flavors
echo 2. Noodle tail flavors
echo 3. Receptor hit position
echo 4. Judgement images
echo 5. Column width and spacing
echo/
echo Miscellanous:
echo 6. Skin theme
echo 7. Rice notes coloration
echo/
:ask
set /p "menu_choice=>> "
if "%menu_choice%" == "1" goto menu1
if "%menu_choice%" == "2" goto menu2
if "%menu_choice%" == "3" goto menu3
if "%menu_choice%" == "4" goto menu4
if "%menu_choice%" == "5" goto menu5
if "%menu_choice%" == "6" goto menu6
if "%menu_choice%" == "7" goto menu7
if "%menu_choice%" == "8" goto menu8
:: invalid selection
goto ask
:menu1
cls
echo #############################
echo ### 1. Rice notes flavors ###
echo #############################
echo/
echo What flavor would you like?
echo/
set i=0
set folder[0]=..
echo Circle:
for /D %%d in (4K/flavors/rice/circle/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
set circle_cnt=!i!
echo/
echo Diamond:
for /D %%d in (4K/flavors/rice/diamond/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
set diamond_cnt=!i!
echo/
echo Arrow:
for /D %%d in (4K/flavors/rice/arrow/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
set arrow_cnt=!i!
echo/
:q1
set /p "option=>> "
if %option% leq 0 (
goto q1
) else if %option% leq %circle_cnt% (
set note_type=circle
) else if %option% leq %diamond_cnt% (
set note_type=diamond
) else if %option% leq %arrow_cnt% (
set note_type=arrow
) else (
goto q1
)
echo/
echo "You have selected %note_type%: !folder[%option%]!"
:: copy the selected flavor assets
for /l %%i in (1,1,4) do (
:: (noodle tail will also be replaced to match the selected flavor)
:: stock receptors are at 460
xcopy "4K\flavors\receptors\!note_type!\Receptor_%%i.png" "4K\current\misc\Receptor_%%i.png*" /Y
xcopy "4K\flavors\receptors\!note_type!\Receptor_Tapped_%%i.png" "4K\current\misc\Receptor_Tapped_%%i.png*" /Y
xcopy "4K\flavors\rice\!note_type!\!folder[%option%]!\rice_%%i.png" "4K\current\rice_%%i.png*" /Y
xcopy "4K\flavors\rice\!note_type!\!folder[%option%]!\noodle_%%i.png" "4K\current\noodle_%%i.png*" /Y
)
xcopy "4K\flavors\noodles\!note_type!\noodle_body.png" "4K\current\noodle_body.png*" /Y
xcopy "4K\flavors\noodles\!note_type!\noodle_tail.png" "4K\current\noodle_tail.png*" /Y
call :skin_ini_edit "HitPosition" 460
exit /B
:menu2
cls
echo ##############################
echo ### 2. Noodle tail flavors ###
echo ##############################
echo/
echo What noodle tail would you like?
set i=0
set folder[0]=..
for /D %%d in (4K/flavors/noodles/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
echo/
:q2
set /p "option=>> "
if %option% leq 0 (
goto q2
) else if not %option% leq %i% (
goto q2
)
echo "You have selected !folder[%option%]!"
:: copy the selected flavor assets
xcopy "4K\flavors\noodles\!folder[%option%]!\noodle_body.png" "4K\current\noodle_body.png*" /Y
xcopy "4K\flavors\noodles\!folder[%option%]!\noodle_tail.png" "4K\current\noodle_tail.png*" /Y
exit /B
:menu3
cls
echo ################################
echo ### 3. Receptor hit position ###
echo ################################
echo/
echo What receptor would you like?
set i=0
set folder[0]=..
for /D %%d in (4K/flavors/receptors/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
echo/
:q3-1
set /p "option=>> "
if %option% leq 0 (
goto q3-1
) else if not %option% leq %i% (
echo %option%
goto q3-1
)
echo "You have selected !folder[%option%]!"
echo/
echo ===========================================================
echo/
echo What hit position would you like (400-480, increments of 5)
echo boge: 430, sel: 460, kanemining: 480
echo/
:q3-2
set /p "hitpos=>> "
set /a remainder = %hitpos% %% 5
if %hitpos% lss 400 (
goto q3-2
) else if %hitpos% gtr 480 (
goto q3-2
) else if not %remainder% == 0 (
goto q3-2
)
:: copy the receptors
for /l %%i in (1,1,4) do (
xcopy "4K\flavors\receptors\!folder[%option%]!\Receptor_%%i.png" "4K\current\misc\Receptor_%%i.png*" /Y
xcopy "4K\flavors\receptors\!folder[%option%]!\Receptor_Tapped_%%i.png" "4K\current\misc\Receptor_Tapped_%%i.png*" /Y
)
set /a offset=((%hitpos%-460)/5)*8
for /l %%i in (1,1,4) do (
"4K\resource\convert.exe" "4K\current\misc\Receptor_%%i.png" -page +0+%offset% -background none -flatten "4K\current\misc\Receptor_%%i.png"
"4K\resource\convert.exe" "4K\current\misc\Receptor_Tapped_%%i.png" -page +0+%offset% -background none -flatten "4K\current\misc\Receptor_Tapped_%%i.png"
)
call :skin_ini_edit "HitPosition" %hitpos%
exit /B
:menu4
cls
echo ###########################
echo ### 4. Judgement images ###
echo ###########################
echo/
echo What flavor would you like?
echo/
set i=0
set folder[0]=..
for /D %%d in (4K/flavors/judgements/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
echo/
:q3-1
set /p "option=>> "
if %option% leq 0 (
goto q3-1
) else if not %option% leq %i% (
echo %option%
goto q3-1
)
echo "You have selected !folder[%option%]!"
:: copy the selected judgements
for /f %%f in ('dir /b "4K\flavors\judgements\!folder[%option%]!\"') do (
copy "4K\flavors\judgements\!folder[%option%]!\%%f" "4K\current\judgements\%%f" /y
)
exit /B
:menu5
cls
echo ###############################
echo ### 5. Column width/spacing ###
echo ###############################
echo/
echo Examples:
echo/
echo boge [default]: 70,70,70,70 and 0,0,0
echo xvenn: 74,73,73,74 and 4,4,4
echo/
set /p "c1=Column 1 width >> "
set /p "c2=Column 2 width >> "
set /p "c3=Column 3 width >> "
set /p "c4=Column 4 width >> "
echo/
set /p "s1=Column 1,2 spacing >> "
set /p "s2=Column 2,3 spacing >> "
set /p "s3=Column 3,4 spacing >> "
echo/
echo Column width: %c1%,%c2%,%c3%,%c4%
echo Column spacing: %s1%,%s2%,%s3%
echo/
set /p "confirm=Press enter to confirm changes"
call :skin_ini_edit "ColumnWidth" "%c1%,%c2%,%c3%,%c4%"
call :skin_ini_edit "ColumnSpacing" "%s1%,%s2%,%s3%"
exit /B
echo 6. Rice notes coloration
echo 7. Receptor visibility
echo 8. Judgement position
:menu6
cls
echo ###########################
echo ### 6. Skin Theme ###
echo ###########################
echo/
echo What flavor would you like?
echo/
set i=0
set folder[0]=..
for /D %%d in (4K/flavors/misc/themes/*) do (
set /A i+=1
set folder[!i!]=%%d
echo !i!: %%d
)
echo/
set /p "option=>> "
echo "You have selected !folder[%option%]!"
:: delete the previous stuff
::if exist mania-hit*.png del mania-hit*.png
::if exist ranking-panel.png del ranking-panel.png
::if exist [email protected] del [email protected]
del *.png
:: copy the selected theme
for /f %%f in ('dir /b "4K\flavors\misc\themes\!folder[%option%]!\"') do (
copy "4K\flavors\misc\themes\!folder[%option%]!\%%f" .
)
:: copy the ranking panel
for /f %%f in ('dir /b "4K\flavors\misc\ranking_panel\!folder[%option%]!\"') do (
copy "4K\flavors\misc\ranking_panel\!folder[%option%]!\%%f" .
)
set /p score_font_overlap=<score_font_overlap_text_file.png
call :skin_ini_edit "ScorePrefix" "fonts/score/!folder[%option%]!/score"
call :skin_ini_edit "ScoreOverlap" %score_font_overlap%
exit /B
:menu7
cls
echo ################################
echo ### 7. Rice notes coloration ###
echo ################################
powershell.exe -nologo -file "4K\resource\dep.ps1" "MY-PC"
echo/
echo Hue modification:
echo/
echo Using a red image:
echo 100 = cyan
echo 66 = green
echo 33 = yellow
echo 0 = no changes
echo -33 = blue
echo -66 = pink
echo -100 = cyan
echo/
:q6-1
set /p "rice_hue=rice hue >> "
if %rice_hue% lss -100 (
goto :q6-1
) else if %rice_hue% gtr 100 (
goto :q6-1
)
:q6-2
set /p "noodle_hue=noodle hue >> "
if %noodle_hue% lss -100 (
goto :q6-2
) else if %noodle_hue% gtr 100 (
goto :q6-2
)
set /a rice_hue=%rice_hue%+100
set /a noodle_hue=%noodle_hue%+100
set /p "confirm=Press enter to confirm changes"
for /l %%i in (1,1,4) do (
"4K\resource\convert.exe" "4K\current\rice_%%i.png" -modulate 100,100,%rice_hue% "4K\current\rice_%%i.png"
"4K\resource\convert.exe" "4K\current\noodle_%%i.png" -modulate 100,100,%noodle_hue% "4K\current\noodle_%%i.png"
)
exit /B
:: utilities
:skin_ini_edit
:: jrepl usage reference https://stackoverflow.com/questions/18871870/batch-file-to-edit-an-ini
set file="skin.ini"
set arg1=%~1
set arg2=%~2
type "%file%"| call 4K/resource/JREPL "^%arg1%.*" "%arg1%: %arg2%" >"%file%.tmp"
move "%file%.tmp" "%file%" >nul