public void onPrepareDialog(int dialogId, Dialog dialog) {
   switch (dialogId) {
     case DIALOG_CHANGE_GAME_MODE:
       int levelType = EditorActivity.level.getGameType() == 1 ? 1 : 0;
       ((AlertDialog) dialog).getListView().setSelection(levelType);
       break;
     case DIALOG_MOVE_PLAYER:
       Player player = EditorActivity.level.getPlayer();
       Vector3f playerLoc = player.getLocation();
       ((EditText) dialog.findViewById(R.id.entities_spawn_x))
           .setText(Float.toString(playerLoc.getX()));
       ((EditText) dialog.findViewById(R.id.entities_spawn_y))
           .setText(Float.toString(playerLoc.getY()));
       ((EditText) dialog.findViewById(R.id.entities_spawn_z))
           .setText(Float.toString(playerLoc.getZ()));
       break;
     default:
       super.onPrepareDialog(dialogId, dialog);
   }
 }