If the GameActivity receives an Intent carrying an imported sudoku containing the key 'isCustom', set 'isCustom' attribute of the created GameInfoContainer to 'true'
This commit is contained in:
parent
54a4024dac
commit
f9d053a069
1 changed files with 12 additions and 4 deletions
|
@ -140,6 +140,7 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig
|
|||
QQWing difficultyCheck;
|
||||
GameInfoContainer container = new GameInfoContainer(0, GameDifficulty.Unspecified,
|
||||
GameType.Unspecified, new int [boardSize], new int [boardSize], new boolean [boardSize][sectionSize]);
|
||||
container.setCustom(extras.getBoolean("isCustom", false));
|
||||
|
||||
try {
|
||||
container.parseGameType("Default_" + sectionSize + "x" + sectionSize);
|
||||
|
@ -488,12 +489,19 @@ public class GameActivity extends BaseActivity implements NavigationView.OnNavig
|
|||
editor.apply();
|
||||
}
|
||||
|
||||
//Show time hints new plus old best time
|
||||
//Don't save statistics if game is custom
|
||||
boolean isNewBestTime;
|
||||
|
||||
statistics.saveGameStats();
|
||||
if (!gameController.gameIsCustom()) {
|
||||
//Show time hints new plus old best time
|
||||
statistics.saveGameStats();
|
||||
isNewBestTime = gameController.getUsedHints() == 0
|
||||
&& statistics.loadStats(gameController.getGameType(),gameController.getDifficulty()).getMinTime() >= gameController.getTime();
|
||||
|
||||
} else {
|
||||
isNewBestTime = false;
|
||||
}
|
||||
|
||||
boolean isNewBestTime = gameController.getUsedHints() == 0
|
||||
&& statistics.loadStats(gameController.getGameType(),gameController.getDifficulty()).getMinTime() >= gameController.getTime();
|
||||
|
||||
dialog = new WinDialog(this, R.style.WinDialog , timeToString(gameController.getTime()), String.valueOf(gameController.getUsedHints()), isNewBestTime);
|
||||
|
||||
|
|
Loading…
Reference in a new issue