From 815b962fe8ac1f3b2e8bb85f958c3b068e89acb0 Mon Sep 17 00:00:00 2001 From: Christopher Beckmann Date: Fri, 19 Feb 2016 19:09:29 +0100 Subject: [PATCH] Added an option, that will reset the timer when resetting the game board. --- .../controller/GameController.java | 10 ++++++++-- app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/pref_settings_general.xml | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java index ef1d1b1..024ae02 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/controller/GameController.java @@ -317,8 +317,14 @@ public class GameController implements IModelChangedListener, Parcelable { public void resetLevel() { gameBoard.reset(); - undoRedoManager.addState(gameBoard); - //notifyListeners(); + + if(settings.getBoolean("pref_timer_reset", true)) { + time = 0; + undoRedoManager = new UndoRedoManager(gameBoard); + } else { + undoRedoManager.addState(gameBoard); + } + notifyHighlightChangedListeners(); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d6eeace..d54a269 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -52,6 +52,8 @@ Note deletion Automatically remove notes when setting values on connected cells + Timer Reset + Also reset the timer, when resetting the game board. Privacy friendly Sudoku diff --git a/app/src/main/res/xml/pref_settings_general.xml b/app/src/main/res/xml/pref_settings_general.xml index 250edf4..173e752 100644 --- a/app/src/main/res/xml/pref_settings_general.xml +++ b/app/src/main/res/xml/pref_settings_general.xml @@ -7,6 +7,12 @@ android:summary="@string/pref_automatic_note_deletion_summary" android:defaultValue="true"/> + +