[gbrainy] Do not show the time bar during game preview



commit be918d081188aa7500b096ba5debbe5b599a6461
Author: Jordi Mas <jmas softcatala org>
Date:   Sat Feb 6 17:43:56 2010 +0100

    Do not show the time bar during game preview

 src/Clients/Classical/Dialogs/CustomGameDialog.cs |    1 +
 src/Core/Main/Game.cs                             |    6 ++++++
 src/Core/Main/Memory.cs                           |    2 +-
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/Clients/Classical/Dialogs/CustomGameDialog.cs b/src/Clients/Classical/Dialogs/CustomGameDialog.cs
index 7a931c4..a9491f5 100644
--- a/src/Clients/Classical/Dialogs/CustomGameDialog.cs
+++ b/src/Clients/Classical/Dialogs/CustomGameDialog.cs
@@ -112,6 +112,7 @@ namespace gbrainy.Clients.Classical
 		    	}
 
 			Game game = games_store.GetValue (iter, COL_OBJECT) as Game;
+			game.IsPreviewMode = true;
 			game.Initialize ();
 			preview_question.Markup = game.Question;
 			drawing_area.puzzle = game;
diff --git a/src/Core/Main/Game.cs b/src/Core/Main/Game.cs
index 0c13bd1..6e96933 100644
--- a/src/Core/Main/Game.cs
+++ b/src/Core/Main/Game.cs
@@ -64,6 +64,7 @@ namespace gbrainy.Core.Main
 		protected Random random;
 		private TimeSpan game_time;
 		private bool tip_used;
+		private bool preview;
 		private Difficulty difficulty;
 		private ISynchronizeInvoke synchronize;
 		private List <Toolkit.Container> containers;
@@ -118,6 +119,11 @@ namespace gbrainy.Core.Main
 			get { return synchronize; }
 		}
 
+		public bool IsPreviewMode {
+			get {return preview; }
+			set {preview = value; }
+		}
+
 		// Stores how difficult the game is
 		public virtual Difficulty GameDifficulty {
 			get {
diff --git a/src/Core/Main/Memory.cs b/src/Core/Main/Memory.cs
index 4b1f650..b800cef 100644
--- a/src/Core/Main/Memory.cs
+++ b/src/Core/Main/Memory.cs
@@ -202,7 +202,7 @@ namespace gbrainy.Core.Main
 		{
 			double percentage;
 
-			if (draw_timer == false)
+			if (draw_timer == false || IsPreviewMode == true)
 				return;
 
 			percentage = 100 - ((time_left * 100) / total_time);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]