Move Speed selector on offhand radial quick menu

This commit is contained in:
Simon 2023-09-28 21:29:51 +01:00
parent 8a09007ad0
commit bc964e2ee0
4 changed files with 47 additions and 34 deletions

View file

@ -471,21 +471,6 @@ void HandleInput_Default( ovrInputStateTrackedRemote *pDominantTrackedRemoteNew,
}
}
//Switch movement speed
{
static bool switched = false;
if (between(-0.2f, primaryJoystickX, 0.2f) &&
between(0.8f, pPrimaryJoystick->y, 1.0f)) {
if (!switched) {
vr.move_speed = (++vr.move_speed) % 3;
switched = true;
}
}
else {
switched = false;
}
}
/*
//Parameter Changer
static bool changed = false;

View file

@ -2952,13 +2952,16 @@ void CG_ItemSelectorSelect_f( void )
cg.forcepowerSelectTime = cg.time;
cg.forcepowerSelect = cg.itemSelectorSelection;
}
else if (cg.itemSelectorType == ST_QUICK_SAVE) {
else if (cg.itemSelectorType == ST_QUICK_MENU) {
if (cg.itemSelectorSelection == 0) {
cgi_SendConsoleCommand("save quick\n");
CG_CenterPrint("Quick Saved", 240);
} else {
} else if (cg.itemSelectorSelection == 1) {
cgi_SendConsoleCommand("load quick\n");
}
else {
vr->move_speed = (++vr->move_speed) % 3;
}
}
//reset ready for next time
@ -2969,7 +2972,7 @@ void CG_ItemSelectorNext_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -2986,7 +2989,7 @@ void CG_ItemSelectorPrev_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -3120,8 +3123,8 @@ void CG_DrawItemSelector( void )
sRGB[1] = 0.0f;
sRGB[2] = 1.0f;
break;
case ST_QUICK_SAVE:
count = 2;
case ST_QUICK_MENU:
count = 3;
sRGB[0] = 1.0f;
sRGB[1] = 1.0f;
sRGB[2] = 1.0f;
@ -3252,7 +3255,7 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
selectable = ForcePower_Valid(itemId);
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
selectable = true;
break;
}
@ -3339,8 +3342,19 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
sprite.customShader = force_icons[showPowers[itemId]];
break;
case ST_QUICK_SAVE:
sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad;
case ST_QUICK_MENU:
switch (itemId)
{
case 0:
sprite.customShader = cgs.media.iconSave;
break;
case 1:
sprite.customShader = cgs.media.iconLoad;
break;
case 2:
sprite.customShader = cgs.media.iconMoveSpeed[(vr->move_speed+1)%3];
break;
}
break;
}

View file

@ -769,7 +769,7 @@ typedef enum
ST_GADGET,
ST_FIGHTING_STYLE,
ST_FORCE_POWER,
ST_QUICK_SAVE
ST_QUICK_MENU
} selectorType_t;
typedef enum

View file

@ -2775,13 +2775,16 @@ void CG_ItemSelectorSelect_f( void )
cg.forcepowerSelectTime = cg.time;
cg.forcepowerSelect = cg.itemSelectorSelection;
}
else if (cg.itemSelectorType == ST_QUICK_SAVE) {
else if (cg.itemSelectorType == ST_QUICK_MENU) {
if (cg.itemSelectorSelection == 0) {
cgi_SendConsoleCommand("save quik*\n");
CG_CenterPrint("Quick Saved", 240);
} else {
} else if (cg.itemSelectorSelection == 1) {
cgi_SendConsoleCommand("load quik\n");
}
else {
vr->move_speed = (++vr->move_speed) % 3;
}
}
//reset ready for next time
@ -2792,7 +2795,7 @@ void CG_ItemSelectorNext_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -2809,7 +2812,7 @@ void CG_ItemSelectorPrev_f( void )
{
if (cg.itemSelectorType >= ST_FORCE_POWER)
{
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER;
cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER;
return;
}
@ -2938,8 +2941,8 @@ void CG_DrawItemSelector( void )
sRGB[1] = 0.0f;
sRGB[2] = 1.0f;
break;
case ST_QUICK_SAVE:
count = 2;
case ST_QUICK_MENU:
count = 3;
sRGB[0] = 1.0f;
sRGB[1] = 1.0f;
sRGB[2] = 1.0f;
@ -3068,7 +3071,7 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
selectable = ForcePower_Valid(itemId);
break;
case ST_QUICK_SAVE:
case ST_QUICK_MENU:
selectable = true;
break;
}
@ -3155,8 +3158,19 @@ void CG_DrawItemSelector( void )
case ST_FORCE_POWER: // force powers
sprite.customShader = force_icons[showPowers[itemId]];
break;
case ST_QUICK_SAVE:
sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad;
case ST_QUICK_MENU:
switch (itemId)
{
case 0:
sprite.customShader = cgs.media.iconSave;
break;
case 1:
sprite.customShader = cgs.media.iconLoad;
break;
case 2:
sprite.customShader = cgs.media.iconMoveSpeed[(vr->move_speed + 1) % 3];
break;
}
break;
}