comparison pytouhou/games/eosd.py @ 351:a628b48a745f

Fix timeout display issue (> 99 should be displayed as 99)
author Thibaut Girka <thib@sitedethib.com>
date Sat, 07 Jul 2012 21:33:17 +0200
parents b3049fb5c448
children a5595de3fe7e
comparison
equal deleted inserted replaced
350:b3049fb5c448 351:a628b48a745f
184 item.update() 184 item.update()
185 185
186 self.labels['boss_lives'].set_text('%d' % boss.remaining_lives) 186 self.labels['boss_lives'].set_text('%d' % boss.remaining_lives)
187 self.labels['boss_lives'].changed = True 187 self.labels['boss_lives'].changed = True
188 188
189 timeout = (boss.timeout - boss.frame) // 60 189 timeout = min((boss.timeout - boss.frame) // 60, 99)
190 timeout_label = self.labels['timeout'] 190 timeout_label = self.labels['timeout']
191 if timeout >= 20: 191 if timeout >= 20:
192 timeout_label.set_color('blue') 192 timeout_label.set_color('blue')
193 elif timeout >= 10: 193 elif timeout >= 10:
194 timeout_label.set_color('darkblue') 194 timeout_label.set_color('darkblue')