diff --git a/Projects/Android/jni/JKXR/VrClientInfo.h b/Projects/Android/jni/JKXR/VrClientInfo.h index 37ae4a8..d25d8ff 100644 --- a/Projects/Android/jni/JKXR/VrClientInfo.h +++ b/Projects/Android/jni/JKXR/VrClientInfo.h @@ -38,6 +38,7 @@ typedef struct { bool immersive_cinematics; bool weapon_stabilised; bool right_handed; + bool menu_right_handed; bool player_moving; int move_speed; // 0 (default) = Comfortable (75%) , 1 = Full (100%), 2 = Walk (50%) bool crouched; diff --git a/Projects/Android/jni/JKXR/VrInputDefault.cpp b/Projects/Android/jni/JKXR/VrInputDefault.cpp index efa0261..f37d396 100644 --- a/Projects/Android/jni/JKXR/VrInputDefault.cpp +++ b/Projects/Android/jni/JKXR/VrInputDefault.cpp @@ -147,17 +147,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, handleTrackedControllerButton(&rightTrackedRemoteState_new, &rightTrackedRemoteState_old, xrButton_Enter, A_ESCAPE); static float menuYaw = 0; - static bool switchedMenuControls = qfalse; if (VR_UseScreenLayer() && !vr.misc_camera && !vr.cin_camera /*bit of a fiddle, but if we are in a misc camera or cin camera, we are in the game and shouldn't be in here*/) { bool controlsLeftHanded = vr_control_scheme->integer >= 10; - if ((controlsLeftHanded && !switchedMenuControls) || (!controlsLeftHanded && switchedMenuControls)) { + if (controlsLeftHanded == vr.menu_right_handed) { interactWithTouchScreen(menuYaw, vr.offhandangles[ANGLES_DEFAULT]); handleTrackedControllerButton(pOffTrackedRemoteNew, pOffTrackedRemoteOld, offButton1, A_MOUSE1); handleTrackedControllerButton(pOffTrackedRemoteNew, pOffTrackedRemoteOld, xrButton_Trigger, A_MOUSE1); handleTrackedControllerButton(pOffTrackedRemoteNew, pOffTrackedRemoteOld, offButton2, A_ESCAPE); if ((pDominantTrackedRemoteNew->Buttons & xrButton_Trigger) != (pDominantTrackedRemoteOld->Buttons & xrButton_Trigger) && (pDominantTrackedRemoteNew->Buttons & xrButton_Trigger)) { - switchedMenuControls = !switchedMenuControls; + vr.menu_right_handed = !vr.menu_right_handed; } } else { interactWithTouchScreen(menuYaw, vr.weaponangles[ANGLES_DEFAULT]); @@ -165,7 +164,7 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew, handleTrackedControllerButton(pDominantTrackedRemoteNew, pDominantTrackedRemoteOld, xrButton_Trigger, A_MOUSE1); handleTrackedControllerButton(pDominantTrackedRemoteNew, pDominantTrackedRemoteOld, domButton2, A_ESCAPE); if ((pOffTrackedRemoteNew->Buttons & xrButton_Trigger) != (pOffTrackedRemoteOld->Buttons & xrButton_Trigger) && (pOffTrackedRemoteNew->Buttons & xrButton_Trigger)) { - switchedMenuControls = !switchedMenuControls; + vr.menu_right_handed = !vr.menu_right_handed; } } } diff --git a/Projects/Android/jni/OpenJK/code/ui/ui_shared.cpp b/Projects/Android/jni/OpenJK/code/ui/ui_shared.cpp index 2a18254..2556ec6 100644 --- a/Projects/Android/jni/OpenJK/code/ui/ui_shared.cpp +++ b/Projects/Android/jni/OpenJK/code/ui/ui_shared.cpp @@ -9250,7 +9250,7 @@ qboolean Item_SetFocus(itemDef_t *item, float x, float y) if (playSound && sfx) { DC->startLocalSound( *sfx, CHAN_LOCAL_SOUND ); - VR_HapticEvent("selector_icon", 0, vr.right_handed ? 1 : 2, 60, 0, 0); + VR_HapticEvent("selector_icon", 0, vr.menu_right_handed ? 1 : 2, 60, 0, 0); } for (i = 0; i < parent->itemCount; i++)