flutter: audio: Remove onBoardTap()'s duplicate play audio

putPiece() and removePiece() has played.
This commit is contained in:
Calcitem 2021-02-27 10:47:02 +08:00
parent 6f1e7f7d74
commit e6634c24ca
1 changed files with 3 additions and 3 deletions

View File

@ -127,10 +127,10 @@ class _GamePageState extends State<GamePage> with RouteAware {
case Act.place: case Act.place:
if (position.putPiece(sq)) { if (position.putPiece(sq)) {
if (position.action == Act.remove) { if (position.action == Act.remove) {
Audios.playTone('mill.mp3'); //Audios.playTone('mill.mp3');
changeStatus(S.of(context).tipRemove); changeStatus(S.of(context).tipRemove);
} else { } else {
Audios.playTone('place.mp3'); //Audios.playTone('place.mp3');
changeStatus(S.of(context).tipPlaced); changeStatus(S.of(context).tipPlaced);
} }
ret = true; ret = true;
@ -161,7 +161,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
case Act.remove: case Act.remove:
if (position.removePiece(sq)) { if (position.removePiece(sq)) {
Audios.playTone('remove.mp3'); //Audios.playTone('remove.mp3');
ret = true; ret = true;
print("removePiece: [$sq]"); print("removePiece: [$sq]");
changeStatus(S.of(context).tipRemoved); changeStatus(S.of(context).tipRemoved);