mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-03-08 18:31:49 +00:00
Weapon selector fixes
This commit is contained in:
parent
4b3de1f360
commit
5cd7e2adeb
2 changed files with 10 additions and 2 deletions
|
@ -1868,6 +1868,11 @@ void CG_DrawWeaponSelect( void ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't display when weapon wheel is opened
|
||||||
|
if (vr->weapon_select) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
color = CG_FadeColor( cg.weaponSelectTime, WEAPON_SELECT_TIME );
|
color = CG_FadeColor( cg.weaponSelectTime, WEAPON_SELECT_TIME );
|
||||||
if ( !color ) {
|
if ( !color ) {
|
||||||
return;
|
return;
|
||||||
|
@ -2120,7 +2125,8 @@ void CG_DrawWeaponSelector( void )
|
||||||
float thumbstickAxisX = 0.0f;
|
float thumbstickAxisX = 0.0f;
|
||||||
float thumbstickAxisY = 0.0f;
|
float thumbstickAxisY = 0.0f;
|
||||||
float a = atan2(vr->thumbstick_location[thumb][0], vr->thumbstick_location[thumb][1]);
|
float a = atan2(vr->thumbstick_location[thumb][0], vr->thumbstick_location[thumb][1]);
|
||||||
if (length(vr->thumbstick_location[thumb][0], vr->thumbstick_location[thumb][1]) > 0.95f)
|
float thumbstickValue = length(vr->thumbstick_location[thumb][0], vr->thumbstick_location[thumb][1]);
|
||||||
|
if (thumbstickValue > 0.95f)
|
||||||
{
|
{
|
||||||
thumbstickAxisX = sinf(a) * 0.95f;
|
thumbstickAxisX = sinf(a) * 0.95f;
|
||||||
thumbstickAxisY = cosf(a) * 0.95f;
|
thumbstickAxisY = cosf(a) * 0.95f;
|
||||||
|
@ -2390,12 +2396,13 @@ void CG_DrawWeaponSelector( void )
|
||||||
// In case was invoked by thumbstick axis and thumbstick is centered
|
// In case was invoked by thumbstick axis and thumbstick is centered
|
||||||
// select weapon (if any selected) and close the selector
|
// select weapon (if any selected) and close the selector
|
||||||
if (vr->weapon_select_autoclose && frac > 0.25f) {
|
if (vr->weapon_select_autoclose && frac > 0.25f) {
|
||||||
if (thumbstickAxisX > -0.1f && thumbstickAxisX < 0.1f && thumbstickAxisY > -0.1f && thumbstickAxisY < 0.1f) {
|
if (thumbstickValue < 0.1f) {
|
||||||
if (selected) {
|
if (selected) {
|
||||||
cg.weaponSelect = cg.weaponSelectorSelection;
|
cg.weaponSelect = cg.weaponSelectorSelection;
|
||||||
}
|
}
|
||||||
vr->weapon_select = qfalse;
|
vr->weapon_select = qfalse;
|
||||||
vr->weapon_select_autoclose = qfalse;
|
vr->weapon_select_autoclose = qfalse;
|
||||||
|
vr->weapon_select_using_thumbstick = qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ typedef struct {
|
||||||
vrFollowMode_t follow_mode;
|
vrFollowMode_t follow_mode;
|
||||||
qboolean weapon_select;
|
qboolean weapon_select;
|
||||||
qboolean weapon_select_autoclose;
|
qboolean weapon_select_autoclose;
|
||||||
|
qboolean weapon_select_using_thumbstick;
|
||||||
qboolean no_crosshair;
|
qboolean no_crosshair;
|
||||||
|
|
||||||
int realign; // used to realign the fake 6DoF playspace in a multiplayer game
|
int realign; // used to realign the fake 6DoF playspace in a multiplayer game
|
||||||
|
|
Loading…
Reference in a new issue