Added an option, that will reset the timer when resetting the game board.

This commit is contained in:
Christopher Beckmann 2016-02-19 19:09:29 +01:00
parent 72786d070e
commit 815b962fe8
3 changed files with 16 additions and 2 deletions

View file

@ -317,8 +317,14 @@ public class GameController implements IModelChangedListener, Parcelable {
public void resetLevel() {
gameBoard.reset();
if(settings.getBoolean("pref_timer_reset", true)) {
time = 0;
undoRedoManager = new UndoRedoManager(gameBoard);
} else {
undoRedoManager.addState(gameBoard);
//notifyListeners();
}
notifyHighlightChangedListeners();
}

View file

@ -52,6 +52,8 @@
</array>
<string name="pref_automatic_note_deletion">Note deletion</string>
<string name="pref_automatic_note_deletion_summary">Automatically remove notes when setting values on connected cells</string>
<string name="pref_timer_reset">Timer Reset</string>
<string name="pref_timer_reset_summary">Also reset the timer, when resetting the game board.</string>
<!-- ###ABOUT### -->
<string name="app_name_long" translatable="false">Privacy friendly Sudoku</string>

View file

@ -7,6 +7,12 @@
android:summary="@string/pref_automatic_note_deletion_summary"
android:defaultValue="true"/>
<SwitchPreference android:id="@+id/pref_timer_reset"
android:key="pref_timer_reset"
android:title="@string/pref_timer_reset"
android:summary="@string/pref_timer_reset_summary"
android:defaultValue="true" />
<ListPreference
android:key="pref_symbols"
android:title="@string/pref_symbols"