2021-07-08 09:38:55 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# there's run & wait-before-run, we only care about the latter.
|
|
|
|
COMMANDTYPE=$1
|
|
|
|
|
|
|
|
# this is how Steam tries to run the game
|
|
|
|
if [ "$COMMANDTYPE" == "wait-before-run" ]; then
|
|
|
|
# used to decipher which game we'll play
|
|
|
|
GAMEBINARY=$(basename "$2")
|
|
|
|
# steam game dir
|
|
|
|
GAMEDIR=$(dirname "$2")
|
|
|
|
|
|
|
|
# we have an unknown amount of parameters, let's make sure we get them
|
|
|
|
# make sure this is quotes, because HeXen II has a space in its path
|
|
|
|
PARMARR=( "$@" )
|
|
|
|
ARGLEN=${#PARMARR[@]}
|
|
|
|
|
|
|
|
# get every parameter after the second (game location) and put it into
|
|
|
|
# its own variable to pass over later
|
|
|
|
GAMEARGS=${PARMARR[@]:2:$ARGLEN-1}
|
|
|
|
|
|
|
|
if [ "$GAMEBINARY" == "Winquake.exe" ]; then
|
2021-07-29 06:20:57 +00:00
|
|
|
fteqw -basedir "$GAMEDIR" -quake $GAMEARGS
|
2021-07-08 09:38:55 +00:00
|
|
|
elif [ "$GAMEBINARY" == "qwcl.exe" ]; then
|
2021-07-29 06:20:57 +00:00
|
|
|
fteqw -basedir "$GAMEDIR" -quake -game qw $GAMEARGS
|
2021-07-08 09:38:55 +00:00
|
|
|
elif [ "$GAMEBINARY" == "Glquake.exe" ]; then
|
2021-07-29 06:20:57 +00:00
|
|
|
fteqw -basedir "$GAMEDIR" -quake $GAMEARGS
|
2021-07-08 09:38:55 +00:00
|
|
|
elif [ "$GAMEBINARY" == "glqwcl.exe" ]; then
|
2021-07-29 06:20:57 +00:00
|
|
|
fteqw -basedir "$GAMEDIR" -quake -game qw $GAMEARGS
|
2021-07-08 09:38:55 +00:00
|
|
|
elif [ "$GAMEBINARY" == "quake3.exe" ]; then
|
|
|
|
fteqw -basedir "$GAMEDIR" -quake3 $GAMEARGS
|
|
|
|
elif [ "$GAMEBINARY" == "quake2.exe" ]; then
|
|
|
|
fteqw -basedir "$GAMEDIR" -quake2 $GAMEARGS
|
|
|
|
elif [ "$GAMEBINARY" == "glh2.exe" ]; then
|
|
|
|
fteqw -basedir "$GAMEDIR" -hexen2 $GAMEARGS
|
|
|
|
else
|
|
|
|
fteqw -basedir "$GAMEDIR" $GAMEARGS
|
|
|
|
fi
|
|
|
|
fi
|