Merge branch 'remove-sdl' of https://github.com/SDLash3D/xash3d-android-project into remove-sdl
This commit is contained in:
commit
276afa836b
7 changed files with 89 additions and 31 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 973f8686e0884c04f79eb0265f3a7ce2bc3235ad
|
Subproject commit a581d08683dd5c6b5695cc334acd9d5d56b23f31
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -7,20 +7,20 @@
|
||||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||||
android:paddingTop="@dimen/activity_vertical_margin"
|
android:paddingTop="@dimen/activity_vertical_margin"
|
||||||
tools:context="in.celest.xash3dVR.FPicker">
|
tools:context="in.celest.xash3dVR.FPicker"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/FileView"
|
android:id="@+id/FileView"
|
||||||
android:layout_above="@+id/button2" />
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/folder"
|
android:text="@string/folder"
|
||||||
android:id="@+id/button_fpicker_select"
|
android:id="@+id/button_fpicker_select"
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:onClick="onFileClick" />
|
android:onClick="onFileClick" />
|
||||||
</RelativeLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -97,6 +97,15 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:weightSum="1">
|
android:weightSum="1">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:text="@string/volume"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
<ToggleButton
|
<ToggleButton
|
||||||
android:id="@+id/useVolume"
|
android:id="@+id/useVolume"
|
||||||
|
@ -125,6 +134,17 @@
|
||||||
<!--android:id="@+id/Tracking"/>-->
|
<!--android:id="@+id/Tracking"/>-->
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView_path"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:text="@string/text_res_path"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/button_select"
|
android:id="@+id/button_select"
|
||||||
|
@ -137,8 +157,16 @@
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:onClick="selectFolder"
|
android:onClick="selectFolder"
|
||||||
android:text="@string/select_folder" />
|
android:text="@string/select_folder" />
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button_shortcut"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:onClick="createShortcut"
|
||||||
|
android:text="@string/create_shortcut_button" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -203,7 +231,6 @@
|
||||||
android:layout_marginTop="3dp" />
|
android:layout_marginTop="3dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView_path"
|
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
|
@ -213,6 +240,7 @@
|
||||||
android:text="@string/text_res_path"
|
android:text="@string/text_res_path"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/cmdPath"
|
android:id="@+id/cmdPath"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -223,19 +251,19 @@
|
||||||
android:layout_marginTop="3dp" />
|
android:layout_marginTop="3dp" />
|
||||||
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/button_shortcut"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="3dp"
|
||||||
android:onClick="createShortcut"
|
android:text="Pixel format"
|
||||||
android:text="@string/create_shortcut_button" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/pixelSpinner"
|
android:id="@+id/pixelSpinner"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="10dp"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
<string name="cmd_args_text">Аргументы командной строки(только для экспертов)</string>
|
<string name="cmd_args_text">Аргументы командной строки(только для экспертов)</string>
|
||||||
<string name="launch_button">Запустить Xash3D</string>
|
<string name="launch_button">Запустить Xash3D</string>
|
||||||
<string name="use_controls">Включить экранное управление</string>
|
<string name="use_controls">Включить экранное управление</string>
|
||||||
<string name="use_volume">Использовать кнопки громкости</string>
|
<string name="volume">Действие кнопок громкости</string>
|
||||||
|
<string name="use_volume">Регулировка громкости</string>
|
||||||
|
<string name="no_volume">Использовать в игре</string>
|
||||||
<string name="text_res_path">Путь к ресурсам игры</string>
|
<string name="text_res_path">Путь к ресурсам игры</string>
|
||||||
<string name="touch_set">Настройки управления</string>
|
<string name="touch_set">Настройки управления</string>
|
||||||
<string name="text_shortcut">Ярлык Xash3D</string>
|
<string name="text_shortcut">Ярлык Xash3D</string>
|
||||||
|
@ -26,4 +28,6 @@
|
||||||
<string name="action_settings">Настройки</string>
|
<string name="action_settings">Настройки</string>
|
||||||
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
|
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
|
||||||
<string name="create_shortcut_button">Создать ярлык</string>
|
<string name="create_shortcut_button">Создать ярлык</string>
|
||||||
|
<string name="select_folder">Выбрать</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -35,13 +35,14 @@ Special thanks to:\n
|
||||||
• <a href="https://github.com/SDLash3D">GitHub</a></string>
|
• <a href="https://github.com/SDLash3D">GitHub</a></string>
|
||||||
<string name="about_button">About Xash3D Android</string>
|
<string name="about_button">About Xash3D Android</string>
|
||||||
<string name="create_shortcut_button">Create mod shortcut</string>
|
<string name="create_shortcut_button">Create mod shortcut</string>
|
||||||
<string name="select_folder">(select)</string>
|
<string name="select_folder">Select folder</string>
|
||||||
|
|
||||||
<string name="text_tab1">Normal</string>
|
<string name="text_tab1">Normal</string>
|
||||||
<string name="text_tab2">Advanced</string>
|
<string name="text_tab2">Advanced</string>
|
||||||
<string name="text_res_tittle2">Normal settings</string>
|
<string name="text_res_tittle2">Normal settings</string>
|
||||||
<string name="text_res_tittle3">Advanced settings</string>
|
<string name="text_res_tittle3">Advanced settings</string>
|
||||||
<string name="use_volume">Gamepad support off!</string>
|
<string name="volume">Volume buttons mode</string>
|
||||||
<string name="no_volume">Gamepad support active!</string>
|
<string name="use_volume">Default action</string>
|
||||||
|
<string name="no_volume">Use in game</string>
|
||||||
<string name="folder">Set current folder</string>
|
<string name="folder">Set current folder</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -10,6 +10,8 @@ import android.view.View;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
@ -40,6 +42,7 @@ public class LauncherActivity extends Activity {
|
||||||
static EditText resPath;
|
static EditText resPath;
|
||||||
static SharedPreferences mPref;
|
static SharedPreferences mPref;
|
||||||
static Spinner pixelSpinner;
|
static Spinner pixelSpinner;
|
||||||
|
static TextView tvResPath;
|
||||||
String getDefaultPath()
|
String getDefaultPath()
|
||||||
{
|
{
|
||||||
File dir = Environment.getExternalStorageDirectory();
|
File dir = Environment.getExternalStorageDirectory();
|
||||||
|
@ -72,12 +75,12 @@ public class LauncherActivity extends Activity {
|
||||||
tabHost.addTab(tabSpec);
|
tabHost.addTab(tabSpec);
|
||||||
|
|
||||||
final String[] list = {
|
final String[] list = {
|
||||||
"RGBA8888",
|
"32 bit (RGBA8888)",
|
||||||
"RGBA888",
|
"24 bit (RGB888)",
|
||||||
"RGB565",
|
"16 bit (RGB565)",
|
||||||
"RGBA5551",
|
"15 bit (RGBA5551)",
|
||||||
"RGBA4444",
|
"12 bit (RGBA4444)",
|
||||||
"RGB332"
|
"8 bit (RGB332)"
|
||||||
};
|
};
|
||||||
pixelSpinner = (Spinner) findViewById(R.id.pixelSpinner);
|
pixelSpinner = (Spinner) findViewById(R.id.pixelSpinner);
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);
|
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);
|
||||||
|
@ -117,10 +120,26 @@ public class LauncherActivity extends Activity {
|
||||||
useVolume = ( ToggleButton ) findViewById( R.id.useVolume );
|
useVolume = ( ToggleButton ) findViewById( R.id.useVolume );
|
||||||
useVolume.setChecked(mPref.getBoolean("usevolume",true));
|
useVolume.setChecked(mPref.getBoolean("usevolume",true));
|
||||||
resPath = ( EditText ) findViewById( R.id.cmdPath );
|
resPath = ( EditText ) findViewById( R.id.cmdPath );
|
||||||
resPath.setText(mPref.getString("basedir", getDefaultPath()));
|
tvResPath = ( TextView ) findViewById( R.id.textView_path );
|
||||||
|
updatePath(mPref.getString("basedir", getDefaultPath()));
|
||||||
|
resPath.setOnFocusChangeListener( new View.OnFocusChangeListener()
|
||||||
|
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus)
|
||||||
|
{
|
||||||
|
updatePath( resPath.getText().toString() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
pixelSpinner.setSelection(mPref.getInt("pixelformat", 0));
|
pixelSpinner.setSelection(mPref.getInt("pixelformat", 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updatePath( String text )
|
||||||
|
{
|
||||||
|
tvResPath.setText(getResources().getString(R.string.text_res_path) + ":\n" + text );
|
||||||
|
resPath.setText(text);
|
||||||
|
|
||||||
|
}
|
||||||
public void startXash(View view)
|
public void startXash(View view)
|
||||||
{
|
{
|
||||||
Intent intent = new Intent(this, XashActivity.class);
|
Intent intent = new Intent(this, XashActivity.class);
|
||||||
|
@ -163,8 +182,9 @@ public void onActivityResult(int requestCode, int resultCode, Intent resultData)
|
||||||
if (resultCode == RESULT_OK) {
|
if (resultCode == RESULT_OK) {
|
||||||
try{
|
try{
|
||||||
|
|
||||||
resPath = ( EditText ) findViewById( R.id.cmdPath );
|
if( resPath == null )
|
||||||
resPath.setText( resultData.getStringExtra("GetPath"));
|
return;
|
||||||
|
updatePath( resultData.getStringExtra("GetPath"));
|
||||||
|
|
||||||
// final List<String> paths = resultData.getData().getPathSegments();
|
// final List<String> paths = resultData.getData().getPathSegments();
|
||||||
// String[] parts = paths.get(1).split(":");
|
// String[] parts = paths.get(1).split(":");
|
||||||
|
|
|
@ -40,6 +40,7 @@ public class XashActivity extends Activity {
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
public static SharedPreferences mPref = null;
|
public static SharedPreferences mPref = null;
|
||||||
|
private static boolean mUseVolume;
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
private static Thread mAudioThread;
|
private static Thread mAudioThread;
|
||||||
|
@ -125,6 +126,7 @@ public class XashActivity extends Activity {
|
||||||
InstallReceiver.extractPAK(this, false);
|
InstallReceiver.extractPAK(this, false);
|
||||||
|
|
||||||
mPixelFormat = mPref.getInt("pixelformat", 0);
|
mPixelFormat = mPref.getInt("pixelformat", 0);
|
||||||
|
mUseVolume = mPref.getBoolean("usevolume", false);
|
||||||
AndroidBug5497Workaround.assistActivity(this);
|
AndroidBug5497Workaround.assistActivity(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,6 +213,9 @@ public class XashActivity extends Activity {
|
||||||
public static boolean handleKey( int keyCode, KeyEvent event )
|
public static boolean handleKey( int keyCode, KeyEvent event )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ( mUseVolume && ( keyCode == KeyEvent.KEYCODE_VOLUME_DOWN ||
|
||||||
|
keyCode == KeyEvent.KEYCODE_VOLUME_UP ) )
|
||||||
|
return false;
|
||||||
//Log.d( TAG, "Keycode " + keyCode );
|
//Log.d( TAG, "Keycode " + keyCode );
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
if (event.getAction() == KeyEvent.ACTION_DOWN)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue