diff --git a/.gitignore b/.gitignore index 85cd828..0d2e346 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,6 @@ vpk_list.txt ## vpk packing cleantf2/ dev/current_options.txt -*.vpk \ No newline at end of file +*.vpk +## linux +venv/ \ No newline at end of file diff --git a/dev/generators/models_null.sh b/dev/generators/models_null.sh index a594f53..1fa2f5b 100755 --- a/dev/generators/models_null.sh +++ b/dev/generators/models_null.sh @@ -10,7 +10,7 @@ for line in $(cat $1); do ;; *) mkdir -p $line > /dev/null 2>&1 - $2 l $3 | grep "$line" | grep ".vtx" | grep -v ".sw.vtx" > vpk_list.txt + $2 -l $3 | grep "$line" | grep ".vtx" | grep -v ".sw.vtx" > vpk_list.txt echo removing models in $line for file in $(cat vpk_list.txt); do diff --git a/dev/linux/vpk.sh b/dev/linux/vpk.sh deleted file mode 100755 index ebf1ede..0000000 --- a/dev/linux/vpk.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -BINPATH=$(dirname $0)/../../../../../bin -LD_LIBRARY_PATH=$BINPATH $BINPATH/vpk_linux32 $* diff --git a/generate.sh b/generate.sh index 4d36244..03a72b5 100755 --- a/generate.sh +++ b/generate.sh @@ -16,11 +16,34 @@ if ! test -f "../../../hl2/hl2_textures_dir.vpk"; then echo Error: unable to find hl2 vpk\'s. Make sure you\'re not using symbolic links that prevent access to the hl2 folder, and that CleanTF2plus is inside the custom folder. exit 1 fi -if ! test -f "../../../bin/vpk_linux32"; then - echo Error: unable to find bin/vpk_linux32. Make sure you\'re not using symbolic links that prevent access to the bin folder, and that CleanTF2plus is inside the custom folder. - exit 1 + +# system dependencies + +if ! wine --version > /dev/null; then + echo Error: unable to find wine. Make sure you installed it with your system\'s package manager. + exit 1 +fi +if ! convert --version > /dev/null; then + echo Error: unable to find imagemagick. Make sure you installed it with your system\'s package manager. + exit 1 fi +if ! python3 --version > /dev/null; then + echo Error: unable to find python3. Make sure you installed it with your system\'s package manager. + exit 1 +fi + +# SETUP +# create python venv and install vpk +echo Setting up python dependencies +python3 -m venv ./venv +source ./venv/bin/activate +pip install vpk + +if ! vpk --version > /dev/null; then + echo Error: unable to install vpk. Correct any python errors or submit an issue. + exit 1 +fi # DATA @@ -249,13 +272,13 @@ elif [ $flat == 2 ]; then fi if [ $nohats == 1 ]; then echo removing hats - dev/generators/models_null.sh dev/lists/linux/nohats.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk" + dev/generators/models_null.sh dev/lists/linux/nohats.txt "vpk" "../../tf2_misc_dir.vpk" dev/generators/remove.sh dev/lists/linux/nohats_weapons.txt echo nohats >> dev/current_options.txt echo done elif [ $nohats == 2 ]; then echo removing hats headsfeet - dev/generators/models_null.sh dev/lists/linux/nohats.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk" + dev/generators/models_null.sh dev/lists/linux/nohats.txt "vpk" "../../tf2_misc_dir.vpk" dev/generators/remove.sh dev/lists/linux/nohats_headsfeet.txt dev/generators/remove.sh dev/lists/linux/nohats_weapons.txt echo nohats headsfeet >> dev/current_options.txt @@ -263,19 +286,19 @@ elif [ $nohats == 2 ]; then fi if [ $playergibs == 1 ]; then echo removing player gibs - dev/generators/models_null.sh dev/lists/linux/model_removal_gibs_player.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk" + dev/generators/models_null.sh dev/lists/linux/model_removal_gibs_player.txt "vpk" "../../tf2_misc_dir.vpk" echo no player gibs >> dev/current_options.txt echo done fi if [ $shells == 1 ]; then echo removing shell models - dev/generators/models_null.sh dev/lists/linux/model_removal_shells.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk" + dev/generators/models_null.sh dev/lists/linux/model_removal_shells.txt "vpk" "../../tf2_misc_dir.vpk" echo no shells >> dev/current_options.txt echo done fi if [ $weapongibs == 1 ]; then echo removing weapon gibs - dev/generators/models_null.sh dev/lists/linux/model_removal_gibs_weapons.txt "dev/linux/vpk.sh" "../../tf2_misc_dir.vpk" + dev/generators/models_null.sh dev/lists/linux/model_removal_gibs_weapons.txt "vpk" "../../tf2_misc_dir.vpk" echo no weapon gibs >> dev/current_options.txt echo done fi diff --git a/pack_vpk.sh b/pack_vpk.sh index 94354aa..eece424 100755 --- a/pack_vpk.sh +++ b/pack_vpk.sh @@ -1,5 +1,7 @@ #!/bin/bash +source venv/bin/activate + # starting echo preparing folder structure mkdir cleantf2 > /dev/null 2>&1 @@ -13,7 +15,7 @@ cat dev/current_options.txt >> cleantf2/readme.txt # creating vpk echo creating vpk -dev/linux/vpk.sh -M cleantf2 > /dev/null 2>&1 +vpk -c cleantf2 cleantf2_dir.vpk > /dev/null 2>&1 # moving vpk files echo moving vpk files