From eb37feedc78ea2e06eed5dbd0f224f959f631689 Mon Sep 17 00:00:00 2001 From: gumartinm Date: Wed, 5 Sep 2012 02:21:39 +0200 Subject: [PATCH] No time for comments :( --- res/values/strings.xml | 4 ++-- src/de/android/reversi/ReversiView.java | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index fa5b469..07047e2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -2,8 +2,8 @@ Reversi Hello world! - YOU LOST! - I WIN! + YOU LOST! + I WIN! Settings ReversiActivity Black: diff --git a/src/de/android/reversi/ReversiView.java b/src/de/android/reversi/ReversiView.java index d8cff67..c36f04c 100644 --- a/src/de/android/reversi/ReversiView.java +++ b/src/de/android/reversi/ReversiView.java @@ -276,7 +276,13 @@ public class ReversiView extends SurfaceView { listAllowedPositions = board.allowedPositions(currentPlayer); if (listAllowedPositions.isEmpty()) { - final DialogFragment newFragment = ErrorDialogFragment.newInstance(R.string.Iwin); + int idString; + if (player1Score > player2Score) { + idString = R.string.player1WON; + } else { + idString = R.string.player2WON; + } + final DialogFragment newFragment = ErrorDialogFragment.newInstance(idString); newFragment.show(((Activity)context).getFragmentManager(), "errorDialog"); } @@ -310,7 +316,13 @@ public class ReversiView extends SurfaceView { mainLoop(ai.getBestMove(board)); } else { - final DialogFragment newFragment = ErrorDialogFragment.newInstance(R.string.AIwon); + int idString; + if (player1Score > player2Score) { + idString = R.string.player1WON; + } else { + idString = R.string.player2WON; + } + final DialogFragment newFragment = ErrorDialogFragment.newInstance(idString); newFragment.show(((Activity)context).getFragmentManager(), "errorDialog"); } } -- 2.1.4