Properly align menu items when there are more than 9.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2414 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2006-08-18 21:11:41 +00:00
parent d55137e472
commit 53866cf077
+9 -2
View File
@@ -268,16 +268,22 @@ EOF
$TEMP_TEXT
EOF
fi
# Count the number of options
I=0
for ITEM in $TEMP_ITEMS; do
I=$(($I + 1))
done
NUM_ITEMS="$I"
I=0
for ITEM in $TEMP_ITEMS; do
I=$(($I + 1))
eval TEMP_TYPE="\$MENU_${MENU}_ITEM_${ITEM}_TYPE"
eval TEMP_TITLE="\$${TEMP_TYPE}_${ITEM}_TITLE"
printf " %i. %-36s %s\n" $I "$TEMP_TITLE" \
printf " %${#NUM_ITEMS}i. %-36s %s\n" $I "$TEMP_TITLE" \
"$(menu_print_value $TEMP_TYPE $ITEM)"
done
NUM_ITEMS="$I"
echo
echo "Press a number plus <ENTER> if you want to change something, "
@@ -347,6 +353,7 @@ EOF
# Also, count the number of options
I=0
for OPTION in $TEMP_OPTIONS; do
I=$(($I + 1))
menu_have_choice "$MENU" "$OPTION"
done
NUM_OPTIONS="$I"