- if (needsReset && (view != null)) {
- view.reset();
- }
-
- }
-
- private int tilesetStringToRes(String s)
- {
- if (s.equals("classic")) {
- return R.drawable.classic;
- } else if (s.equals("jade")) {
- return R.drawable.jade;
- } else if (s.equals("traditional")) {
- return R.drawable.traditional;
- } else if (s.equals("pixel")) {
- return R.drawable.pixel;
+ if (needsReset && (view != null) && (activity != null)) {
+ new AlertDialog.Builder(this)
+ .setTitle("Preferences changed!") // FIXME: hardcoded string
+ .setCancelable(true)
+ .setIcon(R.drawable.icon)
+ .setPositiveButton(android.R.string.yes,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ // User clicked OK button - reset game
+ ((ShisenSho) ((AlertDialog) dialog).getContext()).view.reset();
+ }
+ })
+ .setNegativeButton(android.R.string.no, null)
+ .setMessage("Changes in Preferences will only have an effect if" +
+ " a new game is started. Abort current game and start" +
+ " a new one?").create() // FIXME: hardcoded string
+ .show();