mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-10 14:52:00 +00:00
Move Speed selector on offhand radial quick menu
This commit is contained in:
parent
8a09007ad0
commit
bc964e2ee0
4 changed files with 47 additions and 34 deletions
|
@ -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
|
//Parameter Changer
|
||||||
static bool changed = false;
|
static bool changed = false;
|
||||||
|
|
|
@ -2952,13 +2952,16 @@ void CG_ItemSelectorSelect_f( void )
|
||||||
cg.forcepowerSelectTime = cg.time;
|
cg.forcepowerSelectTime = cg.time;
|
||||||
cg.forcepowerSelect = cg.itemSelectorSelection;
|
cg.forcepowerSelect = cg.itemSelectorSelection;
|
||||||
}
|
}
|
||||||
else if (cg.itemSelectorType == ST_QUICK_SAVE) {
|
else if (cg.itemSelectorType == ST_QUICK_MENU) {
|
||||||
if (cg.itemSelectorSelection == 0) {
|
if (cg.itemSelectorSelection == 0) {
|
||||||
cgi_SendConsoleCommand("save quick\n");
|
cgi_SendConsoleCommand("save quick\n");
|
||||||
CG_CenterPrint("Quick Saved", 240);
|
CG_CenterPrint("Quick Saved", 240);
|
||||||
} else {
|
} else if (cg.itemSelectorSelection == 1) {
|
||||||
cgi_SendConsoleCommand("load quick\n");
|
cgi_SendConsoleCommand("load quick\n");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
vr->move_speed = (++vr->move_speed) % 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//reset ready for next time
|
//reset ready for next time
|
||||||
|
@ -2969,7 +2972,7 @@ void CG_ItemSelectorNext_f( void )
|
||||||
{
|
{
|
||||||
if (cg.itemSelectorType >= ST_FORCE_POWER)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2986,7 +2989,7 @@ void CG_ItemSelectorPrev_f( void )
|
||||||
{
|
{
|
||||||
if (cg.itemSelectorType >= ST_FORCE_POWER)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3120,8 +3123,8 @@ void CG_DrawItemSelector( void )
|
||||||
sRGB[1] = 0.0f;
|
sRGB[1] = 0.0f;
|
||||||
sRGB[2] = 1.0f;
|
sRGB[2] = 1.0f;
|
||||||
break;
|
break;
|
||||||
case ST_QUICK_SAVE:
|
case ST_QUICK_MENU:
|
||||||
count = 2;
|
count = 3;
|
||||||
sRGB[0] = 1.0f;
|
sRGB[0] = 1.0f;
|
||||||
sRGB[1] = 1.0f;
|
sRGB[1] = 1.0f;
|
||||||
sRGB[2] = 1.0f;
|
sRGB[2] = 1.0f;
|
||||||
|
@ -3252,7 +3255,7 @@ void CG_DrawItemSelector( void )
|
||||||
case ST_FORCE_POWER: // force powers
|
case ST_FORCE_POWER: // force powers
|
||||||
selectable = ForcePower_Valid(itemId);
|
selectable = ForcePower_Valid(itemId);
|
||||||
break;
|
break;
|
||||||
case ST_QUICK_SAVE:
|
case ST_QUICK_MENU:
|
||||||
selectable = true;
|
selectable = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3339,8 +3342,19 @@ void CG_DrawItemSelector( void )
|
||||||
case ST_FORCE_POWER: // force powers
|
case ST_FORCE_POWER: // force powers
|
||||||
sprite.customShader = force_icons[showPowers[itemId]];
|
sprite.customShader = force_icons[showPowers[itemId]];
|
||||||
break;
|
break;
|
||||||
case ST_QUICK_SAVE:
|
case ST_QUICK_MENU:
|
||||||
sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -769,7 +769,7 @@ typedef enum
|
||||||
ST_GADGET,
|
ST_GADGET,
|
||||||
ST_FIGHTING_STYLE,
|
ST_FIGHTING_STYLE,
|
||||||
ST_FORCE_POWER,
|
ST_FORCE_POWER,
|
||||||
ST_QUICK_SAVE
|
ST_QUICK_MENU
|
||||||
} selectorType_t;
|
} selectorType_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
@ -2775,13 +2775,16 @@ void CG_ItemSelectorSelect_f( void )
|
||||||
cg.forcepowerSelectTime = cg.time;
|
cg.forcepowerSelectTime = cg.time;
|
||||||
cg.forcepowerSelect = cg.itemSelectorSelection;
|
cg.forcepowerSelect = cg.itemSelectorSelection;
|
||||||
}
|
}
|
||||||
else if (cg.itemSelectorType == ST_QUICK_SAVE) {
|
else if (cg.itemSelectorType == ST_QUICK_MENU) {
|
||||||
if (cg.itemSelectorSelection == 0) {
|
if (cg.itemSelectorSelection == 0) {
|
||||||
cgi_SendConsoleCommand("save quik*\n");
|
cgi_SendConsoleCommand("save quik*\n");
|
||||||
CG_CenterPrint("Quick Saved", 240);
|
CG_CenterPrint("Quick Saved", 240);
|
||||||
} else {
|
} else if (cg.itemSelectorSelection == 1) {
|
||||||
cgi_SendConsoleCommand("load quik\n");
|
cgi_SendConsoleCommand("load quik\n");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
vr->move_speed = (++vr->move_speed) % 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//reset ready for next time
|
//reset ready for next time
|
||||||
|
@ -2792,7 +2795,7 @@ void CG_ItemSelectorNext_f( void )
|
||||||
{
|
{
|
||||||
if (cg.itemSelectorType >= ST_FORCE_POWER)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2809,7 +2812,7 @@ void CG_ItemSelectorPrev_f( void )
|
||||||
{
|
{
|
||||||
if (cg.itemSelectorType >= ST_FORCE_POWER)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2938,8 +2941,8 @@ void CG_DrawItemSelector( void )
|
||||||
sRGB[1] = 0.0f;
|
sRGB[1] = 0.0f;
|
||||||
sRGB[2] = 1.0f;
|
sRGB[2] = 1.0f;
|
||||||
break;
|
break;
|
||||||
case ST_QUICK_SAVE:
|
case ST_QUICK_MENU:
|
||||||
count = 2;
|
count = 3;
|
||||||
sRGB[0] = 1.0f;
|
sRGB[0] = 1.0f;
|
||||||
sRGB[1] = 1.0f;
|
sRGB[1] = 1.0f;
|
||||||
sRGB[2] = 1.0f;
|
sRGB[2] = 1.0f;
|
||||||
|
@ -3068,7 +3071,7 @@ void CG_DrawItemSelector( void )
|
||||||
case ST_FORCE_POWER: // force powers
|
case ST_FORCE_POWER: // force powers
|
||||||
selectable = ForcePower_Valid(itemId);
|
selectable = ForcePower_Valid(itemId);
|
||||||
break;
|
break;
|
||||||
case ST_QUICK_SAVE:
|
case ST_QUICK_MENU:
|
||||||
selectable = true;
|
selectable = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3155,8 +3158,19 @@ void CG_DrawItemSelector( void )
|
||||||
case ST_FORCE_POWER: // force powers
|
case ST_FORCE_POWER: // force powers
|
||||||
sprite.customShader = force_icons[showPowers[itemId]];
|
sprite.customShader = force_icons[showPowers[itemId]];
|
||||||
break;
|
break;
|
||||||
case ST_QUICK_SAVE:
|
case ST_QUICK_MENU:
|
||||||
sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue