OpenTyrian: Volume Up/Down keys navigate menu, mouse click will exit Enter High Score screen

This commit is contained in:
pelya
2010-09-20 15:53:04 +03:00
parent c8cdb9455e
commit f99fd72f38
22 changed files with 65 additions and 36 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sourceforge.sc2"
android:versionCode="1008"
android:versionName="1.0.08 - added 3DO voice pack, speed optimizations, UQM music remix packs do not work yet"
package="com.googlecode.opentyrian"
android:versionCode="2110"
android:versionName="2.1.10 - minor fixes here and there"
android:installLocation="preferExternal"
>
<application android:label="@string/app_name"

View File

@@ -1,6 +1,6 @@
# The namespace in Java file, with dots replaced with underscores
SDL_JAVA_PACKAGE_PATH := com_sourceforge_sc2
SDL_JAVA_PACKAGE_PATH := com_googlecode_opentyrian
# Path to shared libraries - Android 1.6 cannot load them properly, thus we have to specify absolute path here
# SDL_SHARED_LIBRARIES_PATH := /data/data/de.schwardtnet.alienblaster/lib
@@ -10,7 +10,7 @@ SDL_JAVA_PACKAGE_PATH := com_sourceforge_sc2
# Typically /sdcard/alienblaster
# Or /data/data/de.schwardtnet.alienblaster/files if you're planning to unpack data in application private folder
# Your application will just set current directory there
SDL_CURDIR_PATH := com.sourceforge.sc2
SDL_CURDIR_PATH := com.googlecode.opentyrian
# Android Dev Phone G1 has trackball instead of cursor keys, and
# sends trackball movement events as rapid KeyDown/KeyUp events,
@@ -23,17 +23,17 @@ SDL_TRACKBALL_KEYUP_DELAY := 1
# resized in HW-accelerated way, however it eats a tiny bit of CPU
SDL_VIDEO_RENDER_RESIZE := 1
COMPILED_LIBRARIES := sdl_image
COMPILED_LIBRARIES := sdl_net
APPLICATION_ADDITIONAL_CFLAGS := -O2 -finline-functions -DTHREADLIB_SDL=1 -DTIMELIB=SDL -DOVCODEC_TREMOR=1 -DNETPLAY=1 -DHAVE_REGEX=1 -DHAVE_GETOPT_LONG=1 -DHAVE_ZIP=1
APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2
APPLICATION_ADDITIONAL_LDFLAGS := -Lobj/local/armeabi -ltremor
APPLICATION_ADDITIONAL_LDFLAGS :=
APPLICATION_SUBDIRS_BUILD :=
APPLICATION_CUSTOM_BUILD_SCRIPT :=
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=RETURN -DSDL_ANDROID_KEYCODE_1=RSHIFT -DSDL_ANDROID_KEYCODE_2=KP_PLUS -DSDL_ANDROID_KEYCODE_3=KP_MINUS -DSDL_ANDROID_KEYCODE_4=ESCAPE -DSDL_ANDROID_KEYCODE_5=F10
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=SPACE -DSDL_ANDROID_KEYCODE_1=RETURN -DSDL_ANDROID_KEYCODE_2=LCTRL -DSDL_ANDROID_KEYCODE_3=LALT -DSDL_ANDROID_KEYCODE_4=SPACE
# If SDL_Mixer should link to libMAD
SDL_MIXER_USE_LIBMAD :=

View File

@@ -5,6 +5,6 @@ APP_PROJECT_PATH := $(call my-dir)/..
# sdl_image depends on png and jpeg
# sdl_ttf depends on freetype
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_image
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_net
APP_ABI := armeabi

View File

@@ -1,4 +1,5 @@
AppSettingVersion=6
# The application settings for Android libSDL port
AppSettingVersion=8
LibSdlVersion=1.2
AppName="OpenTyrian"
AppFullName=com.googlecode.opentyrian
@@ -14,9 +15,11 @@ RedefinedKeys="SPACE RETURN LCTRL LALT SPACE"
AppTouchscreenKeyboardKeysAmount=4
AppTouchscreenKeyboardKeysAmountAutoFire=1
MultiABI=n
AppVersionCode=2109
AppVersionName="2.1.09"
AppVersionCode=2110
AppVersionName="2.1.10 - minor fixes here and there, menu navigation with Volume Up/Down keys, use Menu button to select"
CompiledLibraries="sdl_net"
CustomBuildScript=n
AppCflags='-finline-functions -O2'
AppLdflags=''
AppSubdirsBuild=''
ReadmeText='^You may press "Home" now - the data will be downloaded in background'

View File

