Updated build scripts, added sorting for SDL keycodes in config menu
This commit is contained in:
@@ -564,6 +564,7 @@ rm -rf project/$OUT/local/*/libsdl-*.so
|
|||||||
rm -rf project/$OUT/local/*/objs/sdl-*/src/*/android
|
rm -rf project/$OUT/local/*/objs/sdl-*/src/*/android
|
||||||
rm -rf project/$OUT/local/*/objs/sdl-*/src/video/SDL_video.o
|
rm -rf project/$OUT/local/*/objs/sdl-*/src/video/SDL_video.o
|
||||||
rm -rf project/$OUT/local/*/objs/sdl-*/SDL_renderer_gles.o
|
rm -rf project/$OUT/local/*/objs/sdl-*/SDL_renderer_gles.o
|
||||||
|
rm -rf project/$OUT/local/*/libsdl_fake_stdout.a project/$OUT/local/*/objs/sdl_fake_stdout/*
|
||||||
# Do not rebuild several huge libraries that do not depend on SDL version
|
# Do not rebuild several huge libraries that do not depend on SDL version
|
||||||
for LIB in freetype intl jpeg png lua mad stlport tremor xerces xml2; do
|
for LIB in freetype intl jpeg png lua mad stlport tremor xerces xml2; do
|
||||||
for ARCH in armeabi armeabi-v7a; do
|
for ARCH in armeabi armeabi-v7a; do
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package net.sourceforge.clonekeenplus;
|
|||||||
|
|
||||||
import java.lang.String;
|
import java.lang.String;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
|
||||||
@@ -495,6 +496,10 @@ class SDL_Keys
|
|||||||
{
|
{
|
||||||
public static String [] names = null;
|
public static String [] names = null;
|
||||||
public static Integer [] values = null;
|
public static Integer [] values = null;
|
||||||
|
|
||||||
|
public static String [] namesSorted = null;
|
||||||
|
public static Integer [] namesSortedIdx = null;
|
||||||
|
public static Integer [] namesSortedBackIdx = null;
|
||||||
|
|
||||||
static final int JAVA_KEYCODE_LAST = 110; // Android 2.3 added several new gaming keys, it ends up at keycode 110 currently - plz keep in sync with javakeycodes.h
|
static final int JAVA_KEYCODE_LAST = 110; // Android 2.3 added several new gaming keys, it ends up at keycode 110 currently - plz keep in sync with javakeycodes.h
|
||||||
|
|
||||||
@@ -535,5 +540,21 @@ class SDL_Keys
|
|||||||
|
|
||||||
names = Names.toArray(new String[0]);
|
names = Names.toArray(new String[0]);
|
||||||
values = Values.toArray(new Integer[0]);
|
values = Values.toArray(new Integer[0]);
|
||||||
|
namesSorted = Names.toArray(new String[0]);
|
||||||
|
namesSortedIdx = new Integer[values.length];
|
||||||
|
namesSortedBackIdx = new Integer[values.length];
|
||||||
|
Arrays.sort(namesSorted);
|
||||||
|
for( int i = 0; i < namesSorted.length; i++ )
|
||||||
|
{
|
||||||
|
for( int j = 0; j < namesSorted.length; j++ )
|
||||||
|
{
|
||||||
|
if( namesSorted[i].equals( names[j] ) )
|
||||||
|
{
|
||||||
|
namesSortedIdx[i] = j;
|
||||||
|
namesSortedBackIdx[j] = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import java.util.Locale;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
|
import java.util.Collections;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
@@ -1518,11 +1519,11 @@ class Settings
|
|||||||
final int KeyIndexFinal = keyIndex;
|
final int KeyIndexFinal = keyIndex;
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
||||||
builder.setTitle(R.string.remap_hwkeys_select);
|
builder.setTitle(R.string.remap_hwkeys_select);
|
||||||
builder.setSingleChoiceItems(SDL_Keys.names, Globals.RemapHwKeycode[keyIndex], new DialogInterface.OnClickListener()
|
builder.setSingleChoiceItems(SDL_Keys.namesSorted, SDL_Keys.namesSortedBackIdx[Globals.RemapHwKeycode[keyIndex]], new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
public void onClick(DialogInterface dialog, int item)
|
public void onClick(DialogInterface dialog, int item)
|
||||||
{
|
{
|
||||||
Globals.RemapHwKeycode[KeyIndexFinal] = item;
|
Globals.RemapHwKeycode[KeyIndexFinal] = SDL_Keys.namesSortedIdx[item];
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
showConfigMainMenu(p);
|
showConfigMainMenu(p);
|
||||||
@@ -1620,11 +1621,11 @@ class Settings
|
|||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
||||||
builder.setTitle(items[currentButton]);
|
builder.setTitle(items[currentButton]);
|
||||||
builder.setSingleChoiceItems(SDL_Keys.names, Globals.RemapScreenKbKeycode[currentButton], new DialogInterface.OnClickListener()
|
builder.setSingleChoiceItems(SDL_Keys.namesSorted, SDL_Keys.namesSortedBackIdx[Globals.RemapScreenKbKeycode[currentButton]], new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
public void onClick(DialogInterface dialog, int item)
|
public void onClick(DialogInterface dialog, int item)
|
||||||
{
|
{
|
||||||
Globals.RemapScreenKbKeycode[currentButton] = item;
|
Globals.RemapScreenKbKeycode[currentButton] = SDL_Keys.namesSortedIdx[item];
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
showRemapScreenKbConfig2(p, currentButton + 1);
|
showRemapScreenKbConfig2(p, currentButton + 1);
|
||||||
@@ -1742,11 +1743,11 @@ class Settings
|
|||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
AlertDialog.Builder builder = new AlertDialog.Builder(p);
|
||||||
builder.setTitle(items[currentButton]);
|
builder.setTitle(items[currentButton]);
|
||||||
builder.setSingleChoiceItems(SDL_Keys.names, Globals.RemapMultitouchGestureKeycode[currentButton], new DialogInterface.OnClickListener()
|
builder.setSingleChoiceItems(SDL_Keys.namesSorted, SDL_Keys.namesSortedBackIdx[Globals.RemapMultitouchGestureKeycode[currentButton]], new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
public void onClick(DialogInterface dialog, int item)
|
public void onClick(DialogInterface dialog, int item)
|
||||||
{
|
{
|
||||||
Globals.RemapMultitouchGestureKeycode[currentButton] = item;
|
Globals.RemapMultitouchGestureKeycode[currentButton] = SDL_Keys.namesSortedIdx[item];
|
||||||
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
showScreenGesturesConfig3(p, currentButton + 1);
|
showScreenGesturesConfig3(p, currentButton + 1);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
dosbox
|
fheroes2
|
||||||
Reference in New Issue
Block a user