-
Notifications
You must be signed in to change notification settings - Fork 1
/
_GENERATE.bat
799 lines (715 loc) · 28.6 KB
/
_GENERATE.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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
@echo off
color E0
title Horsie's Viewmodel Editor
cls
:check_and_set_folders
::Check folders
set vm_customizer_folder=%~dp0
cd "%vm_customizer_folder%"
set vm_customizer_folder=%cd%
cd "%vm_customizer_folder%"
for %%I in (.) do set base_folder=%%~nxI
cd ..\
for %%I in (.) do set check_folder=%%~nxI
cd "%base_folder%"
set "base_folder=%base_folder: =%"
set "check_folder=%check_folder: =%"
IF /I %check_folder%==custom goto :custom_folder
IF /I %check_folder%==tf goto :tf_folder
:wrong_folder
color 4f
echo Wrong folder!
echo Please make sure the program is placed inside your game's "custom" folder or "tf" folder.
echo.
pause
endlocal
goto :eof
:custom_folder
::Set folders
cd "%vm_customizer_folder%"
set vm_customizer_folder=%cd%
cd ..\
set custom_folder=%cd%
set dev_folder=%vm_customizer_folder%\_dev
set batch_folder=%dev_folder%\batch
set animations_folder=%dev_folder%\decompiled_animations
cd ..\
set tf_folder=%cd%
cd ..\
cd bin
set bin_folder=%cd%
cd "%tf_folder%"
cls
IF NOT EXIST tf2_misc_dir.vpk goto :wrong_folder
IF NOT EXIST gameinfo.txt goto :wrong_folder
cd "%vm_customizer_folder%"
goto :check_and_set_folders_done
:tf_folder
::Set folders
cd "%vm_customizer_folder%"
set vm_customizer_folder=%cd%
set dev_folder=%vm_customizer_folder%\_dev
set animations_folder=%dev_folder%\decompiled_animations
set batch_folder=%dev_folder%\batch
cd ..\
set tf_folder=%cd%
set custom_folder=%tf_folder%\custom
cd ..\
cd bin
set bin_folder=%cd%
cd "%tf_folder%"
cls
IF NOT EXIST tf2_misc_dir.vpk goto :wrong_folder
IF NOT EXIST gameinfo.txt goto :wrong_folder
cd "%vm_customizer_folder%"
cd "%vm_customizer_folder%"
goto :check_and_set_folders_done
:check_and_set_folders_done
:check_if_vpk_is_in_use
set vpk_name=__Horsie'sViewmodelEditor
cd %custom_folder%
IF NOT EXIST "%vpk_name%.vpk" goto :del_temp
2>nul (
>>%vpk_name%.vpk echo off
) && (goto :del_temp) || (goto :vpk_in_use)
goto :del_temp
:vpk_in_use
color 4f
echo Error! Game is currently running.
echo Please close the game and try again.
echo.
endlocal
pause
goto :eof
:del_temp
::delete temp just in case
cd "%dev_folder%"
IF EXIST "decompiled_animations_temp" rd /s /q "decompiled_animations_temp"
::delete custom anims temp too
IF EXIST "decompiled_custom_animations_temp" rd /s /q "decompiled_custom_animations_temp"
::delete custom animations folder if no vpks detected
IF NOT EXIST "%vm_customizer_folder%\custom animations\*.vpk" IF EXIST "%dev_folder%\decompiled_custom_animations" rd /s /q "decompiled_custom_animations"
::delete fixed animations folder if no vpk detected
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%dev_folder%\decompiled_fixed_animations" rd /s /q "decompiled_fixed_animations"
::restore default settings files if they are missing
cd "%vm_customizer_folder%"
IF NOT EXIST settings_scout.txt copy "%dev_folder%\default_settings\settings_scout.txt" "%vm_customizer_folder%\settings_scout.txt" >nul
IF NOT EXIST settings_soldier.txt copy "%dev_folder%\default_settings\settings_soldier.txt" "%vm_customizer_folder%\settings_soldier.txt" >nul
IF NOT EXIST settings_pyro.txt copy "%dev_folder%\default_settings\settings_pyro.txt" "%vm_customizer_folder%\settings_pyro.txt" >nul
IF NOT EXIST settings_demoman.txt copy "%dev_folder%\default_settings\settings_demoman.txt" "%vm_customizer_folder%\settings_demoman.txt" >nul
IF NOT EXIST settings_heavy.txt copy "%dev_folder%\default_settings\settings_heavy.txt" "%vm_customizer_folder%\settings_heavy.txt" >nul
IF NOT EXIST settings_engineer.txt copy "%dev_folder%\default_settings\settings_engineer.txt" "%vm_customizer_folder%\settings_engineer.txt" >nul
IF NOT EXIST settings_medic.txt copy "%dev_folder%\default_settings\settings_medic.txt" "%vm_customizer_folder%\settings_medic.txt" >nul
IF NOT EXIST settings_sniper.txt copy "%dev_folder%\default_settings\settings_sniper.txt" "%vm_customizer_folder%\settings_sniper.txt" >nul
IF NOT EXIST settings_spy.txt copy "%dev_folder%\default_settings\settings_spy.txt" "%vm_customizer_folder%\settings_spy.txt" >nul
::restore previous settings if possible
IF EXIST "%dev_folder%\saved_settings.bat" call "%dev_folder%\saved_settings.bat"
::set default options if needed
IF NOT DEFINED automatic_preloading set automatic_preloading=off
IF NOT DEFINED fixed_vm_addon set fixed_vm_addon=on
IF NOT DEFINED disable_tracers set disable_tracers=off
IF NOT DEFINED hide_errors set hide_errors=on
IF NOT DEFINED custom_vm set custom_vm=on
IF NOT DEFINED apply_for_specific_classes set apply_for_specific_classes=false
::fixed viewmodels files check
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" set fixed_vm_addon=off
::custom viewmodels files check
IF NOT EXIST "%vm_customizer_folder%\custom animations\*.vpk" set custom_vm=off
:main_menu
::set some menu variables
IF %automatic_preloading%==on set toggle_preloading=goto :preloading_off
IF %automatic_preloading%==off set toggle_preloading=goto :preloading_on
IF %automatic_preloading%==on set automatic_preloading_status=X
IF %automatic_preloading%==off set automatic_preloading_status=_
IF %disable_tracers%==on set toggle_tracers=goto :disable_tracers_off
IF %disable_tracers%==off set toggle_tracers=goto :disable_tracers_on
IF %disable_tracers%==on set disable_tracers_status=X
IF %disable_tracers%==off set disable_tracers_status=_
IF %hide_errors%==on set toggle_errors=goto :hide_errors_off
IF %hide_errors%==off set toggle_errors=goto :hide_errors_on
IF %hide_errors%==on set hide_errors_status=X
IF %hide_errors%==off set hide_errors_status=_
IF %fixed_vm_addon%==on set toggle_fixed_vm_addon=goto :fixed_vm_addon_off
IF %fixed_vm_addon%==off set toggle_fixed_vm_addon=goto :fixed_vm_addon_on
IF %fixed_vm_addon%==on set fixed_vm_addon_status=X
IF %fixed_vm_addon%==off set fixed_vm_addon_status=_
IF %custom_vm%==on set toggle_custom_vm=goto :custom_vm_off%
IF %custom_vm%==off set toggle_custom_vm=goto :custom_vm_on%
IF %custom_vm%==on set custom_vm_status=X
IF %custom_vm%==off set custom_vm_status=_
::reset per-class install settings
set apply_for_specific_classes=false
set apply_per_class_scout=false
set apply_per_class_soldier=false
set apply_per_class_pyro=false
set apply_per_class_demoman=false
set apply_per_class_heavy=false
set apply_per_class_engineer=false
set apply_per_class_medic=false
set apply_per_class_sniper=false
set apply_per_class_spy=false
::store settings
IF EXIST "%dev_folder%\saved_settings.bat" del "%dev_folder%\saved_settings.bat" >nul
IF %automatic_preloading%==on echo set automatic_preloading=on >> "%dev_folder%\saved_settings.bat"
IF %automatic_preloading%==off echo set automatic_preloading=off >> "%dev_folder%\saved_settings.bat"
IF %disable_tracers%==on echo set disable_tracers=on >> "%dev_folder%\saved_settings.bat"
IF %disable_tracers%==off echo set disable_tracers=off >> "%dev_folder%\saved_settings.bat"
IF %hide_errors%==on echo set hide_errors=on >> "%dev_folder%\saved_settings.bat"
IF %hide_errors%==off echo set hide_errors=off >> "%dev_folder%\saved_settings.bat"
IF %fixed_vm_addon%==on echo set fixed_vm_addon=on >> "%dev_folder%\saved_settings.bat"
IF %fixed_vm_addon%==off IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" echo set fixed_vm_addon=off >> "%dev_folder%\saved_settings.bat"
IF %custom_vm%==on echo set custom_vm=on >> "%dev_folder%\saved_settings.bat"
IF %custom_vm%==off IF EXIST "%vm_customizer_folder%\custom animations\*.vpk" echo set custom_vm=off >> "%dev_folder%\saved_settings.bat"
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Welcome to Horsie's Viewmodel Editor!
echo.
echo.Install:
echo. 1. Install for all classes
echo. 2. Install for specific classes
IF EXIST "%custom_folder%\%vpk_name%.vpk" echo. 0. Uninstall
echo.
echo.Options:
echo. 3. [%automatic_preloading_status%] Include automatic preloading (recommended)
echo. 4. [%disable_tracers_status%] Remove 1st person bullet tracers
echo. 5. [%hide_errors_status%] Hide console errors
echo. 6. Developer settings
::fixed and custom animation prompts
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF NOT EXIST "%vm_customizer_folder%\custom animations\*vpk" (
echo.
echo Toggle animations:
echo. 7. [%fixed_vm_addon_status%] Include Fixed Viewmodels )
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%vm_customizer_folder%\custom animations\*vpk" (
echo.
echo Toggle animations:
echo. 7. [%custom_vm_status%] Include Custom Animations )
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%vm_customizer_folder%\custom animations\*vpk" (
echo.
echo Toggle animations:
echo. 7. [%fixed_vm_addon_status%] Include Fixed Viewmodels
echo. 8. [%custom_vm_status%] Include Custom Animations )
echo.
set M=none
SET /P M=Choose an option:
IF NOT "%M%"=="0" IF NOT "%M%"=="1" IF NOT "%M%"=="2" IF NOT "%M%"=="3" IF NOT "%M%"=="4" IF NOT "%M%"=="5" IF NOT "%M%"=="6" IF NOT "%M%"=="7" IF NOT "%M%"=="8" goto :main_menu
IF %M%==0 (
IF NOT EXIST "%custom_folder%\%vpk_name%.vpk" goto :main_menu
IF EXIST "%custom_folder%\%vpk_name%.vpk" goto :uninstall_prompt)
IF %M%==1 goto :install_for_all_classes_prompt
IF %M%==2 goto :pick_classes_menu
IF %M%==3 %toggle_preloading%
IF %M%==4 %toggle_tracers%
IF %M%==5 %toggle_errors%
IF %M%==6 goto :dev_menu
::fixed and custom animations logic
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF NOT EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==7 goto :main_menu
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF NOT EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==8 goto :main_menu
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF NOT EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==7 %toggle_fixed_vm_addon%
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF NOT EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==8 goto :main_menu
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==7 %toggle_custom_vm%
IF NOT EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==8 goto :main_menu
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==7 %toggle_fixed_vm_addon%
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" IF EXIST "%vm_customizer_folder%\custom animations\*vpk" IF %M%==8 %toggle_custom_vm%
:install_for_all_classes_prompt
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Welcome to Horsie's Viewmodel Editor!
echo.
echo You're about to install the mod for all the classes.
echo.
set M=none
SET /P M=Proceed? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :install_for_all_classes_prompt
IF /i %M%==y (
set apply_for_specific_classes=false
goto :exit_menu )
IF /i %M%==n goto :main_menu
goto :main_menu
:preloading_off
set automatic_preloading=off
set toggle_preloading=goto :preloading_on
goto :main_menu
:preloading_on
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Warning:
echo.
echo.Automatic preloading will allow you to use the custom viewmodels in any server.
echo.It's highly recommended to enable it.
echo.But it can cause crashes in casual if you are using mods that include custom models.
echo.Only enable it if you are not using such mods.
echo.
set M=none
SET /P M=Are you sure that you want to enable it? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :preloading_on
IF /i %M%==n goto :main_menu
set automatic_preloading=on
set toggle_preloading=goto :preloading_off
goto :main_menu
:disable_tracers_off
set disable_tracers=off
set toggle_tracers=goto :disable_tracers_on
goto :main_menu
:disable_tracers_on
set disable_tracers=on
set toggle_tracers=goto :disable_tracers_off
goto :main_menu
:hide_errors_off
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Warning:
echo.
echo.This option hides the console errors caused by some of the mod's options.
echo.Without this, the console might be hard to read due to spam.
echo.
set M=none
SET /P M=Are you sure that you want to disable it? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :hide_errors_off
IF /i %M%==n goto :main_menu
set hide_errors=off
set toggle_errors=goto :hide_errors_on
goto :main_menu
:hide_errors_on
set hide_errors=on
set toggle_errors=goto :hide_errors_off
goto :main_menu
:fixed_vm_addon_off
set fixed_vm_addon=off
set toggle_fixed_vm_addon=goto :fixed_vm_addon_on
goto :main_menu
:fixed_vm_addon_on
set fixed_vm_addon=on
set toggle_fixed_vm_addon=goto :fixed_vm_addon_off
goto :main_menu
:custom_vm_off
set custom_vm=off
set toggle_custom_vm=goto :custom_vm_on
goto :main_menu
:custom_vm_on
set custom_vm=on
set toggle_custom_vm=goto :custom_vm_off
goto :main_menu
:uninstall_prompt
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Warning:
echo.
echo This will remove the generated VPK mod from your custom folder.
echo You don't have to do this before applying new settings, only if you just want to uninstall the mod.
echo.
set M=none
SET /P M=Do you want to proceed? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :uninstall_prompt
IF /i %M%==y (
echo Removing VPK...
IF EXIST "%custom_folder%\%vpk_name%.vpk" del "%custom_folder%\%vpk_name%.vpk"
IF EXIST "%custom_folder%\%vpk_name%.vpk.sound.cache" del "%custom_folder%\%vpk_name%.vpk.sound.cache"
goto :main_menu )
IF /i %M%==n goto :main_menu
:pick_classes_menu
set scout_status=_
set soldier_status=_
set pyro_status=_
set demoman_status=_
set heavy_status=_
set engineer_status=_
set medic_status=_
set sniper_status=_
set spy_status=_
set toggle_scout_status=goto :scout_status_ON
set toggle_soldier_status=goto :soldier_status_ON
set toggle_pyro_status=goto :pyro_status_ON
set toggle_demoman_status=goto :demoman_status_ON
set toggle_heavy_status=goto :heavy_status_ON
set toggle_engineer_status=goto :engineer_status_ON
set toggle_medic_status=goto :medic_status_ON
set toggle_sniper_status=goto :sniper_status_ON
set toggle_spy_status=goto :spy_status_ON
set apply_per_class_scout=false
set apply_per_class_soldier=false
set apply_per_class_pyro=false
set apply_per_class_demoman=false
set apply_per_class_heavy=false
set apply_per_class_engineer=false
set apply_per_class_medic=false
set apply_per_class_sniper=false
set apply_per_class_spy=false
:pick_classes_menu_2
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Welcome to Horsie's Viewmodel Editor!
echo.
echo Toggle classes:
echo. 1. [%scout_status%] Scout
echo. 2. [%soldier_status%] Soldier
echo. 3. [%pyro_status%] Pyro
echo. 4. [%demoman_status%] Demoman
echo. 5. [%heavy_status%] Heavy
echo. 6. [%engineer_status%] Engineer
echo. 7. [%medic_status%] Medic
echo. 8. [%sniper_status%] Sniper
echo. 9. [%spy_status%] Spy
echo.
echo Options:
echo. 10. Install for selected classes
echo. 0. Go back
echo.
set M=none
SET /P M=Choose an option:
IF NOT "%M%"=="0" IF NOT "%M%"=="1" IF NOT "%M%"=="2" IF NOT "%M%"=="3" IF NOT "%M%"=="4" IF NOT "%M%"=="5" IF NOT "%M%"=="6" IF NOT "%M%"=="7" IF NOT "%M%"=="8" IF NOT "%M%"=="9" IF NOT "%M%"=="10" IF NOT "%M%"=="0" goto :pick_classes_menu_2
IF %M%==1 %toggle_scout_status%
IF %M%==2 %toggle_soldier_status%
IF %M%==3 %toggle_pyro_status%
IF %M%==4 %toggle_demoman_status%
IF %M%==5 %toggle_heavy_status%
IF %M%==6 %toggle_engineer_status%
IF %M%==7 %toggle_medic_status%
IF %M%==8 %toggle_sniper_status%
IF %M%==9 %toggle_spy_status%
IF %M%==10 goto :apply_for_selected_classes_prompt
IF %M%==0 goto :main_menu
:scout_status_ON
set scout_status=X
set apply_per_class_scout=true
set toggle_scout_status=goto :scout_status_OFF
goto :pick_classes_menu_2
:soldier_status_ON
set soldier_status=X
set apply_per_class_soldier=true
set toggle_soldier_status=goto :soldier_status_OFF
goto :pick_classes_menu_2
:pyro_status_ON
set pyro_status=X
set apply_per_class_pyro=true
set toggle_pyro_status=goto :pyro_status_OFF
goto :pick_classes_menu_2
:demoman_status_ON
set demoman_status=X
set apply_per_class_demoman=true
set toggle_demoman_status=goto :demoman_status_OFF
goto :pick_classes_menu_2
:heavy_status_ON
set heavy_status=X
set apply_per_class_heavy=true
set toggle_heavy_status=goto :heavy_status_OFF
goto :pick_classes_menu_2
:engineer_status_ON
set engineer_status=X
set apply_per_class_engineer=true
set toggle_engineer_status=goto :engineer_status_OFF
goto :pick_classes_menu_2
:medic_status_ON
set medic_status=X
set apply_per_class_medic=true
set toggle_medic_status=goto :medic_status_OFF
goto :pick_classes_menu_2
:sniper_status_ON
set sniper_status=X
set apply_per_class_sniper=true
set toggle_sniper_status=goto :sniper_status_OFF
goto :pick_classes_menu_2
:spy_status_ON
set spy_status=X
set apply_per_class_spy=true
set toggle_spy_status=goto :spy_status_OFF
goto :pick_classes_menu_2
:scout_status_OFF
set scout_status=_
set apply_per_class_scout=false
set toggle_scout_status=goto :scout_status_ON
goto :pick_classes_menu_2
:soldier_status_OFF
set soldier_status=_
set apply_per_class_soldier=false
set toggle_soldier_status=goto :soldier_status_ON
goto :pick_classes_menu_2
:pyro_status_OFF
set pyro_status=_
set apply_per_class_pyro=false
set toggle_pyro_status=goto :pyro_status_ON
goto :pick_classes_menu_2
:demoman_status_OFF
set demoman_status=_
set apply_per_class_demoman=false
set toggle_demoman_status=goto :demoman_status_ON
goto :pick_classes_menu_2
:heavy_status_OFF
set heavy_status=_
set apply_per_class_heavy=false
set toggle_heavy_status=goto :heavy_status_ON
goto :pick_classes_menu_2
:engineer_status_OFF
set engineer_status=_
set apply_per_class_engineer=false
set toggle_engineer_status=goto :engineer_status_ON
goto :pick_classes_menu_2
:medic_status_OFF
set medic_status=_
set apply_per_class_medic=false
set toggle_medic_status=goto :medic_status_ON
goto :pick_classes_menu_2
:sniper_status_OFF
set sniper_status=_
set apply_per_class_sniper=false
set toggle_sniper_status=goto :sniper_status_ON
goto :pick_classes_menu_2
:spy_status_OFF
set spy_status=_
set apply_per_class_spy=false
set toggle_spy_status=goto :spy_status_ON
goto :pick_classes_menu_2
:apply_for_selected_classes_prompt
IF %scout_status%==_ IF %soldier_status%==_ IF %pyro_status%==_ IF %demoman_status%==_ IF %heavy_status%==_ IF %engineer_status%==_ IF %medic_status%==_ IF %sniper_status%==_ IF %spy_status%==_ goto :pick_classes_menu_2
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Welcome to Horsie's Viewmodel Editor!
echo.
echo You're about install the mod for:
IF %scout_status%==X echo - Scout
IF %soldier_status%==X echo - Soldier
IF %pyro_status%==X echo - Pyro
IF %demoman_status%==X echo - Demoman
IF %heavy_status%==X echo - Heavy
IF %engineer_status%==X echo - Engineer
IF %medic_status%==X echo - Medic
IF %sniper_status%==X echo - Sniper
IF %spy_status%==X echo - Spy
echo.
set M=none
SET /P M=Proceed? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :apply_for_selected_classes_prompt
IF /i %M%==y (
set apply_for_specific_classes=true
goto :exit_menu )
IF /i %M%==n goto :pick_classes_menu_2
:dev_menu
cls
echo. ~~%%%%%%%%_,_,
echo. ~~%%%%%%%%%-"/./
echo. ~~%%%%%%%-' / `.
echo. ~~%%%%%%%%' . ,__;
echo. ~~%%%%%%%%' : \O\
echo. ~~%%%%%%%%' : `.
echo. ~~%%%%%%%%' `. _, '
echo. ~~%%%%%%%%' .'`-._ `.
echo. ~~%%%%%%%%%' : `-. (,;
echo. ~~%%%%%%%%' : `._\_.'
echo. ~~%%%%%%' Welcome to Horsie's Viewmodel Editor!
echo.
echo Dev Options:
echo. 1. Remove all extracted animations
echo. 2. Restore settings files to default
echo. 3. Restore main menu settings to default
echo 0. Go back
echo.
set M=none
SET /P M=Choose dev option:
IF NOT "%M%"=="0" IF NOT "%M%"=="1" IF NOT "%M%"=="2" IF NOT "%M%"=="3" goto :dev_menu
IF %M%==0 goto :main_menu
IF %M%==1 goto :remove_extracted_animations_prompt
IF %M%==2 goto :restore_settings_prompt
IF %M%==3 GOTO :restore_menu_settings_prompt
:remove_extracted_animations_prompt
cls
echo This removes all the files extracted from the game, the fixed viewmodels pack and from custom animations (if present).
echo They will be extracted again when you press start.
echo Only recommended if something is really wrong or the game got updated.
echo.
set M=none
SET /P M=Do you want to proceed? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :remove_extracted_animations_prompt
IF /i %M%==y (
echo Removing all extracted animations...
IF EXIST "%dev_folder%\decompiled_animations" rd /s /q "%dev_folder%\decompiled_animations"
IF EXIST "%dev_folder%\decompiled_fixed_animations" rd /s /q "%dev_folder%\decompiled_fixed_animations"
IF EXIST "%dev_folder%\decompiled_custom_animations" rd /s /q "%dev_folder%\decompiled_custom_animations"
IF EXIST "%dev_folder%\decompiled_custom_animations_temp" rd /s /q "%dev_folder%\decompiled_custom_animations_temp"
goto :dev_menu )
IF /i %M%==n goto :dev_menu
:restore_settings_prompt
cls
echo This restores all the settings_class.txt files to default.
echo There is no way to recover your previous settings if you do this.
echo.
set M=none
SET /P M=Are you sure you want to proceed? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :restore_settings_prompt
IF /i %M%==y (
echo Restoring settings...
xcopy /y "%dev_folder%\default_settings" "%vm_customizer_folder%" /e /q >nul
goto :dev_menu )
IF /i %M%==n goto :dev_menu
:restore_menu_settings_prompt
cls
echo This restores the main menu settings to their default values.
echo.
set M=none
SET /P M=Are you sure you want to proceed? (Y/N):
IF /i NOT "%M%"=="y" IF /i NOT "%M%"=="n" goto :restore_menu_settings_prompt
IF /i %M%==y (
IF EXIST "%dev_folder%\saved_settings.bat" del "%dev_folder%\saved_settings.bat" >nul
set automatic_preloading=off
IF EXIST "%vm_customizer_folder%\fixed viewmodels addon\*.vpk" set fixed_vm_addon=on
set disable_tracers=off
set hide_errors=on
IF EXIST "%vm_customizer_folder%\custom animations\*.vpk" set custom_vm=on
set apply_for_specific_classes=false
goto :dev_menu )
IF /i %M%==n goto :dev_menu
:exit_menu
cls
color 30
::Extract default animations if needed
call "%vm_customizer_folder%\_dev\batch\extract_default_animations.bat"
::Check for and extract fixed viewmodels
IF %fixed_vm_addon%==on call "%vm_customizer_folder%\_dev\batch\extract_fixed_animations.bat"
::Check for and extract custom animations
IF %custom_vm%==on call "%vm_customizer_folder%\_dev\batch\extract_custom_animations.bat"
::Create temp folder + set variables
cd "%dev_folder%"
IF EXIST "decompiled_animations_temp" RMDIR /S /Q "decompiled_animations_temp"
IF NOT EXIST "decompiled_animations_temp" mkdir "decompiled_animations_temp"
xcopy /y "decompiled_animations" "decompiled_animations_temp" /e /q >nul
IF %fixed_vm_addon%==on IF EXIST "decompiled_fixed_animations" xcopy /y "decompiled_fixed_animations" "decompiled_animations_temp" /e /q >nul
IF %custom_vm%==on IF EXIST "decompiled_custom_animations" xcopy /y "decompiled_custom_animations" "decompiled_animations_temp" /e /q >nul
set decompiled_animations_temp=%dev_folder%\decompiled_animations_temp
set qc_folder_temp=%dev_folder%\decompiled_animations_temp
:apply settings
echo.
echo Applying the settings:
IF %apply_for_specific_classes%==true goto :apply_per_class
IF NOT %apply_for_specific_classes%==true goto :apply_for_all
:apply_per_class
cd "%batch_folder%"
IF %apply_per_class_scout%==true call apply_for_scout.bat
cd "%batch_folder%"
IF %apply_per_class_soldier%==true call apply_for_soldier.bat
cd "%batch_folder%"
IF %apply_per_class_pyro%==true call apply_for_pyro.bat
cd "%batch_folder%"
IF %apply_per_class_demoman%==true call apply_for_demoman.bat
cd "%batch_folder%"
IF %apply_per_class_heavy%==true call apply_for_heavy.bat
cd "%batch_folder%"
IF %apply_per_class_engineer%==true call apply_for_engineer.bat
cd "%batch_folder%"
IF %apply_per_class_medic%==true call apply_for_medic.bat
cd "%batch_folder%"
IF %apply_per_class_sniper%==true call apply_for_sniper.bat
cd "%batch_folder%"
IF %apply_per_class_spy%==true call apply_for_spy.bat
goto :compile
:apply_for_all
::call settings batch files
cd "%batch_folder%"
call apply_for_scout.bat
cd "%batch_folder%"
call apply_for_soldier.bat
cd "%batch_folder%"
call apply_for_pyro.bat
cd "%batch_folder%"
call apply_for_demoman.bat
cd "%batch_folder%"
call apply_for_heavy.bat
cd "%batch_folder%"
call apply_for_engineer.bat
cd "%batch_folder%"
call apply_for_medic.bat
cd "%batch_folder%"
call apply_for_sniper.bat
cd "%batch_folder%"
call apply_for_spy.bat
:compile
echo.
echo Compiling the animations:
::compile and pack
cd "%batch_folder%"
call compile_and_pack.bat
:del_temp
::delete temp
cd %dev_folder%
rd /s /q "decompiled_animations_temp"
:finished
color 20
title Done!
:horse
cls
echo ~~%%%%%%%%_,_,
echo ~~%%%%%%%%%-"/./
echo ~~%%%%%%%-' / `.
echo ~~%%%%%%%%' . ,__;
echo ~~%%%%%%%%' : \O\
echo ~~%%%%%%%%' : `.
echo ~~%%%%%%%%' `. _, '
echo ~~%%%%%%%%' .'`-._ `.
echo ~~%%%%%%%%%' : `-. (,;
echo ~~%%%%%%%%' : `._\_.'
echo ~~%%%%%%' ; Done^^! Your edited viewmodels have been installed.
echo.
echo Press any key to exit.
endlocal
pause >nul