diff --git a/project/java/Globals.java b/project/java/Globals.java
index 46d123591..135527fc4 100644
--- a/project/java/Globals.java
+++ b/project/java/Globals.java
@@ -106,8 +106,10 @@ class Globals
public static int ClickScreenTouchspotSize = 0;
public static int RemapHwKeycode[] = new int[SDL_Keys.JAVA_KEYCODE_LAST];
public static int RemapScreenKbKeycode[] = new int[6];
- public static boolean ScreenKbControlsShown[] = new boolean[8]; /* Also joystick and text input button added */
- public static int ScreenKbControlsLayout[][] = new int[][] { { 0, 303, 177, 480 }, { 0, 0, 48, 48 }, { 712, 392, 800, 480 }, { 624, 392, 712, 480 }, { 712, 304, 800, 392 }, { 624, 304, 712, 392 }, { 712, 216, 800, 304 }, { 624, 216, 712, 304 } }; // Values for 800x480 resolution
+ public static int ScreenKbControlsLayout[][] = AppUsesSecondJoystick ? // Values for 800x480 resolution
+ new int[][] { { 0, 303, 177, 480 }, { 0, 0, 48, 48 }, { 400, 392, 488, 480 }, { 312, 392, 400, 480 }, { 400, 304, 488, 392 }, { 312, 304, 400, 392 }, { 400, 216, 488, 304 }, { 312, 216, 400, 304 }, { 623, 303, 800, 480 } } :
+ new int[][] { { 0, 303, 177, 480 }, { 0, 0, 48, 48 }, { 712, 392, 800, 480 }, { 624, 392, 712, 480 }, { 712, 304, 800, 392 }, { 624, 304, 712, 392 }, { 712, 216, 800, 304 }, { 624, 216, 712, 304 } };
+ public static boolean ScreenKbControlsShown[] = new boolean[ScreenKbControlsLayout.length]; /* Also joystick and text input button added */
public static int RemapMultitouchGestureKeycode[] = new int[4];
public static boolean MultitouchGesturesUsed[] = new boolean[4];
public static int MultitouchGestureSensitivity = 1;
diff --git a/project/java/Settings.java b/project/java/Settings.java
index 3cdefd555..53c1f15a8 100644
--- a/project/java/Settings.java
+++ b/project/java/Settings.java
@@ -66,6 +66,7 @@ import android.app.AlarmManager;
import android.util.DisplayMetrics;
import android.net.Uri;
import java.util.concurrent.Semaphore;
+import java.util.Arrays;
import android.graphics.Color;
import android.hardware.SensorEventListener;
import android.hardware.SensorEvent;
@@ -207,6 +208,8 @@ class Settings
Globals.ScreenKbControlsShown[1] = Globals.AppNeedsTextInput;
for( int i = 2; i < Globals.ScreenKbControlsShown.length; i++ )
Globals.ScreenKbControlsShown[i] = ( i - 2 < Globals.AppTouchscreenKeyboardKeysAmount );
+ if( Globals.AppUsesSecondJoystick )
+ Globals.ScreenKbControlsShown[8] = true;
for( int i = 0; i < Globals.RemapMultitouchGestureKeycode.length; i++ )
{
int sdlKey = nativeGetKeymapKeyMultitouchGesture(i);
@@ -1720,25 +1723,24 @@ class Settings
p.getResources().getString(R.string.remap_screenkb_button) + " 6",
};
- boolean defaults[] = {
- Globals.ScreenKbControlsShown[0],
- Globals.ScreenKbControlsShown[1],
- Globals.ScreenKbControlsShown[2],
- Globals.ScreenKbControlsShown[3],
- Globals.ScreenKbControlsShown[4],
- Globals.ScreenKbControlsShown[5],
- Globals.ScreenKbControlsShown[6],
- Globals.ScreenKbControlsShown[7],
- };
-
+ boolean defaults[] = Arrays.copyOf(Globals.ScreenKbControlsShown, Globals.ScreenKbControlsShown.length);
+ if( Globals.AppUsesSecondJoystick )
+ {
+ items = Arrays.copyOf(items, items.length + 1);
+ items[items.length - 1] = p.getResources().getString(R.string.remap_screenkb_joystick) + " 2";
+ defaults = Arrays.copyOf(defaults, defaults.length + 1);
+ defaults[defaults.length - 1] = true;
+ }
+
+ for( int i = 0; i < Math.min(6, Globals.AppTouchscreenKeyboardKeysNames.length); i++ )
+ items[i+2] += " - " + Globals.AppTouchscreenKeyboardKeysNames[i];
+
AlertDialog.Builder builder = new AlertDialog.Builder(p);
builder.setTitle(p.getResources().getString(R.string.remap_screenkb));
builder.setMultiChoiceItems(items, defaults, new DialogInterface.OnMultiChoiceClickListener()
{
public void onClick(DialogInterface dialog, int item, boolean isChecked)
{
- if( ! Globals.UseTouchscreenKeyboard )
- item += 8;
Globals.ScreenKbControlsShown[item] = isChecked;
}
});
@@ -1772,7 +1774,10 @@ class Settings
p.getResources().getString(R.string.remap_screenkb_button) + " 5",
p.getResources().getString(R.string.remap_screenkb_button) + " 6",
};
-
+
+ for( int i = 0; i < Math.min(6, Globals.AppTouchscreenKeyboardKeysNames.length); i++ )
+ items[i] += " - " + Globals.AppTouchscreenKeyboardKeysNames[i];
+
if( currentButton >= Globals.RemapScreenKbKeycode.length )
{
goBack(p);
@@ -2051,7 +2056,8 @@ class Settings
R.drawable.b3,
R.drawable.b4,
R.drawable.b5,
- R.drawable.b6
+ R.drawable.b6,
+ R.drawable.dpad
};
int oldX = 0, oldY = 0;
boolean resizing = false;
@@ -2078,7 +2084,8 @@ class Settings
R.drawable.sun_b3,
R.drawable.sun_b4,
R.drawable.sun_b5,
- R.drawable.sun_b6
+ R.drawable.sun_b6,
+ R.drawable.sun_dpad
};
}
@@ -2097,7 +2104,7 @@ class Settings
continue;
if( currentButton == -1 )
currentButton = i;
- Log.i("SDL", "Screen kb button " + i + " coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
+ //Log.i("SDL", "Screen kb button " + i + " coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
// Check if the button is off screen edge or shrunk to zero
if( Globals.ScreenKbControlsLayout[i][0] > Globals.ScreenKbControlsLayout[i][2] - displayY/12 )
Globals.ScreenKbControlsLayout[i][0] = Globals.ScreenKbControlsLayout[i][2] - displayY/12;
@@ -2127,7 +2134,7 @@ class Settings
Globals.ScreenKbControlsLayout[i][1] -= Globals.ScreenKbControlsLayout[i][3] - displayY;
Globals.ScreenKbControlsLayout[i][3] = displayY;
}
- Log.i("SDL", "After bounds check coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
+ //Log.i("SDL", "After bounds check coords " + Globals.ScreenKbControlsLayout[i][0] + ":" + Globals.ScreenKbControlsLayout[i][1] + ":" + Globals.ScreenKbControlsLayout[i][2] + ":" + Globals.ScreenKbControlsLayout[i][3] );
imgs[i] = new ImageView(p);
imgs[i].setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
@@ -2162,9 +2169,17 @@ class Settings
src = new RectF(0, 0, boundaryBmp.getWidth(), boundaryBmp.getHeight());
m.setRectToRect(src, dst, Matrix.ScaleToFit.FILL);
boundary.setImageMatrix(m);
- String buttonText = (i == 0 ? "Joystick" : ( i == 1 ? "Text input" : "" ));
- if ( i >= 2 && i - 2 < Globals.AppTouchscreenKeyboardKeysNames.length )
+ String buttonText = "";
+ if( i >= 2 && i <= 7 )
+ buttonText = p.getResources().getString(R.string.remap_screenkb_button) + (i - 2);
+ if( i >= 2 && i - 2 < Globals.AppTouchscreenKeyboardKeysNames.length )
buttonText = Globals.AppTouchscreenKeyboardKeysNames[i - 2];
+ if( i == 0 )
+ buttonText = "Joystick";
+ if( i == 1 )
+ buttonText = "Text input";
+ if( i == 8 )
+ buttonText = "Joystick 2";
p.setText(p.getResources().getString(R.string.screenkb_custom_layout_help) + "\n" + buttonText.replace("_", " "));
}
diff --git a/project/java/translations/values/strings.xml b/project/java/translations/values/strings.xml
index e790a9d46..865aa2a57 100644
--- a/project/java/translations/values/strings.xml
+++ b/project/java/translations/values/strings.xml
@@ -126,9 +126,9 @@
Select SDL keycode
Remap on-screen controls
- On-screen joystick
- On-screen button
- On-screen text input button
+ Joystick
+ Button
+ Text input button
Two-finger screen gestures
Two-finger screen gestures sensitivity
Zoom in two-finger gesture
diff --git a/project/jni/application/ballfield/AndroidAppSettings.cfg b/project/jni/application/ballfield/AndroidAppSettings.cfg
index e38e4662e..c92e5c2ae 100644
--- a/project/jni/application/ballfield/AndroidAppSettings.cfg
+++ b/project/jni/application/ballfield/AndroidAppSettings.cfg
@@ -23,7 +23,7 @@ InhibitSuspend=n
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
-AppDataDownloadUrl="Game data is 1 Mb|ballfield3.zip"
+AppDataDownloadUrl="!!Game data is 1 Mb|ballfield3.zip"
# Video color depth - 16 BPP is the fastest and supported for all modes, 24 bpp is supported only
# with SwVideoMode=y, SDL_OPENGL mode supports everything. (16)/(24)/(32)
@@ -143,7 +143,7 @@ StartupMenuButtonTimeout=3000
# Menu items to hide from startup menu, available menu items:
# OkButton DummyMenu MainMenu MouseConfigMainMenu KeyboardConfigMainMenu DownloadConfig OptionalDownloadConfig ScreenKeyboardSizeConfig ScreenKeyboardDrawSizeConfig ScreenKeyboardThemeConfig ScreenKeyboardTransparencyConfig AudioConfig DisplaySizeConfig LeftClickConfig RightClickConfig AdditionalMouseConfig JoystickMouseConfig TouchPressureMeasurementTool RemapHwKeysConfig RemapScreenKbConfig ScreenGesturesConfig CalibrateTouchscreenMenu CustomizeScreenKbLayout VideoSettingsConfig ShowReadme GyroscopeCalibration ResetToDefaultsConfig
-HiddenMenuOptions=''
+HiddenMenuOptions='OptionalDownloadConfig'
# Menu items to show at startup - this is Java code snippet, leave empty for default:
# new Settings.ShowReadme(), (AppUsesMouse \&\& \! ForceRelativeMouseMode \? new Settings.DisplaySizeConfig(true) : new Settings.DummyMenu()), new Settings.OptionalDownloadConfig(true), new Settings.GyroscopeCalibration()
diff --git a/project/jni/application/sc2/AndroidAppSettings.cfg b/project/jni/application/sc2/AndroidAppSettings.cfg
index 3543874b4..d5b767925 100644
--- a/project/jni/application/sc2/AndroidAppSettings.cfg
+++ b/project/jni/application/sc2/AndroidAppSettings.cfg
@@ -168,7 +168,7 @@ AppVersionName="0.7.0.23"
ResetSdlConfigForThisVersion=y
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
-DeleteFilesOnUpgrade="addons packages menu.key uqm.key uqm.rmp version config/uqm.cfg"
+DeleteFilesOnUpgrade="addons packages menu.key uqm.key uqm.rmp version config/uqm.cfg libsdl-DownloadFinished-4.flag libsdl-DownloadFinished-5.flag libsdl-DownloadFinished-6.flag libsdl-DownloadFinished-7.flag libsdl-DownloadFinished-8.flag"
# Optional shared libraries to compile - removing some of them will save space
# MP3 support by libMAD is encumbered by patents and libMAD is GPL-ed