Permalink
Browse files

Reverting changes to strings.xml

Decided to keep strings.xml the same and split on ": " within the
strings. Eventually this should be cleaned up by separating the "Player
1" string from the Pak string.
  • Loading branch information...
Mike McFadden
Mike McFadden committed Mar 18, 2015
1 parent 3cb695c commit 4093d1f8a19b2994d89361b9e1fbeaf90d440e08
Showing with 40 additions and 13 deletions.
  1. +12 −4 res/values/strings.xml
  2. +28 −9 src/paulscode/android/mupen64plusae/GameLifecycleHandler.java
View
@@ -36,10 +36,18 @@
<string name="menuItem_enableFramelimiter">Sync audio</string>
<string name="menuItem_disableFramelimiter">Desync audio</string>
<string name="menuItem_paks">Controller Paks</string> <!-- capitalize since trademark -->
<string name="menuItem_pak_empty">Empty</string>
<string name="menuItem_pak_mem">Memory Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak_rumble">Rumble Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_player">Player %1$d</string>
<string name="menuItem_pak1_empty">Player 1: Empty</string> <!-- capitalize since trademark -->
<string name="menuItem_pak1_mem">Player 1: Memory Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak1_rumble">Player 1: Rumble Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak2_empty">Player 2: Empty</string>
<string name="menuItem_pak2_mem">Player 2: Memory Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak2_rumble">Player 2: Rumble Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak3_empty">Player 3: Empty</string>
<string name="menuItem_pak3_mem">Player 3: Memory Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak3_rumble">Player 3: Rumble Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak4_empty">Player 4: Empty</string>
<string name="menuItem_pak4_mem">Player 4: Memory Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_pak4_rumble">Player 4: Rumble Pak</string> <!-- capitalize since trademark -->
<string name="menuItem_setIme">Change IME</string>
<string name="menuItem_exit">Exit</string>
@@ -431,10 +431,28 @@ public void onAction()
mGamePrefs.isPlugged3,
mGamePrefs.isPlugged4 };
final String[] pakTypes = {
mActivity.getString( R.string.menuItem_pak_empty ),
mActivity.getString( R.string.menuItem_pak_mem ),
mActivity.getString( R.string.menuItem_pak_rumble ) };
final String[][] pakTypes = {
{
mActivity.getString( R.string.menuItem_pak1_empty ),
mActivity.getString( R.string.menuItem_pak1_mem ),
mActivity.getString( R.string.menuItem_pak1_rumble )
},
{
mActivity.getString( R.string.menuItem_pak2_empty ),
mActivity.getString( R.string.menuItem_pak2_mem ),
mActivity.getString( R.string.menuItem_pak2_rumble )
},
{
mActivity.getString( R.string.menuItem_pak3_empty ),
mActivity.getString( R.string.menuItem_pak3_mem ),
mActivity.getString( R.string.menuItem_pak3_rumble )
},
{
mActivity.getString( R.string.menuItem_pak4_empty ),
mActivity.getString( R.string.menuItem_pak4_mem ),
mActivity.getString( R.string.menuItem_pak4_rumble )
}
};
final int[] pakMap = {
NativeConstants.PAK_TYPE_NONE,
@@ -467,10 +485,10 @@ public void onAction()
break;
}
final String playerString = mActivity.getString( R.string.menuItem_player, player );
final String[] pakString = pakTypes[player - 1][pakIndex].split(": ");
final int finalPlayer = player;
mGameSidebar.addRow( 0x0, playerString, pakTypes[pakIndex],
mGameSidebar.addRow( 0x0, pakString[0], pakString[pakString.length - 1],
new GameSidebar.Action()
{
@Override
@@ -488,7 +506,7 @@ public void onAction()
boolean permitRumble = AppData.IS_JELLY_BEAN || ( player == 1 && hasPhoneVibrator );
// Show the options for this player
for( int pak = 0; pak < pakTypes.length; pak++ )
for( int pak = 0; pak < pakTypes[0].length; pak++ )
{
if( !permitRumble && pak == 2 )
continue;
@@ -498,8 +516,9 @@ public void onAction()
icon = R.drawable.ic_check;
final int finalPak = pak;
final String[] pakName = pakTypes[player - 1][pak].split(": ");
mGameSidebar.addRow( 0x0, pakTypes[pak], null, new GameSidebar.Action()
mGameSidebar.addRow( 0x0, pakName[pakName.length - 1], null, new GameSidebar.Action()
{
@Override
public void onAction()
@@ -510,7 +529,7 @@ public void onAction()
NativeInput.setConfig( finalPlayer - 1, true, newPakIndex );
// Send a toast message
Notifier.showToast( mActivity, playerString + ": " + pakTypes[finalPak] );
Notifier.showToast( mActivity, pakTypes[finalPlayer - 1][finalPak] );
// Collapse this section in the sidebar
mShowPak = 0;

0 comments on commit 4093d1f

Please sign in to comment.