Merge autoupdate to remove-sdl

This commit is contained in:
a1batross 2016-07-26 17:07:01 +06:00
commit 1195c1b96b
13 changed files with 573 additions and 607 deletions

View file

@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-21
target=android-13

View file

@ -1,337 +1,260 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_shortcut"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#252525"
android:weightSum="1"
tools:context="in.celest.xash3d.LauncherActivity">
<TextView
android:id="@+id/textView_tittle"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginBottom="1dp"
android:layout_marginLeft="5dp"
android:background="#555555"
android:layout_marginRight="5dp"
android:layout_marginTop="20dp"
android:text="@string/launcher_name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25sp"
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="10dp"
android:singleLine="true"
android:gravity="center_vertical" />
<TabHost
android:id="@+id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.20"
android:paddingBottom="10dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#555555"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:showDividers="middle"></TabWidget>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView2" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="25dp"
android:background="#333333"
android:orientation="vertical"
android:text="@string/text_tab1"
android:weightSum="0.6">
<TextView
android:id="@+id/textView_path1"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:background="#444444"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/text_res_tittle2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical|center_horizontal" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#444444"
android:orientation="vertical"
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
android:id="@+id/useVolume"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="nothing"
android:textOff="@string/no_volume"
android:textOn="@string/use_volume" />
<!--<CheckBox-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_width="match_parent"-->
<!--android:textAppearance="?android:attr/textAppearanceMedium"-->
<!--android:text="@string/use_volume"-->
<!--android:id="@+id/useVolume"/>-->
<!--<CheckBox-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_width="match_parent"-->
<!--android:textAppearance="?android:attr/textAppearanceMedium"-->
<!--android:text="@string/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
android:id="@+id/button_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:onClick="selectFolder"
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>
<LinearLayout
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#333333"
android:orientation="vertical"
android:text="@string/text_tab2">
<TextView
android:id="@+id/textView_path2"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:background="#444444"
android:layout_marginRight="10dp"
android:layout_marginTop="13dp"
android:text="@string/text_res_tittle3"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical|center_horizontal" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#444444"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:id="@+id/textView_args"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:text="@string/cmd_args_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/cmdArgs"
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="3dp" />
<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/text_res_path"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/cmdPath"
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="3dp" />
<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="Pixel format"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/pixelSpinner"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"/>
<ToggleButton
android:id="@+id/enableResizeWorkaround"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="enableResizeWorkaround"
android:textOff="Keyboard does not resize screen"
android:textOn="Keyboard resizes screen" />
<TextView
android:id="@+id/textView7"
android:layout_marginBottom="10dp"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:clickable="false" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>
</LinearLayout>
</TabHost>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#444444"
android:layout_marginBottom="-20dp"
android:paddingTop="5dp"
android:layout_gravity="bottom"
android:orientation="horizontal">
<Button
android:id="@+id/button_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:onClick="aboutXash"
android:text="@string/about_button" />
<Button
android:id="@+id/button_launch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="6"
android:layout_marginLeft="0dp"
android:layout_weight="0.87"
android:onClick="startXash"
android:text="@string/launch_button" />
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_shortcut"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#252525"
android:weightSum="1"
tools:context="in.celest.xash3d.LauncherActivity" >
<TextView
android:id="@+id/textView_tittle"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginBottom="1dp"
android:layout_marginLeft="5dp"
android:background="#555555"
android:layout_marginRight="5dp"
android:layout_marginTop="20dp"
android:text="@string/launcher_name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25sp"
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="10dp"
android:singleLine="true"
android:gravity="center_vertical" />
<TabHost
android:id="@+id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.20"
android:paddingBottom="10dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#555555"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:showDividers="middle" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView2">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="25dp"
android:background="#333333"
android:orientation="vertical"
android:text="@string/text_tab1"
android:weightSum="0.6">
<TextView
android:id="@+id/textView_path1"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:background="#444444"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/text_res_tittle2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical|center_horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#444444"
android:orientation="vertical"
android:weightSum="1">
<ToggleButton
android:id="@+id/useVolume"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="nothing"
android:textOff="@string/no_volume"
android:textOn="@string/use_volume" />
<Button
android:id="@+id/button_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:onClick="selectFolder"
android:text="@string/select_folder" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#333333"
android:orientation="vertical"
android:text="@string/text_tab2">
<TextView
android:id="@+id/textView_path2"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:background="#444444"
android:layout_marginRight="10dp"
android:layout_marginTop="13dp"
android:text="@string/text_res_tittle3"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical|center_horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#444444"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:id="@+id/textView_args"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:text="@string/cmd_args_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/cmdArgs"
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="3dp" />
<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" />
<EditText
android:id="@+id/cmdPath"
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="3dp" />
<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" />
<Spinner
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:id="@+id/pixelSpinner"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp" />
<ToggleButton
android:id="@+id/enableResizeWorkaround"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="enableResizeWorkaround"
android:textOff="Keyboard does not resize screen"
android:textOn="Keyboard resizes screen" />
<CheckBox
android:id="@+id/check_updates"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/update_button" />
<TextView
android:id="@+id/textView7"
android:layout_marginBottom="10dp"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:clickable="false" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>
</LinearLayout>
</TabHost>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#444444"
android:layout_marginBottom="-20dp"
android:paddingTop="5dp"
android:layout_gravity="bottom"
android:orientation="horizontal">
<Button
android:id="@+id/button_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:onClick="aboutXash"
android:text="@string/about_button" />
<Button
android:id="@+id/button_launch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="6"
android:layout_marginLeft="0dp"
android:layout_weight="0.87"
android:onClick="startXash"
android:text="@string/launch_button" />
</LinearLayout>
</LinearLayout>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Xash3D starten!</string>
<string name="cmd_args_text">Command line arguments(experts only)</string>
<string name="use_controls">Touch Kontroller aktivieren</string>
@ -19,7 +14,6 @@
<string name="shortcut_name">Kurzbefehl Name</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">SDLash3D steht in keinem Zusammenhang zu Valve oder einem ihrer Partners. All copyrights reserved to their respective owners.</string>
<string name="about_authors">Portierung auf Android by SDLash3D team: \n
&#8226; a1batross\n
@ -30,9 +24,9 @@ Spezieller Dank an:\n
&#8226; Uncle Mike für Xash3D engine\n
&#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n</string>
<string name="about_links">Folge uns auf:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
<string name="about_links">Folge uns auf:\n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Über Xash3D Android</string>
<string name="create_shortcut_button">mod Kurzbefehl ersellen</string>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">¡Iniciar Xash3D!</string>
<string name="cmd_args_text">Parámetros de línea de comandos(sólo expertos)</string>
<string name="use_controls">Activar controles táctiles</string>
@ -18,10 +13,7 @@
<string name="pkgname">Nombre del paquete del mod (sólo expertos)</string>
<string name="shortcut_name">Nombre del acceso directo</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">SDLash3D no está afiliado con Valve o cualquiera de sus socios. Todos los derechos reservados a sus respectivos dueños.</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">Adaptación para Android por SDLash3D team: \n
&#8226; a1batross\n
&#8226; mittorn \n
@ -31,9 +23,9 @@ Especial agradecimiento a:\n
&#8226; Uncle Mike por Xash3D engine\n
&#8226; Valve por Half-Life\n
&#8226; Desarrolladores de libSDL2.\n</string>
<string name="about_links">Siguenos en:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
<string name="about_links">Siguenos en: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Acerca de Xash3D Android</string>
<string name="create_shortcut_button">Crear acceso directo del mod</string>

