info: Show period and comma only when screenReaderSupport is enabled
This commit is contained in:
parent
af25423d4e
commit
ccee0de09f
|
@ -1534,6 +1534,8 @@ class _GamePageState extends State<GamePage>
|
||||||
|
|
||||||
String getInfoText() {
|
String getInfoText() {
|
||||||
String phase = "";
|
String phase = "";
|
||||||
|
String period = Config.screenReaderSupport ? "." : "";
|
||||||
|
String comma = Config.screenReaderSupport ? "," : "";
|
||||||
|
|
||||||
var pos = Game.instance.position;
|
var pos = Game.instance.position;
|
||||||
|
|
||||||
|
@ -1554,13 +1556,15 @@ class _GamePageState extends State<GamePage>
|
||||||
S.of(context).inHand +
|
S.of(context).inHand +
|
||||||
": " +
|
": " +
|
||||||
pos.pieceInHandCount[PieceColor.white].toString() +
|
pos.pieceInHandCount[PieceColor.white].toString() +
|
||||||
",\n" +
|
comma +
|
||||||
|
"\n" +
|
||||||
S.of(context).player2 +
|
S.of(context).player2 +
|
||||||
" " +
|
" " +
|
||||||
S.of(context).inHand +
|
S.of(context).inHand +
|
||||||
": " +
|
": " +
|
||||||
pos.pieceInHandCount[PieceColor.black].toString() +
|
pos.pieceInHandCount[PieceColor.black].toString() +
|
||||||
",\n"
|
comma +
|
||||||
|
"\n"
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
String us = "";
|
String us = "";
|
||||||
|
@ -1588,22 +1592,30 @@ class _GamePageState extends State<GamePage>
|
||||||
lastMove = n1;
|
lastMove = n1;
|
||||||
}
|
}
|
||||||
if (Config.screenReaderSupport) {
|
if (Config.screenReaderSupport) {
|
||||||
lastMove =
|
lastMove = S.of(context).lastMove +
|
||||||
S.of(context).lastMove + ": " + them + ", " + lastMove + ".\n";
|
": " +
|
||||||
|
them +
|
||||||
|
", " +
|
||||||
|
lastMove +
|
||||||
|
period +
|
||||||
|
"\n";
|
||||||
} else {
|
} else {
|
||||||
lastMove = S.of(context).lastMove + ": " + lastMove + ".\n";
|
lastMove = S.of(context).lastMove + ": " + lastMove + period + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String ret = phase +
|
String ret = phase +
|
||||||
".\n" +
|
period +
|
||||||
|
"\n" +
|
||||||
lastMove +
|
lastMove +
|
||||||
S.of(context).sideToMove +
|
S.of(context).sideToMove +
|
||||||
": " +
|
": " +
|
||||||
us +
|
us +
|
||||||
". " +
|
period +
|
||||||
tip +
|
tip +
|
||||||
"\n\n" +
|
"\n" +
|
||||||
|
period +
|
||||||
|
"\n" +
|
||||||
S.of(context).pieceCount +
|
S.of(context).pieceCount +
|
||||||
":\n" +
|
":\n" +
|
||||||
pieceCountInHand +
|
pieceCountInHand +
|
||||||
|
@ -1612,27 +1624,31 @@ class _GamePageState extends State<GamePage>
|
||||||
S.of(context).onBoard +
|
S.of(context).onBoard +
|
||||||
": " +
|
": " +
|
||||||
pos.pieceOnBoardCount[PieceColor.white].toString() +
|
pos.pieceOnBoardCount[PieceColor.white].toString() +
|
||||||
",\n" +
|
comma +
|
||||||
|
"\n" +
|
||||||
S.of(context).player2 +
|
S.of(context).player2 +
|
||||||
" " +
|
" " +
|
||||||
S.of(context).onBoard +
|
S.of(context).onBoard +
|
||||||
": " +
|
": " +
|
||||||
pos.pieceOnBoardCount[PieceColor.black].toString() +
|
pos.pieceOnBoardCount[PieceColor.black].toString() +
|
||||||
".\n\n" +
|
period +
|
||||||
|
"\n\n" +
|
||||||
S.of(context).score +
|
S.of(context).score +
|
||||||
":\n" +
|
":\n" +
|
||||||
S.of(context).player1 +
|
S.of(context).player1 +
|
||||||
": " +
|
": " +
|
||||||
pos.score[PieceColor.white].toString() +
|
pos.score[PieceColor.white].toString() +
|
||||||
",\n" +
|
comma +
|
||||||
|
"\n" +
|
||||||
S.of(context).player2 +
|
S.of(context).player2 +
|
||||||
": " +
|
": " +
|
||||||
pos.score[PieceColor.black].toString() +
|
pos.score[PieceColor.black].toString() +
|
||||||
",\n" +
|
comma +
|
||||||
|
"\n" +
|
||||||
S.of(context).draw +
|
S.of(context).draw +
|
||||||
": " +
|
": " +
|
||||||
pos.score[PieceColor.draw].toString() +
|
pos.score[PieceColor.draw].toString() +
|
||||||
".";
|
period;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue