mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-04-18 06:11:18 +00:00
Do not create missionpack folder if not installed
This commit is contained in:
parent
5e0cabe3a1
commit
41f1f1a7e4
1 changed files with 18 additions and 17 deletions
|
@ -95,8 +95,10 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] results) {
|
||||
if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION_ID) {
|
||||
finish();
|
||||
System.exit(0);
|
||||
try {
|
||||
create();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,28 +108,26 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
}
|
||||
|
||||
public void create() throws IOException {
|
||||
//Make the directories
|
||||
// Prepare base game directory
|
||||
new File("/sdcard/ioquake3Quest/baseq3").mkdirs();
|
||||
new File("/sdcard/ioquake3Quest/missionpack").mkdirs();
|
||||
|
||||
//Copy the command line params file
|
||||
// Copy the command line params file and autoexec
|
||||
copy_asset("/sdcard/ioquake3Quest", "commandline.txt", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "autoexec.cfg", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "autoexec.cfg", false);
|
||||
|
||||
//copy demo
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pak0.pk3", false);
|
||||
|
||||
//our special pak files
|
||||
// Copy our special pak file and demo
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pakQ3Q.pk3", true);
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pak66.pk3", true);
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true);
|
||||
|
||||
// cleanup incompatible shaders
|
||||
copy_asset("/sdcard/ioquake3Quest/baseq3", "pak0.pk3", false);
|
||||
// Cleanup incompatible shaders
|
||||
delete_asset("/sdcard/ioquake3Quest/baseq3/glsl");
|
||||
delete_asset("/sdcard/ioquake3Quest/missionpack/glsl");
|
||||
|
||||
//If open arena is installed then copy necessary stuff
|
||||
// If Team Arena is installed then copy necessary stuff
|
||||
if (new File("/sdcard/ioquake3Quest/missionpack").exists()) {
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "autoexec.cfg", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/missionpack", "pakQ3Q.pk3", true);
|
||||
delete_asset("/sdcard/ioquake3Quest/missionpack/glsl");
|
||||
}
|
||||
|
||||
// If Open Arena is installed then copy necessary stuff
|
||||
if (new File("/sdcard/ioquake3Quest/baseoa").exists()) {
|
||||
copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec_oa.cfg", "autoexec.cfg", false);
|
||||
copy_asset("/sdcard/ioquake3Quest/baseoa", "pakQ3Q.pk3", true);
|
||||
|
@ -160,6 +160,7 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback
|
|||
|
||||
Log.d(TAG, "setting env");
|
||||
try {
|
||||
//commandLineParams += " +map q3dm7";
|
||||
setenv("commandline", commandLineParams, true);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue