Prevent gesture use skipping cutscenes or exiting security cameras

also don't allow weapon firing whilst showing item selector
This commit is contained in:
Simon 2022-11-30 17:52:57 +00:00
parent 5781390a92
commit cd9026c927
2 changed files with 11 additions and 6 deletions

View file

@ -660,9 +660,8 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
if ((pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) !=
(pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger)) {
ALOGV("**WEAPON EVENT** Not Grip Pushed %sattack",
(pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) ? "+" : "-");
firing = (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger);
firing = (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) &&
!vr.item_selector;
sendButtonAction("+attack", firing);
}
@ -858,7 +857,9 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
float threshhold = vr_gesture_triggered_use_threshold->value;
// Hand must be extended and at least on waist level
// Com_Printf("DISTANCE: %.2f ; HEIGHT: %.2f\n", absoluteDistanceToHMD, verticalDistanceToHMD);
if (!vr.weapon_stabilised && absoluteDistanceToHMD > threshhold && verticalDistanceToHMD > -threshhold) {
bool gestureUseAllowed = !vr.weapon_stabilised && !vr.cin_camera && !vr.misc_camera &&
!vr.remote_turret;
if (gestureUseAllowed && absoluteDistanceToHMD > threshhold && verticalDistanceToHMD > -threshhold) {
if (!vr.useGestureActive) {
vr.useGestureActive = true;
sendButtonAction("+use", true);

View file

@ -2782,8 +2782,10 @@ void CG_ItemSelectorNext_f( void )
}
centity_t *cent = &cg_entities[cg.snap->ps.clientNum];
//Only show the stance selection if using saber and in third person
int selectors = ((cent->gent->client->ps.forcePowersKnown & ( 1 << FP_SABER_OFFENSE )) &&
cent->currentState.weapon == WP_SABER) ? 3 : 2;
cent->currentState.weapon == WP_SABER && cg_thirdPerson.integer) ? 3 : 2;
cg.itemSelectorType = (cg.itemSelectorType+1) % selectors;
cg.itemSelectorTime = cg.time;
}
@ -2796,8 +2798,10 @@ void CG_ItemSelectorPrev_f( void )
}
centity_t *cent = &cg_entities[cg.snap->ps.clientNum];
//Only show the stance selection if using saber and in third person
int selectors = ((cent->gent->client->ps.forcePowersKnown & ( 1 << FP_SABER_OFFENSE )) &&
cent->currentState.weapon == WP_SABER) ? 3 : 2;
cent->currentState.weapon == WP_SABER && cg_thirdPerson.integer) ? 3 : 2;
if (--cg.itemSelectorType < 0)
cg.itemSelectorType = selectors-1;
cg.itemSelectorTime = cg.time;