#684215 gnotravex: says score is in the top ten when it's not

#684215#5
Date:
2012-08-07 21:21:05 UTC
From:
To:
at the end of the game gnotravex either says your score is the best, or
you made the top ten.  Untested patch follows.
--- gnotravex/src/gnotravex.vala.orig	2012-08-07 23:15:40.000000000 +0200
+++ gnotravex/src/gnotravex.vala	2012-08-07 23:14:27.000000000 +0200
@@ -196,9 +196,15 @@
         var pos = highscores.add_time_score ((seconds / 60) * 1.0 + (seconds % 60) / 100.0);

         var scores_dialog = new GnomeGamesSupport.ScoresDialog (window, highscores, _("Tetravex Scores"));
+        var message = _("You didn't make the top ten, better luck next time.");
         scores_dialog.set_category_description (_("Size:"));
-        scores_dialog.set_hilight (pos);
-        scores_dialog.set_message ("<b>%s</b>\n\n%s".printf (_("Congratulations!"), pos == 1 ? _("Your score is the best!") : _("Your score has made the top ten.")));
+        if (pos > 0)
+            scores_dialog.set_hilight (pos);
+            if (pos == 1)
+                message = _("Your score is the best!");
+            else
+                message = _("Your score has made the top ten.");
+        scores_dialog.set_message ("<b>%s</b>\n\n%s".printf (_("Congratulations!"), message));
         scores_dialog.set_buttons (GnomeGamesSupport.ScoresButtons.QUIT_BUTTON | GnomeGamesSupport.ScoresButtons.NEW_GAME_BUTTON);
         if (scores_dialog.run () == Gtk.ResponseType.REJECT)
             window.destroy ();

Cheers,
Julien