Hedgeroid: Don't change the template when clicking the map.
authorMedo <smaxein@googlemail.com>
Sat, 18 Aug 2012 21:04:37 +0200
changeset 7572 4e223b05be7c
parent 7570 54c400a5c209
child 7574 b9ec869e624a
Hedgeroid: Don't change the template when clicking the map.
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/MapFragment.java
--- 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;
 			}
 		}
 	};