[gcompris] mining: add fast-forward option for tutorial
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris] mining: add fast-forward option for tutorial
- Date: Tue, 25 Sep 2012 22:13:20 +0000 (UTC)
commit 35507350046262ad39863d761354b099eb9be5b9
Author: Peter Albrecht <pa-dev gmx de>
Date: Mon Sep 24 22:33:59 2012 +0200
mining: add fast-forward option for tutorial
If the user does not follow the tutorial exactly, and has already zoomed
in at max, when entering the "nugget approach area", we don't have to
show him, how to zoom in any more.
src/mining-activity/mining.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/mining-activity/mining.py b/src/mining-activity/mining.py
index c5a9cf9..f868a35 100644
--- a/src/mining-activity/mining.py
+++ b/src/mining-activity/mining.py
@@ -313,7 +313,14 @@ class Gcompris_mining:
# a^2 + b^2 <= c^2
if (x - nx) * (x - nx) + (y - ny) * (y - ny) <= self.min_nugget_approach * self.min_nugget_approach:
# the mouse cursor is close enough, go to next tutorial step
- self.tutorial.set_tutorial_state('zoom in', False)
+
+ if self.nugget.is_visible():
+ # the nugget is already visible, so we can fast-forward to the "zoom in" tutorial
+ self.tutorial.set_tutorial_state('zoom in', False)
+ self.tutorial.set_tutorial_state('click', False)
+ else:
+ # go the default way: "move to", "zoom in", "click", ...
+ self.tutorial.set_tutorial_state('zoom in', False)
else:
# if we still want to show the user, where to move the mouse pointer to, we need to
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]