mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-10 06:41:58 +00:00
Remap face buttons along with switching thumbsticks
This commit is contained in:
parent
8cf2ffc445
commit
8cf8f3ae1b
5 changed files with 42 additions and 4 deletions
|
@ -213,6 +213,19 @@ static void Controls3_MenuEvent( void* ptr, int notification ) {
|
|||
break;
|
||||
|
||||
case ID_SWITCHTHUMBSTICKS:
|
||||
{
|
||||
if (s_controls3.switchthumbsticks.curvalue) {
|
||||
trap_Cvar_Set("vr_button_map_A", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_B", "+button3"); // Gesture
|
||||
trap_Cvar_Set("vr_button_map_X", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_Y", "+movedown"); // Crouch
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_A", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_B", "+movedown"); // Crouch
|
||||
trap_Cvar_Set("vr_button_map_X", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_Y", "+button3"); // Gesture
|
||||
}
|
||||
}
|
||||
trap_Cvar_SetValue( "vr_switchThumbsticks", s_controls3.switchthumbsticks.curvalue );
|
||||
break;
|
||||
|
||||
|
|
|
@ -3223,6 +3223,18 @@ static void UI_Update(const char *name) {
|
|||
trap_Cvar_Set("vr_button_map_RTHUMBLEFT_ALT", ""); // unmapped
|
||||
break;
|
||||
}
|
||||
} else if (Q_stricmp(name, "vr_switchThumbsticks") == 0) {
|
||||
if (val) {
|
||||
trap_Cvar_Set("vr_button_map_A", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_B", "+button3"); // Gesture
|
||||
trap_Cvar_Set("vr_button_map_X", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_Y", "+movedown"); // Crouch
|
||||
} else {
|
||||
trap_Cvar_Set("vr_button_map_A", "+moveup"); // Jump
|
||||
trap_Cvar_Set("vr_button_map_B", "+movedown"); // Crouch
|
||||
trap_Cvar_Set("vr_button_map_X", "+button2"); // Use Item
|
||||
trap_Cvar_Set("vr_button_map_Y", "+button3"); // Gesture
|
||||
}
|
||||
} else if (Q_stricmp(name, "vr_uturn") == 0) {
|
||||
int controlSchema = (int)trap_Cvar_VariableValue( "vr_controlSchema" ) % 3;
|
||||
if (val) {
|
||||
|
|
|
@ -239,14 +239,25 @@ void VR_InitCvars( void )
|
|||
Cvar_Get ("vr_button_map_RTHUMBLEFT_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
}
|
||||
|
||||
// Map face buttons based on thumbstick assigned to movement
|
||||
// (cannot move and jump/crouch with same thumb at same time)
|
||||
qboolean switchThumbsticks = Cvar_VariableValue( "vr_switchThumbsticks" ) != 0;
|
||||
if (switchThumbsticks) {
|
||||
Cvar_Get ("vr_button_map_A", "+button2", CVAR_ARCHIVE); // Use Item
|
||||
Cvar_Get ("vr_button_map_B", "+button3", CVAR_ARCHIVE); // Gesture
|
||||
Cvar_Get ("vr_button_map_X", "+moveup", CVAR_ARCHIVE); // Jump
|
||||
Cvar_Get ("vr_button_map_Y", "+movedown", CVAR_ARCHIVE); // Crouch
|
||||
} else {
|
||||
Cvar_Get ("vr_button_map_A", "+moveup", CVAR_ARCHIVE); // Jump
|
||||
Cvar_Get ("vr_button_map_B", "+movedown", CVAR_ARCHIVE); // Crouch
|
||||
Cvar_Get ("vr_button_map_X", "+button2", CVAR_ARCHIVE); // Use Item
|
||||
Cvar_Get ("vr_button_map_Y", "+button3", CVAR_ARCHIVE); // Gesture
|
||||
}
|
||||
|
||||
//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
|
||||
Cvar_Get ("vr_button_map_B_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_X", "+button2", CVAR_ARCHIVE); // Use Item
|
||||
Cvar_Get ("vr_button_map_X_ALT", "", CVAR_ARCHIVE); // unmapped
|
||||
Cvar_Get ("vr_button_map_Y", "+button3", CVAR_ARCHIVE); // Gesture
|
||||
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
|
||||
|
|
|
@ -157,6 +157,7 @@ itemDef {
|
|||
textscale .333
|
||||
forecolor 1 1 1 1
|
||||
visible 1
|
||||
action { uiScript update "vr_switchThumbsticks" }
|
||||
}
|
||||
|
||||
itemDef {
|
||||
|
|
|
@ -279,6 +279,7 @@ itemDef {
|
|||
textscale .25
|
||||
forecolor 1 1 1 1
|
||||
visible 1
|
||||
action { uiScript update "vr_switchThumbsticks" }
|
||||
}
|
||||
|
||||
itemDef {
|
||||
|
|
Loading…
Reference in a new issue