Sunday, October 18, 2009

Scrolling leaderboard fixed

Jean Philippe wanted to include the scrolling leaderboard in the first release of Speed Dreams, so I've revisited the (obviously buggy) code.
I've simplified it quite a bit, every time the string is scrolled out of the screen it is regenerated on the basis of the last lap's results. It has no obscure logic anymore (for me at least).
I also made it generate 3-letter abbreviatons of the driver names, so the string to scroll would not be too long. This generation works on the idea of finding the first non-matching character in the driver names, so if there are 2 totally identically named drivers it cannot do any magic at all. I plan to introduce a new attribute to drivers (in the XML file) where we can clearly tell SD what abbrev to use, so one driver will be shown by that name each and every time, like RAI is always Raikonnen in F1. But I think that would come only after the release.
You can see the changes in SVN rev 1511, 1512, 1526, 1597, 1602 and 1603 (with some clean-up work included, too).

No comments:

Post a Comment