show hints for medal targets

This commit is contained in:
Vincent Riquer 2014-06-19 16:09:07 +02:00
parent 6d8fef49e6
commit 680878e18a

90
graph
View File

@ -180,22 +180,34 @@ then
if (( last["$stat"] >= bronze["$stat"] ))
then
(( bronzecount++ ))
if (( last["$stat"] >= silver["$stat"] ))
then
(( silvercount++ ))
if (( last["$stat"] >= gold["$stat"] ))
then
(( goldcount++ ))
if (( last["$stat"] >= platinum["$stat"] ))
then
(( platinumcount++ ))
if (( last["$stat"] >= black["$stat"] ))
then
(( blackcount++ ))
fi
fi
fi
fi
else
(( pct = last["$stat"] * 100 / bronze["$stat"] ))
upbronze[pct]+="$stat "
fi
if (( last["$stat"] >= silver["$stat"] ))
then
(( silvercount++ ))
else
(( pct = last["$stat"] * 100 / silver["$stat"] ))
upsilver[pct]+="$stat "
fi
if (( last["$stat"] >= gold["$stat"] ))
then
(( goldcount++ ))
else
upgold+=( "$stat" )
fi
if (( last["$stat"] >= platinum["$stat"] ))
then
(( platinumcount++ ))
else
upplatinum+=( "$stat" )
fi
if (( last["$stat"] >= black["$stat"] ))
then
(( blackcount++ ))
else
upblack+=( "$stat" )
fi
done
cat <<-EOHTML
@ -227,36 +239,65 @@ then
printf "%'li" ${lvl[level]}
echo '</td>'
else
echo '<td style="background:grey">'
echo '<td style="background:lightgrey">'
printf "%'li" ${lvl[level]}
echo " (<span style=\"color:#FF2020;font-weight:bold\">"
printf "%'li" $(( last["AP"] - lvl[level] ))
echo '</td>'
echo '</span>)</td>'
fi
if (( silvercount >= lvlsilver[level] ))
then
echo '<td style="background:lightgreen">'${lvlsilver[level]}'</td>'
else
echo '<td style="background:grey">'$(( silvercount - lvlsilver[level] ))'</td>'
echo "<td style=\"background:lightgrey\">${lvlsilver[level]} (<span style=\"color:#FF2020;font-weight:bold\">$(( silvercount - lvlsilver[level] ))</span>)<br />"
for id in {100..0}
do
[ -z "${upsilver[id]}" ] && continue
(( colforce = id * 255 / 100 ))
echo "<div style=\"background:#FF$(printf %02x $colforce )00\"><a href=\"#${upsilver[id]}\">${upsilver[id]} ($id%)</a></div>"
done
echo '</td>'
fi
if (( goldcount >= lvlgold[level] ))
then
echo '<td style="background:lightgreen">'${lvlgold[level]}'</td>'
else
echo '<td style="background:grey">'$(( goldcount - lvlgold[level] ))'</td>'
echo "<td style=\"background:lightgrey\">${lvlgold[level]} (<span style=\"color:#FF2020;font-weight:bold\">$(( goldcount - lvlgold[level] ))</span>)<br />"
for id in {100..0}
do
[ -z "${upgold[id]}" ] && continue
(( colforce = id * 255 / 100 ))
echo "<div style=\"background:#FF$(printf %02x $colforce )00\"><a href=\"#${upgold[id]}\">${upgold[id]} ($id%)</a></div>"
done
echo '</td>'
fi
if (( platinumcount >= lvlplatinum[level] ))
then
echo '<td style="background:lightgreen">'${lvlplatinum[level]}'</td>'
else
echo '<td style="background:grey">'$(( platinumcount - lvlplatinum[level] ))'</td>'
echo "<td style=\"background:lightgrey\">${lvlplatinum[level]} (<span style=\"color:#FF2020;font-weight:bold\">$(( platinumcount - lvlplatinum[level] ))</span>)<br />"
for id in {100..0}
do
[ -z "${upplatinum[id]}" ] && continue
(( colforce = id * 255 / 100 ))
echo "<div style=\"background:#FF$(printf %02x $colforce )00\"><a href=\"#${upplatinum[id]}\">${upplatinum[id]} ($id%)</a></div>"
done
echo '</td>'
fi
if (( blackcount >= lvlblack[level] ))
then
echo '<td style="background:lightgreen">'${lvlblack[level]}'</td>'
else
echo '<td style="background:grey">'$(( blackcount - lvlblack[level] ))'</td>'
echo "<td style=\"background:lightgrey\">${lvlblack[level]} (<span style=\"color:#FF2020;font-weight:bold\">$(( blackcount - lvlblack[level] ))</span>)<br />"
for id in {100..0}
do
[ -z "${upblack[id]}" ] && continue
(( colforce = id * 255 / 100 ))
echo "<div style=\"background:#FF$(printf %02x $colforce )00\"><a href=\"#${upblack[id]}\">${upblack[id]} ($id%)</a></div>"
done
echo '</td>'
fi
echo "</tr>"
echo '</tr>'
done
cat <<-EOHTML
</table>
@ -325,6 +366,7 @@ then
<div>
<img
src="graph?graph=$stat&amp;start=$start&amp;end=$end"
id="$stat"
alt="Ingress $stat evolution" />
</div>
EOHTML