Support odd/even theming for top5/top10.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 Feb 2012 20:17:27 +0000 (21:17 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 Feb 2012 20:17:27 +0000 (21:17 +0100)
bigscreen/top10scorescreen.cpp
bigscreen/top5chosenscreen.cpp

index a9a52bf..2ac1cb0 100644 (file)
@@ -66,18 +66,25 @@ void Top10ScoreScreen::draw(unsigned char *buf, unsigned width, unsigned height)
        
        unsigned row = 1, y = 140;
        for (std::vector<TopScore>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
+               std::string suffix;
+               if (row % 2 == 1) {
+                       suffix = ".odd";
+               } else {
+                       suffix = ".even";
+               }
+
                char str[16];
-               std::string heading_theme_element = "top10scores.rowheading";
-               std::string nick_theme_element = "top10scores.nick";
-               std::string songname_theme_element = "top10scores.songname";
-               std::string frequency_theme_element = "top10scores.frequency";
+               std::string heading_theme_element = "top10scores.rowheading" + suffix;
+               std::string nick_theme_element = "top10scores.nick" + suffix;
+               std::string songname_theme_element = "top10scores.songname" + suffix;
+               std::string frequency_theme_element = "top10scores.frequency" + suffix;
 
                // print new entries in red
                if (seen_topscore.count(*i) == 0 && seen_topscore.size() > 0) {
-                       heading_theme_element = "top10scores.freshrowheading";
-                       nick_theme_element = "top10scores.freshnick";
-                       songname_theme_element = "top10scores.freshsongname";
-                       frequency_theme_element = "top10scores.freshfrequency";
+                       heading_theme_element = "top10scores.freshrowheading" + suffix;
+                       nick_theme_element = "top10scores.freshnick" + suffix;
+                       songname_theme_element = "top10scores.freshsongname" + suffix;
+                       frequency_theme_element = "top10scores.freshfrequency" + suffix;
                }
 
                std::sprintf(str, "%u", row++);
index 32ca278..ccfbea9 100644 (file)
@@ -64,16 +64,23 @@ void Top5ChosenScreen::draw(unsigned char *buf, unsigned width, unsigned height)
        
        unsigned row = 1, y = 140;
        for (std::vector<TopChosen>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
+               std::string suffix;
+               if (row % 2 == 1) {
+                       suffix = ".odd";
+               } else {
+                       suffix = ".even";
+               }
+
                char str[16];
-               std::string heading_theme_element = "top5chosensongs.rowheading";
-               std::string songname_theme_element = "top5chosensongs.songname";
-               std::string frequency_theme_element = "top5chosensongs.frequency";
+               std::string heading_theme_element = "top5chosensongs.rowheading" + suffix;
+               std::string songname_theme_element = "top5chosensongs.songname" + suffix;
+               std::string frequency_theme_element = "top5chosensongs.frequency" + suffix;
 
                // print new entries in red
                if (seen_topchosen.count(*i) == 0 && seen_topchosen.size() > 0) {
-                       heading_theme_element = "top5chosensongs.freshrowheading";
-                       songname_theme_element = "top5chosensongs.freshsongname";
-                       frequency_theme_element = "top5chosensongs.freshfrequency";
+                       heading_theme_element = "top5chosensongs.freshrowheading" + suffix;
+                       songname_theme_element = "top5chosensongs.freshsongname" + suffix;
+                       frequency_theme_element = "top5chosensongs.freshfrequency" + suffix;
                }
 
                std::sprintf(str, "%u", row++);