Added an option, that will reset the timer when resetting the game board.
This commit is contained in:
parent
72786d070e
commit
815b962fe8
3 changed files with 16 additions and 2 deletions
|
@ -317,8 +317,14 @@ public class GameController implements IModelChangedListener, Parcelable {
|
||||||
|
|
||||||
public void resetLevel() {
|
public void resetLevel() {
|
||||||
gameBoard.reset();
|
gameBoard.reset();
|
||||||
undoRedoManager.addState(gameBoard);
|
|
||||||
//notifyListeners();
|
if(settings.getBoolean("pref_timer_reset", true)) {
|
||||||
|
time = 0;
|
||||||
|
undoRedoManager = new UndoRedoManager(gameBoard);
|
||||||
|
} else {
|
||||||
|
undoRedoManager.addState(gameBoard);
|
||||||
|
}
|
||||||
|
|
||||||
notifyHighlightChangedListeners();
|
notifyHighlightChangedListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,8 @@
|
||||||
</array>
|
</array>
|
||||||
<string name="pref_automatic_note_deletion">Note deletion</string>
|
<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_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### -->
|
<!-- ###ABOUT### -->
|
||||||
<string name="app_name_long" translatable="false">Privacy friendly Sudoku</string>
|
<string name="app_name_long" translatable="false">Privacy friendly Sudoku</string>
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
android:summary="@string/pref_automatic_note_deletion_summary"
|
android:summary="@string/pref_automatic_note_deletion_summary"
|
||||||
android:defaultValue="true"/>
|
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
|
<ListPreference
|
||||||
android:key="pref_symbols"
|
android:key="pref_symbols"
|
||||||
android:title="@string/pref_symbols"
|
android:title="@string/pref_symbols"
|
||||||
|
|
Loading…
Reference in a new issue