Add delay before allowing to skip cinematic

This commit is contained in:
Petr Bartos 2023-04-18 22:21:03 +02:00 committed by Simon
parent ccd581c8d0
commit 4bea59c543

View file

@ -346,9 +346,16 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
if (vr.cin_camera)
static int cinCameraTimestamp = -1;
if (vr.cin_camera && cinCameraTimestamp == -1) {
cinCameraTimestamp = Sys_Milliseconds();
} else if (!vr.cin_camera) {
cinCameraTimestamp = -1;
}
if (vr.cin_camera && cinCameraTimestamp + 1000 < Sys_Milliseconds())
{
//To skip cinematic use any thumb or trigger
// To skip cinematic use any thumb or trigger (but wait a while
// to prevent skipping when cinematic is started during action)
if ((primaryButtonsNew & primaryThumb) != (primaryButtonsOld & primaryThumb)) {
sendButtonAction("+use", (primaryButtonsNew & primaryThumb));
}