diff --git a/src/ui/flutter_app/lib/l10n/intl_en.arb b/src/ui/flutter_app/lib/l10n/intl_en.arb index d932fdb3..c2bf4314 100644 --- a/src/ui/flutter_app/lib/l10n/intl_en.arb +++ b/src/ui/flutter_app/lib/l10n/intl_en.arb @@ -564,13 +564,13 @@ "@player": { "description": "player" }, - "player1": "Player 1", + "player1": "Player1", "@player1": { - "description": "Player 1" + "description": "Player1" }, - "player2": "Player 2", + "player2": "Player2", "@player2": { - "description": "Player 2" + "description": "Player2" }, "howToPlay": "How to play", "@howToPlay": { @@ -771,5 +771,17 @@ "developerMode": "Developer mode", "@developerMode": { "description": "Developer mode" + }, + "pieceCount": "Piece count", + "@pieceCount": { + "description": "Piece count" + }, + "inHand": "in hand", + "@inHand": { + "description": "in hand" + }, + "onBoard": "on board", + "@onBoard": { + "description": "on board" } } diff --git a/src/ui/flutter_app/lib/l10n/intl_zh.arb b/src/ui/flutter_app/lib/l10n/intl_zh.arb index c46f1ccc..2c2e1261 100644 --- a/src/ui/flutter_app/lib/l10n/intl_zh.arb +++ b/src/ui/flutter_app/lib/l10n/intl_zh.arb @@ -192,5 +192,8 @@ "timeout": "超时", "personalization": "外观设置", "forDevelopers": "开发者选项", - "developerMode": "开发者模式" + "developerMode": "开发者模式", + "pieceCount": "棋子数", + "inHand": "手上", + "onBoard": "棋盘上" } \ No newline at end of file diff --git a/src/ui/flutter_app/lib/widgets/game_page.dart b/src/ui/flutter_app/lib/widgets/game_page.dart index 5423c630..97fc77ab 100644 --- a/src/ui/flutter_app/lib/widgets/game_page.dart +++ b/src/ui/flutter_app/lib/widgets/game_page.dart @@ -612,29 +612,54 @@ class _GamePageState extends State with RouteAware { .showSnackBar(SnackBar(content: Text(message))); } + String getHintText() { + String ret = S.of(context).score + + "\n" + + S.of(context).player1 + + ": " + + Game.instance.position.score[PieceColor.black].toString() + + "\n" + + S.of(context).player2 + + ": " + + Game.instance.position.score[PieceColor.white].toString() + + "\n" + + S.of(context).draw + + ": " + + Game.instance.position.score[PieceColor.draw].toString() + + "\n\n" + + S.of(context).pieceCount + + "\n" + + S.of(context).player1 + + " " + + S.of(context).inHand + + ": " + + Game.instance.position.pieceInHandCount[PieceColor.black].toString() + + "\n" + + S.of(context).player2 + + " " + + S.of(context).inHand + + ": " + + Game.instance.position.pieceInHandCount[PieceColor.white].toString() + + "\n" + + S.of(context).player1 + + " " + + S.of(context).onBoard + + ": " + + Game.instance.position.pieceOnBoardCount[PieceColor.black].toString() + + "\n" + + S.of(context).player2 + + " " + + S.of(context).onBoard + + ": " + + Game.instance.position.pieceOnBoardCount[PieceColor.white].toString() + + "\n"; + return ret; + } + Widget createToolbar() { final manualText = Game.instance.position.manualText; - // TODO: - final analyzeText = "Score: " + - Game.instance.position.score[PieceColor.black].toString() + - " : " + - Game.instance.position.score[PieceColor.white].toString() + - " : " + - Game.instance.position.score[PieceColor.draw].toString() + - "\n" + - "Black has: " + - Game.instance.position.pieceInHandCount[PieceColor.black].toString() + - " pieces in hand\n" + - "White has: " + - Game.instance.position.pieceInHandCount[PieceColor.white].toString() + - " pieces in hand\n" + - "Black has: " + - Game.instance.position.pieceOnBoardCount[PieceColor.black].toString() + - " pieces on board\n" + - "White has: " + - Game.instance.position.pieceOnBoardCount[PieceColor.white].toString() + - " pieces on board\n"; + final analyzeText = getHintText(); var newGameButton = TextButton( child: Column( @@ -732,8 +757,6 @@ class _GamePageState extends State with RouteAware { builder: (BuildContext context) { return AlertDialog( backgroundColor: AppTheme.hintDialogackgroundColor, - title: Text(S.of(context).analyze, - style: TextStyle(color: AppTheme.hintTextColor)), content: SingleChildScrollView( child: Text(analyzeText, style: AppTheme.moveHistoryTextStyle)), actions: [