From: gumartinm Date: Wed, 5 Sep 2012 00:21:39 +0000 (+0200) Subject: No time for comments :( X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=eb37feedc78ea2e06eed5dbd0f224f959f631689;p=AndroidReversiForFun%2F.git No time for comments :( --- 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"); } }