Added quick save/load

This commit is contained in:
Simon 2021-03-15 23:05:23 +00:00
parent fafa72f3ed
commit bacfc279b6
2 changed files with 52 additions and 30 deletions

17
.gitignore vendored
View file

@ -26,25 +26,16 @@ $RECYCLE.BIN/
*.ap_ *.ap_
*.class *.class
projects/Android/build/* projects/Android/build/*
projects/Android/.idea/*
projects/Android/jni/SupportLibs/* projects/Android/jni/SupportLibs/*
assets/oculussig* Projects/Android/.cxx/*
Projects/Android/.externalNativeBuild/ndkBuild/debug/arm64-v8a/android_gradle_build.json
Projects/Android/.cxx/ndkBuild/*
*.json *.json
Projects/Android/.externalNativeBuild/ndkBuild/debug/arm64-v8a/ndkBuild_build_command.txt Projects/Android/.externalNativeBuild/*
Projects/Android/.externalNativeBuild/ndkBuild/debug/arm64-v8a/ndkBuild_build_output.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/arm64-v8a/ndkBuild_build_command.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/armeabi-v7a/ndkBuild_build_output.txt
*.bin *.bin
Projects/Android/.gradle/* Projects/Android/.gradle/*
*.ser *.ser
Projects/Android/.idea/codeStyles/Project.xml Projects/Android/.idea/codeStyles/Project.xml
*.xml *.xml
Projects/Android/.externalNativeBuild/ndkBuild/debug/armeabi-v7a/ndkBuild_build_command.txt Projects/Android/.gradle/*
Projects/Android/.externalNativeBuild/ndkBuild/release/armeabi-v7a/ndkBuild_build_command.txt
Projects/Android/.externalNativeBuild/ndkBuild/debug/armeabi-v7a/ndkBuild_build_output.txt
Projects/Android/.externalNativeBuild/ndkBuild/release/arm64-v8a/ndkBuild_build_output.txt
Projects/Android/.gradle/4.6/fileHashes/fileHashes.lock
Projects/Android/.gradle/vcsWorkingDirs/gc.properties
drbeef-release-key.keystore drbeef-release-key.keystore
Projects/Android/.idea/.name Projects/Android/.idea/.name

View file

@ -1476,16 +1476,16 @@ static void weaponHaptics()
break; break;
case IT_LIGHTNING: case IT_LIGHTNING:
{ {
hapticInterval = 10; hapticInterval = 100;
hapticLevel = lhrandom(0.0, 0.8f); hapticLevel = lhrandom(0.0, 0.8f);
hapticLength = 10; hapticLength = 80;
} }
break; break;
case IT_SUPER_LIGHTNING: case IT_SUPER_LIGHTNING:
{ {
hapticInterval = 10; hapticInterval = 100;
hapticLevel = lhrandom(0.3, 1.0f); hapticLevel = lhrandom(0.3, 1.0f);
hapticLength = 10; hapticLength = 60;
} }
break; break;
case IT_AXE: case IT_AXE:
@ -1849,22 +1849,53 @@ static void ovrApp_HandleInput( ovrApp * app )
ovrButton_Trigger, K_MOUSE1); ovrButton_Trigger, K_MOUSE1);
} }
#ifndef NDEBUG static bool canUseQuickSave = false;
//Give all weapons and all ammo and god mode if (canUseQuickSave)
if ((leftTrackedRemoteState_new.Buttons & ovrButton_X) && {
(leftTrackedRemoteState_new.Buttons & ovrButton_X) != if ((leftTrackedRemoteState_new.Buttons & ovrButton_X) &&
(leftTrackedRemoteState_old.Buttons & ovrButton_X)) { (leftTrackedRemoteState_new.Buttons & ovrButton_X) !=
Cbuf_InsertText("God\n"); (leftTrackedRemoteState_old.Buttons & ovrButton_X)) {
Cbuf_InsertText("Impulse 9\n"); Cbuf_InsertText("save quick\n");
breakHere = 1;
//Vibrate to let user know they successfully saved
SCR_CenterPrint("Quick Saved");
Android_Vibrate(500, cl_righthanded.integer ? 0 : 1, 1.0);
}
if ((leftTrackedRemoteState_new.Buttons & ovrButton_Y) &&
(leftTrackedRemoteState_new.Buttons & ovrButton_Y) !=
(leftTrackedRemoteState_old.Buttons & ovrButton_Y)) {
Cbuf_InsertText("load quick");
}
} }
else {
#ifndef NDEBUG
//Give all weapons and all ammo and god mode
if ((leftTrackedRemoteState_new.Buttons & ovrButton_X) &&
(leftTrackedRemoteState_new.Buttons & ovrButton_X) !=
(leftTrackedRemoteState_old.Buttons & ovrButton_X)) {
Cbuf_InsertText("God\n");
Cbuf_InsertText("Impulse 9\n");
breakHere = 1;
}
#endif #endif
//Toggle text input //Toggle text input
if ((leftTrackedRemoteState_new.Buttons & ovrButton_Y) && if ((leftTrackedRemoteState_new.Buttons & ovrButton_Y) &&
(leftTrackedRemoteState_new.Buttons & ovrButton_Y) != (leftTrackedRemoteState_new.Buttons & ovrButton_Y) !=
(leftTrackedRemoteState_old.Buttons & ovrButton_Y)) { (leftTrackedRemoteState_old.Buttons & ovrButton_Y)) {
textInput = !textInput; textInput = !textInput;
}
}
if (offHandRemoteTracking->Status & (VRAPI_TRACKING_STATUS_POSITION_TRACKED | VRAPI_TRACKING_STATUS_POSITION_VALID)) {
canUseQuickSave = false;
}
else if (!canUseQuickSave) {
canUseQuickSave = true;
//Vibrate to let user know they can quick save
Android_Vibrate(500, cl_righthanded.integer ? 0 : 1, 1.0);
} }