For the top5/top10 screens, split the “data” class.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 Feb 2012 20:15:32 +0000 (21:15 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 Feb 2012 20:15:32 +0000 (21:15 +0100)
bigscreen/theme.config
bigscreen/top10scorescreen.cpp
bigscreen/top5chosenscreen.cpp

index ab01ebb..69ed4f1 100644 (file)
@@ -36,18 +36,12 @@ freshcolumnheading.blue=0
 rowheading.red=255
 rowheading.green=255
 rowheading.blue=255
-data.red=255
-data.green=255
-data.blue=255
-freshdata.red=255
-freshdata.green=0
-freshdata.blue=0
 divider.red=127
 divider.green=127
 divider.blue=127
 
 # available elements: background.groupscreen, background.top5chosenscreen, background.top10scorescreen, mainheading, (fresh)columnheading, randomsongname, nextsonginfo.player, nextsonginfo.title, nextsonginfo.highscore, need, divider
-# available elements that also have .odd and .even: rowheading, (fresh)score, (fresh)chosensongname, (fresh)totalscore, (fresh)rank
+# available elements that also have .odd and .even: rowheading, (fresh)score, (fresh)chosensongname, (fresh)totalscore, (fresh)rank, top10scores.(fresh)rowheading, top10scores.(fresh)nick, top10scores.(fresh)songname, top10scores.(fresh)frequency, top5chosensongs.(fresh)rowheading, top5chosensongs.(fresh)songname, top5chosensongs.(fresh)frequency
 
 ## How to draw rectangles in the background (up to ten, numbered 0-9):
 # background.groupscreen.rect1.x0=0
index a024e98..a9a52bf 100644 (file)
@@ -67,31 +67,35 @@ 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) {
                char str[16];
-               std::string theme_element = "data";
-               std::string heading_theme_element = "rowheading";
+               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";
 
                // print new entries in red
                if (seen_topscore.count(*i) == 0 && seen_topscore.size() > 0) {
-                       theme_element = "freshdata";
-                       heading_theme_element = "freshrowheading";
+                       heading_theme_element = "top10scores.freshrowheading";
+                       nick_theme_element = "top10scores.freshnick";
+                       songname_theme_element = "top10scores.freshsongname";
+                       frequency_theme_element = "top10scores.freshfrequency";
                }
 
                std::sprintf(str, "%u", row++);
                unsigned width = my_draw_text(str, NULL, 24.0, heading_theme_element);
                my_draw_text(str, buf, 24.0, heading_theme_element, RANK_X - width/2, y);
 
-               my_draw_text(i->nick, buf, 24.0, theme_element, PLAYER_X, y);
+               my_draw_text(i->nick, buf, 24.0, nick_theme_element, PLAYER_X, y);
 
-               if (my_draw_text(i->title, NULL, 24.0, theme_element) > SONG_MAX_WIDTH &&
+               if (my_draw_text(i->title, NULL, 24.0, songname_theme_element) > SONG_MAX_WIDTH &&
                    !i->shorttitle.empty()) {
-                       my_draw_text(i->shorttitle, buf, 24.0, theme_element, SONG_X, y);
+                       my_draw_text(i->shorttitle, buf, 24.0, songname_theme_element, SONG_X, y);
                } else {
-                       my_draw_text(i->title, buf, 24.0, theme_element, SONG_X, y);
+                       my_draw_text(i->title, buf, 24.0, songname_theme_element, SONG_X, y);
                }
                
                std::sprintf(str, "%u", i->score);
-               width = my_draw_text(str, NULL, 24.0, theme_element);
-               my_draw_text(str, buf, 24.0, theme_element, SCORE_X - width/2, y);
+               width = my_draw_text(str, NULL, 24.0, frequency_theme_element);
+               my_draw_text(str, buf, 24.0, frequency_theme_element, SCORE_X - width/2, y);
 
                y += 40;
        }
index d63b724..32ca278 100644 (file)
@@ -65,28 +65,30 @@ 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) {
                char str[16];
-               std::string theme_element = "data";
-               std::string heading_theme_element = "rowheading";
+               std::string heading_theme_element = "top5chosensongs.rowheading";
+               std::string songname_theme_element = "top5chosensongs.songname";
+               std::string frequency_theme_element = "top5chosensongs.frequency";
 
                // print new entries in red
                if (seen_topchosen.count(*i) == 0 && seen_topchosen.size() > 0) {
-                       theme_element = "freshdata";
-                       heading_theme_element = "freshrowheading";
+                       heading_theme_element = "top5chosensongs.freshrowheading";
+                       songname_theme_element = "top5chosensongs.freshsongname";
+                       frequency_theme_element = "top5chosensongs.freshfrequency";
                }
 
                std::sprintf(str, "%u", row++);
                unsigned width = my_draw_text(str, NULL, 24.0, heading_theme_element);
                my_draw_text(str, buf, 24.0, heading_theme_element, RANK_X - width/2, y);
 
-               if (my_draw_text(i->title, NULL, 24.0, theme_element) > SONG_MAX_WIDTH) {
-                       my_draw_text(i->shorttitle, buf, 24.0, theme_element, SONG_X, y);
+               if (my_draw_text(i->title, NULL, 24.0, songname_theme_element) > SONG_MAX_WIDTH) {
+                       my_draw_text(i->shorttitle, buf, 24.0, songname_theme_element, SONG_X, y);
                } else {
-                       my_draw_text(i->title, buf, 24.0, theme_element, SONG_X, y);
+                       my_draw_text(i->title, buf, 24.0, songname_theme_element, SONG_X, y);
                }
                
                std::sprintf(str, "%u", i->frequency);
-               width = my_draw_text(str, NULL, 24.0, theme_element);
-               my_draw_text(str, buf, 24.0, theme_element, FREQUENCY_X - width/2, y);
+               width = my_draw_text(str, NULL, 24.0, frequency_theme_element);
+               my_draw_text(str, buf, 24.0, frequency_theme_element, FREQUENCY_X - width/2, y);
 
                y += 40;
        }