mirror of
https://github.com/DrBeef/RTCWQuest.git
synced 2025-03-03 23:51:20 +00:00
Updated controls:
- HUD toggle moved to menu - Removed right grip shortcuts (they were interfering with selector) - X/Y for selecting items replaced by selector - Trigger to toggle scope/silencer/akimbo moved to X (instead of HUD toggle)
This commit is contained in:
parent
0f6d6386e8
commit
ce6d680ba9
5 changed files with 72 additions and 94 deletions
|
@ -1503,6 +1503,7 @@ void RTCWVR_Init()
|
||||||
vr_comfort_vignette = Cvar_Get ("vr_comfort_vignette", "0.0", CVAR_ARCHIVE);
|
vr_comfort_vignette = Cvar_Get ("vr_comfort_vignette", "0.0", CVAR_ARCHIVE);
|
||||||
vr_gesture_triggered_use = Cvar_Get ("vr_gesture_triggered_use", "1", CVAR_ARCHIVE);
|
vr_gesture_triggered_use = Cvar_Get ("vr_gesture_triggered_use", "1", CVAR_ARCHIVE);
|
||||||
vr_use_gesture_boundary = Cvar_Get ("vr_use_gesture_boundary", "0.35", CVAR_ARCHIVE);
|
vr_use_gesture_boundary = Cvar_Get ("vr_use_gesture_boundary", "0.35", CVAR_ARCHIVE);
|
||||||
|
vr_draw_hud = Cvar_Get ("vr_draw_hud", "1", CVAR_ARCHIVE);
|
||||||
|
|
||||||
//Defaults
|
//Defaults
|
||||||
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE);
|
vr_control_scheme = Cvar_Get( "vr_control_scheme", "0", CVAR_ARCHIVE);
|
||||||
|
|
|
@ -15,4 +15,4 @@ cvar_t *vr_cinematic_stereo;
|
||||||
cvar_t *vr_screen_dist;
|
cvar_t *vr_screen_dist;
|
||||||
cvar_t *vr_gesture_triggered_use;
|
cvar_t *vr_gesture_triggered_use;
|
||||||
cvar_t *vr_use_gesture_boundary;
|
cvar_t *vr_use_gesture_boundary;
|
||||||
|
cvar_t *vr_draw_hud;
|
||||||
|
|
|
@ -43,6 +43,7 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
||||||
vr_control_scheme->value == 99; // Always right-handed for weapon calibration
|
vr_control_scheme->value == 99; // Always right-handed for weapon calibration
|
||||||
|
|
||||||
vr.teleportenabled = vr_teleport->integer != 0;
|
vr.teleportenabled = vr_teleport->integer != 0;
|
||||||
|
vr.visible_hud = vr_draw_hud->integer;
|
||||||
|
|
||||||
static qboolean dominantGripPushed = false;
|
static qboolean dominantGripPushed = false;
|
||||||
static float dominantGripPushTime = 0.0f;
|
static float dominantGripPushTime = 0.0f;
|
||||||
|
@ -553,60 +554,6 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//We need to record if we have started firing primary so that releasing trigger will stop firing, if user has pushed grip
|
|
||||||
//in meantime, then it wouldn't stop the gun firing and it would get stuck
|
|
||||||
static qboolean firing = false;
|
|
||||||
if (dominantGripPushed && vr.backpackitemactive == 0)
|
|
||||||
{
|
|
||||||
if ((pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) !=
|
|
||||||
(pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger))
|
|
||||||
{
|
|
||||||
if (!vr.scopedweapon) {
|
|
||||||
if (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) {
|
|
||||||
ALOGV("**WEAPON EVENT** weapalt");
|
|
||||||
sendButtonActionSimple("weapalt");
|
|
||||||
}
|
|
||||||
else if (firing)
|
|
||||||
{
|
|
||||||
//no longer firing
|
|
||||||
vr.akimboTriggerState = 0;
|
|
||||||
firing = qfalse;
|
|
||||||
ALOGV("**WEAPON EVENT** Grip Pushed %sattack", (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) ? "+" : "-");
|
|
||||||
sendButtonAction("+attack", firing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (vr.detachablescope)
|
|
||||||
{
|
|
||||||
if (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) {
|
|
||||||
//See if we are able to detach the scope
|
|
||||||
ALOGV("**WEAPON EVENT** weapdetachscope");
|
|
||||||
sendButtonActionSimple("weapdetachscope");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Just ignore grip and fire
|
|
||||||
ALOGV("**WEAPON EVENT** Grip Pushed %sattack", (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) ? "+" : "-");
|
|
||||||
firing = (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger);
|
|
||||||
if (vr.weaponid == WP_AKIMBO) {
|
|
||||||
if (firing) {
|
|
||||||
vr.akimboTriggerState |= ACTIVE_WEAPON_HAND;
|
|
||||||
sendButtonAction("+attack", firing);
|
|
||||||
} else {
|
|
||||||
vr.akimboTriggerState &= ~ACTIVE_WEAPON_HAND;
|
|
||||||
if (!vr.akimboTriggerState) { // Stop firing only if we are not firing with off-hand weapon
|
|
||||||
sendButtonAction("+attack", firing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
vr.akimboTriggerState = 0;
|
|
||||||
sendButtonAction("+attack", firing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//Fire Primary
|
//Fire Primary
|
||||||
if (vr.backpackitemactive != 3 && !vr.binocularsActive && // Can't fire while holding binoculars
|
if (vr.backpackitemactive != 3 && !vr.binocularsActive && // Can't fire while holding binoculars
|
||||||
!vr.velocitytriggered && // Don't fire velocity triggered weapons
|
!vr.velocitytriggered && // Don't fire velocity triggered weapons
|
||||||
|
@ -614,7 +561,7 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
||||||
(pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger)) {
|
(pDominantTrackedRemoteOld->Buttons & ovrButton_Trigger)) {
|
||||||
|
|
||||||
ALOGV("**WEAPON EVENT** Not Grip Pushed %sattack", (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) ? "+" : "-");
|
ALOGV("**WEAPON EVENT** Not Grip Pushed %sattack", (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger) ? "+" : "-");
|
||||||
firing = (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger);
|
qboolean firing = (pDominantTrackedRemoteNew->Buttons & ovrButton_Trigger);
|
||||||
if (vr.weaponid == WP_AKIMBO) {
|
if (vr.weaponid == WP_AKIMBO) {
|
||||||
if (firing) {
|
if (firing) {
|
||||||
vr.akimboTriggerState |= ACTIVE_WEAPON_HAND;
|
vr.akimboTriggerState |= ACTIVE_WEAPON_HAND;
|
||||||
|
@ -640,7 +587,6 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
||||||
zoomin = !zoomin;
|
zoomin = !zoomin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//Duck
|
//Duck
|
||||||
if (vr.backpackitemactive != 2 &&
|
if (vr.backpackitemactive != 2 &&
|
||||||
|
@ -722,33 +668,30 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
||||||
stopUseItemNextFrame = false;
|
stopUseItemNextFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detach scopes, draw akimbo
|
||||||
if (!canUseQuickSave) {
|
if (!canUseQuickSave) {
|
||||||
if (((secondaryButtonsNew & secondaryButton1) !=
|
if (((secondaryButtonsNew & secondaryButton1) !=
|
||||||
(secondaryButtonsOld & secondaryButton1)) &&
|
(secondaryButtonsOld & secondaryButton1)) &&
|
||||||
(secondaryButtonsNew & secondaryButton1)) {
|
(secondaryButtonsNew & secondaryButton1)) {
|
||||||
|
if (!vr.scopedweapon) {
|
||||||
if (dominantGripPushed) {
|
ALOGV("**WEAPON EVENT** weapalt");
|
||||||
Cbuf_AddText("+useitem\n");
|
sendButtonActionSimple("weapalt");
|
||||||
stopUseItemNextFrame = qtrue;
|
} else if (vr.detachablescope) {
|
||||||
} else {
|
//See if we are able to detach the scope
|
||||||
vr.visible_hud = !vr.visible_hud;
|
ALOGV("**WEAPON EVENT** weapdetachscope");
|
||||||
|
sendButtonActionSimple("weapdetachscope");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//notebook or select "item"
|
// Notebook
|
||||||
if (!canUseQuickSave) {
|
if (!canUseQuickSave) {
|
||||||
if (((secondaryButtonsNew & secondaryButton2) !=
|
if (((secondaryButtonsNew & secondaryButton2) !=
|
||||||
(secondaryButtonsOld & secondaryButton2)) &&
|
(secondaryButtonsOld & secondaryButton2)) &&
|
||||||
(secondaryButtonsNew & secondaryButton2)) {
|
(secondaryButtonsNew & secondaryButton2)) {
|
||||||
|
|
||||||
if (dominantGripPushed) {
|
|
||||||
sendButtonActionSimple("itemprev");
|
|
||||||
} else {
|
|
||||||
sendButtonActionSimple("notebook");
|
sendButtonActionSimple("notebook");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Kick!
|
//Kick!
|
||||||
|
@ -759,7 +702,7 @@ void HandleInput_Default( ovrInputStateGamepad *pFootTrackingNew, ovrInputStateG
|
||||||
|
|
||||||
//We need to record if we have started firing primary so that releasing trigger will stop definitely firing, if user has pushed grip
|
//We need to record if we have started firing primary so that releasing trigger will stop definitely firing, if user has pushed grip
|
||||||
//in meantime, then it wouldn't stop the gun firing and it would get stuck
|
//in meantime, then it wouldn't stop the gun firing and it would get stuck
|
||||||
if (!vr.teleportenabled)
|
if (!vr.teleportenabled || vr.weaponid == WP_AKIMBO)
|
||||||
{
|
{
|
||||||
if (vr.weaponid == WP_AKIMBO && vr.backpackitemactive != 3 && !vr.binocularsActive) {
|
if (vr.weaponid == WP_AKIMBO && vr.backpackitemactive != 3 && !vr.binocularsActive) {
|
||||||
// Fire off-hand weapon
|
// Fire off-hand weapon
|
||||||
|
|
|
@ -396,6 +396,23 @@ itemDef
|
||||||
visible 1
|
visible 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemDef {
|
||||||
|
name vr
|
||||||
|
group grpControls
|
||||||
|
type ITEM_TYPE_YESNO
|
||||||
|
text "Draw HUD: "
|
||||||
|
cvar "vr_draw_hud"
|
||||||
|
rect 82 270 290 12
|
||||||
|
textalign ITEM_ALIGN_RIGHT
|
||||||
|
textalignx 142
|
||||||
|
textaligny 10
|
||||||
|
textscale .23
|
||||||
|
style WINDOW_STYLE_FILLED
|
||||||
|
backcolor 1 1 1 .07
|
||||||
|
forecolor 1 1 1 1
|
||||||
|
visible 1
|
||||||
|
}
|
||||||
|
|
||||||
// TOOLS MESSAGE //
|
// TOOLS MESSAGE //
|
||||||
|
|
||||||
itemDef
|
itemDef
|
||||||
|
|
|
@ -369,6 +369,23 @@ itemDef
|
||||||
visible 1
|
visible 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemDef {
|
||||||
|
name ingame_vr
|
||||||
|
group grpControls
|
||||||
|
type ITEM_TYPE_YESNO
|
||||||
|
text "Draw HUD: "
|
||||||
|
cvar "vr_draw_hud"
|
||||||
|
rect 82 270 290 12
|
||||||
|
textalign ITEM_ALIGN_RIGHT
|
||||||
|
textalignx 142
|
||||||
|
textaligny 10
|
||||||
|
textscale .23
|
||||||
|
style WINDOW_STYLE_FILLED
|
||||||
|
backcolor 1 1 1 .07
|
||||||
|
forecolor 1 1 1 1
|
||||||
|
visible 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
itemDef {
|
itemDef {
|
||||||
name yesno_message
|
name yesno_message
|
||||||
|
|
Loading…
Reference in a new issue