Hedgeroid: Don't change the template when clicking the map.
--- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MapFragment.java Sat Aug 18 18:11:47 2012 +0200
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MapFragment.java Sat Aug 18 21:04:37 2012 +0200
@@ -81,6 +81,7 @@
} catch (IOException e) {
Toast.makeText(getActivity().getApplicationContext(), R.string.error_missing_sdcard_or_files, Toast.LENGTH_LONG).show();
getActivity().finish();
+ return null;
}
Collections.sort(mapFiles, MapFile.MISSIONS_FIRST_NAME_ORDER);
@@ -200,16 +201,8 @@
private final OnClickListener mapClickListener = new OnClickListener() {
public void onClick(View v) {
stateManager.changeMapSeed(MapRecipe.makeRandomSeed());
- switch(mapTypeSpinner.getSelectedItemPosition()) {
- case Frontlib.MAPGEN_NAMED:
+ if(mapTypeSpinner.getSelectedItemPosition() == Frontlib.MAPGEN_NAMED) {
mapNameSpinner.setSelection(random.nextInt(mapNameSpinner.getCount()));
- break;
- case Frontlib.MAPGEN_REGULAR:
- templateSpinner.setSelection(Frontlib.TEMPLATEFILTER_ALL);
- break;
- case Frontlib.MAPGEN_MAZE:
- mazeSizeSpinner.setSelection(random.nextInt(mazeSizeSpinner.getCount()));
- break;
}
}
};