[gcompris] explore actvitiy, added missing bonus
- From: Bruno Coudoin <bcoudoin src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gcompris] explore actvitiy, added missing bonus
 
- Date: Thu, 13 Sep 2012 23:15:37 +0000 (UTC)
 
commit 8c90cc1fb6890ae1e6b4ab7f2c7ef175836084be
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Fri Sep 14 01:14:06 2012 +0200
    explore actvitiy, added missing bonus
    
    When moving from level 2 to 3 the bonus was missing.
    Implemented it in a way to have the level change after
    the bonus is displayed (in the pause).
 src/explore-activity/explore.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/explore-activity/explore.py b/src/explore-activity/explore.py
index 35f9adc..b025a29 100644
--- a/src/explore-activity/explore.py
+++ b/src/explore-activity/explore.py
@@ -65,6 +65,7 @@ class Gcompris_explore:
 
         self.locationSeen = 0
         self.progressBar = None
+        self.next_action = None
 
     def start(self):
         '''
@@ -327,10 +328,10 @@ class Gcompris_explore:
             self.remainingItems.remove(self.currentSelection)
             self.progressBar.success()
             if len(self.remainingItems):
-                gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.SMILEY)
-                self.playRandom()
+                self.next_action = self.playRandom
             else:
-                self.next_level()
+                self.next_action = self.next_level
+            gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.SMILEY)
         else:
             gcompris.bonus.display(gcompris.bonus.LOOSE, gcompris.bonus.SMILEY)
 
@@ -546,7 +547,9 @@ class Gcompris_explore:
         strn = u'%c' % utf8char
 
     def pause(self, pause):
-        pass
+        if self.next_action:
+            self.next_action()
+            self.next_action = None
 
 class ProgressBar:
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]