View file

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (آزمایشی)</string>
<string name="launch_button">!Xash3Dاجرای</string>
<string name="cmd_args_text">دستورات خط فرمان (فقط برای حرفه ای ها):</string>
<string name="use_controls">فعال کردن کنترل های لمسی</string>
@ -15,11 +12,9 @@
<string name="gamedir">مسیر مود</string>
<string name="pkgname">نام بسته مود (فقط برای حرفه ای ها):</string>
<string name="shortcut_name">نام میانبر</string>
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">یا شرکای آن ندارد. تمامی حقوق کپی برای صاحبان هر کدام محفوظ است. Valve هیچ نسبتی با SDLash3D</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">:SDLash3D پورت شده به اندروید توسط تیم \n • a1batross\n • mittorn \n • nicknekit.\n تشکر ویژه از:\n • Xash3Dبرای موتور Uncle Mike\n • Half-Life برای Valve\n • libSDL2 توسعه دهندگان.\n</string>
<string name="about_links">ما را دنبال کنید در : •<a href="https://vk.com/xashdroid">VK</a><a href="http://moddb.com/game/xash3d-android">ModDB</a><a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_links">ما را دنبال کنید در :\n<a href="https://vk.com/xashdroid">VK</a>\n<a href="http://moddb.com/game/xash3d-android">ModDB</a>\n<a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Xash3D Android درباره</string>
<string name="create_shortcut_button">ایجاد میانبر مود</string>
<string name="select_folder">(انتخاب)</string>