@@ -840,7 +840,7 @@ enum de_mode_t JE_modeSelect( void )
{
break; /* User has selected, return choice */
}
if (keysactive[SDLK_UP])
if (keysactive[SDLK_UP] || keysactive[SDLK_LCTRL])
{
if(mode == MODE_FIRST)
{
@@ -854,7 +854,7 @@ enum de_mode_t JE_modeSelect( void )
mode--;
}
}
if (keysactive[SDLK_DOWN])
if (keysactive[SDLK_DOWN] || keysactive[SDLK_LALT])
{
if(mode >= MODE_LAST-1)
{

View File

@@ -1030,13 +1030,13 @@ void JE_itemScreen( void )
joystick_down |= joystick[j].direction[2];
}
if (keysactive[SDLK_UP] || joystick_up)
if (keysactive[SDLK_UP] || keysactive[SDLK_LCTRL] || joystick_up)
{
yChg = -1;
inputDetected = false;
}
if (keysactive[SDLK_DOWN] || joystick_down)
if (keysactive[SDLK_DOWN] || keysactive[SDLK_LALT] || joystick_down)
{
yChg = 1;
inputDetected = false;
@@ -1310,6 +1310,7 @@ void JE_itemScreen( void )
break;
case SDLK_UP:
case SDLK_LCTRL:
keyboardUsed = true;
lastDirection = -1;
@@ -1335,6 +1336,7 @@ void JE_itemScreen( void )
break;
case SDLK_DOWN:
case SDLK_LALT:
keyboardUsed = true;
lastDirection = 1;

View File

@@ -156,12 +156,14 @@ void jukebox( void )
case SDLK_LEFT:
case SDLK_UP:
case SDLK_LCTRL:
play_song((song_playing > 0 ? song_playing : MUSIC_NUM) - 1);
stopped = false;
break;
case SDLK_RETURN:
case SDLK_RIGHT:
case SDLK_DOWN:
case SDLK_LALT:
play_song((song_playing + 1) % MUSIC_NUM);
stopped = false;
break;

View File

@@ -269,6 +269,7 @@ void JE_helpSystem( JE_byte startTopic )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
menu--;
if (menu < 2)
{
@@ -277,6 +278,7 @@ void JE_helpSystem( JE_byte startTopic )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
menu++;
if (menu > TOPICS)
{
@@ -395,6 +397,7 @@ void JE_helpSystem( JE_byte startTopic )
case SDLK_LEFT:
case SDLK_UP:
case SDLK_PAGEUP:
case SDLK_LCTRL:
page--;
JE_playSampleNum(S_CURSOR);
break;
@@ -403,6 +406,7 @@ void JE_helpSystem( JE_byte startTopic )
case SDLK_PAGEDOWN:
case SDLK_RETURN:
case SDLK_SPACE:
case SDLK_LALT:
if (page == MAX_PAGE)
{
page = 0;
@@ -628,6 +632,7 @@ void JE_loadScreen( void )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
sel--;
if (sel < min)
{
@@ -636,6 +641,7 @@ void JE_loadScreen( void )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
sel++;
if (sel > max)
{
@@ -1251,6 +1257,7 @@ JE_boolean JE_inGameSetup( void )
JE_playSampleNum(S_SPRING);
break;
case SDLK_UP:
case SDLK_LCTRL:
if (--sel < 1)
{
sel = 6;
@@ -1258,6 +1265,7 @@ JE_boolean JE_inGameSetup( void )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
if (++sel > 6)
{
sel = 1;
@@ -1581,7 +1589,7 @@ void JE_highScoreCheck( void )
if (!playing)
play_song(31);
/*
if (mouseButton > 0)
{
if (mouseX > 56 && mouseX < 142 && mouseY > 123 && mouseY < 149)
@@ -1594,10 +1602,14 @@ void JE_highScoreCheck( void )
cancel = true;
}
}
else if (newkey)
else
*/
if (newkey || newmouse)
{
bool validkey = false;
lastkey_char = toupper(lastkey_char);
if(mouse_pressed[0])
lastkey_char = SDLK_SPACE;
switch(lastkey_char)
{
//case ' ':

View File

@@ -62,6 +62,7 @@ bool select_gameplay( void )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
gameplay--;
if (gameplay < 1)
{
@@ -70,6 +71,7 @@ bool select_gameplay( void )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
gameplay++;
if (gameplay > gameplay_max)
{
@@ -139,6 +141,7 @@ bool select_episode( void )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
episode--;
if (episode < 1)
{
@@ -147,6 +150,7 @@ bool select_episode( void )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
episode++;
if (episode > episode_max)
{
@@ -225,6 +229,7 @@ bool select_difficulty( void )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
difficultyLevel--;
if (difficultyLevel < 1)
{
@@ -233,6 +238,7 @@ bool select_difficulty( void )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
difficultyLevel++;
if (difficultyLevel > difficulty_max)
{

View File

@@ -126,6 +126,7 @@ void opentyrian_menu( void )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
sel--;
if (sel < 0)
{
@@ -134,6 +135,7 @@ void opentyrian_menu( void )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
sel++;
if (sel > maxSel)
{

View File

@@ -3547,6 +3547,7 @@ bool JE_titleScreen( JE_boolean animate )
switch (lastkey_sym)
{
case SDLK_UP:
case SDLK_LCTRL:
if (menu == 0)
menu = menunum-1;
else
@@ -3554,6 +3555,7 @@ bool JE_titleScreen( JE_boolean animate )
JE_playSampleNum(S_CURSOR);
break;
case SDLK_DOWN:
case SDLK_LALT:
if (menu == menunum-1)
menu = 0;
else

View File

@@ -1 +1 @@
sc2
opentyrian

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Ur-Quan Masters</string>
<string name="app_name">OpenTyrian</string>
</resources>

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import android.app.Activity;
import android.content.Context;

View File

@@ -1,6 +1,6 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change
// spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import java.util.zip.*;
import java.io.*;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import android.app.Activity;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import android.app.Activity;
import android.content.Context;

View File

@@ -18,7 +18,7 @@
fixed with a hammer and rasp to work with libSDL port */
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import java.io.Writer;
import java.util.ArrayList;

View File

@@ -1,14 +1,14 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import android.app.Activity;
import android.content.Context;
class Globals {
public static String ApplicationName = "Ur-QuanMasters";
public static String ApplicationName = "OpenTyrian";
// Should be zip file
public static String DataDownloadUrl = "Game data is 14 Mb|https://sites.google.com/site/xpelyax/Home/sc2-data.zip?attredirects=0%26d=1|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/sc2-data.zip/download|http://sitesproxy.goapk.com/site/xpelyax/Home/sc2-data.zip^3DO remixed music (19 Mb) - enable it in Setup->Sound Options->3DO Remixes|:addons/3domusic/3domusic.zip:https://sites.google.com/site/xpelyax/Home/3domusic.zip?attredirects=0%26d=1|:addons/3domusic/3domusic.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3domusic.zip/download|:addons/3domusic/3domusic.zip:http://sitesproxy.goapk.com/site/xpelyax/Home/3domusic.zip^UQM music remix pack 1 (50 Mb) - enable it in Setup->Sound Options->UQM Remixes|:addons/remix/uqm-remix-pack1.zip:http://sourceforge.net/projects/sc2/files/UQM%20Remix%20Packs/UQM%20Remix%20Pack%201/uqm-remix-pack1.zip/download^UQM music remix pack 2 (60 Mb)|:addons/remix/uqm-remix-pack2.zip:http://sourceforge.net/projects/sc2/files/UQM%20Remix%20Packs/UQM%20Remix%20Pack%202/uqm-remix-pack2.zip/download^UQM music remix pack 3 (40 Mb)|:addons/remix/uqm-remix-pack3.zip:http://sourceforge.net/projects/sc2/files/UQM%20Remix%20Packs/UQM%20Remix%20Pack%203/uqm-remix-pack3.zip/download^3DO voice (115 Mb) - go to Setup->Sound Options and increase Voice volume from zero|:addons/3dovoice/3dovoice.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovoice.zip/download";
public static String DataDownloadUrl = "Data files size is 11 Mb|http://sites.google.com/site/xpelyax/Home/tyrian21-data.zip?attredirects=0%26d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/tyrian21-data.zip";
// 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;
@@ -19,7 +19,7 @@ class Globals {
// 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 boolean AppUsesMouse = false;
public static boolean AppUsesMouse = true;
public static boolean AppNeedsArrowKeys = true;
@@ -27,9 +27,9 @@ class Globals {
public static boolean AppUsesMultitouch = false;
public static int AppTouchscreenKeyboardKeysAmount = 2;
public static int AppTouchscreenKeyboardKeysAmount = 4;
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 2;
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
// Phone-specific config
// It will download app data to /sdcard/alienblaster if set to true,
@@ -48,5 +48,5 @@ class Globals {
}
class LoadLibrary {
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_image"); };
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_net"); };
}

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import android.app.Activity;
import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import android.app.Activity;
import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2;
package com.googlecode.opentyrian;
import javax.microedition.khronos.opengles.GL10;