# HG changeset patch # User Simon Cross # Date 1259433759 0 # Node ID 80725d6475691462e021786bdfb671f60db21ecc # Parent 7f037ee2a6c82ef89c1a0bd439886a023493a2f5 Neaten up gameover screen. diff -r 7f037ee2a6c8 -r 80725d647569 gamelib/gameover.py --- a/gamelib/gameover.py Sat Nov 28 18:40:04 2009 +0000 +++ b/gamelib/gameover.py Sat Nov 28 18:42:39 2009 +0000 @@ -96,7 +96,6 @@ level.sell_price_chicken * len(gameboard.chickens) + \ level.sell_price_egg * gameboard.eggs - self.tr() made_list = scoreboard.check(score) is not None if level.is_game_over(gameboard): if len(gameboard.chickens) > 0: @@ -109,20 +108,38 @@ else: self.survived = LEFT message = random.choice(LEFT_MESSAGES) + + self.tr() self.td(gui.Label(message, color=constants.FG_COLOR), colspan=3) self.add_spacer() + + # heading options + head_kwargs = { + 'color': constants.FG_COLOR, + 'style': { + 'padding_top': 10, + 'padding_bottom': 5, + }, + } + # show the scoreboard self.tr() - self.td(gui.Label('Level: %s' % level.level_name, color=constants.FG_COLOR), - colspan=3) + self.td(html.HTML('High Scores for Level%s:' + % level.level_name, **head_kwargs), + colspan=3) for highscore in scoreboard: self.tr() self.td(gui.Label(highscore.name, color=constants.FG_COLOR), colspan=2) self.td(gui.Label('%d' % highscore.score, color=constants.FG_COLOR)) + # show player score + + self.tr() + self.td(html.HTML('Your Score:', **head_kwargs), colspan=3) + self.tr() self.td(gui.Label("Groats : %d" % gameboard.cash, color=constants.FG_COLOR)) @@ -138,15 +155,16 @@ self.tr() self.td(gui.Label("Final score : %d" % score, color=constants.FG_COLOR), colspan=3) + if made_list: - scoreboard.save() self.tr() if self.survived == WON: - self.td(gui.Label("You made the high scores", - color=constants.FG_COLOR), colspan=3) + msg = "You made the high scores!" + scoreboard.save() else: - self.td(gui.Label("Pity, you could have made the high scores", - color=constants.FG_COLOR), colspan=3) + msg = "Pity, you could have made the high scores." + self.td(html.HTML("%s" % msg, **head_kwargs) + , colspan=3) self.add_spacer(50)