View file

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (테스트)</string>
<string name="launch_button">Xash3D 실행!</string>
<string name="cmd_args_text">커멘드 라인 입력(고급 설정)</string>
<string name="use_controls">터치 컨트롤 사용</string>
@ -17,7 +13,6 @@
<string name="gamedir">모드 디렉토리</string>
<string name="pkgname">모드 패키지 이름(고급설정)</string>
<string name="shortcut_name">바로가기 이름</string>
<string name="about_main">Xash3D 안드로이드</string>
<string name="about_copyright">우리 SDLash3D는 밸브와 상업적으로 관련이 없습니다. 모든 저작권은 소유주로 보류되어있음을 알립니다..</string>
<string name="about_authors">안드로이드 이식 by SDLash3D팀: \n
• a1batross\n
@ -29,9 +24,9 @@
• 밸브의 하프라이프\n
• libSDL2 개발자분들\n
• 한글화 byAIC from X3A NaverCafe</string>
<string name="about_links">
여기서 우리를: • <a href="https://vk.com/xashdroid">VK</a>
<a href="http://moddb.com/game/xash3d-android">모드디비</a>
<string name="about_links">\n
여기서 우리를: • <a href="https://vk.com/xashdroid">VK</a>\n
<a href="http://moddb.com/game/xash3d-android">모드디비</a>\n
<a href="https://github.com/SDLash3D">깃허브</a>
</string>
<string name="about_button">Xash3D 안드로이드 정보</string>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Iniciar Xash3D!</string>
<string name="cmd_args_text">Argumentos de linha de comando(apenas expecialistas)</string>
<string name="use_controls">Habilitar controles de touch</string>
@ -18,10 +13,7 @@
<string name="pkgname">Nome do pacote de Mod (apenas expecialistas)</string>
<string name="shortcut_name">Nome do atalho</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">SDLash3D não é afiliado com a Valve ou qualquer um dos seus parceiros. Todos os direitos autorais reservados aos respectivos proprietários.</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">Porta para android pelo time SDLash3D: \n
&#8226; a1batross\n
&#8226; mittorn \n
@ -31,9 +23,9 @@ Agradecimentos especiais para:\n
&#8226; Uncle Mike pelo motor Xash3D\n
&#8226; Valve pelo Half-Life\n
&#8226; Desenvolvedores libSDL2.\n</string>
<string name="about_links">Siga-nos no:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
<string name="about_links">Siga-nos no:\n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Sobre Android Xash3D</string>
<string name="create_shortcut_button">Criar atalho para o mod</string>

View file

