diff --git a/Projects/Android/jni/OpenJK/JKXR/VrInputDefault.cpp b/Projects/Android/jni/OpenJK/JKXR/VrInputDefault.cpp index 8f94fd9..b58d57b 100644 --- a/Projects/Android/jni/OpenJK/JKXR/VrInputDefault.cpp +++ b/Projects/Android/jni/OpenJK/JKXR/VrInputDefault.cpp @@ -471,6 +471,21 @@ 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; diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp index 214342a..7568331 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp @@ -2952,16 +2952,13 @@ void CG_ItemSelectorSelect_f( void ) cg.forcepowerSelectTime = cg.time; cg.forcepowerSelect = cg.itemSelectorSelection; } - else if (cg.itemSelectorType == ST_QUICK_MENU) { + else if (cg.itemSelectorType == ST_QUICK_SAVE) { if (cg.itemSelectorSelection == 0) { cgi_SendConsoleCommand("save quick\n"); CG_CenterPrint("Quick Saved", 240); - } else if (cg.itemSelectorSelection == 1) { + } else { cgi_SendConsoleCommand("load quick\n"); } - else { - vr->move_speed = (++vr->move_speed) % 3; - } } //reset ready for next time @@ -2972,7 +2969,7 @@ void CG_ItemSelectorNext_f( void ) { if (cg.itemSelectorType >= ST_FORCE_POWER) { - cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER; + cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER; return; } @@ -2989,7 +2986,7 @@ void CG_ItemSelectorPrev_f( void ) { if (cg.itemSelectorType >= ST_FORCE_POWER) { - cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER; + cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER; return; } @@ -3123,8 +3120,8 @@ void CG_DrawItemSelector( void ) sRGB[1] = 0.0f; sRGB[2] = 1.0f; break; - case ST_QUICK_MENU: - count = 3; + case ST_QUICK_SAVE: + count = 2; sRGB[0] = 1.0f; sRGB[1] = 1.0f; sRGB[2] = 1.0f; @@ -3255,7 +3252,7 @@ void CG_DrawItemSelector( void ) case ST_FORCE_POWER: // force powers selectable = ForcePower_Valid(itemId); break; - case ST_QUICK_MENU: + case ST_QUICK_SAVE: selectable = true; break; } @@ -3342,19 +3339,8 @@ void CG_DrawItemSelector( void ) case ST_FORCE_POWER: // force powers sprite.customShader = force_icons[showPowers[itemId]]; break; - 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; - } + case ST_QUICK_SAVE: + sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad; break; } diff --git a/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h b/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h index 52326cd..d56e814 100644 --- a/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h +++ b/Projects/Android/jni/OpenJK/code/qcommon/q_shared.h @@ -769,7 +769,7 @@ typedef enum ST_GADGET, ST_FIGHTING_STYLE, ST_FORCE_POWER, - ST_QUICK_MENU + ST_QUICK_SAVE } selectorType_t; typedef enum diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp index 5b24042..8aab0a1 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp @@ -2775,16 +2775,13 @@ void CG_ItemSelectorSelect_f( void ) cg.forcepowerSelectTime = cg.time; cg.forcepowerSelect = cg.itemSelectorSelection; } - else if (cg.itemSelectorType == ST_QUICK_MENU) { + else if (cg.itemSelectorType == ST_QUICK_SAVE) { if (cg.itemSelectorSelection == 0) { cgi_SendConsoleCommand("save quik*\n"); CG_CenterPrint("Quick Saved", 240); - } else if (cg.itemSelectorSelection == 1) { + } else { cgi_SendConsoleCommand("load quik\n"); } - else { - vr->move_speed = (++vr->move_speed) % 3; - } } //reset ready for next time @@ -2795,7 +2792,7 @@ void CG_ItemSelectorNext_f( void ) { if (cg.itemSelectorType >= ST_FORCE_POWER) { - cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER; + cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER; return; } @@ -2812,7 +2809,7 @@ void CG_ItemSelectorPrev_f( void ) { if (cg.itemSelectorType >= ST_FORCE_POWER) { - cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_MENU : ST_FORCE_POWER; + cg.itemSelectorType = (cg.itemSelectorType == ST_FORCE_POWER) ? ST_QUICK_SAVE : ST_FORCE_POWER; return; } @@ -2941,8 +2938,8 @@ void CG_DrawItemSelector( void ) sRGB[1] = 0.0f; sRGB[2] = 1.0f; break; - case ST_QUICK_MENU: - count = 3; + case ST_QUICK_SAVE: + count = 2; sRGB[0] = 1.0f; sRGB[1] = 1.0f; sRGB[2] = 1.0f; @@ -3071,7 +3068,7 @@ void CG_DrawItemSelector( void ) case ST_FORCE_POWER: // force powers selectable = ForcePower_Valid(itemId); break; - case ST_QUICK_MENU: + case ST_QUICK_SAVE: selectable = true; break; } @@ -3158,19 +3155,8 @@ void CG_DrawItemSelector( void ) case ST_FORCE_POWER: // force powers sprite.customShader = force_icons[showPowers[itemId]]; break; - 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; - } + case ST_QUICK_SAVE: + sprite.customShader = itemId == 0 ? cgs.media.iconSave : cgs.media.iconLoad; break; }