mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-22 20:11:40 +00:00
Merge pull request #14 from petr666/feature/control-tweaks
Control tweaks
This commit is contained in:
commit
edee441e7a
6 changed files with 288 additions and 121 deletions
|
@ -14,13 +14,36 @@ set cg_weaponbob 0
|
|||
set sv_pure 0
|
||||
set sv_master1 "13.36.227.32:27950"
|
||||
|
||||
//VR Button mappings - ONLY put overrides of defaults in here, such as alt key mappings
|
||||
set vr_button_map_RTHUMBFORWARD_ALT "weapon 2"
|
||||
set vr_button_map_RTHUMBFORWARDRIGHT_ALT "weapon 3"
|
||||
set vr_button_map_RTHUMBRIGHT_ALT "weapon 4"
|
||||
set vr_button_map_RTHUMBBACKRIGHT_ALT "weapon 5"
|
||||
set vr_button_map_RTHUMBBACK_ALT "weapon 6"
|
||||
set vr_button_map_RTHUMBBACKLEFT_ALT "weapon 7"
|
||||
set vr_button_map_RTHUMBLEFT_ALT "weapon 8"
|
||||
set vr_button_map_RTHUMBFORWARDLEFT_ALT "weapon 9"
|
||||
|
||||
// VR Button mappings - ONLY put overrides of defaults in here, such as alt key mappings
|
||||
// set vr_button_map_A ""
|
||||
// set vr_button_map_A_ALT ""
|
||||
// set vr_button_map_B ""
|
||||
// set vr_button_map_B_ALT ""
|
||||
// set vr_button_map_X ""
|
||||
// set vr_button_map_X_ALT ""
|
||||
// set vr_button_map_Y ""
|
||||
// set vr_button_map_Y_ALT ""
|
||||
// set vr_button_map_SECONDARYTHUMBSTICK ""
|
||||
// set vr_button_map_SECONDARYTHUMBSTICK_ALT ""
|
||||
// set vr_button_map_PRIMARYTHUMBSTICK ""
|
||||
// set vr_button_map_PRIMARYTHUMBSTICK_ALT ""
|
||||
// set vr_button_map_RTHUMBFORWARD ""
|
||||
// set vr_button_map_RTHUMBFORWARD_ALT ""
|
||||
// set vr_button_map_RTHUMBFORWARDLEFT ""
|
||||
// set vr_button_map_RTHUMBFORWARDLEFT_ALT ""
|
||||
// set vr_button_map_RTHUMBFORWARDRIGHT ""
|
||||
// set vr_button_map_RTHUMBFORWARDRIGHT_ALT ""
|
||||
// set vr_button_map_RTHUMBBACK ""
|
||||
// set vr_button_map_RTHUMBBACK_ALT ""
|
||||
// set vr_button_map_RTHUMBBACKLEFT ""
|
||||
// set vr_button_map_RTHUMBBACKLEFT_ALT ""
|
||||
// set vr_button_map_RTHUMBBACKRIGHT ""
|
||||
// set vr_button_map_RTHUMBBACKRIGHT_ALT ""
|
||||
// set vr_button_map_SECONDARYTRIGGER ""
|
||||
// set vr_button_map_SECONDARYTRIGGER_ALT ""
|
||||
// set vr_button_map_PRIMARYTRIGGER ""
|
||||
// set vr_button_map_PRIMARYTRIGGER_ALT ""
|
||||
// set vr_button_map_SECONDARYGRIP ""
|
||||
// set vr_button_map_SECONDARYGRIP_ALT ""
|
||||
// set vr_button_map_PRIMARYGRIP "+alt"
|
||||
// set vr_button_map_PRIMARYGRIP_ALT ""
|
||||
|
|
|
@ -2094,6 +2094,15 @@ void CG_DrawWeaponSelector( void )
|
|||
VectorMA(holsterOrigin, ((DEPTH*2.0f)*((selectorMode == WS_CONTROLLER) ? frac : 1.0f)), holsterForward, holsterOrigin);
|
||||
VectorCopy(holsterOrigin, selectorOrigin);
|
||||
|
||||
float thumbstickAxisX = 0.0f;
|
||||
float thumbstickAxisY = 0.0f;
|
||||
if (length(vr->thumbstick_location[THUMB_RIGHT][0], vr->thumbstick_location[THUMB_RIGHT][1]) > 0.95f)
|
||||
{
|
||||
float a = atan2(vr->thumbstick_location[THUMB_RIGHT][0], vr->thumbstick_location[THUMB_RIGHT][1]);
|
||||
thumbstickAxisX = sinf(a) * 0.95f;
|
||||
thumbstickAxisY = cosf(a) * 0.95f;
|
||||
}
|
||||
|
||||
float x = 0.0f;
|
||||
float y = 0.0f;
|
||||
if (selectorMode == WS_CONTROLLER)
|
||||
|
@ -2110,12 +2119,8 @@ void CG_DrawWeaponSelector( void )
|
|||
}
|
||||
else //selectorMode == WS_HMD
|
||||
{
|
||||
if (length(vr->thumbstick_location[THUMB_RIGHT][0], vr->thumbstick_location[THUMB_RIGHT][1]) > 0.95f)
|
||||
{
|
||||
float a = atan2(vr->thumbstick_location[THUMB_RIGHT][0], vr->thumbstick_location[THUMB_RIGHT][1]);
|
||||
x = sinf(a) * 0.95f;
|
||||
y = cosf(a) * 0.95f;
|
||||
}
|
||||
x = thumbstickAxisX;
|
||||
y = thumbstickAxisY;
|
||||
}
|
||||
|
||||
VectorMA(selectorOrigin, RAD * x, holsterRight, selectorOrigin);
|
||||
|
@ -2355,6 +2360,18 @@ void CG_DrawWeaponSelector( void )
|
|||
{
|
||||
cg.weaponSelectorSelection = WP_NONE;
|
||||
}
|
||||
|
||||
// In case was invoked by thumbstick axis and thumbstick is centered
|
||||
// select weapon (if any selected) and close the selector
|
||||
if (vr->weapon_select_autoclose && frac > 0.25f) {
|
||||
if (thumbstickAxisX > -0.1f && thumbstickAxisX < 0.1f && thumbstickAxisY > -0.1f && thumbstickAxisY < 0.1f) {
|
||||
if (selected) {
|
||||
cg.weaponSelect = cg.weaponSelectorSelection;
|
||||
}
|
||||
vr->weapon_select = qfalse;
|
||||
vr->weapon_select_autoclose = qfalse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -47,8 +47,10 @@ CONTROLS OPTIONS MENU
|
|||
#define ID_RIGHTHANDED 132
|
||||
#define ID_WEAPONPITCH 133
|
||||
#define ID_WEAPONSELECTORMODE 134
|
||||
#define ID_UTURN 135
|
||||
#define ID_CONTROLSCHEMA 136
|
||||
|
||||
#define ID_BACK 135
|
||||
#define ID_BACK 137
|
||||
|
||||
#define NUM_DIRECTIONMODE 2
|
||||
|
||||
|
@ -65,9 +67,11 @@ typedef struct {
|
|||
menuradiobutton_s twohanded;
|
||||
menulist_s directionmode;
|
||||
menulist_s snapturn;
|
||||
menuradiobutton_s uturn;
|
||||
menuradiobutton_s righthanded;
|
||||
menuslider_s weaponpitch;
|
||||
menulist_s weaponselectormode;
|
||||
menulist_s controlschema;
|
||||
|
||||
menubitmap_s back;
|
||||
} controls3_t;
|
||||
|
@ -81,9 +85,11 @@ static void Controls3_SetMenuItems( void ) {
|
|||
s_controls3.twohanded.curvalue = trap_Cvar_VariableValue( "vr_twoHandedWeapons" ) != 0;
|
||||
s_controls3.directionmode.curvalue = (int)trap_Cvar_VariableValue( "vr_directionMode" ) % NUM_DIRECTIONMODE;
|
||||
s_controls3.snapturn.curvalue = (int)trap_Cvar_VariableValue( "vr_snapturn" ) / 45;
|
||||
s_controls3.uturn.curvalue = trap_Cvar_VariableValue( "vr_uturn" ) != 0;
|
||||
s_controls3.righthanded.curvalue = trap_Cvar_VariableValue( "vr_righthanded" ) != 0;
|
||||
s_controls3.weaponpitch.curvalue = trap_Cvar_VariableValue( "vr_weaponPitch" ) + 25;
|
||||
s_controls3.weaponselectormode.curvalue = (int)trap_Cvar_VariableValue( "vr_weaponSelectorMode" ) % 4;
|
||||
s_controls3.weaponselectormode.curvalue = (int)trap_Cvar_VariableValue( "vr_weaponSelectorMode" ) % 2;
|
||||
s_controls3.controlschema.curvalue = (int)trap_Cvar_VariableValue( "vr_controlSchema" ) % 2;
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,32 +128,84 @@ static void Controls3_MenuEvent( void* ptr, int notification ) {
|
|||
break;
|
||||
|
||||
case ID_WEAPONSELECTORMODE:
|
||||
trap_Cvar_SetValue( "vr_weaponSelectorMode", s_controls3.weaponselectormode.curvalue );
|
||||
break;
|
||||
|
||||
case ID_UTURN:
|
||||
{
|
||||
switch (s_controls3.weaponselectormode.curvalue)
|
||||
if (s_controls3.uturn.curvalue) {
|
||||
if (s_controls3.controlschema.curvalue == 0) {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK", "uturn");
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK_ALT", "uturn");
|
||||
}
|
||||
} else {
|
||||
if (s_controls3.controlschema.curvalue == 0) {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK", "");
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK_ALT", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
trap_Cvar_SetValue( "vr_uturn", s_controls3.uturn.curvalue );
|
||||
break;
|
||||
|
||||
case ID_CONTROLSCHEMA:
|
||||
{
|
||||
switch (s_controls3.controlschema.curvalue)
|
||||
{
|
||||
case 0: //Controller
|
||||
trap_Cvar_Set( "vr_button_map_PRIMARYGRIP", "+weapon_select");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBFORWARD", "");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBBACK", "uturn");
|
||||
case 0: // Default schema
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBLEFT", ""); // empty ~ turn left
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBRIGHT", ""); // empty ~ turn right
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARD", "weapnext"); // next weapon
|
||||
if (s_controls3.uturn.curvalue) {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK", "uturn"); // u-turn
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK", "weapprev"); // previous weapon
|
||||
}
|
||||
trap_Cvar_Set("vr_button_map_PRIMARYGRIP", "+weapon_select"); // weapon selector
|
||||
trap_Cvar_Set("vr_button_map_PRIMARYTHUMBSTICK", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARD_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDRIGHT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDRIGHT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBRIGHT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKRIGHT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKRIGHT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKLEFT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKLEFT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBLEFT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDLEFT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDLEFT_ALT", ""); // unmapped
|
||||
break;
|
||||
case 1: //HMD
|
||||
trap_Cvar_Set( "vr_button_map_PRIMARYGRIP", "+weapon_select");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBFORWARD", "");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBBACK", "uturn");
|
||||
break;
|
||||
case 2: //Alt-Key bindings
|
||||
trap_Cvar_Set( "vr_button_map_PRIMARYGRIP", "+alt");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBFORWARD", "");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBBACK", "uturn");
|
||||
break;
|
||||
case 3: //Thumbstick
|
||||
trap_Cvar_Set( "vr_button_map_PRIMARYGRIP", "");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBFORWARD", "weapnext");
|
||||
trap_Cvar_Set( "vr_button_map_RTHUMBBACK", "weapprev");
|
||||
default: // Now we have only two schemas
|
||||
// All directions as weapon select (useful for HMD wheel)
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARD", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDRIGHT", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBRIGHT", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKRIGHT", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKLEFT", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBLEFT", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDLEFT", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_PRIMARYTHUMBSTICK", "+weapon_select");
|
||||
trap_Cvar_Set("vr_button_map_PRIMARYGRIP", "+alt"); // switch to alt layout
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBLEFT_ALT", ""); // empty ~ turn left
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBRIGHT_ALT", ""); // empty ~ turn right
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARD_ALT", "weapnext");
|
||||
if (s_controls3.uturn.curvalue) {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK_ALT", "uturn");
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACK_ALT", "weapprev");
|
||||
}
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDRIGHT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKRIGHT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBBACKLEFT_ALT", ""); // unmapped
|
||||
trap_Cvar_Set("vr_button_map_RTHUMBFORWARDLEFT_ALT", ""); // unmapped
|
||||
break;
|
||||
}
|
||||
}
|
||||
trap_Cvar_SetValue( "vr_weaponSelectorMode", s_controls3.weaponselectormode.curvalue );
|
||||
trap_Cvar_SetValue( "vr_controlSchema", s_controls3.controlschema.curvalue );
|
||||
break;
|
||||
|
||||
case ID_BACK:
|
||||
|
@ -178,8 +236,13 @@ static void Controls3_MenuInit( void ) {
|
|||
{
|
||||
"Controller Weapon Selector",
|
||||
"HMD Weapon Wheel",
|
||||
"Alt-Key Bindings",
|
||||
"Thumbstick Forward/Back",
|
||||
NULL
|
||||
};
|
||||
|
||||
static const char *s_controlschema[] =
|
||||
{
|
||||
"Primary",
|
||||
"Secondary",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -213,7 +276,7 @@ static void Controls3_MenuInit( void ) {
|
|||
s_controls3.framer.width = 256;
|
||||
s_controls3.framer.height = 334;
|
||||
|
||||
y = 162;
|
||||
y = 126;
|
||||
s_controls3.autoswitch.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_controls3.autoswitch.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_controls3.autoswitch.generic.name = "Autoswitch Weapons:";
|
||||
|
@ -262,6 +325,15 @@ static void Controls3_MenuInit( void ) {
|
|||
s_controls3.snapturn.itemnames = s_snapturn;
|
||||
s_controls3.snapturn.numitems = 3;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_controls3.uturn.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_controls3.uturn.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_controls3.uturn.generic.x = VR_X_POS;
|
||||
s_controls3.uturn.generic.y = y;
|
||||
s_controls3.uturn.generic.name = "Quick U-Turn:";
|
||||
s_controls3.uturn.generic.callback = Controls3_MenuEvent;
|
||||
s_controls3.uturn.generic.id = ID_UTURN;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_controls3.righthanded.generic.type = MTYPE_RADIOBUTTON;
|
||||
s_controls3.righthanded.generic.name = "Right-Handed:";
|
||||
|
@ -291,7 +363,18 @@ static void Controls3_MenuInit( void ) {
|
|||
s_controls3.weaponselectormode.generic.callback = Controls3_MenuEvent;
|
||||
s_controls3.weaponselectormode.generic.id = ID_WEAPONSELECTORMODE;
|
||||
s_controls3.weaponselectormode.itemnames = s_weaponselectormode;
|
||||
s_controls3.weaponselectormode.numitems = 4;
|
||||
s_controls3.weaponselectormode.numitems = 2;
|
||||
|
||||
y += BIGCHAR_HEIGHT+2;
|
||||
s_controls3.controlschema.generic.type = MTYPE_SPINCONTROL;
|
||||
s_controls3.controlschema.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
|
||||
s_controls3.controlschema.generic.x = VR_X_POS;
|
||||
s_controls3.controlschema.generic.y = y;
|
||||
s_controls3.controlschema.generic.name = "Control Schema:";
|
||||
s_controls3.controlschema.generic.callback = Controls3_MenuEvent;
|
||||
s_controls3.controlschema.generic.id = ID_CONTROLSCHEMA;
|
||||
s_controls3.controlschema.itemnames = s_controlschema;
|
||||
s_controls3.controlschema.numitems = 2;
|
||||
|
||||
s_controls3.back.generic.type = MTYPE_BITMAP;
|
||||
s_controls3.back.generic.name = ART_BACK0;
|
||||
|
@ -313,9 +396,11 @@ static void Controls3_MenuInit( void ) {
|
|||
Menu_AddItem( &s_controls3.menu, &s_controls3.twohanded );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.directionmode );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.snapturn );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.uturn );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.righthanded );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.weaponpitch );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.weaponselectormode );
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.controlschema );
|
||||
|
||||
Menu_AddItem( &s_controls3.menu, &s_controls3.back );
|
||||
|
||||
|
|
|
@ -93,7 +93,61 @@ void VR_InitCvars( void )
|
|||
Cvar_Get ("vr_weapon_adjustment_11", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_weapon_adjustment_12", "0.8,-5.5,6,0,0,0,0", CVAR_ARCHIVE);
|
||||
|
||||
//Button remapping
|
||||
// Control schemas
|
||||
Cvar_Get ("vr_uturn", "0", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_controlSchema", "0", CVAR_ARCHIVE);
|
||||
qboolean uturnEnabled = Cvar_VariableValue( "vr_uturn" ) != 0;
|
||||
int controlSchema = (int)Cvar_VariableValue( "vr_controlSchema" ) % 2;
|
||||
if (controlSchema == 0) {
|
||||
Cvar_Get ("vr_button_map_RTHUMBLEFT", "", CVAR_ARCHIVE); // empty ~ turn left
|
||||
Cvar_Get ("vr_button_map_RTHUMBRIGHT", "", CVAR_ARCHIVE); // empty ~ turn right
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARD", "weapnext", CVAR_ARCHIVE); // next weapon
|
||||
if (uturnEnabled) {
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK", "uturn", CVAR_ARCHIVE); // u-turn
|
||||
} else {
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK", "weapprev", CVAR_ARCHIVE); // previous weapon
|
||||
}
|
||||
Cvar_Get ("vr_button_map_PRIMARYGRIP", "+weapon_select", CVAR_ARCHIVE); // weapon selector
|
||||
Cvar_Get ("vr_button_map_PRIMARYTHUMBSTICK", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARD_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
} else {
|
||||
// All directions as weapon select (useful for HMD wheel)
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARD", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBRIGHT", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBLEFT", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_PRIMARYTHUMBSTICK", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_PRIMARYGRIP", "+alt", CVAR_ARCHIVE); // switch to alt layout
|
||||
Cvar_Get ("vr_button_map_RTHUMBLEFT_ALT", "", CVAR_ARCHIVE); // empty ~ turn left
|
||||
Cvar_Get ("vr_button_map_RTHUMBRIGHT_ALT", "", CVAR_ARCHIVE); // empty ~ turn right
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARD_ALT", "weapnext", CVAR_ARCHIVE);
|
||||
if (uturnEnabled) {
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK_ALT", "uturn", CVAR_ARCHIVE);
|
||||
} else {
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK_ALT", "weapprev", CVAR_ARCHIVE);
|
||||
}
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
}
|
||||
|
||||
//Remaining button mapping (buttons not affected by schemas)
|
||||
Cvar_Get ("vr_button_map_A", "+moveup", CVAR_ARCHIVE); // Jump
|
||||
Cvar_Get ("vr_button_map_A_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_B", "+movedown", CVAR_ARCHIVE); // Crouch
|
||||
|
@ -104,32 +158,14 @@ void VR_InitCvars( void )
|
|||
Cvar_Get ("vr_button_map_Y_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_SECONDARYTHUMBSTICK", "+scores", CVAR_ARCHIVE); // Scoreboard
|
||||
Cvar_Get ("vr_button_map_SECONDARYTHUMBSTICK_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_PRIMARYTHUMBSTICK", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_PRIMARYTHUMBSTICK_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARD", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARD_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBRIGHT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKRIGHT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK", "uturn", CVAR_ARCHIVE); // U-Turn
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACK_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBBACKLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBLEFT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_RTHUMBFORWARDLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_SECONDARYTRIGGER", "+moveup", CVAR_ARCHIVE); // Also Jump
|
||||
Cvar_Get ("vr_button_map_SECONDARYTRIGGER_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_PRIMARYTRIGGER", "+attack", CVAR_ARCHIVE); // Fire
|
||||
Cvar_Get ("vr_button_map_PRIMARYTRIGGER_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_SECONDARYGRIP", "+weapon_stabilise", CVAR_ARCHIVE); // Weapon stabilisation
|
||||
Cvar_Get ("vr_button_map_SECONDARYGRIP_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_PRIMARYGRIP", "+weapon_select", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_PRIMARYGRIP_ALT", "", CVAR_ARCHIVE);
|
||||
Cvar_Get ("vr_button_map_PRIMARYGRIP_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
}
|
||||
|
||||
void VR_Destroy( engine_t* engine )
|
||||
|
|
|
@ -18,6 +18,7 @@ typedef struct {
|
|||
qboolean local_server; // used in bg_pmove.c
|
||||
vrFollowMode_t follow_mode;
|
||||
qboolean weapon_select;
|
||||
qboolean weapon_select_autoclose;
|
||||
qboolean smooth_turning;
|
||||
|
||||
int realign; // used to realign the fake 6DoF playspace in a multiplayer game
|
||||
|
|
|
@ -243,7 +243,7 @@ static void VR_processHaptics() {
|
|||
}
|
||||
}
|
||||
|
||||
static void IN_SendButtonAction(const char* action, qboolean pressed)
|
||||
static void IN_SendButtonAction(const char* action, qboolean pressed, qboolean isThumbstickAxis)
|
||||
{
|
||||
if (action)
|
||||
{
|
||||
|
@ -265,6 +265,7 @@ static void IN_SendButtonAction(const char* action, qboolean pressed)
|
|||
else if (strcmp(action, "+weapon_select") == 0)
|
||||
{
|
||||
vr.weapon_select = pressed;
|
||||
vr.weapon_select_autoclose = isThumbstickAxis;
|
||||
if (!pressed)
|
||||
{
|
||||
Cbuf_AddText("weapon_select");
|
||||
|
@ -350,21 +351,25 @@ void VR_HapticEvent(const char* event, int position, int flags, int intensity, f
|
|||
static qboolean IN_GetButtonAction(const char* button, char* action)
|
||||
{
|
||||
char cvarname[256];
|
||||
Com_sprintf(cvarname, 256, "vr_button_map_%s%s", button, alt_key_mode_active ? "_ALT" : "");
|
||||
if (alt_key_mode_active) {
|
||||
Com_sprintf(cvarname, 256, "vr_button_map_%s_ALT", button);
|
||||
} else {
|
||||
Com_sprintf(cvarname, 256, "vr_button_map_%s", button);
|
||||
}
|
||||
|
||||
char * val = Cvar_VariableString(cvarname);
|
||||
if (val && strlen(val) > 0)
|
||||
{
|
||||
Com_sprintf(action, 256, "%s", val);
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
//If we didn't find something for this button and the alt key is active, then see if the un-alt key has a function
|
||||
if (alt_key_mode_active)
|
||||
else if (alt_key_mode_active)
|
||||
{
|
||||
// No action found for buttom ALT mapping. Check if we are not
|
||||
// holding ALT key itself (there is no ALT function for ALT)
|
||||
Com_sprintf(cvarname, 256, "vr_button_map_%s", button);
|
||||
char * val = Cvar_VariableString(cvarname);
|
||||
if (val && strlen(val) > 0)
|
||||
{
|
||||
if (val && strcmp(val, "+alt") == 0) {
|
||||
Com_sprintf(action, 256, "%s", val);
|
||||
return qtrue;
|
||||
}
|
||||
|
@ -526,11 +531,11 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
// stop left & right
|
||||
vr.smooth_turning = false;
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_LEFT) && IN_GetButtonAction("RTHUMBLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_LEFT;
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_RIGHT) && IN_GetButtonAction("RTHUMBRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_RIGHT;
|
||||
|
||||
|
@ -538,19 +543,19 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
if (joystickX < -releasedThreshold) {
|
||||
// stop up
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UP) && IN_GetButtonAction("RTHUMBFORWARD", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UP;
|
||||
// stop up-right
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UPRIGHT) && IN_GetButtonAction("RTHUMBFORWARDRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UPRIGHT;
|
||||
// start up-left
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_UPLEFT)) {
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_UPLEFT;
|
||||
if (IN_GetButtonAction("RTHUMBFORWARDLEFT", action)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -558,19 +563,19 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
} else if (joystickX > releasedThreshold) {
|
||||
// stop up
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UP) && IN_GetButtonAction("RTHUMBFORWARD", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UP;
|
||||
// stop up-left
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UPLEFT) && IN_GetButtonAction("RTHUMBFORWARDLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UPLEFT;
|
||||
// start up-right
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_UPRIGHT)) {
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_UPRIGHT;
|
||||
if (IN_GetButtonAction("RTHUMBFORWARDRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -578,19 +583,19 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
} else {
|
||||
// stop up-left
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UPLEFT) && IN_GetButtonAction("RTHUMBFORWARDLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UPLEFT;
|
||||
// stop up-right
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UPRIGHT) && IN_GetButtonAction("RTHUMBFORWARDRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UPRIGHT;
|
||||
// start up
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_UP) && joystickY > pressedThreshold) {
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_UP;
|
||||
if (IN_GetButtonAction("RTHUMBFORWARD", action)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -601,11 +606,11 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
// stop left & right
|
||||
vr.smooth_turning = false;
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_LEFT) && IN_GetButtonAction("RTHUMBLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_LEFT;
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_RIGHT) && IN_GetButtonAction("RTHUMBRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_RIGHT;
|
||||
|
||||
|
@ -613,19 +618,19 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
if (joystickX < -releasedThreshold) {
|
||||
// stop down
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWN) && IN_GetButtonAction("RTHUMBBACK", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWN;
|
||||
// stop down-right
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWNRIGHT) && IN_GetButtonAction("RTHUMBBACKRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWNRIGHT;
|
||||
// start down-left
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_DOWNLEFT)) {
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_DOWNLEFT;
|
||||
if (IN_GetButtonAction("RTHUMBBACKLEFT", action)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -633,19 +638,19 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
} else if (joystickX > releasedThreshold) {
|
||||
// stop down
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWN) && IN_GetButtonAction("RTHUMBBACK", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWN;
|
||||
// stop down-left
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWNLEFT) && IN_GetButtonAction("RTHUMBBACKLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWNLEFT;
|
||||
// start down-right
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_DOWNRIGHT)) {
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_DOWNRIGHT;
|
||||
if (IN_GetButtonAction("RTHUMBBACKRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -653,19 +658,19 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
} else {
|
||||
// stop down-left
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWNLEFT) && IN_GetButtonAction("RTHUMBBACKLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWNLEFT;
|
||||
// stop down-right
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWNRIGHT) && IN_GetButtonAction("RTHUMBBACKRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWNRIGHT;
|
||||
// start down
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_DOWN) && joystickY < -pressedThreshold) {
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_DOWN;
|
||||
if (IN_GetButtonAction("RTHUMBBACK", action)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -675,32 +680,32 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
|
||||
// stop up-left
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UPLEFT) && IN_GetButtonAction("RTHUMBFORWARDLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UPLEFT;
|
||||
// stop up
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UP) && IN_GetButtonAction("RTHUMBFORWARD", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UP;
|
||||
// stop up-right
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_UPRIGHT) && IN_GetButtonAction("RTHUMBFORWARDRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_UPRIGHT;
|
||||
// stop down-left
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWNLEFT) && IN_GetButtonAction("RTHUMBBACKLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWNLEFT;
|
||||
// stop down
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWN) && IN_GetButtonAction("RTHUMBBACK", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWN;
|
||||
// stop down-right
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_DOWNRIGHT) && IN_GetButtonAction("RTHUMBBACKRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_DOWNRIGHT;
|
||||
|
||||
|
@ -711,7 +716,7 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
if (IN_GetButtonAction("RTHUMBLEFT", action)) {
|
||||
vr.smooth_turning = false;
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_LEFT)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_LEFT;
|
||||
|
||||
|
@ -740,7 +745,7 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
vr.smooth_turning = false;
|
||||
}
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_LEFT) && IN_GetButtonAction("RTHUMBLEFT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_LEFT;
|
||||
}
|
||||
|
@ -752,7 +757,7 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
if (IN_GetButtonAction("RTHUMBRIGHT", action)) {
|
||||
vr.smooth_turning = false;
|
||||
if (!(controller->axisButtons & VR_TOUCH_AXIS_RIGHT)) {
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qtrue);
|
||||
}
|
||||
controller->axisButtons |= VR_TOUCH_AXIS_RIGHT;
|
||||
|
||||
|
@ -781,7 +786,7 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
|
|||
vr.smooth_turning = false;
|
||||
}
|
||||
if ((controller->axisButtons & VR_TOUCH_AXIS_RIGHT) && IN_GetButtonAction("RTHUMBRIGHT", action)) {
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qtrue);
|
||||
}
|
||||
controller->axisButtons &= ~VR_TOUCH_AXIS_RIGHT;
|
||||
}
|
||||
|
@ -828,7 +833,7 @@ static void IN_VRTriggers( qboolean isRightController, float index ) {
|
|||
controller->axisButtons |= VR_TOUCH_AXIS_TRIGGER_INDEX;
|
||||
if (IN_GetButtonAction("PRIMARYTRIGGER", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
}
|
||||
else if ((controller->axisButtons & VR_TOUCH_AXIS_TRIGGER_INDEX) &&
|
||||
|
@ -837,7 +842,7 @@ static void IN_VRTriggers( qboolean isRightController, float index ) {
|
|||
controller->axisButtons &= ~VR_TOUCH_AXIS_TRIGGER_INDEX;
|
||||
if (IN_GetButtonAction("PRIMARYTRIGGER", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -851,7 +856,7 @@ static void IN_VRTriggers( qboolean isRightController, float index ) {
|
|||
controller->axisButtons |= VR_TOUCH_AXIS_TRIGGER_INDEX;
|
||||
if (IN_GetButtonAction("SECONDARYTRIGGER", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
}
|
||||
else if ((controller->axisButtons & VR_TOUCH_AXIS_TRIGGER_INDEX) &&
|
||||
|
@ -860,7 +865,7 @@ static void IN_VRTriggers( qboolean isRightController, float index ) {
|
|||
controller->axisButtons &= ~VR_TOUCH_AXIS_TRIGGER_INDEX;
|
||||
if (IN_GetButtonAction("SECONDARYTRIGGER", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -887,7 +892,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("SECONDARYGRIP", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
}
|
||||
else if (!(buttons & ovrButton_GripTrigger) &&
|
||||
|
@ -895,7 +900,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("SECONDARYGRIP", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -905,7 +910,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("PRIMARYGRIP", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
}
|
||||
else if (!(buttons & ovrButton_GripTrigger) &&
|
||||
|
@ -913,7 +918,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("PRIMARYGRIP", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -924,14 +929,14 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
if ((buttons & ovrButton_LThumb) && !(controller->buttons & ovrButton_LThumb)) {
|
||||
if (IN_GetButtonAction("SECONDARYTHUMBSTICK", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
|
||||
vr.realign = 3;
|
||||
} else if (!(buttons & ovrButton_LThumb) && (controller->buttons & ovrButton_LThumb)) {
|
||||
if (IN_GetButtonAction("SECONDARYTHUMBSTICK", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -940,12 +945,12 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
if ((buttons & ovrButton_RThumb) && !(controller->buttons & ovrButton_RThumb)) {
|
||||
if (IN_GetButtonAction("PRIMARYTHUMBSTICK", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
} else if (!(buttons & ovrButton_RThumb) && (controller->buttons & ovrButton_RThumb)) {
|
||||
if (IN_GetButtonAction("PRIMARYTHUMBSTICK", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -961,7 +966,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("A", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -969,7 +974,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("A", action) && !(cl.snap.ps.pm_flags & PMF_FOLLOW))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -977,12 +982,12 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
if ((buttons & ovrButton_B) && !(controller->buttons & ovrButton_B)) {
|
||||
if (IN_GetButtonAction("B", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
} else if (!(buttons & ovrButton_B) && (controller->buttons & ovrButton_B)) {
|
||||
if (IN_GetButtonAction("B", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -998,7 +1003,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("X", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1006,7 +1011,7 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
{
|
||||
if (IN_GetButtonAction("X", action) && !(cl.snap.ps.pm_flags & PMF_FOLLOW))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1014,12 +1019,12 @@ static void IN_VRButtonsChanged( qboolean isRightController, uint32_t buttons )
|
|||
if ((buttons & ovrButton_Y) && !(controller->buttons & ovrButton_Y)) {
|
||||
if (IN_GetButtonAction("Y", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qtrue);
|
||||
IN_SendButtonAction(action, qtrue, qfalse);
|
||||
}
|
||||
} else if (!(buttons & ovrButton_Y) && (controller->buttons & ovrButton_Y)) {
|
||||
if (IN_GetButtonAction("Y", action))
|
||||
{
|
||||
IN_SendButtonAction(action, qfalse);
|
||||
IN_SendButtonAction(action, qfalse, qfalse);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue