Only show new medal requirements

This commit is contained in:
Vincent Riquer 2015-02-10 14:47:05 +01:00
parent c2a57943f2
commit 3c6796cff1
2 changed files with 49 additions and 16 deletions

64
index
View File

@ -174,8 +174,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextsilver[timestamp]} for stat in ${nextsilver[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} silver)" ) if ! (( shown["$stat silver"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat silver"]=1
fi
(( ++count == lvlsilver[level] - silvercount )) && break 2 (( ++count == lvlsilver[level] - silvercount )) && break 2
done done
fi fi
@ -184,8 +188,12 @@ then
do do
(( count >= lvlsilver[level] - silvercount )) && break 1 (( count >= lvlsilver[level] - silvercount )) && break 1
(( count < lvlsilver[level] - silvercount )) && never=1 (( count < lvlsilver[level] - silvercount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} silver)" ) if ! (( shown["$stat silver"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upsilver[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat silver"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )
@ -205,8 +213,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextgold[timestamp]} for stat in ${nextgold[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" ) if ! (( shown["$stat gold"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat gold"]=1
fi
(( ++count == lvlgold[level] - goldcount )) && break 2 (( ++count == lvlgold[level] - goldcount )) && break 2
done done
fi fi
@ -215,8 +227,12 @@ then
do do
(( count >= lvlgold[level] - goldcount )) && break 1 (( count >= lvlgold[level] - goldcount )) && break 1
(( count < lvlgold[level] - goldcount )) && never=1 (( count < lvlgold[level] - goldcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" ) if ! (( shown["$stat gold"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upgold[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat gold"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )
@ -236,8 +252,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextplatinum[timestamp]} for stat in ${nextplatinum[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} platinum)" ) if ! (( shown["$stat platinum"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat platinum"]=1
fi
(( ++count == lvlplatinum[level] - platinumcount )) && break 2 (( ++count == lvlplatinum[level] - platinumcount )) && break 2
done done
fi fi
@ -246,8 +266,12 @@ then
do do
(( count >= lvlplatinum[level] - platinumcount )) && break 1 (( count >= lvlplatinum[level] - platinumcount )) && break 1
(( count < lvlplatinum[level] - platinumcount )) && never=1 (( count < lvlplatinum[level] - platinumcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} platinum)" ) if ! (( shown["$stat platinum"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upplatinum[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat platinum"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )
@ -267,8 +291,12 @@ then
&& maxtimestamp=$timestamp && maxtimestamp=$timestamp
for stat in ${nextblack[timestamp]} for stat in ${nextblack[timestamp]}
do do
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} black)" ) if ! (( shown["$stat black"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat black"]=1
fi
(( ++count == lvlblack[level] - blackcount )) && break 2 (( ++count == lvlblack[level] - blackcount )) && break 2
done done
fi fi
@ -277,8 +305,12 @@ then
do do
(( count >= lvlblack[level] - blackcount )) && break 1 (( count >= lvlblack[level] - blackcount )) && break 1
(( count < lvlblack[level] - blackcount )) && never=1 (( count < lvlblack[level] - blackcount )) && never=1
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} black)" ) if ! (( shown["$stat black"] ))
tableline+=( '<br />' ) then
tableline+=( "$(print_medal $timestamp $stat ${upblack[$stat]:-0} gold)" )
tableline+=( '<br />' )
shown["$stat black"]=1
fi
(( count++ )) (( count++ ))
done done
tableline+=( '</td>' ) tableline+=( '</td>' )

View File

@ -33,6 +33,7 @@ declare -A \
hasplatinum \ hasplatinum \
hasblack \ hasblack \
first \ first \
shown \
declare -a \ declare -a \
bronzes \ bronzes \