From 366fcfd894a7992e4ea980113e6cd855ed19dbb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr> Date: Mon, 29 Jan 2024 00:14:35 +0100 Subject: [PATCH] Disable tap on cell when animation runs --- android/gradle.properties | 4 +-- .../metadata/android/en-US/changelogs/13.txt | 1 + .../metadata/android/fr-FR/changelogs/13.txt | 1 + lib/ui/widgets/game_board.dart | 25 +++++++++++++------ pubspec.yaml | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/13.txt create mode 100644 fastlane/metadata/android/fr-FR/changelogs/13.txt diff --git a/android/gradle.properties b/android/gradle.properties index d9abd55..6638812 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.12 -app.versionCode=12 +app.versionName=0.0.13 +app.versionCode=13 diff --git a/fastlane/metadata/android/en-US/changelogs/13.txt b/fastlane/metadata/android/en-US/changelogs/13.txt new file mode 100644 index 0000000..b52679f --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/13.txt @@ -0,0 +1 @@ +Disable delete bloc if animation is running. diff --git a/fastlane/metadata/android/fr-FR/changelogs/13.txt b/fastlane/metadata/android/fr-FR/changelogs/13.txt new file mode 100644 index 0000000..9bfd903 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/13.txt @@ -0,0 +1 @@ +Désactive la suppression de bloc si une animation est en cours. diff --git a/lib/ui/widgets/game_board.dart b/lib/ui/widgets/game_board.dart index 746ebbc..c2ca025 100644 --- a/lib/ui/widgets/game_board.dart +++ b/lib/ui/widgets/game_board.dart @@ -104,13 +104,24 @@ class _GameBoard extends State<GameBoard> with TickerProviderStateMixin { return GestureDetector( onTapUp: (details) { - final double xTap = details.localPosition.dx; - final double yTap = details.localPosition.dy; - final int col = xTap ~/ (displayWidth / currentGame.settings.boardSize); - final int row = yTap ~/ (displayWidth / currentGame.settings.boardSize); - - final GameCubit gameCubit = BlocProvider.of<GameCubit>(context); - animateCells(gameCubit.tapOnCell(CellLocation.go(row, col))); + bool canRemoveCell = true; + animations.forEach((row) { + row.forEach((cell) { + if (cell != null) { + canRemoveCell = false; + } + }); + }); + + if (canRemoveCell) { + final double xTap = details.localPosition.dx; + final double yTap = details.localPosition.dy; + final int col = xTap ~/ (displayWidth / currentGame.settings.boardSize); + final int row = yTap ~/ (displayWidth / currentGame.settings.boardSize); + + final GameCubit gameCubit = BlocProvider.of<GameCubit>(context); + animateCells(gameCubit.tapOnCell(CellLocation.go(row, col))); + } }, child: CustomPaint( size: Size(displayWidth, displayWidth), diff --git a/pubspec.yaml b/pubspec.yaml index 8fd9227..614c574 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Jeweled Game publish_to: 'none' -version: 0.0.12+12 +version: 0.0.13+13 environment: sdk: '^3.0.0' -- GitLab