diff options
author | sm0a9f4 <sm0a9f4@1dde52a2-2b62-11df-8484-2f92f965d510> | 2010-04-05 03:08:55 +0000 |
---|---|---|
committer | sm0a9f4 <sm0a9f4@1dde52a2-2b62-11df-8484-2f92f965d510> | 2010-04-05 03:08:55 +0000 |
commit | e1fe50fadc9160b2c4ee09350b781c9b80d54e1f (patch) | |
tree | 74b46dbbccadd5c3bc401b1093eeaa6495b1897a /src/com | |
parent | 3c1e67e433728684b5f228c5d4f3e5b1457bb271 (diff) | |
download | replicaisland-e1fe50fadc9160b2c4ee09350b781c9b80d54e1f.tar.gz |
Fixed tilt sensitivity crash on Moment (app code was suspect), added option to turn on debug logging from preferences.
git-svn-id: http://replicaisland.googlecode.com/svn/trunk@5 1dde52a2-2b62-11df-8484-2f92f965d510
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/replica/replicaisland/AndouKun.java | 25 | ||||
-rw-r--r-- | src/com/replica/replicaisland/SliderPreference.java | 8 |
2 files changed, 21 insertions, 12 deletions
diff --git a/src/com/replica/replicaisland/AndouKun.java b/src/com/replica/replicaisland/AndouKun.java index eb08bd0..dc29132 100644 --- a/src/com/replica/replicaisland/AndouKun.java +++ b/src/com/replica/replicaisland/AndouKun.java @@ -66,6 +66,7 @@ public class AndouKun extends Activity implements SensorEventListener { public static final String PREFERENCE_CLICK_ATTACK = "enableClickAttack"; public static final String PREFERENCE_TILT_CONTROLS = "enableTiltControls"; public static final String PREFERENCE_TILT_SENSITIVITY = "tiltSensitivity"; + public static final String PREFERENCE_ENABLE_DEBUG = "enableDebug"; public static final String PREFERENCE_LEFT_KEY = "keyLeft"; public static final String PREFERENCE_RIGHT_KEY = "keyRight"; @@ -78,7 +79,7 @@ public class AndouKun extends Activity implements SensorEventListener { // If the version is a negative number, debug features (logging and a debug menu) // are enabled. - public static final int VERSION = 10; + public static final int VERSION = 12; private GLSurfaceView mGLSurfaceView; private Game mGame; @@ -102,7 +103,11 @@ public class AndouKun extends Activity implements SensorEventListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (VERSION < 0) { + + SharedPreferences prefs = getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE); + final boolean debugLogs = prefs.getBoolean(PREFERENCE_ENABLE_DEBUG, false); + + if (VERSION < 0 || debugLogs) { DebugLog.setDebugLogging(true); } else { DebugLog.setDebugLogging(false); @@ -137,7 +142,7 @@ public class AndouKun extends Activity implements SensorEventListener { mLevelRow = 0; mLevelIndex = 0; - SharedPreferences prefs = getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE); + mPrefsEditor = prefs.edit(); mLevelRow = prefs.getInt(PREFERENCE_LEVEL_ROW, 0); mLevelIndex = prefs.getInt(PREFERENCE_LEVEL_INDEX, 0); @@ -245,12 +250,22 @@ public class AndouKun extends Activity implements SensorEventListener { @Override protected void onResume() { super.onResume(); + + // Preferences may have changed while we were paused. + SharedPreferences prefs = getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE); + final boolean debugLogs = prefs.getBoolean(PREFERENCE_ENABLE_DEBUG, false); + + if (VERSION < 0 || debugLogs) { + DebugLog.setDebugLogging(true); + } else { + DebugLog.setDebugLogging(false); + } + DebugLog.d("AndouKun", "onResume"); mGLSurfaceView.onResume(); mGame.onResume(this, false); + - // Preferences may have changed while we were paused. - SharedPreferences prefs = getSharedPreferences(PREFERENCE_NAME, MODE_PRIVATE); final boolean soundEnabled = prefs.getBoolean(PREFERENCE_SOUND_ENABLED, true); final boolean clickAttack = prefs.getBoolean(PREFERENCE_CLICK_ATTACK, true); final boolean tiltControls = prefs.getBoolean(PREFERENCE_TILT_CONTROLS, false); diff --git a/src/com/replica/replicaisland/SliderPreference.java b/src/com/replica/replicaisland/SliderPreference.java index 1b02ca5..4e91887 100644 --- a/src/com/replica/replicaisland/SliderPreference.java +++ b/src/com/replica/replicaisland/SliderPreference.java @@ -82,14 +82,8 @@ public class SliderPreference extends Preference implements OnSeekBarChangeListe return shell; } - public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) { - - if(!callChangeListener(progress)){ - seekBar.setProgress(mValue); - return; - } + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - seekBar.setProgress(progress); mValue = progress; persistInt(mValue); |