.. changes

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7440 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
RandumKiwi
2013-03-30 08:19:44 +00:00
parent 0cd7a422c2
commit 091f3a9091
+19 -12
View File
@@ -4,12 +4,15 @@
# Run "sh configfolder_script.sh --all" to auto-accept "yes" as the answer to
# all questions in this script.
# This is the main AssaultCube folder.
# This is the main AssaultCube folder:
PATHTOACDIR=~/AssaultCube/SVN_Trunk
# This is the docs folder (which holds reference.xml)
# This is the docs folder (which holds reference.xml):
ABSOLUTEPATHTODOCS=~/AssaultCube/SVN_Website/htdocs/docs
# Path to "official" folder:
MAPSPATH="$PATHTOACDIR/packages/maps/official"
echo "Generate an updated ./config/securemaps.cfg (Y/N)?"
if [ "$1" != "--all" ]; then
@@ -64,6 +67,18 @@ else
echo -e "\a\E[1mNOTE:\E[0m Config files haven't had leading whitespace stripped.\n"
fi
# Auto-generates a list of maps:
MAPSLIST=`cd "$MAPSPATH" && find ./*.cgz | xargs -i basename {} .cgz | sort -u | sed 's/\n/ /g'`
# Currently listed CTF maps:
CURCTFMAPS="$(cd $PATHTOACDIR/config && sed -n 's/const ctfmaps \[//p' menus.cfg | sed 's/\]//g')"
# List of non-CTF maps:
NONCTFLIST=`echo " " "$CURCTFMAPS" " " "$MAPSLIST" " " | sed "s/ /\n/g" | sed '/^$/d' | sort | uniq -u`
read
echo "Update all menus with current \"official\" maps (Y/N)?"
if [ "$1" != "--all" ]; then
read ANSR
@@ -71,20 +86,11 @@ fi
if [ "$ANSR" = "y" ] || [ "$ANSR" = "Y" ] || [ "$ANSR" = "yes" ] || [ "$ANSR" = "YES" ] || [ "$1" = "--all" ]; then
cd $PATHTOACDIR/config
# Auto-generates a list of maps:
MAPSLIST=`cd "$PATHTOACDIR" && find ./packages/maps/official/*.cgz | xargs -i basename {} .cgz | sort -u | sed 's/\n/ /g'`
# Currently listed CTF maps:
CURCTFMAPS="$(sed -n 's/const ctfmaps \[//p' menus.cfg | sed 's/\]//g')"
# Replacement text for "const defaultmaps":
DEFLTMAPS=`echo "const defaultmaps [" $MAPSLIST "]"`
# Replacement text for the bot silders:
BOTSLIDER=`echo 'menuitemslider [Map: ] 0 (- (listlen $defaultmaps) 1) "$survMap" 1 [' $MAPSLIST '] [ survMap = $arg1 ]'`
# List of non-CTF maps:
NONCTFLIST=`echo " " "$CURCTFMAPS" " " "$MAPSLIST" " " | sed "s/ /\n/g" | sed '/^$/d' | sort | uniq -u`
BOTSLIDER=`echo 'menuitemslider (_ [Map: ]) 0 (- (listlen $defaultmaps) 1) "$survMap" 1 [' $MAPSLIST '] [ survMap = $arg1 ]'`
sed -i 's/const defaultmaps..*/'"$DEFLTMAPS"'/g' menus.cfg
sed -i 's/menuitemslider \[Map: \] 0..*/'"$BOTSLIDER"'/g' menus_bot.cfg
@@ -110,3 +116,4 @@ else
echo -e "\a\E[1mNOTE:\E[0m No map menus have been updated."
fi