@ -1,33 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--<string name="app_name" translatable="false">Xash3D</string>
<string name="launcher_name" translatable="false">Xash3D</string>
<string name="launcher_name_test" translatable="false">Xash3D (test)</string>
<string name="version_string" translatable="false">v0.17.1</string>-->
<string name="launch_button">Запустить Xash3D</strin g>
<string name="cmd_args_text">Аргументы командной строки(только для экспертов)</string>
<<<<<<< HEAD
<string name="launch_button">Запустить Xash3D</string>
<string name="use_controls">Включить экранное управление</string>
<string name="volume">Действие кнопок громкости</string>
<string name="use_volume">Регулировка громкости</string>
<string name="no_volume">Использовать в игре</string>
=======
>>>>>>> autoupdate
<string name="text_res_path">Путь к ресурсам игры</string>
<string name="touch_set">Настройки управления</string>
<string name="text_shortcut">Ярлык Xash3D</string>
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
<string name="shortcut_button_save">Сохранить ярлык</string>
<string name="gamedir">Каталог мода</string>
<string name="pkgname">Пакет мода (только для экспертов)</string>
<string name="shortcut_name">Название ярлыка</string>
<string name="about_authors">Порт на Android осуществлен командой SDLash3D:\n
&#8226; a1batross\n
&#8226; mittorn\n
&#8226; nicknekit\n
Особые благодарности:\n
&#8226; Дяде Мише за Xash3D\n
&#8226; Valve за Half-Life\n
&#8226; Beloko Games за поддержку сенсорного управления\n
&#8226; Разработчикам libSDL2</string>
<string name="about_button">О Xash3D Android</string>
<!--<string name="about_main" translatable="false">Xash3D Android</string>-->
<string name="about_copyright">SDLash3D не связан с Valve или с любыми из их партнеров. Все авторские права принадлежат их соотвественным обладателям.</string>
<string name="action_settings">Настройки</string>
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
<string name="create_shortcut_button">Создать ярлык</string>
<string name="select_folder">Выбрать</string>
<!-- Seems Android skips any line breaks and tabs here. -->
<string name="about_authors">
Порт на Android осуществлен командой SDLash3D:\n
&#8226; a1batross\n
&#8226; mittorn\n
&#8226; nicknekit\n
Особые благодарности:\n
&#8226; Дяде Мише за Xash3D\n
&#8226; Valve за Half-Life\n
&#8226; Разработчикам libSDL2
</string>
<string name="about_links">
Подпишись на нас: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a>
</string>
<string name="about_button">О Xash3D Android</string>
<string name="create_shortcut_button">Создать ярлык</string>
<string name="select_folder">Выбрать путь игровых файлов</string>
<string name="text_tab1">Стандартный</string>
<string name="text_tab2">Продвинутый</string>
<string name="text_res_tittle2">Стандартные настройки</string>
<string name="text_res_tittle3">Продвинутые настройки</string>
<string name="use_volume">Использовать кнопки громкости</string>
<string name="no_volume">Не использовать кнопки громкости</string>
<string name="folder">Выбрать текущий каталог</string>
<string name="update_button">Проверять обновления при запуске</string>
<string name="update_message">%s доступен! Скачай его сейчас!</string>
<string name="update">Обновить</string>
<string name="cancel">Отмена</string>
<string name="no_updates">Обновления не найдены</string>
<string name="checking_updates">Работаю...</string>-
>>>>>>> autoupdate
</resources>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Xash3D\'yi Başlat!</string>
<string name="cmd_args_text">Komut satırı parametreleri(uzmanlar için)</string>
<string name="use_controls">Dokunmatik kontrolleri etkinleştir</string>
@ -18,8 +13,6 @@
<string name="pkgname">Mod\'un paket adı (uzmanlar için)</string>
<string name="shortcut_name">Kısayol adı</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">SDLash3D, Valve veya Valve\'ın herhangi bir partnerine bağlı değildir. Tüm telif hakları kendi sahiplerine aittir.</string>
<string name="about_authors">SDLash3D takımından Android Port\'u: \n
&#8226; a1batross\n
@ -30,9 +23,9 @@
&#8226; Uncle Mike for Xash3D engine\n
&#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n</string>
<string name="about_links">Bizi buralardan takip edin:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
<string name="about_links">Bizi buralardan takip edin: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Xash3D Android Hakkında</string>
<string name="create_shortcut_button">Mod kısayolu oluştur</string>

