Skip to content

Commit

Permalink
Allow flags like -definebones
Browse files Browse the repository at this point in the history
now able to use any flag that your StudioMDL have, thx to $@ variable
  Brigadu, de nada
  • Loading branch information
LoveRenamon authored Oct 17, 2021
1 parent b3006ea commit 00fd137
Showing 1 changed file with 22 additions and 34 deletions.
56 changes: 22 additions & 34 deletions StudioMDL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export WINEDEBUG="-all"

export VPROJECT="/mnt/500GB/source1/0xdecompiled"
export SteamLibrary="/mnt/500GB/SteamLibrary/steamapps/common"
export CompileFlags="-verbose -printbones -fastbuild -fullcollide -collapsereport -dumpmaterials -nop4 -nox360 -n -h -parsecompletion"
export CompileFlags="-verbose -printbones -fastbuild -fullcollide -collapsereport -dumpmaterials -nop4 -nox360 -n -h -parsecompletion $@"

export SFM="Z:$SteamLibrary/SourceFilmmaker/game/usermod"
export SFMbin="$SteamLibrary/SourceFilmmaker/game/bin"
Expand All @@ -23,7 +23,7 @@ cd $SFMbin
title="\n\e[0;38;5;220mStudioMDL script para Source Engine. por: Davi (Debiddo) Gooz\e[0m\n"
prompt="Selecione uma opção: jogo ou compilar: "
options=("GMod" "SFM" "L4D2" "Compile")
gamemsg="O jogo selecionado é agora é"
gamemsg="\nO jogo selecionado é agora é"
compilemsg="Compilando para o relativo jogo em:\n\e[1;49;97m\"$GAME/models\"\e[0m\n"

echo -e "\nStudioMDL rodando em \e[1;49;97m\"$WINEARCH\"\e[0m dentro do prefixo \e[1;49;97m\"$WINEPREFIX\"\e[0m\n
Expand All @@ -41,70 +41,58 @@ echo -e "$title"
PS3="$prompt"
select opt in "${options[@]}" "Quit"; do
case "$REPLY" in
1) echo "$gamemsg Garry's Mod"
1) echo -e "$gamemsg \e[1;49;97m\Garry's Mod\e[0m"
export GAME=$GMod
cd $GModbin;echo;;
g) echo "$gamemsg Garry's Mod"
export GAME=$GMod
cd $GModbin;echo;;
gmod) echo "$gamemsg Garry's Mod"
g*) echo -e "$gamemsg \e[1;49;97m\Garry's Mod"
export GAME=$GMod
cd $GModbin;echo;;

2) echo "$gamemsg Source Filmmaker"
2) echo -e "$gamemsg \e[1;49;97m\Source Filmmaker\e[0m"
export GAME=$SFM
cd $SFMbin;echo;;
s) echo "$gamemsg Source Filmmaker"
export GAME=$SFM
cd $SFMbin;echo;;
sfm) echo "$gamemsg Source Filmmaker"
s*) echo -e "$gamemsg \e[1;49;97m\Source Filmmaker\e[0m"
export GAME=$SFM
cd $SFMbin;echo;;

3) echo "$gamemsg Left 4 Dead 2"
3) echo -e "$gamemsg \e[1;49;97m\Left 4 Dead 2\e[0m"
export GAME="$L4D2"
cd "$L4D2bin";echo;;
l) echo "$gamemsg Left 4 Dead 2"
cd "$L4D2bin";
echo -e "\npara compilar, digite \e[1;49;97m\"lc\"\e[0m";;
l) echo -e "$gamemsg \e[1;49;97m\Left 4 Dead 2\e[0m"
export GAME="$L4D2"
cd "$L4D2bin";echo;;
l4d2) echo "$gamemsg Left 4 Dead 2"
cd "$L4D2bin";
echo -e "\npara compilar, digite \e[1;49;97m\"lc\"\e[0m";;
l4d*) echo -e "$gamemsg \e[1;49;97m\Left 4 Dead 2\e[0m"
export GAME="$L4D2"
cd "$L4D2bin";echo;;
cd "$L4D2bin";
echo -e "\npara compilar, digite \e[1;49;97m\"lc\"\e[0m";;

# Compile part:
4) echo -e "$compilemsg"
read -p "QC: " qcfile
env wine studiomdl $CompileFlags -game "$GAME" "V:/0xdecompiled/$qcfile"
echo -e $title;;
c) echo -e "$compilemsg"
read -p "QC: " qcfile
env wine studiomdl $CompileFlags -game "$GAME" "V:/0xdecompiled/$qcfile"
echo -e $title;;
m) echo -e "$compilemsg"
read -p "QC: " qcfile
env wine studiomdl $CompileFlags -game "$GAME" "V:/0xdecompiled/$qcfile"
echo -e $title;;
mdl) echo -e "$compilemsg"
c*) echo -e "$compilemsg"
read -p "QC: " qcfile
env wine studiomdl $CompileFlags -game "$GAME" "V:/0xdecompiled/$qcfile"
echo -e $title;;
compile) echo -e "$compilemsg"
m*) echo -e "$compilemsg"
read -p "QC: " qcfile
env wine studiomdl $CompileFlags -game "$GAME" "V:/0xdecompiled/$qcfile"
echo -e $title;;

# Especial para l4d2
lc) echo -e "\nCompilando especialmente para \e[1;49;97mLeft 4 Dead 2\e[0m em:\n\e[1;49;97m\"$GAME/models\"\e[0m\n"
lc*) echo -e "\nCompilando especialmente para \e[1;49;97mLeft 4 Dead 2\e[0m em:\n\e[1;49;97m\"$GAME/models\"\e[0m\n"
read -e -p "QC: " qcfile
cd "$L4D2bin"
env WINEPREFIX=/mnt/500GB/SteamLibrary/steamapps/compatdata/563/pfx "$proton4" ./studiomdl.exe '-checklenghts -n -h -printbones -printgraph -nox360 -fastbuild -dumpmaterials -nop4 -verbose' -game "$L4D2" "V:/0xdecompiled/$qcfile"
env WINEPREFIX=/mnt/500GB/SteamLibrary/steamapps/compatdata/563/pfx "$proton4" ./studiomdl.exe '-checklenghts -n -h -printbones -printgraph -nox360 -fastbuild -dumpmaterials -nop4 -verbose' "$@" -game "$L4D2" "V:/0xdecompiled/$qcfile"
echo -e "\n$title\n";;

$((${#options[@]}+1))) break;;
quit) break;;
sair) break;;
q) break;;
*) echo -e "\e[0;38;5;160mOpção inválida. Tente outra.\e[0m\n"
e*) break;;
q*) break;;
*) echo -e "\e[0;38;5;160mOpção inválida. Tente outra.\e[0m\n";
continue;;
esac
done

0 comments on commit 00fd137

Please sign in to comment.