Added names to keys in screen keyboard layout dialog
This commit is contained in:
@@ -434,6 +434,22 @@ if [ -n "$var" ] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$RedefinedKeysScreenKbNames" -o -z "$AUTO" ]; then
|
||||
if [ -z "$RedefinedKeysScreenKbNames" ]; then
|
||||
RedefinedKeysScreenKbNames="$RedefinedKeysScreenKb"
|
||||
CHANGED=1
|
||||
fi
|
||||
echo
|
||||
echo "Names for on-screen keyboard keys, such as Fire, Jump, Run etc, separated by spaces, they are used in SDL config menu"
|
||||
echo "$RedefinedKeysScreenKbNames"
|
||||
echo -n ": "
|
||||
read var
|
||||
if [ -n "$var" ] ; then
|
||||
RedefinedKeysScreenKbNames="$var"
|
||||
CHANGED=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$StartupMenuButtonTimeout" -o -z "$AUTO" ]; then
|
||||
echo
|
||||
echo -n "How long to show startup menu button, in msec, 0 to disable startup menu ($StartupMenuButtonTimeout): "
|
||||
@@ -712,6 +728,7 @@ echo RedefinedKeys=\"$RedefinedKeys\" >> AndroidAppSettings.cfg
|
||||
echo AppTouchscreenKeyboardKeysAmount=$AppTouchscreenKeyboardKeysAmount >> AndroidAppSettings.cfg
|
||||
echo AppTouchscreenKeyboardKeysAmountAutoFire=$AppTouchscreenKeyboardKeysAmountAutoFire >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysScreenKb=\"$RedefinedKeysScreenKb\" >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysScreenKbNames=\"$RedefinedKeysScreenKbNames\" >> AndroidAppSettings.cfg
|
||||
echo StartupMenuButtonTimeout=$StartupMenuButtonTimeout >> AndroidAppSettings.cfg
|
||||
echo HiddenMenuOptions=\'$HiddenMenuOptions\' >> AndroidAppSettings.cfg
|
||||
echo FirstStartMenuOptions=\'$FirstStartMenuOptions\' >> AndroidAppSettings.cfg
|
||||
@@ -1038,6 +1055,7 @@ sed -i "s/public static boolean ResetSdlConfigForThisVersion = .*;/public static
|
||||
sed -i "s|public static String DeleteFilesOnUpgrade = .*;|public static String DeleteFilesOnUpgrade = \"$DeleteFilesOnUpgrade\";|" project/src/Globals.java
|
||||
sed -i "s/public static int AppTouchscreenKeyboardKeysAmount = .*;/public static int AppTouchscreenKeyboardKeysAmount = $AppTouchscreenKeyboardKeysAmount;/" project/src/Globals.java
|
||||
sed -i "s/public static int AppTouchscreenKeyboardKeysAmountAutoFire = .*;/public static int AppTouchscreenKeyboardKeysAmountAutoFire = $AppTouchscreenKeyboardKeysAmountAutoFire;/" project/src/Globals.java
|
||||
sed -i "s@public static String\\[\\] AppTouchscreenKeyboardKeysNames = .*;@public static String[] AppTouchscreenKeyboardKeysNames = \"$RedefinedKeysScreenKbNames\".split(\" \");@" project/src/Globals.java
|
||||
sed -i "s/public static int StartupMenuButtonTimeout = .*;/public static int StartupMenuButtonTimeout = $StartupMenuButtonTimeout;/" project/src/Globals.java
|
||||
sed -i "s/public static int AppMinimumRAM = .*;/public static int AppMinimumRAM = $AppMinimumRAM;/" project/src/Globals.java
|
||||
sed -i "s/public static Settings.Menu HiddenMenuOptions .*;/public static Settings.Menu HiddenMenuOptions [] = { $HiddenMenuOptions1 };/" project/src/Globals.java
|
||||
|
||||
@@ -61,6 +61,7 @@ class Globals
|
||||
public static String DeleteFilesOnUpgrade = "";
|
||||
public static int AppTouchscreenKeyboardKeysAmount = 4;
|
||||
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
|
||||
public static String[] AppTouchscreenKeyboardKeysNames = "Fire Shoot Switch_weapon Jump Run Hide/Seek".split(" ");
|
||||
public static int StartupMenuButtonTimeout = 3000;
|
||||
public static int AppMinimumRAM = 0;
|
||||
public static Settings.Menu HiddenMenuOptions [] = {};
|
||||
|
||||
@@ -2057,6 +2057,25 @@ class Settings
|
||||
};
|
||||
buttons = buttons2;
|
||||
}
|
||||
|
||||
for( int i = 0; i < Globals.ScreenKbControlsLayout.length; i++ )
|
||||
{
|
||||
imgs[i] = new ImageView(p);
|
||||
imgs[i].setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
|
||||
imgs[i].setScaleType(ImageView.ScaleType.MATRIX);
|
||||
bmps[i] = BitmapFactory.decodeResource( p.getResources(), buttons[i] );
|
||||
imgs[i].setImageBitmap(bmps[i]);
|
||||
imgs[i].setAlpha(128);
|
||||
layout.addView(imgs[i]);
|
||||
Matrix m = new Matrix();
|
||||
RectF src = new RectF(0, 0, bmps[i].getWidth(), bmps[i].getHeight());
|
||||
RectF dst = new RectF(Globals.ScreenKbControlsLayout[i][0], Globals.ScreenKbControlsLayout[i][1],
|
||||
Globals.ScreenKbControlsLayout[i][2], Globals.ScreenKbControlsLayout[i][3]);
|
||||
m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL);
|
||||
imgs[i].setImageMatrix(m);
|
||||
}
|
||||
boundary.bringToFront();
|
||||
|
||||
setupButton(true);
|
||||
}
|
||||
|
||||
@@ -2080,16 +2099,6 @@ class Settings
|
||||
}
|
||||
} while( ! Globals.ScreenKbControlsShown[currentButton] );
|
||||
|
||||
if( imgs[currentButton] == null )
|
||||
{
|
||||
imgs[currentButton] = new ImageView(p);
|
||||
imgs[currentButton].setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
|
||||
imgs[currentButton].setScaleType(ImageView.ScaleType.MATRIX);
|
||||
bmps[currentButton] = BitmapFactory.decodeResource( p.getResources(), buttons[currentButton] );
|
||||
imgs[currentButton].setImageBitmap(bmps[currentButton]);
|
||||
layout.addView(imgs[currentButton]);
|
||||
boundary.bringToFront();
|
||||
}
|
||||
if( Globals.ScreenKbControlsLayout[currentButton][0] == Globals.ScreenKbControlsLayout[currentButton][2] ||
|
||||
Globals.ScreenKbControlsLayout[currentButton][1] == Globals.ScreenKbControlsLayout[currentButton][3] )
|
||||
{
|
||||
@@ -2116,6 +2125,10 @@ class Settings
|
||||
src = new RectF(0, 0, boundaryBmp.getWidth(), boundaryBmp.getHeight());
|
||||
m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL);
|
||||
boundary.setImageMatrix(m);
|
||||
String buttonText = (currentButton == 0 ? "DPAD" : ( currentButton == 1 ? "Text input" : "" ));
|
||||
if ( currentButton >= 2 && currentButton - 2 < Globals.AppTouchscreenKeyboardKeysNames.length )
|
||||
buttonText = Globals.AppTouchscreenKeyboardKeysNames[currentButton - 2];
|
||||
p.setText(p.getResources().getString(R.string.screenkb_custom_layout_help) + "\n" + buttonText.replace("_", " "));
|
||||
}
|
||||
|
||||
public void onTouchEvent(final MotionEvent ev)
|
||||
|
||||
@@ -36,6 +36,7 @@ RedefinedKeys="SPACE SPACE NO_REMAP NO_REMAP RETURN ESCAPE LCTRL"
|
||||
AppTouchscreenKeyboardKeysAmount=5
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
RedefinedKeysScreenKb="SLASH BACKSPACE TAB END LCTRL SPACE UNKNOWN UNKNOWN UNKNOWN UNKNOWN"
|
||||
RedefinedKeysScreenKbNames="Change_weapon Sniper_view Show_scores Jump/centerview Fire Jump"
|
||||
StartupMenuButtonTimeout=3000
|
||||
HiddenMenuOptions='OptionalDownloadConfig DisplaySizeConfig'
|
||||
FirstStartMenuOptions=''
|
||||
|
||||
Submodule project/jni/application/openarena/engine updated: 07dfdc11f1...cec6cad84b
Submodule project/jni/application/openarena/vm updated: 157d48a0c0...f7ed2dc3ae
Reference in New Issue
Block a user