View file

@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Запустити Xash3D</string>
<string name="cmd_args_text">Аргументи командного рядка(тільки для експертів)</string>
<string name="use_controls">Включити екранне управління</string>
@ -16,9 +12,6 @@
<string name="gamedir">Каталог мода</string>
<string name="pkgname">Пакет мода (тільки для експертів)</string>
<string name="shortcut_name">Назва ярлика</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">SDLash3D не пов\'язаний з Valve або з будь-якими з їх партнерів. Всі авторські права належать їх відповідним власникам.</string>
<string name="about_authors">Порт на Android здійснений командою SDLash3D:\n
&#8226; a1batross\n
@ -29,9 +22,9 @@
&#8226; Дяде Мише за Xash3D\n
&#8226; Valve за Half-Life\n
&#8226; Розробникам libSDL2.\n</string>
<string name="about_links">Слідуйте за нами в:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
<string name="about_links">Слідуйте за нами в:\n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">О Xash3D Android</string>
<string name="create_shortcut_button">Створити ярлик мода</string>

View file

@ -1,77 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">启动 Xash3D!</string>
<string name="cmd_args_text">命令行参数(高级)</string>
<string name="use_controls">启用触摸控制</string>
<string name="use_volume">使用音量键</string>
<string name="text_res_path">游戏资源路径</string>
<string name="touch_set">控制设置</string>
<string name="text_shortcut">Xash3D 快捷方式</string>
<string name="text_shortcut_test">Xash3D_test 快捷方式</string>
<string name="shortcut_button_save">保存快捷方式</string>
<string name="gamedir">Mod 目录</string>
<string name="pkgname">Mod 资源包名字(高级)</string>
<string name="shortcut_name">快捷方式名字</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">SDLash3D不隶属于Valve或其合作伙伴。 版权归各自所有。</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">由SDLash3D团队移植到Android系统成员 \n
&#8226; a1batross\n
&#8226; mittorn \n
&#8226; nicknekit.\n
特别感谢:\n
&#8226; Uncle Mike 制作的 Xash3D 引擎\n
&#8226; Valve 制作的 《半条命》\n
&#8226; libSDL2 开发商\n</string>
<string name="about_links">联系我们:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
<string name="about_links">联系我们: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">关于 Xash3D Android</string>
<string name="create_shortcut_button">创建mod快捷方式</string>
<string name="select_folder">(选择)</string>
</resources>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="app_name" translatable="false">Xash3D</string>
<string name="launcher_name" translatable="false">Xash3D</string>
<string name="launcher_name_test" translatable="false">Xash3D (test)</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="launch_button">Launch Xash3D!</string>
<string name="cmd_args_text">Command line arguments(experts only)</string>
@ -16,26 +16,29 @@
<string name="pkgname">Mod package name (experts only)</string>
<string name="shortcut_name">Shortcut name</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_main" translatable="false">Xash3D Android</string>
<string name="about_copyright">SDLash3D is not affiliated with Valve or any of their partners. All copyrights reserved to their respective owners.</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">Port to Android by SDLash3D team: \n
&#8226; a1batross\n
&#8226; mittorn \n
&#8226; nicknekit.\n
<!-- Seems Android skips any line breaks and tabs here. -->
<string name="about_authors">
Port to Android by SDLash3D team: \n
&#8226; a1batross\n
&#8226; mittorn \n
&#8226; nicknekit.\n
Special thanks to:\n
&#8226; Uncle Mike for Xash3D engine\n
&#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n</string>
<string name="about_links">Follow us in:
&#8226; <a href="https://vk.com/xashdroid">VK</a>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
&#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">About Xash3D Android</string>
Special thanks to:\n
&#8226; Uncle Mike for Xash3D engine\n
&#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n
</string>
<string name="about_links">
Follow us in: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a>
</string>
<string name="about_button">About</string>
<string name="create_shortcut_button">Create mod shortcut</string>
<string name="select_folder">Select folder</string>
<string name="select_folder">Select game data location</string>
<string name="text_tab1">Normal</string>
<string name="text_tab2">Advanced</string>
@ -45,4 +48,11 @@ Special thanks to:\n
<string name="use_volume">Default action</string>
<string name="no_volume">Use in game</string>
<string name="folder">Set current folder</string>
<string name="update_button">Check updates on start</string>
<string name="update_message">%s is available! Download it now!</string>
<string name="update">Update</string>
<string name="cancel">Cancel</string>
<string name="no_updates">No updates was found</string>
<string name="checking_updates">Working...</string>
</resources>

