comparison gamelib/gamegui.py @ 224:e4f9513c9dd0

Include mission name in the results
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 22:33:05 +0200
parents 19aae2b701d1
children f8c05e6dc0e2
comparison
equal deleted inserted replaced
223:19aae2b701d1 224:e4f9513c9dd0
401 "Nothing of interest happened", font_medium, 401 "Nothing of interest happened", font_medium,
402 (255, 255, 255)) 402 (255, 255, 255))
403 self.add_child(results) 403 self.add_child(results)
404 else: 404 else:
405 y = 200 405 y = 200
406 for msg_type, msg, loot in messages: 406 for mission, msg_type, msg, loot in messages:
407 # FIXME: Better widgets 407 # FIXME: Better widgets
408 if msg_type == GAME_WIN: 408 if msg_type == GAME_WIN:
409 self._make_win_screen(turn, msg) 409 self._make_win_screen(turn, msg)
410 self.is_game_over = True 410 self.is_game_over = True
411 break 411 break
412 colour = self.message_colours.get(msg_type, (255, 255, 255)) 412 colour = self.message_colours.get(msg_type, (255, 255, 255))
413 if mission:
414 msg = '%s: %s' % (mission, msg)
413 y = self.display_message(y, msg, loot, colour) 415 y = self.display_message(y, msg, loot, colour)
414 416
415 def display_message(self, y, msg, loot, colour, font=font_medium): 417 def display_message(self, y, msg, loot, colour, font=font_medium):
416 text = TextBox((50, y, 700, 25), msg, font, colour) 418 text = TextBox((50, y, 700, 25), msg, font, colour)
417 y += text.rect.height + 5 419 y += text.rect.height + 5