Initial beloko drop-out, add extras envs

This commit is contained in:
mittorn
2015-12-20 16:39:56 +06:00
parent 44279c195f
commit cd89009d6b
68 changed files with 52 additions and 2610 deletions
+24 -6
View File
@@ -15,24 +15,42 @@ import android.os.*;
public class ShortcutActivity extends Activity
{
static EditText name;
static EditText name, gamedir, pkgname, argv;
@Override
protected void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setContentView(R.layout.activity_shortcut);
name=(EditText)findViewById(R.id.shortcut_name);
Intent intent=getIntent();
name = (EditText)findViewById(R.id.shortcut_name);
pkgname = (EditText)findViewById(R.id.shortcut_pkgname);
gamedir = (EditText)findViewById(R.id.shortcut_gamedir);
argv = (EditText)findViewById(R.id.shortcut_cmdArgs);
String argvs = intent.getStringExtra("argv");
if( argvs != null )
argv.setText(argvs);
String pkgnames = intent.getStringExtra("pkgname");
if( pkgnames != null )
argv.setText(pkgnames);
String gamedirs = intent.getStringExtra("gamedir");
if( gamedirs != null )
argv.setText(gamedirs);
String names = intent.getStringExtra("name");
if( names != null )
argv.setText(names);
//name.setText("Name");
}
public void saveShortcut(View view)
{
Intent intent = new Intent();
intent.setAction("in.celest.xash3d.START");
EditText argv = (EditText)findViewById(R.id.shortcut_cmdArgs);
if(argv.length() != 0) intent.putExtra("argv",argv.getText().toString());
EditText gamedir = (EditText)findViewById(R.id.shortcut_gamedir);
EditText pkgname = (EditText)findViewById(R.id.shortcut_pkgname);
if(pkgname.length() != 0) intent.putExtra("gamelibdir", "/data/data/"+pkgname.getText().toString().replace("!","in.celest.xash3d.")+"/lib/");
if(pkgname.length() != 0)
{
intent.putExtra("gamelibdir", "/data/data/"+pkgname.getText().toString().replace("!","in.celest.xash3d.")+"/lib/");
intent.putExtra("pakfile", "/data/data/"+pkgname.getText().toString().replace("!","in.celest.xash3d.")+"/files/extras.pak");
}
if(gamedir.length() != 0) intent.putExtra("gamedir",gamedir.getText().toString());
Intent wrapIntent = new Intent();
wrapIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent);