New revamped startup dialog, with possibility to disable separate menu options or entire dialog through ChangeAppSettings.sh
This commit is contained in:
@@ -266,6 +266,27 @@ if [ -n "$var" ] ; then
|
||||
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): "
|
||||
read var
|
||||
if [ -n "$var" ] ; then
|
||||
StartupMenuButtonTimeout="$var"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$HiddenMenuOptions" -o -z "$AUTO" ]; then
|
||||
echo
|
||||
echo "Menu items to hide from startup menu, available menu items:"
|
||||
echo `grep 'extends Menu' project/java/Settings.java | sed 's/.* class \(.*\) extends .*/\1/'`
|
||||
echo "($HiddenMenuOptions)"
|
||||
echo -n ": "
|
||||
read var
|
||||
if [ -n "$var" ] ; then
|
||||
HiddenMenuOptions="$var"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$MultiABI" -o -z "$AUTO" ]; then
|
||||
echo
|
||||
echo "Enable multi-ABI binary, with hardware FPU support - "
|
||||
@@ -404,6 +425,8 @@ echo RedefinedKeys=\"$RedefinedKeys\" >> AndroidAppSettings.cfg
|
||||
echo AppTouchscreenKeyboardKeysAmount=$AppTouchscreenKeyboardKeysAmount >> AndroidAppSettings.cfg
|
||||
echo AppTouchscreenKeyboardKeysAmountAutoFire=$AppTouchscreenKeyboardKeysAmountAutoFire >> AndroidAppSettings.cfg
|
||||
echo RedefinedKeysScreenKb=\"$RedefinedKeysScreenKb\" >> AndroidAppSettings.cfg
|
||||
echo StartupMenuButtonTimeout=$StartupMenuButtonTimeout >> AndroidAppSettings.cfg
|
||||
echo HiddenMenuOptions=\'$HiddenMenuOptions\' >> AndroidAppSettings.cfg
|
||||
echo MultiABI=$MultiABI >> AndroidAppSettings.cfg
|
||||
echo AppVersionCode=$AppVersionCode >> AndroidAppSettings.cfg
|
||||
echo AppVersionName=\"$AppVersionName\" >> AndroidAppSettings.cfg
|
||||
@@ -545,6 +568,11 @@ if [ "$CustomBuildScript" = "n" ] ; then
|
||||
CustomBuildScript=
|
||||
fi
|
||||
|
||||
HiddenMenuOptions1=""
|
||||
for F in $HiddenMenuOptions; do
|
||||
HiddenMenuOptions1="$HiddenMenuOptions1 new Settings.$F(),"
|
||||
done
|
||||
|
||||
ReadmeText="`echo $ReadmeText | sed 's/\"/\\\\\\\\\"/g' | sed 's/[&%]//g'`"
|
||||
|
||||
echo Patching project/AndroidManifest.xml
|
||||
@@ -584,6 +612,8 @@ cat project/src/Globals.java | \
|
||||
sed "s/public static boolean NonBlockingSwapBuffers = .*;/public static boolean NonBlockingSwapBuffers = $NonBlockingSwapBuffers;/" | \
|
||||
sed "s/public static int AppTouchscreenKeyboardKeysAmount = .*;/public static int AppTouchscreenKeyboardKeysAmount = $AppTouchscreenKeyboardKeysAmount;/" | \
|
||||
sed "s/public static int AppTouchscreenKeyboardKeysAmountAutoFire = .*;/public static int AppTouchscreenKeyboardKeysAmountAutoFire = $AppTouchscreenKeyboardKeysAmountAutoFire;/" | \
|
||||
sed "s/public static int StartupMenuButtonTimeout = .*;/public static int StartupMenuButtonTimeout = $StartupMenuButtonTimeout;/" | \
|
||||
sed "s/public static Settings.Menu HiddenMenuOptions .*;/public static Settings.Menu HiddenMenuOptions [] = { $HiddenMenuOptions1 };/" | \
|
||||
sed "s%public static String ReadmeText = .*%public static String ReadmeText = \"$ReadmeText\".replace(\"^\",\"\\\n\");%" | \
|
||||
sed "s%public static String CommandLine = .*%public static String CommandLine = \"$AppCmdline\";%" | \
|
||||
sed "s/public static String AppLibraries.*/public static String AppLibraries[] = { $LibrariesToLoad };/" > \
|
||||
|
||||
@@ -17,51 +17,33 @@ import java.util.Vector;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
class Globals {
|
||||
// These config options are modified by ChangeAppsettings.sh script - see the detailed descriptions there
|
||||
public static String ApplicationName = "CommanderGenius";
|
||||
|
||||
public static String AppLibraries[] = { "sdl-1.2", };
|
||||
|
||||
public static final boolean Using_SDL_1_3 = false;
|
||||
|
||||
// Should be zip file
|
||||
public static String DataDownloadUrl = "Data files are 2 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-data.zip/download^High-quality GFX and music - 40 Mb|https://sourceforge.net/projects/libsdl-android/files/CommanderGenius/commandergenius-hqp.zip/download";
|
||||
|
||||
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
|
||||
public static boolean NeedDepthBuffer = false;
|
||||
|
||||
public static boolean SwVideoMode = false;
|
||||
|
||||
public static boolean HorizontalOrientation = true;
|
||||
|
||||
// prevent device from going to suspend mode
|
||||
public static boolean InhibitSuspend = false;
|
||||
|
||||
// Readme text to be shown on download page
|
||||
public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n");
|
||||
|
||||
public static String CommandLine = "";
|
||||
|
||||
public static boolean AppUsesMouse = false;
|
||||
|
||||
public static boolean AppNeedsTwoButtonMouse = false;
|
||||
|
||||
public static boolean AppNeedsArrowKeys = true;
|
||||
|
||||
public static boolean AppNeedsTextInput = true;
|
||||
|
||||
public static boolean AppUsesJoystick = false;
|
||||
|
||||
public static boolean AppHandlesJoystickSensitivity = false;
|
||||
|
||||
public static boolean AppUsesMultitouch = false;
|
||||
|
||||
public static boolean NonBlockingSwapBuffers = false;
|
||||
|
||||
public static int AppTouchscreenKeyboardKeysAmount = 4;
|
||||
|
||||
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
|
||||
public static int StartupMenuButtonTimeout = 3000;
|
||||
public static Settings.Menu HiddenMenuOptions [] = {};
|
||||
// Not configurable yet through ChangeAppSettings.sh
|
||||
public static Settings.Menu FirstStartMenuOptions [] = { (AppUsesMouse ? new Settings.DisplaySizeConfig(true) : new Settings.DummyMenu()), new Settings.OptionalDownloadConfig(true) };
|
||||
|
||||
// Phone-specific config, TODO: move this to settings
|
||||
// Phone-specific config, modified by user in "Change phone config" startup dialog, TODO: move this to settings
|
||||
public static boolean DownloadToSdcard = true;
|
||||
public static boolean PhoneHasTrackball = false;
|
||||
public static boolean PhoneHasArrowKeys = false;
|
||||
|
||||
@@ -121,16 +121,19 @@ public class MainActivity extends Activity {
|
||||
|
||||
if( !Settings.settingsChanged )
|
||||
{
|
||||
System.out.println("libSDL: 3-second timeout in startup screen");
|
||||
System.out.println("libSDL: " + String.valueOf(Globals.StartupMenuButtonTimeout) + "-msec timeout in startup screen");
|
||||
class Callback implements Runnable
|
||||
{
|
||||
MainActivity p;
|
||||
Callback( MainActivity _p ) { p = _p; }
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
} catch( InterruptedException e ) {};
|
||||
if( Globals.StartupMenuButtonTimeout > 0 )
|
||||
{
|
||||
try {
|
||||
Thread.sleep(Globals.StartupMenuButtonTimeout);
|
||||
} catch( InterruptedException e ) {};
|
||||
}
|
||||
if( Settings.settingsChanged )
|
||||
return;
|
||||
System.out.println("libSDL: Timeout reached in startup screen, process with downloader");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,8 @@ RedefinedKeys="LCTRL M T H E"
|
||||
AppTouchscreenKeyboardKeysAmount=0
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
RedefinedKeysScreenKb="LCTRL M T H E C SPACE C S L"
|
||||
StartupMenuButtonTimeout=3000
|
||||
HiddenMenuOptions='KeyboardConfigMainMenu ScreenKeyboardThemeConfig ScreenKeyboardTransparencyConfig'
|
||||
MultiABI=n
|
||||
AppVersionCode=235014
|
||||
AppVersionName="2350.14"
|
||||
|
||||
Reference in New Issue
Block a user