View file

@ -2,48 +2,69 @@ package in.celest.xash3d;
import android.app.Activity;
import android.app.Dialog;
import android.app.AlertDialog;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Build;
import android.os.Environment;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.content.Intent;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.ArrayAdapter;
import android.content.Intent;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.SharedPreferences;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.net.Uri;
import android.os.Environment;
import java.lang.reflect.Method;
import java.util.List;
import java.io.File;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.ArrayAdapter;
import android.widget.TabHost;
import android.widget.ToggleButton;
import android.widget.Toast;
import android.net.Uri;
import android.util.Log;
import java.lang.reflect.Method;
import java.util.List;
import java.io.File;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.FileOutputStream;
import java.net.URLConnection;
import java.net.URL;
import org.json.*;
import in.celest.xash3d.hl.R;
public class LauncherActivity extends Activity {
// public final static String ARGV = "in.celest.xash3d.MESSAGE";
public final static int sdk = Integer.valueOf(Build.VERSION.SDK);
public final static String UPDATE_LINK = "https://api.github.com/repos/SDLash3D/xash3d-android-project/releases/latest";
static EditText cmdArgs;
static ToggleButton useVolume;
static ToggleButton resizeWorkaround;
static CheckBox checkUpdates;
static EditText resPath;
static SharedPreferences mPref;
static Spinner pixelSpinner;
static TextView tvResPath;
String getDefaultPath()
{
File dir = Environment.getExternalStorageDirectory();
@ -51,90 +72,62 @@ public class LauncherActivity extends Activity {
return dir.getPath() + "/xash";
return "/sdcard/xash";
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//super.setTheme( 0x01030005 );
if ( sdk >= 21 )
super.setTheme( 0x01030224 );
setContentView(R.layout.activity_launcher);
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//super.setTheme( 0x01030005 );
if ( sdk >= 21 )
super.setTheme( 0x01030224 );
TabHost tabHost = (TabHost) findViewById(R.id.tabhost);
setContentView(R.layout.activity_launcher);
tabHost.setup();
TabHost tabHost = (TabHost) findViewById(R.id.tabhost);
tabHost.setup();
TabHost.TabSpec tabSpec;
tabSpec = tabHost.newTabSpec("tabtag1");
tabSpec.setIndicator(getString(R.string.text_tab1));
tabSpec.setContent(R.id.tab1);
tabHost.addTab(tabSpec);
TabHost.TabSpec tabSpec;
tabSpec = tabHost.newTabSpec("tabtag1");
tabSpec.setIndicator(getString(R.string.text_tab1));
tabSpec.setContent(R.id.tab1);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tabtag2");
tabSpec.setIndicator(getString(R.string.text_tab2));
tabSpec.setContent(R.id.tab2);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tabtag2");
tabSpec.setIndicator(getString(R.string.text_tab2));
tabSpec.setContent(R.id.tab2);
tabHost.addTab(tabSpec);
final String[] list = {
"32 bit (RGBA8888)",
"24 bit (RGB888)",
"16 bit (RGB565)",
"16 bit (RGBA5551)",
"16 bit (RGBA4444)",
"8 bit (RGB332)"
};
pixelSpinner = (Spinner) findViewById(R.id.pixelSpinner);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);
//ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, list, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
pixelSpinner.setAdapter(adapter);
Button selectFolderButton = ( Button ) findViewById( R.id.button_select );
selectFolderButton.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
selectFolder(v);
}
});
((Button)findViewById( R.id.button_launch )).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
startXash(v);
}
});
((Button)findViewById( R.id.button_shortcut )).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
createShortcut(v);
}
});
((Button)findViewById( R.id.button_about )).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
aboutXash(v);
}
});
// if ( Build.VERSION.SDK_INT < 21 )
// selectFolder.setVisibility( View.GONE );
mPref = getSharedPreferences("engine", 0);
cmdArgs = (EditText)findViewById(R.id.cmdArgs);
cmdArgs.setText(mPref.getString("argv","-dev 3 -log"));
useVolume = ( ToggleButton ) findViewById( R.id.useVolume );
useVolume.setChecked(mPref.getBoolean("usevolume",true));
resizeWorkaround = ( ToggleButton ) findViewById( R.id.enableResizeWorkaround );
resizeWorkaround.setChecked(mPref.getBoolean("enableResizeWorkaround",true));
resPath = ( EditText ) findViewById( R.id.cmdPath );
tvResPath = ( TextView ) findViewById( R.id.textView_path );
updatePath(mPref.getString("basedir", getDefaultPath()));
resPath.setOnFocusChangeListener( new View.OnFocusChangeListener()
mPref = getSharedPreferences("engine", 0);
cmdArgs = (EditText)findViewById(R.id.cmdArgs);
useVolume = (ToggleButton) findViewById( R.id.useVolume );
resPath = (EditText) findViewById( R.id.cmdPath );
checkUpdates = (CheckBox)findViewById(R.id.check_updates);
pixelSpinner = (Spinner) findViewById(R.id.pixelSpinner);
resizeWorkaround = (ToggleButton) findViewById( R.id.enableResizeWorkaround );
{
@Override
public void onFocusChange(View v, boolean hasFocus)
final String[] list = {
"RGBA8888",
"RGBA888",
"RGB565",
"RGBA5551",
"RGBA4444",
"RGB332"
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
pixelSpinner.setAdapter(adapter);
useVolume.setChecked(mPref.getBoolean("usevolume",true));
checkUpdates.setChecked(mPref.getBoolean("check_updates",true));
resPath.setText(mPref.getString("basedir", getDefaultPath()));
cmdArgs.setText(mPref.getString("argv","-dev 3 -log"));
pixelSpinner.setSelection(mPref.getInt("pixelformat", 0));
resizeWorkaround.setChecked(mPref.getBoolean("enableResizeWorkaround",true));
if(mPref.getBoolean("check_updates", true))
{
updatePath( resPath.getText().toString() );
new CheckUpdate(true).execute(UPDATE_LINK);
}
} );
pixelSpinner.setSelection(mPref.getInt("pixelformat", 0));
}
void updatePath( String text )
@ -145,29 +138,30 @@ public class LauncherActivity extends Activity {
}
public void startXash(View view)
{
Intent intent = new Intent(this, XashActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Intent intent = new Intent(this, XashActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
SharedPreferences.Editor editor = mPref.edit();
editor.putString("argv", cmdArgs.getText().toString());
editor.putBoolean("usevolume",useVolume.isChecked());
editor.putString("basedir", resPath.getText().toString());
editor.putInt("pixelformat", pixelSpinner.getSelectedItemPosition());
editor.putBoolean("enableResizeWorkaround",resizeWorkaround.isChecked());
editor.commit();
startActivity(intent);
SharedPreferences.Editor editor = mPref.edit();
editor.putString("argv", cmdArgs.getText().toString());
editor.putBoolean("usevolume",useVolume.isChecked());
editor.putString("basedir", resPath.getText().toString());
editor.putInt("pixelformat", pixelSpinner.getSelectedItemPosition());
editor.putBoolean("enableResizeWorkaround",resizeWorkaround.isChecked());
editor.putBoolean("check_updates", checkUpdates.isChecked());
editor.commit();
startActivity(intent);
}
public void aboutXash(View view)
{
final Activity a = this;
this.runOnUiThread(new Runnable() {
this.runOnUiThread(new Runnable()
{
public void run()
{
final Dialog dialog = new Dialog(a);
dialog.setContentView(R.layout.about);
dialog.setCancelable(true);
dialog.show();
}
});
@ -177,31 +171,33 @@ public class LauncherActivity extends Activity {
{
Intent intent = new Intent(this, in.celest.xash3d.FPicker.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE");
//Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE");
startActivityForResult(intent, 42);
resPath.setEnabled(false);
}
public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
if (resultCode == RESULT_OK) {
try{
if( resPath == null )
return;
updatePath( resultData.getStringExtra("GetPath"));
// final List<String> paths = resultData.getData().getPathSegments();
// String[] parts = paths.get(1).split(":");
// String storagepath = Environment.getExternalStorageDirectory().getPath() + "/";
// String path = storagepath + parts[1];
// if( path != null)
// resPath.setText( path );
resPath.setEnabled(true);
}
catch(Exception e)
public void onActivityResult(int requestCode, int resultCode, Intent resultData)
{
if (resultCode == RESULT_OK)
{
e.printStackTrace();
}
try
{
if( resPath == null )
return;
updatePath(resultData.getStringExtra("GetPath"));
// final List<String> paths = resultData.getData().getPathSegments();
// String[] parts = paths.get(1).split(":");
// String storagepath = Environment.getExternalStorageDirectory().getPath() + "/";
// String path = storagepath + parts[1];
// if( path != null)
// resPath.setText( path );
resPath.setEnabled(true);
}
catch(Exception e)
{
e.printStackTrace();
}
}
resPath.setEnabled(true);
}
@ -236,4 +232,98 @@ try{
return super.onOptionsItemSelected(item);
}
private class CheckUpdate extends AsyncTask<String, Void, String> {
InputStream is = null;
ByteArrayOutputStream os = null;
boolean mSilent;
public CheckUpdate( boolean silent )
{
mSilent = silent;
}
protected String doInBackground(String... urls) {
try
{
URL url = new URL(urls[0]);
is = url.openConnection().getInputStream();
os = new ByteArrayOutputStream();
byte[] buffer = new byte[8196];
int len;
while ((len = is.read(buffer)) > 0)
{
os.write(buffer, 0, len);
}
return os.toString();
}
catch(Exception e)
{
e.printStackTrace();
return null;
}
}
protected void onPostExecute(String result)
{
try
{
if (is != null)
{
is.close();
is = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
JSONObject obj = new JSONObject(os.toString());
try
{
if (os != null)
{
os.close();
os = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
final String version = obj.getString("tag_name");
final String url = obj.getString("html_url");
final String name = obj.getString("name");
Log.d("Xash", "Found: " + version +
", I: " + getString(R.string.version_string));
// this is an update
if( getString(R.string.version_string).compareTo(version) < 0 )
{
String dialog_message = String.format(getString(R.string.update_message), name);
AlertDialog.Builder builder = new AlertDialog.Builder(getBaseContext());
builder.setMessage(dialog_message)
.setPositiveButton(R.string.update, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id) {
final Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(url));
startActivity(intent);
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which){}
});
builder.create().show();
}
else if( !mSilent )
{
Toast.makeText(getBaseContext(), R.string.no_updates, Toast.LENGTH_SHORT).show();
}
}
}
}