build_game.sh: When RADIANT_PATH is set, copy entities.def, radiant.game and radiant.xml (build parms) into the users Radiant gamepack directory.

This commit is contained in:
Marco Cawthorne 2023-05-27 12:00:50 -07:00
parent 12bb472abc
commit bd8351db58
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 28 additions and 5 deletions

View File

@ -1,6 +1,31 @@
#!/bin/sh #!/bin/sh
. ./build.cfg . ./build.cfg
safe_copy()
{
if [ -f "$1" ]
then
cp -v "$1" "$2"
fi
}
radiant_build()
{
# copy files over to RADIANT
if [ ! -z "$RADIANT_PATH" ]
then
if [ -d "$RADIANT_PATH/gamepacks/games" ];
then
./make_mapdef.sh "$1"
mkdir -p "$RADIANT_PATH/gamepacks/$1.game/$1/"
safe_copy "./$1/radiant.game" "$RADIANT_PATH/gamepacks/games/$1.game"
safe_copy "./$1/entities.def" "$RADIANT_PATH/gamepacks/$1.game/$1/entities.def"
safe_copy "./$1/radiant.xml" "$RADIANT_PATH/gamepacks/$1.game/default_build_menu.xml"
exit
fi
fi
}
if [ "$SKIP_UPDATE" = "1" ]; then if [ "$SKIP_UPDATE" = "1" ]; then
BUILD_UPDATE=0 BUILD_UPDATE=0
fi fi
@ -34,7 +59,7 @@ if [ -x "$(command -v fteqcc)" ]; then
make make
cd "$SCRPATH" cd "$SCRPATH"
./make_mapdef.sh "$1" radiant_build "$1"
exit 0 exit 0
fi fi
@ -70,10 +95,8 @@ if [ -x "$(command -v fteqcc)" ]; then
cd .. cd ..
export GAMEDIR=$(basename $PWD) export GAMEDIR=$(basename $PWD)
cd $OLDDIR cd $OLDDIR
if [ -f "$SCRPATH"/bin/worldspawn ]; then radiant_build "$GAMEDIR"
./make_mapdef.sh $GAMEDIR
fi
done; done;
else else
printf "FTEQCC compiler is not present, please run build_engine.sh\n" printf "FTEQCC compiler is not present, please run build_engine.sh\n"
fi fi