From 84984d30e777b8cc8d01b4f835eec558f83d5c00 Mon Sep 17 00:00:00 2001 From: Petr Bartos Date: Sat, 9 Apr 2022 20:56:40 +0200 Subject: [PATCH 1/3] Use custom config with weapon adjustment for OpenArena --- android/app/src/main/assets/autoexec_oa.cfg | 75 +++++++++++++++++++ .../com/drbeef/ioq3quest/MainActivity.java | 8 +- 2 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 android/app/src/main/assets/autoexec_oa.cfg diff --git a/android/app/src/main/assets/autoexec_oa.cfg b/android/app/src/main/assets/autoexec_oa.cfg new file mode 100644 index 00000000..e9544c7c --- /dev/null +++ b/android/app/src/main/assets/autoexec_oa.cfg @@ -0,0 +1,75 @@ +bind LEFTARROW +moveleft +bind RIGHTARROW +moveright +sensitivity 100 +set in_joystick 1 +set r_externalGLSL 1 +set r_stereoEnabled 1 +set r_mode -2 +set cg_runpitch 0 +set cg_runroll 0 +set cg_bobup 0 +set cg_bobpitch 0 +set cg_bobroll 0 +set cg_weaponbob 0 +set sv_pure 0 +set sv_master1 "13.36.227.32:27950" + +set vr_weapon_adjustment_1 "1.0,0,12,-13,-36,0,100" +set vr_weapon_adjustment_2 "1.0,-6,6,-3,0,0,0" +set vr_weapon_adjustment_3 "0.8,-6,8,-8,0,0,0" +set vr_weapon_adjustment_4 "1.0,-5,7,-4,0,0,0" +set vr_weapon_adjustment_5 "1.0,-5,6,-4,0,0,0" +set vr_weapon_adjustment_6 "0.8,-3,10,8,0,0,-10" +set vr_weapon_adjustment_7 "0.8,-5,8,0,0,0,0" +set vr_weapon_adjustment_8 "0.9,-4,8,-2,0,0,0" +set vr_weapon_adjustment_9 "1.0,-7,10,-4,0,0,0" + +////////////////////////////////////////////////////////////////////////////////////////////////// +// // +// Custom Button mappings - ONLY put overrides of defaults in here, such as alt key mappings. // +// // +// Contained sample mapping corresponds to default control schema. Note that by mapping // +// thumbstick diagonals, thumbstick switches to 8-way mode requiring more precise input! // +// // +// To activate mapping, do not forget to remove "//" (marking commented out / inactive line). // +// Also note that custom mappings will be overridden by defaults until game restart in case // +// controls are changed from in-game menu. // +// // +////////////////////////////////////////////////////////////////////////////////////////////////// + +// set vr_button_map_A "+moveup" +// set vr_button_map_A_ALT "" +// set vr_button_map_B "+movedown" +// set vr_button_map_B_ALT "" +// set vr_button_map_X "+button2" +// set vr_button_map_X_ALT "" +// set vr_button_map_Y "+button3" +// set vr_button_map_Y_ALT "" +// set vr_button_map_SECONDARYTHUMBSTICK "+scores" +// set vr_button_map_SECONDARYTHUMBSTICK_ALT "" +// set vr_button_map_PRIMARYTHUMBSTICK "" +// set vr_button_map_PRIMARYTHUMBSTICK_ALT "" +// set vr_button_map_SECONDARYTRIGGER "+moveup" +// set vr_button_map_SECONDARYTRIGGER_ALT "" +// set vr_button_map_PRIMARYTRIGGER "+attack" +// set vr_button_map_PRIMARYTRIGGER_ALT "" +// set vr_button_map_SECONDARYGRIP "+weapon_stabilise" +// set vr_button_map_SECONDARYGRIP_ALT "" +// set vr_button_map_PRIMARYGRIP "+weapon_select" +// set vr_button_map_PRIMARYGRIP_ALT "" +// set vr_button_map_RTHUMBFORWARD "weapnext" +// set vr_button_map_RTHUMBFORWARD_ALT "" +// set vr_button_map_RTHUMBFORWARDRIGHT "" +// set vr_button_map_RTHUMBFORWARDRIGHT_ALT "" +// set vr_button_map_RTHUMBRIGHT "turnright" +// set vr_button_map_RTHUMBRIGHT_ALT "" +// set vr_button_map_RTHUMBBACKRIGHT "" +// set vr_button_map_RTHUMBBACKRIGHT_ALT "" +// set vr_button_map_RTHUMBBACK "weapprev" +// set vr_button_map_RTHUMBBACK_ALT "" +// set vr_button_map_RTHUMBBACKLEFT "" +// set vr_button_map_RTHUMBBACKLEFT_ALT "" +// set vr_button_map_RTHUMBLEFT "turnleft" +// set vr_button_map_RTHUMBLEFT_ALT "" +// set vr_button_map_RTHUMBFORWARDLEFT "" +// set vr_button_map_RTHUMBFORWARDLEFT_ALT "" diff --git a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java index e6d4df45..6da66dbe 100644 --- a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java +++ b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java @@ -106,7 +106,7 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback //If open arena is installed then copy necessary stuff if (new File("/sdcard/ioquake3Quest/baseoa").exists()) { - copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec.cfg", false); + copy_asset("/sdcard/ioquake3Quest/baseoa", "autoexec_oa.cfg", "autoexec.cfg", false); copy_asset("/sdcard/ioquake3Quest/baseoa", "pakQ3Q.pk3", true); } @@ -152,6 +152,10 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback } public void copy_asset(String path, String name, boolean force) { + copy_asset(path, name, name, force); + } + + public void copy_asset(String path, String name, String newName, boolean force) { File f = new File(path + "/" + name); if (!f.exists() || force) { @@ -159,7 +163,7 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback String fullname = path + "/" + name; String directory = fullname.substring(0, fullname.lastIndexOf("/")); new File(directory).mkdirs(); - _copy_asset(name, path + "/" + name); + _copy_asset(name, path + "/" + targetName); } } From 8498047b839fb4b85831795445434d0d465059d4 Mon Sep 17 00:00:00 2001 From: Petr Bartos Date: Sat, 9 Apr 2022 21:22:59 +0200 Subject: [PATCH 2/3] Fix parameter name --- .../app/src/main/java/com/drbeef/ioq3quest/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java index 6da66dbe..1e2338ce 100644 --- a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java +++ b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java @@ -163,7 +163,7 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback String fullname = path + "/" + name; String directory = fullname.substring(0, fullname.lastIndexOf("/")); new File(directory).mkdirs(); - _copy_asset(name, path + "/" + targetName); + _copy_asset(name, path + "/" + newName); } } From 51ef5302e67702e35210eba03bd76389baa3911e Mon Sep 17 00:00:00 2001 From: Petr Bartos Date: Sat, 9 Apr 2022 21:47:29 +0200 Subject: [PATCH 3/3] Fix overwriting of OpenArena autoexec --- .../app/src/main/java/com/drbeef/ioq3quest/MainActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java index 1e2338ce..6aaa683a 100644 --- a/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java +++ b/android/app/src/main/java/com/drbeef/ioq3quest/MainActivity.java @@ -156,7 +156,7 @@ public class MainActivity extends SDLActivity // implements KeyEvent.Callback } public void copy_asset(String path, String name, String newName, boolean force) { - File f = new File(path + "/" + name); + File f = new File(path + "/" + newName); if (!f.exists() || force) { //Ensure we have an appropriate folder