Screen keyboard text input can be disabled through ChangeAppSettings, also it will hide screen joystick if it's not required, but key amount > 0

This commit is contained in:
pelya
2010-11-05 16:11:18 +02:00
parent 152ac68f89
commit 6b250d3d50
4 changed files with 27 additions and 7 deletions
+20 -4
View File
@@ -1,6 +1,6 @@
#!/bin/sh
CHANGE_APP_SETTINGS_VERSION=12
CHANGE_APP_SETTINGS_VERSION=13
AUTO=
if [ "X$1" = "X-a" ]; then
@@ -12,9 +12,9 @@ fi
. ./AndroidAppSettings.cfg
if [ "$CHANGE_APP_SETTINGS_VERSION" != "$AppSettingVersion" ]; then
AUTO=
fi
#if [ "$CHANGE_APP_SETTINGS_VERSION" != "$AppSettingVersion" ]; then
# AUTO=
#fi
var=""
@@ -117,6 +117,14 @@ if [ -n "$var" ] ; then
fi
fi
if [ -z "$AppNeedsTextInput" -o -z "$AUTO" ]; then
echo -n "\nApplication needs text input (y) or (n), enables button for text input on screen ($AppNeedsTextInput): "
read var
if [ -n "$var" ] ; then
AppNeedsTextInput="$var"
fi
fi
if [ -z "$AppUsesJoystick" -o -z "$AUTO" ]; then
echo -n "\nApplication uses joystick (y) or (n), the accelerometer (2-axis) or orientation sensor (3-axis)\nwill be used as joystick 0, also on-screen DPAD will be used as joystick -\nmake sure you can navigate all app menus with joystick or mouse ($AppUsesJoystick): "
read var
@@ -298,6 +306,7 @@ echo SdlVideoResizeKeepAspect=$SdlVideoResizeKeepAspect >> AndroidAppSettings.cf
echo NeedDepthBuffer=$NeedDepthBuffer >> AndroidAppSettings.cfg
echo AppUsesMouse=$AppUsesMouse >> AndroidAppSettings.cfg
echo AppNeedsArrowKeys=$AppNeedsArrowKeys >> AndroidAppSettings.cfg
echo AppNeedsTextInput=$AppNeedsTextInput >> AndroidAppSettings.cfg
echo AppUsesJoystick=$AppUsesJoystick >> AndroidAppSettings.cfg
echo AppHandlesJoystickSensitivity=$AppHandlesJoystickSensitivity >> AndroidAppSettings.cfg
echo AppUsesMultitouch=$AppUsesMultitouch >> AndroidAppSettings.cfg
@@ -370,6 +379,12 @@ else
AppNeedsArrowKeys=false
fi
if [ "$AppNeedsTextInput" = "y" ] ; then
AppNeedsTextInput=true
else
AppNeedsTextInput=false
fi
if [ "$AppUsesJoystick" = "y" ] ; then
AppUsesJoystick=true
else
@@ -451,6 +466,7 @@ cat project/src/Globals.java | \
sed "s/public static boolean InhibitSuspend = .*;/public static boolean InhibitSuspend = $InhibitSuspend;/" | \
sed "s/public static boolean AppUsesMouse = .*;/public static boolean AppUsesMouse = $AppUsesMouse;/" | \
sed "s/public static boolean AppNeedsArrowKeys = .*;/public static boolean AppNeedsArrowKeys = $AppNeedsArrowKeys;/" | \
sed "s/public static boolean AppNeedsTextInput = .*;/public static boolean AppNeedsTextInput = $AppNeedsTextInput;/" | \
sed "s/public static boolean AppUsesJoystick = .*;/public static boolean AppUsesJoystick = $AppUsesJoystick;/" | \
sed "s/public static boolean AppHandlesJoystickSensitivity = .*;/public static boolean AppHandlesJoystickSensitivity = $AppHandlesJoystickSensitivity;/" | \
sed "s/public static boolean AppUsesMultitouch = .*;/public static boolean AppUsesMultitouch = $AppUsesMultitouch;/" | \
+2
View File
@@ -26,6 +26,8 @@ class Globals {
public static boolean AppNeedsArrowKeys = true;
public static boolean AppNeedsTextInput = true;
public static boolean AppUsesJoystick = false;
public static boolean AppHandlesJoystickSensitivity = false;
+3 -2
View File
@@ -259,7 +259,7 @@ class Settings
static void showAdditionalInputConfig(final MainActivity p)
{
if( ! Globals.AppNeedsArrowKeys && ! Globals.AppUsesJoystick )
if( ! ( Globals.AppNeedsArrowKeys || Globals.AppNeedsTextInput || Globals.AppTouchscreenKeyboardKeysAmount > 0 ) && ! Globals.AppUsesJoystick )
{
showAccelerometerConfig(p);
return;
@@ -469,7 +469,8 @@ class Settings
Globals.TouchscreenKeyboardTheme,
Globals.AppTouchscreenKeyboardKeysAmount,
Globals.AppTouchscreenKeyboardKeysAmountAutoFire,
1, 1);
Globals.AppNeedsArrowKeys ? 1 : 0,
Globals.AppNeedsTextInput ? 1 : 0 );
}
SetupTouchscreenKeyboardGraphics(p);
String lang = new String(Locale.getDefault().getLanguage());
@@ -1,5 +1,5 @@
# The application settings for Android libSDL port
AppSettingVersion=12
AppSettingVersion=13
LibSdlVersion=1.2
AppName="Ur-Quan Masters"
AppFullName=com.sourceforge.sc2
@@ -11,6 +11,7 @@ SdlVideoResizeKeepAspect=n
NeedDepthBuffer=n
AppUsesMouse=n
AppNeedsArrowKeys=y
AppNeedsTextInput=y
AppUsesJoystick=y
AppHandlesJoystickSensitivity=n
AppUsesMultitouch=n