Merge pull request #61 from petr666/feature/menu-update

Improve scrolling through the multiplayer servers
This commit is contained in:
Simon 2022-04-12 22:07:54 +01:00 committed by GitHub
commit 8a64a5a8e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View file

@ -1243,11 +1243,11 @@ static void ArenaServers_Event( void* ptr, int event ) {
break;
case ID_SCROLL_UP:
ScrollList_Key( &g_arenaservers.list, K_UPARROW );
ScrollList_Key( &g_arenaservers.list, K_PGUP );
break;
case ID_SCROLL_DOWN:
ScrollList_Key( &g_arenaservers.list, K_DOWNARROW );
ScrollList_Key( &g_arenaservers.list, K_PGDN );
break;
case ID_BACK:

View file

@ -690,8 +690,35 @@ static void IN_VRJoystick( qboolean isRightController, float joystickX, float jo
vr.thumbstick_location[isRightController][0] = joystickX;
vr.thumbstick_location[isRightController][1] = joystickY;
if (!vr.virtual_screen && cl.snap.ps.pm_type != PM_INTERMISSION)
if (vr.virtual_screen || cl.snap.ps.pm_type == PM_INTERMISSION)
{
// Use thumbstick UP/DOWN as PAGEUP/PAGEDOWN in menus
if (joystickY > thumbstickPressedThreshold) {
if (!IN_InputActivated(&controller->axisButtons, VR_TOUCH_AXIS_UP)) {
IN_ActivateInput(&controller->axisButtons, VR_TOUCH_AXIS_UP);
Com_QueueEvent(in_vrEventTime, SE_KEY, K_PGUP, qtrue, 0, NULL);
}
} else if (joystickY < -thumbstickPressedThreshold) {
if (!IN_InputActivated(&controller->axisButtons, VR_TOUCH_AXIS_DOWN)) {
IN_ActivateInput(&controller->axisButtons, VR_TOUCH_AXIS_DOWN);
Com_QueueEvent(in_vrEventTime, SE_KEY, K_PGDN, qtrue, 0, NULL);
}
} else if (joystickY < thumbstickReleasedThreshold && joystickY > -thumbstickReleasedThreshold) {
if (IN_InputActivated(&controller->axisButtons, VR_TOUCH_AXIS_UP)) {
IN_DeactivateInput(&controller->axisButtons, VR_TOUCH_AXIS_UP);
Com_QueueEvent(in_vrEventTime, SE_KEY, K_PGUP, qfalse, 0, NULL);
}
if (IN_InputActivated(&controller->axisButtons, VR_TOUCH_AXIS_DOWN)) {
IN_DeactivateInput(&controller->axisButtons, VR_TOUCH_AXIS_DOWN);
Com_QueueEvent(in_vrEventTime, SE_KEY, K_PGDN, qfalse, 0, NULL);
}
}
}
else
{
if (isRightController == (vr_switchThumbsticks->integer != 0)) {
vec3_t positional;
VectorClear(positional);