Permalink
Browse files

front: Fix preferences not being hidden in GamePrefsActivity.

  • Loading branch information...
littleguy77 committed Apr 30, 2015
1 parent f810c36 commit 44e3da6f7b97bc79231f4f74621da3219054226f
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:mupen64="http://schemas.android.com/apk/res/org.mupen64plusae.v3.alpha"
android:key="screenPlayMenuActivity" >
android:key="screenRoot" >
<paulscode.android.mupen64plusae.preference.ProfilePreference
android:icon="@drawable/ic_circuit"
@@ -60,9 +60,8 @@
OnSharedPreferenceChangeListener
{
// These constants must match the keys used in res/xml/preferences_play.xml
private static final String SCREEN_ROOT = "screenRoot";
private static final String SCREEN_CHEATS = "screenCheats";
private static final String CATEGORY_GAME_SETTINGS = "categoryGameSettings";
private static final String CATEGORY_CHEATS = "categoryCheats";
private static final String ACTION_CHEAT_EDITOR = "actionCheatEditor";
@@ -159,7 +158,7 @@ protected void onCreate( Bundle savedInstanceState )
// Remove wiki menu item if not applicable
if( TextUtils.isEmpty( mRomDetail.wikiUrl ) )
{
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, ACTION_WIKI );
PrefUtil.removePreference( this, SCREEN_ROOT, ACTION_WIKI );
}
// Setup controller profiles settings based on ROM's number of players
@@ -169,18 +168,18 @@ protected void onCreate( Bundle savedInstanceState )
findPreference( CONTROLLER_PROFILE1 ).setTitle( R.string.controllerProfile_title );
// Remove unneeded preference items
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, CONTROLLER_PROFILE2 );
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, CONTROLLER_PROFILE3 );
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, CONTROLLER_PROFILE4 );
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, PLAYER_MAP );
PrefUtil.removePreference( this, SCREEN_ROOT, CONTROLLER_PROFILE2 );
PrefUtil.removePreference( this, SCREEN_ROOT, CONTROLLER_PROFILE3 );
PrefUtil.removePreference( this, SCREEN_ROOT, CONTROLLER_PROFILE4 );
PrefUtil.removePreference( this, SCREEN_ROOT, PLAYER_MAP );
}
else
{
// Remove unneeded preference items
if( mRomDetail.players < 4 )
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, CONTROLLER_PROFILE4 );
PrefUtil.removePreference( this, SCREEN_ROOT, CONTROLLER_PROFILE4 );
if( mRomDetail.players < 3 )
PrefUtil.removePreference( this, CATEGORY_GAME_SETTINGS, CONTROLLER_PROFILE3 );
PrefUtil.removePreference( this, SCREEN_ROOT, CONTROLLER_PROFILE3 );
// Configure the player map preference
PlayerMapPreference playerPref = (PlayerMapPreference) findPreference( PLAYER_MAP );

0 comments on commit 44e3da6

Please sign in to comment.